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
3. Literals and embedding¶ Sometimes we know at compile time what the (initial) contents of a Buffer is. It would be cumbersome to have to allocate the buffer and to write its content word by word at program initialization or before using the buffer. This chapter presents the alternatives. 3.1. List literals¶ If the buffer is very small, we can use the OverloadedLists extension to create an immutable buffer from a list of bytes. It allows the creation of small unpinned immutable buffers into GHC’s heap (aka BufferI). {-# LANGUAGE OverloadedLists #-} b :: BufferI b = [25,26,27,28] -- Word8 values This should only be used for very small buffers. First, because it is not the most efficient way to build a buffer: the actual buffer will be created when it is first used. Second, because it is very cumbersome to list bytes’ values in a list. 3.2. Embedding files as buffers¶ You can embed an external file (or some part of it) into your executable. At runtime you can access it as a normal external buffer (mutable or not). {-# LANGUAGE TemplateHaskell #-} import Haskus.Memory.Buffer import Haskus.Memory.Embed let b = $(embedFile "myfile.bin" True -- is the resulting buffer mutable or not (Just 8) -- optional alignment constraint (Just 10) -- optional offset in the file (Just 128) -- optional number of bytes to include ) 3.3. Embedding buffers using Template Haskell¶ If you know how to build your buffer at compile time, you can build it and embed it into the executable with Template Haskell by using embedBuffer. import Haskus.Memory.Embed embedBuffer :: Buffer mut pin fin heap -- ^ Source buffer -> Bool -- ^ Should the embedded buffer be mutable or not -> Maybe Word -- ^ Optional alignement constraint -> Maybe Word -- ^ Optional offset in the source buffer -> Maybe Word -- ^ Optional number of bytes to include -> Q Exp -- ^ BufferE or BufferME, depending on mutability parameter
https://docs.haskus.org/memory/embed.html
CC-MAIN-2019-18
refinedweb
309
61.26
The proposed patch management workflow in this document has many similarities with git-pq. It differs in these points: - Patch branches all originate in upstream or in the branches they depend on. git-pq puts all patches on one line. - The commit objects of patch branches are conserved in a normal packaging workflow even though users only share the usual upstream, master, build branches and release tags. - This workflow allows to make use of GIT's merge capabilities. For the purpose of this document, the master branch is the branch where /debian/ lives. Others like to call this branch e.g. "debian". Short overview This is how Martin F. Krafft summarized this proposal: - you develop your features on branches, but you do not push the branch heads; - the feature branches get merged into an integration/build branch, which is pushed. This way, all contributors get the commits; - as part of the build process, the feature branches are exported to a debian/patches series, and each patch file includes additional information, such as dependency data, and also the SHA-1 of the feature branch head at the time when the patch was made; -. One of the points Martin disliked was the merge of the patches in the integration branch. I pointed out an alternative: As a variation of the described workflow you can establish a special branch that holds references to all feature branch commits in its history. The content of this branch does not matter. A status command should warn you if the head of any feature branch is not in the history this special branch. Another command could create a new commit in this special branch with the parent pointing to all new heads. Most basic workflow, without patches, sane upstream upstream | | master | | | /* merge, new debian version (n commits) |/ | * | new upstream version | | | * debianize, debian release (n commits) | / |/ * import upstream Upstream needs clean up to be dfsg compliant upstream | | dfsg_clean | | | | master | | | | | * new debian version | | /| | |/ | | * | merge, clean up (n commits) | /| | |/ | | * | | import new unmodified upstream | | | | | * debianize, debian release | | / | |/ | * merge, clean up (n commits) | / |/ * import unmodified upstream Patches, dfsg free upstream principles, requirements, concepts - Patches should not be merged to the master branch, because it's hard to "unmerge". - We want to use GIT's merge capabilities and other features, therefor we'd like to work on patches in seperate branches per patch. - It should be much easier to use then topgit - We don't want to be forced to pull/push douzens of patch branches. - We don't want to (permanently) pollute the branch namespace Design - When a new release has been merged to master, a new build branch is forked from master: build-$UPSTREAM_VERSION - Patch branches are only merged in such build branches, never in the master branch - Later we can delete the build branches but we still keep the commits since we tag each Debian release - The primary storage of patches are patch files in quilt format in debian/patches in the master branch - We provide tooling to convert patch branches into annotated quilt patches and recreate *identical* patch branches from quilt files. We add extra headers in [ dep-3] format to the quilt files in debian/patches: - git-commit: SHA-1 value of the HEAD of the patch branch - git-base-commit: SHA-1 value of the base commit of the patch branch (only necessary if git-base-dependencies is not empty) - git-dependencies: list of branch names of dependencies of this patch branch Workflow Creating patches: - Checkout patch branch from upstream (or from the branch it depends on). - Hack, commit - Create an annotated quilt patch from the patch branch - repeat the above for other patch branches - merge the patch branches into the build branch - Once the patches are merged in the build branch, the patch branches can be deleted. Editing patches: - Recreate the patch branches with informations from the quilt annotations - Hack, commit - update quilt files - merge updated patch branches into build branch Update upstream: - Import upstream, merge into master - recreate the patch branches - either merge upstream changes into each patch branch or rebase patch branches - hack on patch branches - update quilt files - merge updated patch branches into build branch Tooling The outlined workflow could be done manually without new tools. It's however only practical, if additional tools are provided. This section describes the necessary tools to be implemented. environment variables (names can change): - UPSTREAM_BRANCH - the name of the upstream branch, default "upstream", may need to be changed to dfsg_clean - DEBIAN_BRANCH - the branch containing the debianization, most importantly the debian/patches folder create quilt file options: - dependency branches [optionally, defaults to empty=UPSTREAM_BRANCH] - base [optionally, defaults to SHA-1 of UPSTREAM_BRANCH] - head [optionally, defaults to SHA-1 of current HEAD] - name [optionally, defaults to current HEAD name] - target [optionally, defaults to debian/patches/$BRANCH_NAME] Creates a quilt patch file from a patch branch or updates an existing one, inheriting options from an exisiting quilt file. Additionally there should be a wrapper command to invoke this command over all patches listed in debian/patches to update the quilt files. options: - branch name (translates to the quilt file's name) Creates a branch with the given name pointing to the commit specified in the git-commit line of the quilt file. Checks out the branch if checkout option is true. Additionally there should be a wrapper command to invoke this command over all patches listed in debian/patches. merge patch branch(es) options: - target branch - name [optionally, n-times, names of branches to merge] Merges all patch branches into the target branches. Creates the target branch if it doesn't exist yet. status options: - build branch [optionally] Gives the following informations: - list of patches (according to files in debian/patches) - which patches needs update (because dependency or upstream was updated) - which patches don't have their commit objects in the object database - which patches have not yet been merged in the build branch Extensions Detect cherry-picked patches available in upstream Requirement: Upstream uses GIT and you track upstream in your repository Use case: You cherry picked a commit from upstream which was not yet available in the packaged version. When you later package an upstream version that contains the cherry-picked commit, the tools should note that and drop the patch. Implementation: An additional dep-3 header field ( git-upstream-cherry-picked ) could contain a commit sha-1 (or a range commit range). It's then possible to detect, whether the commit is available in the current worked on upstream version. Detect patches applied upstream via empty diff When the diff between upstream and a patch branch becomes empty after a diff, then this means, that a patch has been applied upstream and the patch can be dropped. TODO - How to ask GIT for the first common commit of two branches? - function needed to check, whether a commit/branch is in the history of another commit. links - man git-quiltimport quilt headers Scratchpad - some of the options dpkg-source runs patch with: - --unified (Interpret the patch file as a unified context diff) - -.
https://wiki.debian.org/ThomasKoch/GitPackagingWorkflow
CC-MAIN-2017-26
refinedweb
1,174
50.7
Summary: A Java Month class that you can use in Java calendar applications. I was just cleaning up some old bits, and ran across a Java Month class that I've used on several calendar-related projects. If you happen to be working on a Java calendar application, and need a class to represent the months in a year, this source code may be helpful, so I thought I'd share it here. Without any further ado then, here is the source code for this Java Month class: package com.devdaily.calendar; import java.util.Calendar; import java.util.HashMap; /** * A Java Month class which can be used in a calendar application, * such as our JSP Calendar, located here: *... */ public class Month { private int month; private int year; private int days[][]; private int numberOfWeeks; private static HashMap months = new HashMap(); /** * This constructor is private so callers will use the * public "getMonth" methods. */ private Month() { } /** * This constructor is private so callers will use the * public "getMonth" methods. */ private Month(int month, int year) { days = new int[6][7]; numberOfWeeks = 0; this.month = month; this.year = year; buildWeeks(); } public int getMonth() { return month; } /** * Call this method to get a Month object to work with. */ public static Month getMonth(int month, int year) { String key = String.valueOf((new StringBuffer(String.valueOf(month))).append("/").append(year)); if (months.containsKey(key)) { return (Month) months.get(key); } else { Month newMonth = new Month(month, year); months.put(key, newMonth); return newMonth; } } private void buildWeeks() { Calendar c = Calendar.getInstance(); c.setFirstDayOfWeek(1); c.set(year, month, 1); for (; c.get(2) == month; c.add(5, 1)) { int weekNumber = c.get(4) - 1; int dayOfWeek = calculateDay(c.get(7)); days[weekNumber][dayOfWeek] = c.get(5); numberOfWeeks = weekNumber; } } public int calculateDay(int day) { if (day == 1) return 0; if (day == 2) return 1; if (day == 3) return 2; if (day == 4) return 3; if (day == 5) return 4; if (day == 6) return 5; return day != 7 ? 7 : 6; } public int[][] getDays() { return days; } public int getNumberOfWeeks() { return numberOfWeeks + 1; } public int getYear() { return year; } } I'm not going to take the time to explain this source code at this time, but if you'd like to see some more code that demonstrates the use of this Java Month class, please take a look at my Java JSP calendar (web calendar) project. The JSP files in that project will show you everything you need to work with months, years, etc. Post new comment
http://alvinalexander.com/java/java-month-class-source-code-calendar-free
CC-MAIN-2013-48
refinedweb
412
65.83
Quick Start to Reasonable Server Faces (RSF), a Java Web Programming Framework Introduction Reasonable Server Faces (RSF) is Java open source Web framework built upon of the Spring framework. It is an extremely light weight framework that allows for pure XHTML templating and complete lifecycle handling. This article defines and demonstrates three of RSF's primary tenets: primacy of markup, zero server state, correct use of POST/GET. RSF, unlike other Java web frameworks, places a primary emphasis on markup and the role of the web designer. The web designer is not constrained by framework generated markup nor are they she forced to design around inline code or pseudo code. Templates are pure XHTML and require no framework knowledge to create or maintain. This creates a complete separation from the presentation and Java code-behind. The web designer and the developer can work independently without needing to coordinate their efforts as you will see in the sample app. RSF aims to follow the correct and efficient browser behavior on the server by following a strict POST->GET redirect in order to keep all GET requests idempotent. In this way, POST is used solely to send data to the server, and GET is used solely to return data to the browser. This resolves many issues that other frameworks face with browser back button behavior or deep linking issues. Recipe List Application To demonstrate these primary goals along with RSF's core components, a very simple recipe list application will be built. The application will create a list of items by allowing users to add additional items via a web form. This easy task will showcase many features including: template construction, link behavior, simple internationalization, and form posts. To start off the simple application, first you need to prepare the environment for RSF. RSF's wiki web site has a great guide to setting up the RSF Development Environment, and is out of the scope of this article. Once that has been completed, you can start by creating the XHTML templates used in the application. As mentioned before, these are pure XHTML templates constructed with presentation as their only concern. For this simple app, there will be two pages, so you need to create two XHTML templates: recipelist.html <> <h4 rsf:There are currently {0} item(s).</h4> <ul> <li rsf: <span rsf:An Item</span> </li> </ul> <a rsf:Add an Item</a> </body> </html> itemForm.html <> <form rsf: <fieldset> <legend rsf:Add an Item to the List</legend> <ol> <li> <label rsf:Item:</label> <input type="text" rsf: </li> </ol> <div class="buttonwrap"> <input type="submit" rsf: </div> </fieldset> </form> </body> </html> As can be seen above, these are nearly completely valid XHTML documents except for the addition of one single attribute, rsf:id="". This is the only mechanism in which RSF is represented in the templates. In fact, these templates can be viewed in any web browser as-is (browsers will simply ignore the extra attribute) and can also be validated. Any text or other properties in the template in nodes that contain the rsf:id attribute will be overwritten via RSF, so templates can contain as much "dummy-data" as you wish. This can be extremely useful to allow the designer to communicate the intent of the markup structure to the developer by allowing dummy content to exist. The list of appropriate rsf:id values is the only contract that the designer and developer must maintain with each other. As long as the same ids are used in the semantically same way, the view will work. The rsf:id tags specify an id that allows the RSF rendering engine a location to wire up its data. The use of an id with a colon (:) is a special convention that tells the rendering engine that this XHTML node (and its children) may be repeated. To support internationalization another special tag convention is used to pull text directly out of a standard Java properties bundle. This allows the developer to directly wire an rsf:id to a properties bundle key by simply specifying a special rsf:id="msg=property_key". For this application, all of the page text has been pulled into the following property bundle: messages.properties title = Recipe List header = Recipe List form_legend = Add an Item to the List label_item = Item: current_items_count = There are currently {0} item(s). Once you have a templates in place, you must create a Component Producer for each template. A component producer in RSF is the mechanism in which the component tree in Java is built. Each producer implements the ViewComponentProducer interface and has a corresponding ViewID, which should match the filename of the template. The overridden method fillComponents is where the component tree is built to match the rsf:ids in the template. The parameter UIContainer tofill acts as a parent element of the component tree where all of the components will be added. The producer to build the component tree for the recipe list items is below: RecipeListProducer ... public class RecipeListProducer implements ViewComponentProducer, DefaultView { public static String VIEW_ID = "recipelist"; public String getViewID() { return VIEW_ID; } private RecipeListService service; public void setService(RecipeListService service) { this.service = service; } public void fillComponents(UIContainer tofill, ViewParameters viewparams, ComponentChecker checker) { //Build Recipe List List<String> items = service.getItems(); UIMessage.make(tofill, "current_count", "current_items_count", new Object[] {items.size()}); for (String item : items){ //Create a new <li> element UIBranchContainer row = UIBranchContainer.make(tofill, "current_items:"); UIOutput.make(row, "row_item", item); } //Create Link to Add Item Form UIInternalLink.make(tofill, "add_item", new SimpleViewParameters(ItemFormProducer.VIEW_ID)); } } With this producer, a few key concepts are introduced as well as a few of RSF's built in components. The RecipeListService above simply returns a list of strings that represent each item of the recipe list. Previously, it was shown that the message bundle text for internationalization can be utilized directly by the template. If, however, you need to do more than just output static text, you have the option of using RSF's UIMessage component that will perform the bundle lookup. Here, after retrieving the list of recipe items from the service, you want to display the total count of items using the message bundle with key "current_items_count". Using the UIMessage component, you look up the bundle string "current_items_count", format the text adding in the items.size() into a placeholder, and attach that to the DOM node with the rsf:id="current_count".<<
https://www.developer.com/java/web/article.php/3815631/Quick-Start-to-Reasonable-Server-Faces-RSF-a-Java-Web-Programming-Framework.htm
CC-MAIN-2018-43
refinedweb
1,067
52.49
Credit card api jobs ...should automatically charge the credit card on file. 6. It should one at a time send a api query to [login to view URL] with the card information and amount. It should then take the return (approved or denied) and store it in the batch log. When it's approved, it should tag that item in the batch as "Completed". If one card in the batch is... We need a responsive flights based website. You will need to install API's and Merchant Gateway. The site also requires phone number and Credit Card number to be verified. API knowledge is required Prior experience in such websites is mandatory. I need an Android/iphone app. I would like it designed and built. ...mobile banking API. The API provides endpoints to collect payment, disburse payment, issue refunds and query transactions. The payment gateway works with a mobile number (MSISDN) at checkout i.e. there is no Credit Card details captured or stored on Magento at any point. The payment gateway should have an admin interface to configure the API keys and enable... .. ...system, and then send the payments to the staff's designated payment type. The staff should be able to enter their PayPal email to receive funds by paypal, and also their credit card or bank information. Please check which major payment provider (i.e. square, or slide) allows for sending payments using those methods without us having to signup for a :- [login to view URL] A simple credit card project with test methods. Mostly completed, but needs a couple more files and test files .., including: > New or updated stock information (including product I need an Android app. I would like it designed and [login to view URL] refer to the app named ok credit i need same app with new technologies logo for my credit repair company ,I want a army women picture and a civilian man picture Looking for a programme...for adding something to our shop, the work should be clear, have the bitcoin API also waitting to be added inside the shop. Need to update last design from 2014 to the new one from 2018, just have to finish the layout inside. Payment will be done in BITCOIN, no credit card, no bank transfer, no western union... only Bitcoin. ..)... ...We can discuss any details over chat. For "PayDock credit Toekenization" can the customer know if a card is already stored within Paydock? This would be useful if the customer purchases further services and just wants to use what is stored in Paydock. Secondly, The purpose of using the Vault api as another option is to allow the merchant to: [login to view URL] [lo... ...Services Limited ...Also, we will handle the code which is already started and have already the integration with the API. At the moment it is integrate and develop the login, registration, create profile and add pet. What should be done: - Views and logic to create credit card (consume service) - View of list and search of active veterinarians (consume service) - View'm looking for a developer to build a Delphi.. add.
https://www.tr.freelancer.com/job-search/credit-card-api/
CC-MAIN-2018-51
refinedweb
521
73.07
Bruno Haible wrote: > Hello Pádraig, > > The documentation files you sent document the status before any 'fallocate' > module is added to gnulib. So I committed them for you: > > 2009-05-21 Pádraig Brady <address@hidden> > > * doc/glibc-functions/fallocate.texi: New file. > * doc/gnulib.texi: Include it. Thanks a million for looking at this Bruno! > The fallocate.texi will need a modification that goes along with the > 'fallocate' module. > >> This is my first gnulib module > > Ok, here are detail comments: > > - fallocate.c should have a GPLv3 copyright header. oops > - A rpl_fallocate function that always returns ENOSYS makes no sense for > gnulib. > In gnulib, we enable a function when we have working code for it. If the > replacement can be implemented only on some platforms, we make sure the .h > file > defines an indicator that users can test with #if or #ifdef. Well libc, kernel or filesystem could return ENOSYS so code using fallocate() has to handle it anyway. I did it like that so gnulib users can call fallocate() unconditionally for the common optional optimization use case. Or they can also #if HAVE_FALLOCATE .... #endif if desired. > > In coreutils, the policy is different: coreutils at some places has dummy > stubs, and is willing to compile in function calls to these dummy stubs on > platforms that lack the particular functionality. Other projects that use > gnulib prefer to use a #if around the code that uses the functionality. > > - In fallocate.c, the "#undef fallocate" should go away. It makes it > impossible > to make a namespace-clean library by adding a > #define fallocate libfoo_private_fallocate > to config.h. ok > - glibc declares fallocate() in <fcntl.h>. Therefore gnulib should do the > same. > There is no use in creating a file "fallocate.h"; instead, put the > declarations > into fcntl.in.h. hmm. I was wondering about that. The reason I chose fallocate.h was for platform independence. Also <linux/falloc.h> needs to be handled independently then. > - In fallocate.m4 you are doing > AC_DEFINE([fallocate], [rpl_fallocate], [replacement stub]) > This define is better done in the .h file (fcntl.in.h in this case). > Otherwise you get problems when a platform has an 'fallocate' function. > We used that mix of config.h and *.in.h idiom in the beginning, but it > turned out to be more maintainable to put the entire replacement code > into the *.in.h file. ok > > - In fallocate.m4 the invocation of AC_TRY_LINK takes some time (it runs > the compiler and linker) and therefore should be protected by a cache > variable. AC_CACHE_CHECK is your friend. ok > >> Note also "fallocate()" functionality is available on >> solaris using the fcntl(fd, F_ALLOCSP, ...) interface. >> Hopefully this can be wrapped by this fallocate() at >> some stage. > > Yes, sure, please do this. F_ALLOCSP and F_ALLOCSP64. The more platforms > a replacement supports, the better. ok I'll try and get opensolaris to test this >> Note fallocate() is unfortunately not available on 32 bit >> fedora 11 at least when AC_SYS_LARGEFILE is used due to: >> > > IMO this is not worth working around, because it's likely to be fixed > quickly in glibc. My thoughts also. thanks again! Pádraig.
http://lists.gnu.org/archive/html/bug-gnulib/2009-05/msg00234.html
CC-MAIN-2017-04
refinedweb
513
68.87
File. Append Text(String) Method Definition Creates a StreamWriter that appends UTF-8 encoded text to an existing file, or to a new file if the specified file does not exist. public: static System::IO::StreamWriter ^ AppendText(System::String ^ path); public static System.IO.StreamWriter AppendText (string path); static member AppendText : string -> System.IO.StreamWriter Public Shared Function AppendText (path As String) As StreamWriter Parameters Returns A stream writer that appends UTF-8 encoded text to the specified file or to a new file. Exceptions The caller does not have the required permission. path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by InvalidPathChars. path is null. The specified path, file name, or both exceed the system-defined maximum length. The specified path is invalid (for example, the directory doesn't exist or it is on an unmapped drive). path is in an invalid format. Examples The following example appends text to a file. The method creates a new file if the file doesn't exist. However, the directory named temp on drive C must exist for the example to complete successfully. using namespace System; using namespace System::IO; int main() { String^ path = "c:\\temp\\MyTest.txt"; // This text is added only once to the file. if ( !File::Exists( path ) ) { // Create a file to write to. StreamWriter^ sw = File::CreateText( path ); try { sw->WriteLine( "Hello" ); sw->WriteLine( "And" ); sw->WriteLine( "Welcome" ); } finally { if ( sw ) delete (IDisposable^)sw; } } // This text is always added, making the file longer over time // if it is not deleted. StreamWriter^ sw = File::AppendText( path ); try { sw->WriteLine( "This" ); sw->WriteLine( "is Extra" ); sw->WriteLine( "Text" ); } finally { if ( sw ) delete (IDisposable^)sw; } // Open the file to read from. StreamReader^ sr = File::OpenText( path ); try { String^ s = ""; while ( s = sr->ReadLine() ) { Console::WriteLine( s ); } } finally { if ( sr ) delete (IDisposable^)sr; } }); } } } } Imports System.IO Public Class Test Public Shared Sub Main() Dim path As String = "c:\temp\MyTest.txt" ' This text is added only once to the file. If Not File.Exists(path) Then ' Create a file to write to. Using sw As StreamWriter = File.CreateText(path) sw.WriteLine("Hello") sw.WriteLine("And") sw.WriteLine("Welcome") End Using End If ' This text is always added, making the file longer over time ' if it is not deleted. Using sw As StreamWriter = File.AppendText(path) sw.WriteLine("This") sw.WriteLine("is Extra") sw.WriteLine("Text") End Using ' Open the file to read from. Using sr As StreamReader = File.OpenText(path) Do While sr.Peek() >= 0 Console.WriteLine(sr.ReadLine()) Loop End Using End Sub End Class Remarks.
https://docs.microsoft.com/en-us/dotnet/api/system.io.file.appendtext?view=netstandard-2.0
CC-MAIN-2020-45
refinedweb
436
59.6
envelope From: address for a message should be specified with the MTA_USER item code. With this item code, only the local part of a mail address may be specified, that is, the user name. The mtaSend() routine will automatically append the official local host name to the user name so as to produce a valid mail address. The MTA_ENV_FROM item code may be used to explicitly specify a complete envelope From: address but this is usually not necessary. Applications that enqueue nonlocal mail should probably be using the SDK routines rather than mtaSend(). If neither MTA_USER nor MTA_ENV_FROM are specified, then the user name associated with the current process will be used for the envelope From: address. When MTA_USER is used, the From: header line will be derived from the envelope From: address. When MTA_ENV_FROM is used, the From: header line will be derived from the user name of the current process. In either case, if a From: header line is supplied in an initial header, then a Sender: header line will be added to the message header. The initial From: header line will be left intact and the address specified, and Sender: address will be derived from either the envelope From: address (MTA_USER) or from the user name of the current process, that is, from MTA_ENV_FROM. Only privileged users may use MTA_USER to specify a user name different than that of the current process. To be considered a “privileged” process on UNIX® systems, the process must have the same (real) user ID (UID) as either the root or Messaging Server account. body of a message, that is, the message content, is built up from zero or more input files or procedures. The input files and procedures are read or invoked in the order specified in the item list passed to the mtaSend() routine. The message body is built up by appending the next input source to the end of the previous input source. A blank line will be inserted in the message as a separator between input sources if the MTA_BLANK item is requested in the item list. The MTA_MSG_FILE and MTA_MSG_PROC item codes are used to specify the name or address of input files or procedures. An initial message header may be supplied from either an input file or procedure. The message header will then be modified as needed when the message is enqueued. The MTA_HDR_FILE and MTA_HDR_PROC items are used to specify the name or address of an input file or procedure. If an initial message header is to be supplied, it must appear in the item list before any MTA_MSG_FILE or MTA_MSG_PROC items. A blank line must be supplied at the end of the message header, or at the start of the first message-body input source. This blank line will automatically be supplied when the MTA_BLANK item code is specified in the item list. The MTA_MODE_ and MTA_ENC_ items control the access mode and encodings applied to message body input sources. These items set the current access mode and encoding to be applied to all subsequent input sources that appear in the item list. The default access mode is MTA_MODE_TEXT, which uses text mode access. The default encoding is MTA_ENC_UNKNOWN, which results in no encoding of the data. The binary access mode will not be applied to input procedures. The access mode and encoding item codes do not apply to input sources for an initial message header, which is always accessed using the default access mode and never encoded. Input procedures use the following calling format: ssize_t proc(const char **bufadr) where const char **bufadr is the address of pointer to the starting memory location of the next piece of input data. The return value is ssize_t, which gives the length of the input data. A value that is equal to or greater than zero (0) indicates success. A value of minus one (-1) indicates that there is no further data to return (EOF). Any other negative value indicates an error for which processing should be aborted. The procedure will be repeatedly called until a negative value is returned, which indicates all input data has been retrieved or an error occurred..
http://docs.oracle.com/cd/E19796-01/819-2652/acdgs/index.html
CC-MAIN-2014-52
refinedweb
696
59.84
python-dev Summary for 2006-03-01 through 2006-03-15 Contents - Announcements - Summaries - Maintaining ctypes in SVN trunk - Windows buildbots - Python 3.0: itr.next() or next(itr) - Python 3.0: base64 encoding - Coverity scans of Python code - Speeding up lookups of builtins - Requiring parentheses for conditional expressions - Exposing a global thread lock - Making quit and exit callable - Python 3.0: Using C++ - A @decorator decorator - Expanding the use of as - Relative imports in the stdlib - Making staticmethod objects callable - Adding a uuid module to the stdlib - A dict that takes key= callable - Bug in __future__ processing - Cleaning up string code - Freeing Python-allocated memory to the system - Modifying the context manager __exit__ API - Python 3.0: default comparisons - Deferred Threads - Previous Summaries - Skipped Threads - Epilogue [The HTML version of this Summary is available at] Announcements Webstats for python.org Thomas Wouters set up webalizer on dinsdale.python.org and added webstats for all subsites of python.org: - - - - - - Check 'em out if you're interested! Contributing thread: [SJB] Python 2.5 release schedule The first releases scheduled for Python 2.5 are quickly approaching. Check PEP 356 for details, but the first alpha is due on April 1st. Contributing thread: [SJB] Py3K branch Guido has begun work on Py3K, starting a new branch to rip out some stuff like string exceptions and classic classes. He's trying to get a "feel" for what Python 3.0 will look like, hopefully before his keynote in OSCON. Contributing thread: [SJB] Deprecated modules going away in Python 2.5 A number of deprecated modules will be removed in Python 2.5, including: - reconvert.py - regex (regexmodule.c) - regex_syntax.py - regsub.py and a variety of things from lib-old. These modules have been deprecated for a while now, and will be pulled in the next Python release. Contributing thread: [SJB] Summaries Maintaining ctypes in SVN trunk Thomas Heller put ctypes into the Python SVN repository, and with the help of perky, Neal Norwitz and Thomas Wouters, updated it to take advantage of the new ssize_t feature. The "official" ctypes development will remain in its Sourceforge repository at least for a while since this makes it easy to test ctypes on the SF compile farm. Contributing threads: - ctypes is in SVN now. - Developing/patching ctypes (was: Re: integrating ctypes into python) - Developing/patching ctypes [SJB] Windows buildbots Josiah Carlson had been working on getting a buildbot slave running on a Windows box, but eventually gave up due to crashes caused by VS.NET. Tim Peters fought his way through the setup with a XP box, posting his lessons to the wiki, and Trent Mick managed to follow a similar route and setup a Win2K buildbot slave. Thanks to all who suffered through the config -- Windows buildbot coverage looks pretty good now! Contributing threads: [SJB] Python 3.0: itr.next() or next(itr) The end of last fortnight's defaultdict thread turned to discussing the fate of the iterator protocol's .next() method in Python 3.0. Greg Ewing argued that renaming .next() to .__next__() and introducing a builtin function next() would be more consistent with the other magic methods and also more future-proof, since the next() function could be modified if the protocol method needed to change. Raymond Hettinger was very strongly against this proposal, suggesting that trading a Python-level attribute lookup for a Python-level global lookup plus a C-level slot lookup was not a good tradeoff. The discussion then spread out to other protocol method/function pairs -- e.g. len() and __len__() -- and Oleg Broytmann suggested that they could all be replaced with methods, thus saving a lookup and clearing out the builtin namespace. Neil Schemenauer and Michael Chermside argued against such a change, saying that the double-underscore pattern allows new special methods to be introduced without worrying about breaking user code, and that using functions for protocols forces developers to use the same names when the protocols are involved, while using methods could allow some developers to choose different names than others. Guido indicated that he'd like to do some usability studies to determine whether methods or functions were more intuitive for the various protocols. Contributing threads: - defaultdict and on_missing() - iterator API in Py3.0 - iterator API in Py3. - .len() instead of __len__() (was: iterator API in Py3.0) - x.len() instead of len(x) in Py3.0 - .len() instead of __len__() (was: iterator API inPy3.0) - .len() instead of __len__() in Py3.0 [SJB] Python 3.0: base64 encoding This fortnight continued discussion from the last as to whether the base64 encoding should produce unicode or bytes objects. The encoding is specified in RFC 2045 as "designed to represent arbitrary sequences of octets" using "a 65-character subset of US-ASCII". Traditionally, base64 "encoding" goes from bytes to characters, and base64 "decoding" goes from characters to bytes. But this is the inverse of the usual unicode meanings, where "encoding" goes from characters to bytes, and where "decoding" goes from bytes to characters. Thus some people felt that the recent proposal to have only bytes.decode(), which would produce unicode, and unicode.encode(), which would produce bytes, would be a major problem for encodings like base64 which used the opposite terminology. A variety of proposals ensued, including putting .encode() and .decode() on both bytes and strings, having encode() and decode() builtins, and various ways of putting encoding and decoding into the unicode and bytes constructors or classmethods. No clear solution could be agreed upon at the time. Contributing thread: [SJB] Coverity scans of Python code Ben Chelf of Coverity presented scan.coverity.com, which provides the results of some static source code analysis looking for a variety of code defects in a variety of open source projects, including Python. Full access to the reports is limited to core developers, but Neal Norwitz explained a bit what had been made available. The types of problems reported in Python include unintialized variables, resource leak, negative return values, using a NULL pointer, dead code, use after free and some other similar conditions. The reports provide information about what condition is violated and where, and according to Neal have been high quality and accurate, though of course there were some false positives. Generally, developers seemed quite happy with the reports, and a number of bugs have subsequently been fixed. Contributing threads: - Coverity Open Source Defect Scan of Python - About "Coverity Study Ranks LAMP Code Quality" - Coverity report [SJB] Speeding up lookups of builtins Steven Elliott was looking into reducing the cost of looking up Python builtins. Two PEPs (PEP 280 and PEP 329) had already been proposed for similar purposes, but Steven felt these were biting off too much at once as they tried to optimize all global attribute lookups instead of just those of builtins. His proposal would replace the global-builtin lookup chain with an array that indexed the builtins. A fast check for builtin shadowing would be performed before using a builtin; if no shadowing existed, the builtin would simply be extracted from the array, and if shadowing was present, the longer lookup sequence would be followed. Guido indicated that he would like to be able to assume that builtins are not shadowed in Python 3.0, but made no comment on the particular implementation strategy suggested. Steven Elliott promised a PEP, though it was not yet available at the time of this summary. Contributing thread: [SJB] Requiring parentheses for conditional expressions Upon seeing a recent checkin using conditional expressions, Jim Jewett suggested that parentheses should be required around all conditional expressions for the sake of readability. The usual syntax debate ensued, and in the end it looked like the most likely result was that PEP 8 would be updated to suggest parentheses around the "test" part of the conditional expression if it contained any internal whitespace. Contributing threads: [SJB] Exposing a global thread lock Raymond Hettinger suggested exposing the global interpreter lock to allow code to temporarily suspend all thread switching. Guido was strongly against the idea as it was not portable to Jython or IronPython and it was likely to cause deadlocks. However, there was some support for it, and others indicated that the only way it could cause deadlocks is if locks were acquired within the sections where thread switching was disabled, and that even these could be avoided by having locks raise an exception if acquired in such a section. However, Michael Chermside explained that supporting such a thing in Jython and IronPython would really be impossible, and suggested that the functionality be made available in an extension module instead. Raymond Hettinger then suggested modifying sys.setcheckinterval() to allow thread switching to be stopped, but Martin v. Löwis explained that even disabling this "release the GIL from time to time" setting would not disable thread switching as, for example, the file_write call inside a PRINT_* opcode releases the GIL around fwrite regardless. Contributing thread: [SJB] Making quit and exit callable Ian Bicking resuscitated a previous proposal to make quit and exit callable objects with informative __repr__ messages like license and help already have. Georg Brandl submitted a patch that makes quit and exit essentially synonymous with sys.exit but with better __repr__ messages. The patch was accepted and should appear in Python 2.5. Contributing thread: [SJB] Python 3.0: Using C++ Fredrik Lundh suggested that in Python 3.0 it might be useful to switch to C++ instead of C for Python's implementation. This would allow some additional type checking, some more reliable reference counting with local variable destructors and smart pointers, and "native" exception handling. However, it would likely make linking and writing extension modules more difficult as C++ does not interoperate with others as happily as C does. Stephen J. Turnbull suggested that it might also be worth considering following the route of XEmacs -- all code must compile without warnings under both C and C++. No final decision was made, but for the moment it looks like Python will stick with the status quo. Contributing thread: [SJB] A @decorator decorator Georg Brandl presented a patch providing a ``decorator` decorator`_ that would transfer a function's __name__, __doc__ and __dict__ attributes to the wrapped function. Initially, he had placed it in a new decorator module, but a number of folks suggested that this module and the functional module -- which currently only contains partial() -- should be merged into a functools module. At the time of this summary, the patch had not been applied. Contributing thread: [SJB] Expanding the use of as Georg Brandl proposed that since as is finally becoming a keyword, other statements might allow as to be used for binding a name like the import and with statements do now. Generally people thought that using as to name the while or if conditions was not really that useful, especially since the parallel to with statements was pretty weak -- with statements bind the result of the context manager's __enter__() call, not the context manager itself. Contributing thread: [SJB] Relative imports in the stdlib Guido made a checkin using the new relative import feature in a few places. Because using relative imports can cause custom __import__'s to break (because they don't take the new optional fifth argument), Guido backed out the changes, and updated PEP 8 to indicate that absolute imports were to be preferred over relative imports whenever possible. Contributing threads: - Using relative imports in std lib packages ([Python-checkins] r43033 - in python/trunk/Lib: distutils/sysconfig.py encodings/__init__.py) - [Python-checkins] r43033 - in python/trunk/Lib: distutils/sysconfig.py encodings/__init__.py [SJB] Making staticmethod objects callable Nicolas Fleury suggested that staticmethod objects should be made callable so that code like: class A(object): @staticmethod def foo(): pass bar = foo() would work instead of compaining that staticmethod objects are not callable. Generally, people seemed to feel that most uses of staticmethods were better expressed as module-level functions anyway, and so catering to odd uses of staticmethods was not something Python needed to do. Contributing thread: [SJB] Adding a uuid module to the stdlib Fredrik Lundh suggested adding Ka-Ping Yee's uuid module to the standard library. Most people were agreeable to the idea, but with other uuid implementations around, there was some discussion about the details. Phillip J. Eby suggested something more along the lines of PEAK's uuid module, but no final decisions were made. Contributing thread: [SJB] A dict that takes key= callable Neil Schemenauer suggested providing dict variants in the collections module that would use the ids of the objects instead of the objects themselves. Guido suggested that it would likely be more useful to design a dict variant that took a key= argument like list.sort() does, and apply that key function to all keys in the dict. That would make implementing Neil's id-dict almost trivial and support a variety of other use-cases, like case-insensitive dicts. People seemed quite supportive of the proposal, but no patch was available at the time of this summary. Contributing thread: [SJB] Bug in __future__ processing Martin Maly found Guido's previously encountered bug that Python 2.2 through 2.4 allows some assignment statements before the __future__ import. Tim Peters correctly channeled Guido that this was a bug and would be fixed in Python 2.5. Contributing thread: [SJB] Cleaning up string code Chris Perkins noted that str.count() is substantially slower than unicode.count(). Ben Cartwright and others indicated that the source for these functions showed clearly that the unicode version had been better optimized. Fredrik Lundh and Armin Rigo both mentioned cleaning up the string code to avoid some of the duplication and potentially to merge the str and unicode implementations together. At the time of this summary, it didn't seem that any progress towards this goal had yet been made. Contributing thread: [SJB] Freeing Python-allocated memory to the system Tim Peters spent his PyCon time working on a patch by Evan Jones, originally discussed in January. The patch enables Python to free memory back to the operating system so that code like: x = [] for i in xrange(1000000): x.append([]) del x[:] does not continue to consume massive memory after the del statement. Tim gave python-devvers some time to review the patch for any speed or other issues, and then committed it. Contributing thread: [SJB] Modifying the context manager __exit__ API After thinking things over, Guido decided that the context manager __exit__ method should be required to return True if it wants to suppress an exception. This addressed the main concerns about the previous API, that if __exit__ methods were required to reraise exceptions, a lot of __exit__ methods might end up with easily-missed bugs. Contributing thread: [SJB] Python 3.0: default comparisons In Python 3.0, Guido plans to ditch the default < <= > >= comparisons currently provided, and only provide == != where by default all objects compare as unequal. Contributing thread: [SJB] Skipped Threads - New test failure on Windows - .py and .txt files missing svn:eol-style in trunk - Using and binding relative names (was Re: PEP forBetter Control of Nested Lexical Scopes) - Stateful codecs [Was: str object going in Py3K] - bytes thoughts - wiki as scratchpad - test_compiler failure - DRAFT: python-dev Summary for 2006-01-16 through 2005-01-31 - Weekly Python Patch/Bug Summary - When will regex really go away? - ref leak w/except hooks - Faster list comprehensions - PEP 357 - Lib/test/test_compiler.py fails - FrOSCon 2006 - Call for {Papers|Projects} - Outdated Python Info on (fwd) - My buildbot host upgraded to OSX 10.4 - Slightly OT: Replying to posts - New Future Keywords - [Python-checkins] Python Regression Test Failures refleak (1) - [Python-checkins] Python humor - Two gcmodule patches - Scientific Survey: Working Conditions in Open Source Projects - _bsddb.c ownership - str(Exception) changed, is that intended? - Long-time shy failure in test_socket_ssl - mail.python.org disruption - Bug Day? - Generated code in test_ast.py - fixing log messages - [Python-checkins] r42929 - python/trunk/Tools/scripts/svneol.py - unicodedata.c no longer compiles on Windows - multidict API - Google ads on python.org? - libbzip2 version? - PythonCoreCurrentVersion - Strange behavior in Python 2.5a0 (trunk) --- possible error in AST? - Why are so many built-in types inheritable? - checkin r43015 - Topic suggestions from the PyCon feedback - Another threading idea - Octal literals - [Python-checkins] r43022 - in python/trunk: Modules/xxmodule.c Objects/object.c - [Python-checkins] Python Regression Test Failuresrefleak (1) - [Python-checkins] r43028 - python/trunk/Modules/_ctypes/cfield.c - PEP 338 implemented in SVN Epilogue This is a summary of traffic on the python-dev mailing list from March 01, 2006 through March 15th written by the python-dev summary pair of Steve Bethard and Tony Meyer (some day we'll really catch up)..
http://www.python.org/dev/summary/2006-03-01_2006-03-15/
crawl-002
refinedweb
2,794
52.6
Details Description The NodeComparator.compare() method has two faults when taken from the perspective where a predicate function returns multiple Attribute ( or Namespace) siblings. The first issue is that compare(Object o1,Object o2) should return 0 when o1 == o2. This should be default behaviour as during the sorting process it is technically legal for the comparator to be called that way. The bigger issue is that if o1 and o2 are both siblings, and both either Attributes, or Namespaces, then the code 'falls through', and uses the compare() result of the parent (Element) to test for the document order. Unfortunately, they have the same parent (and the same depth), and, as a result, they always compare() as value 1. This always puts the o1 sibling after the o2 sibling. Further, this breaks the Comparator 'contract', because: 1 == compare(SiblingA, SiblingB) also: 1 == compare(SiblingB, SiblingA) Attached are two files, the first is a test case showing the problem. The second is a NodeComparator .java class with two changes to the current version in subversion: 1. it immediately returns 0 for o1 == o2 2. it does a special sibling-compare for sibling Attributes/Namespaces The motivation for '2' is that the XPath specification does allow a preceding/following axis for namespaces/attributes (likely because DOM has no Attribute order assumption), but, almost all implementations have a 'natural' order for Attributes and Namespaces, and the axis-order must be consistent for any evaluation anyways. This change provides consistency and reliability in the NodeComparator class. Activity > The implementation dependent order is jaxen's order. Respectfully, I believe you are wrong on this point. Jaxen is not the 'owner' of the 'Data Model'. Jaxen (by design) 'delegates' ownership of the XPath 'Data Model' to the 'Navigator'. The 'Navigator' is the 'implementation' of the Data Model, and thus the Navigator is the authority on (from a Jaxen perspective) of what the document model is, and thus by extension what the 'document order' is. To illustrate the 'bug' using 'Proof by Contradiction' logic (using the attributes axis)..... Assume that Jaxen 'owns' the 'document order' of Attributes. From the Navigator documentation: getAttributeAxisIterator() returns "an Iterator capable of traversing the axis, not null" To 'traverse' the axis it first has to know not only what the axis contains but also what the order of the axis is. Jaxen determines the order. But Jaxen cannot know the order until it has all the Attributes and also only after it has run the XPath expression (because the Jaxen 'order' is currently dependent on the XPath expression). This is 'absurd', therefore the assumption must be wrong. Jaxen cannot 'own' the document order and expect the Navigator to return Attributes in document-order. Conclusion The navigator 'owns' document order (of everything, including Attributes), and it exposes the document order in the sequence returned by the axis iterators. Jaxen ignores this implied order for both the namespace and attribute axes. Hence Jaxen has a bug. Rolf I am trying to figure out the motivation for the way you implemented this fix... Just so I understand it correctly, there is no XML-based specification for determining the order of Attribute and Namespace declarations, similarly there is no XPath specification, yet, there is a Jaxen specification that says the Namespaces/Attribute axes are provided by the Navigator.... Yet, from what I can tell, you arbitrarilily (against the Jaxen documentation) re-sort all the attributes by the QName, and the namespaces by prefix? Why are those orders better than the actual axis order? Before this fix, the Attribute/Namespace orders would only be 'wrong' (different to the attribute/namespace axes) when there was a 'union' XPath operator, but now the attribute/namespace results are often wrong because they are always re-sorted alphabetically! I am happy to help/work on making a solution work that makes sense... and if my 'fix' for #221 was not complete (because DOM navigator returns different values each time you access it's Namespace axis....) then I can work to fix that. But this issue is not fixed, it is more broken than before! I had to pick something that would give us a predictable sort order to make Java 7 work, so I picked the simplest thing that could possibly work. (Well, not quite the simplest. Three other things that seemed simpler failed. This was my fourth attempt to fix Jaxen-221.) Beyond that, this approach satisfies the XPath 1.0 spec to my satisfaction. If you can contrive an XPath expression for which this generates demonstrably incorrect output, as Abhay Kumar Yadav did in Jaxen-221, then I'll try to fix it. But remember that the XPath specification does not define any order for attribute and namespace nodes (though I notice now it does require "The namespace nodes are defined to occur before the attribute nodes." I should check to see that we've got that right.) The deep issue here is that XML parsers are not required to, and in practice don't, generate attribute and namespace nodes in any particular order. Indeed you can parse the same document several times and get the attributes in different orders each time. Indeed in some APIs, you can parse a document once, read the attributes several times, and get them in different orders each time. Attributes and namespace are fundamentally unordered. Any ordering jaxen provides is a convenience for navigational purposes. It may change from one release to the next; indeed from one run to the next; and client code should not rely on it. Hi Elliotte. It would be great to have a 'clean' discussion about this... the comments on this issue is cumbersome, and the mailing list for Jaxen appears to have been unused for half-a-decade... But, in my head, the issue is 'clearl', yet I don't seem to be able to communicate it effectively.... and I think you have the same 'clarity' in your head... which is fine, but hear me out... ... and I think I will start by asking you to consider three different specific points, in order: 1. I agree, XML spec does not define a particular order for Attributes, in fact, it says: Note that the order of attribute specifications in a start-tag or empty-element tag is not significant. The XML InfoSet specification also says the order of Attributes is not defined to be part of the InfoSet. 2. XPath specification does define that a document order exists for Attributes, and that the order is 'implementation specific'. - Section 5 defines the 'Document Order' including: "The relative order of namespace nodes is implementation-dependent. The relative order of attribute nodes is implementation-dependent." One very important question as it relates to this bug, (and I will expand on this later) is "what is the 'implementation'"? Further, the order of these values, the Namespaces and Attributes, are 'exposed' in the XPath specification as the attribute:: and namespace:: axes. The XPath spec defines all axes to be either in document-order, or reverse-document-order. There is no explicit exception for attribute:: or namespace::. Further, the document order is not allowed to change during the evaluation of a query. The implication is that: a) there is a document order; b) it is implementation-dependent for attribute:: and namespace:: and c) it is not allowed to change during the evaluation of an expression. 3. The Jaxen 'specification' defines an abstraction layer between the XPath 'engine' and the document 'model'. The engine can work on any model that is defined using the Jaxen 'Navigator'. The documentation for 'Navigator' says: "There is a method to obtain a java.util.Iterator, for each axis specified by XPath.". The only way to make Jaxen work in all cases is for the Navigator implementation to be consistent with all three specifications... XML, XPath, and Jaxen. Now, back to the question of 'implementation-dependant'. Who 'owns' the implementation. Jaxen's documentation is not as 'rigourous' or 'formal' as a w3c specification, but, there is a clear implication that "Jaxen is an engine", There is a document model (with implementations for DOM, XOM, etc.), and the Navigator defines the 'interface' between the engine and the model. The issue at hand (JAXEN 215) is really about who owns the 'document order'. In my head it is clear that the document order is 'owned' by the document model, and is 'exposed' by the Navigator. In your head it seems that the document order is owned by the document model for everything except the attribute and the namespace axes, where Jaxen unilaterally redefines the order to be something else. There is no specification that makes Jaxen reorder those axes. On the contrary, Jaxen 'clearly' delegates the order of the axes to the Navigator. So, the symptoms of this contradiction between the Navigator concept and the Jaxen reordering is things like the following should be 'obvious', but they break (using an XPath 'pseudocode'): (using DOM): element.getAttributes().item(0) == XPath.evaluate("@*[1]", element) (using JDOM): element.getAttributes().get(0) .... element.getNamespacesInScope().get(0) == XPath.evaluate("namespace::*[1]", element); and so on.... Other issues are things like new artificial differences between the : XPath.selectSingleNode("@") and XPath.selectNodes("@[1]") I want to point out a special 'marketing' angle for Jaxen that the engine can be applied to non-XML models too - as long as they can expose the implementation in a way that conforms to the Navigator (this is something that I have done with Jaxen a couple of times already.... -apart from JDOM - by the way). So, apart from pointing out the incongruence you have introduced by 'stealing' ownership of 'document order', I guess I can put together a demonstration of it.... which I have already done a number of times in this discussion, but perhaps I will do it with something other than JDOM.... Oh, by the way, it was me who put together the test case for #221..... Rolf error in description...: The text "The motivation for '2' is that the XPath specification does allow a ..." should in fact read: "The motivation for '2' is that the XPath specification does NOT allow a ..."
http://jira.codehaus.org/browse/JAXEN-215?focusedCommentId=279312&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel
CC-MAIN-2014-10
refinedweb
1,692
54.42
Harshavardhan Gangavarapu13,727 Points Create a public method named getRemainingCharacterCount that returns an int representing how many characters they have public class Tweet { String mText; private String text; public static final int MAX_CHARS=140; public Tweet(String text) { mText = text; } public String getText() { return text; } int answer=MAX_CHARS-mText.length(); public void setText(String text) { mText = text; } public int getRemainingCharecterCount(){ return answer; } } 2 Answers Daniel TuratoJava Web Development Techdegree Graduate 30,118 Points Well first there is a few issues with your code, for starters you don't need to create an outside field for answer as that's what the method is used for. Also, even if you were thinking of adding a field for this value you would put it above the methods and not in between them. I can't see the challenge you on to see if the code will be correct for this but I think this should work: public class Tweet { public static final int MAX_CHARS=140; private String mText; public Tweet(String text) { mText = text; } public String getText() { return text; } public void setText(String text) { mText = text; } public int getRemainingCharecterCount(){ return MAX_CHARS - mText.length(); } } Harshavardhan Gangavarapu13,727 Points Harshavardhan Gangavarapu13,727 Points Did not complete the challenge. Below is the error which occurred with your code: Tweet.java:10: error: cannot find symbol return text; ^ symbol: variable text location: class Tweet Note: JavaTester.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error
https://teamtreehouse.com/community/create-a-public-method-named-getremainingcharactercount-that-returns-an-int-representing-how-many-characters-they-have
CC-MAIN-2020-40
refinedweb
245
54.66
ALB and k8s: Routing between namespaces • Mark Eschbach ALBs are bound to a specific namespace. This is quiet unforutnate since each ALB costs at least $18 a month and you miss out on a lot of awesome features. Sure failure domains are isolated however if you publish a number of small serivces this is rather obnoxious. A suggestion which looks promising is to have the ALB target the nginx ingress controller and dispatch from there. A little sad the ALB does not support this out of the box but will have to do for now. Perhaps in the future I will consider other ingress mechanisms to replace nginx if it exhibits broken connection issues on restart or is not monitorable still. nginx Installation Need to prime nginx’s stable repository first: helm repo add nginx-stable helm repo update After a quick glance throught the configuration some options definitely need to chnage. Here is my initial pass at the configuration for the chart. Configuration knobs controller: service: type: ClusterIP prometheus: create: true Most important is setting the controller to use the ClusterIP as this is what the ALBs will target. If unset this will create a new ELB via the LoadBalancer service configuration which is definitely not what is desired. Caveat: Default Host Well, after seraching for a while turns out nginx does not support a critical use case: default hosts. This is really disappointing but I can work around the issue I suppose. All sites must be named and nginx provides it’s own default host. Easy enough to resolve by just directing specific hosts to the nginx controllers, although this makes me sad.
http://meschbach.com/stream-of-consciousness/programming/2020/09/06-alb-routing/
CC-MAIN-2021-31
refinedweb
275
60.24
span8 span4 span8 span4 Hi I am trying to use this python script which would be very helpful for me. I have a huge amount of data from a WFS which needs to be tiled in a good way. @takashi had a very good code, but I can’t get it to work in 2017.10.154 edition (the version I have). I have a test file with more than 2000 points and I want tiles with 230 points each. I have python installed on my computer and I am using the python caller. I get error messages: ” FME Configuration: No destination coordinate system set PythonFactory failed to load python symbol `FeatureProcessor' Factory proxy not initialized f_4(PythonFactory): PythonFactory failed to process feature” Why is that? Any suggestions? /Regards, Tobias Hi @trydlinge, In your PythonCaller, please change the Class or Function to Process Features to 'NonUniformBoxGenerator'. It is presently set to the default 'FeatureProcessor', but there is no class or function with that name in your script. The script was created for the old pyfme module (maybe in FME 2013 and earlier), so it may not work in the current FME even if you have modified the parameter setting. This is updated version. Note: Your sample data contains many duplicate points. In my observation, the maximum number of duplicates was 1330, so this script cannot finish iteration for dividing bounding box if you set 230 (less than 1330) to stopping condition. If you need to separate the duplicate points into groups having 230 or less points, the script would not be useful. import fmeobjects class NonUniformBoxGenerator(object): def __init__(self): self.points = [] # List of (x, y, point feature) self.boxId = 0 # Bounding Box ID def input(self, feature): # Extract coordinate and store the point feature. coord = feature.getCoordinate(0) self.points.append((coord[0], coord[1], feature)) def close(self): # Calculate initial extent. xmin, ymin, p = self.points[0] xmax, ymax = xmin, ymin for x, y, p in self.points[1:]: if x < xmin: xmin = x elif xmax < x: xmax = x if y < ymin: ymin = y elif ymax < y: ymax = y # Start creating boxes. self.createBoundingBox((xmin, ymin, xmax, ymax), self.points) # This method will be called recursively to divide box by four, # until the number of inside points becomes less than 230. def createBoundingBox(self, extent, points): xmin, ymin, xmax, ymax = extent if len(points) < 230: # Create a box polygon; output the polygon and inside points. # Output features can be classified by the GeometryFilter. coords = [(xmin,ymin),(xmax,ymin),(xmax,ymax),(xmin,ymax),(xmin,ymin)] boundary = fmeobjects.FMELine(coords) box = fmeobjects.FMEFeature() box.setGeometry(fmeobjects.FMEPolygon(boundary)) box.setAttribute('_box_id', self.boxId) self.pyoutput(box) for x, y, p in points: p.setAttribute('_box_id', self.boxId) self.pyoutput(p) self.boxId += 1 else: # Calculate extent of divided boxes. xc = (xmin + xmax) * 0.5 # Center X yc = (ymin + ymax) * 0.5 # Center Y extentList = [ (xmin, ymin, xc, yc), # bottom-left (xc, ymin, xmax, yc), # bottom-right (xmin, yc, xc, ymax), # top-left (xc, yc, xmax, ymax) # top-right ] # Collect inside points for each box. pointsList = [[], [], [], []] for x, y, p in points: if y < yc: if x < xc: # bottom-left pointsList[0].append((x, y, p)) else: # bottom-right pointsList[1].append((x, y, p)) else: if x < xc: # top-left pointsList[2].append((x, y, p)) else: # top-right pointsList[3].append((x, y, p)) del points # save memory # Call the method for each box. for extent, points in zip(extentList, pointsList): self.createBoundingBox(extent, points) Answers Answers and Comments 3 People are following this question.
https://knowledge.safe.com/questions/64299/python-caller-issue-grouping-points-into-tiles.html
CC-MAIN-2019-51
refinedweb
596
66.44
Hi, I was trying to send a static inner class from server to client, but I started to get some weird exceptions on the client side. Gladly I found the source of this bug. Let me show an example: Let's supose we have the following classes: package pckg; public class Foo { public static class Bar {} } When I try to send an instance of Foo.Bar to the client, the JSON enconder outputs something like this: {"__EncodedType":"pckg.Foo.Bar","__ObjectID":"2141231"} That's what is causing the client to get nuts. It should be pckg.Foo$Bar instead of pckg.Foo.Bar To fix this, just change every reference from Class.getCanonicalName() to Class.getName() in the class JSONEncoder. BTW, I was getting the following exception on the client when trying to get a message part: com.google.gwt.core.client.JavaScriptException: (TypeError): Cannot call method 'get' of null And the message part I was trying to access was not even the inner class that had the problem. There might be some problem with the decoding on the client, because it is not validating the incoming message. PS.: All those things I am reporting here are from version 1.3.2.Final Regards, Vitor. This should work fine in 2.0-SNAPSHOT.
https://developer.jboss.org/message/716635?tstart=0
CC-MAIN-2018-09
refinedweb
213
67.96
“Statements do not return results and are executed solely for their side effects, while expressions always return a result and often do not have side effects at all.” Goals This chapter isn’t a lesson so much as it as an observation — a short note that the FP code I’m writing in this book also falls into a category known as Expression-Oriented Programming, or EOP. In fact, because Pure FP code is more strict than EOP, FP is a superset of EOP. As a result, we just happen to be writing EOP code while we’re writing Scala/FP code. Therefore, my goals for this lesson are: - To show the difference between statements and expressions - To briefly explain and demonstrate EOP - To note that all “Pure FP” code is also EOP code I wrote about EOP in the Scala Cookbook, so I’ll keep this discussion short. Statements and expressions When you write pure functional code, you write a series of expressions that combine pure functions. In addition to this code conforming to an FP style, the style also fits the definition of “Expression-Oriented Programming,” or EOP. This means that every line of code returns a result (“evaluates to a result”), and is therefore an expression rather than a statement. As noted in the quote at the beginning of this chapter, statements do not return results and are executed solely for their side effects. An expression has the form: val resultingValue = somePureFunction(someImmutableValues) Contrast that with the OOP “statement-oriented code” I used to write: order.calculateTaxes() order.updatePrices() Those two lines of code are statements because they don’t have a return value; they’re just executed for their side effects. In FP and EOP you write those same statements as expressions, like this: val tax = calculateTax(order) val price = calculatePrice(order) While that may seem like a minor change, the effect on your overall coding style is huge. Writing code in an EOP style is essentially a gateway to writing in an FP style. I’m tempted to write about “The Benefits of EOP,” but because I already wrote about “[The Benefits of Functional Programming(/book/benefits-of-functional-programming-in-scala.html)” and “The Benefits of Pure Functions,” I won’t repeat those points here. Please see those chapters to refresh your memory on all of those benefits. A key point A key point of this lesson is that when you see statements like this: order.calculateTaxes() order.updatePrices() you should think, “Ah, these are statements that are called for their side effects. This is imperative code, not FP code.” Scala supports EOP (and FP) As I noted in the Scala Cookbook, these are obviously expressions: val x = 2 + 2 val doubles = List(1,2,3,4,5).map(_ * 2) But it’s a little less obvious that the if/then construct can also be used to write expressions: val greater = if (a > b) a else b Note: In Java you need the special ternary operator syntax to write code like that. The match construct also returns a result, and is used to write expressions: val evenOrOdd = i match { case 1 | 3 | 5 | 7 | 9 => println("odd") case 2 | 4 | 6 | 8 | 10 => println("even") } And try/catch blocks are also used to write expressions: def toInt(s: String): Int = { try { s.toInt } catch { case _ : Throwable => 0 } } Summary When every line of code has a return value it is said that you are writing expressions, and using an EOP style. In contrast, statements are lines of code that do not have return values, and are executed for their side effects. When see statements in code you should think, “This is imperative code, not FP code.” As noted in this lesson, because EOP is a subset of an FP style, when you write Scala/FP code you are also writing EOP code. What’s next Given this background, the next lesson shows how writing Unix pipeline commands also fits an EOP style, and in fact, an FP style.
http://alvinalexander.com/scala/fp-book/note-about-expression-oriented-programming/
CC-MAIN-2020-45
refinedweb
675
64.64
Today, on our continued journey through the in-depth .NET Exception Handling series, we’ll be taking a closer look at the System.IO.PathTooLongException in .NET. As the name implies, the System.IO.PathTooLongException is usually thrown when a path is passed to a variety of System.IO namespaced methods that is too long for the current .NET version and/or operating system configuration. In this article we’ll examine the System.IO.PathTooLongException in more detail, starting with how the exception fits into the larger .NET Exception hierarchy. We’ll then take a brief look at what path sizes are allowed, along with some functional C# code samples that illustrate how System.IO.PathTooLongExceptions are commonly thrown and can be avoided, so let’s get to it! The Technical Rundown - All .NET exceptions are derived classes of the System.Exceptionbase class, or derived from another inherited class therein. System.SystemExceptionis inherited from the System.Exceptionclass. System.IO.IOExceptioninherits from System.SystemException. System.IO.PathTooLongExceptioninherits from System.IO.IOException. Full Code Sample Below is the full code sample we’ll be using in this article. It can be copied and pasted if you’d like to play with the code yourself and see how everything works. When Should You Use It? One of the biggest challenges when dealing with IO during development can be handling local file creation and access. From permissions to synchronicity to path structure and length, every platform has slightly different rules you must abide by. Therefore, exceptions like the System.IO.PathTooLongException that we’re looking at today must be present to handle outside cases. Since we’ll be looking at the maximum allowed path length, let’s briefly go over the piece that make up a full path. We can use the System.IO.Path class to help us accomplish this through a variety of built-in methods: We start with a path, then extract and output all the various components that make up the path, until we finally retrieve the full path at the end. The result is an output that shows exactly what makes up a path to a file: It’s important to understand that .NET is looking at the full path when determining whether a path length is too long and, therefore, if a System.IO.PathTooLongException should be thrown. Most of our code sample logic takes place in the CreateFileByPathLength(int length, char character = 'a') method: Since all we care about is the length of the path, we’re creating file names with a single character repeated over and over, enough times to result in the full path length being equal to the passed length parameter. The CurrentPath property provides a convenient way of retrieving the full directory (without a file name) of where our executable resides, so we this to test if the length parameter is the same size (or smaller) than the full path length we’d need to actually create a new file. To create a new file we manually create a new path by combining the CurrentPath with a file name that repeats the passed character parameter as many times as necessary to result in a path length equal to length. Finally, we output the (shortened) version of the path and the actual path length to the console, before attempting to create a new file at that location. If successful, we output a message, and if creation fails, an exception is thrown and we catch and log that instead. That’s really all we need for setup, so now we can test this out by attempting to create files with full path lengths of various sizes. At this point it’s worth noting that the official documentation tells us that applications that target .NET Framework 4.6.2 or later will support paths up to 32,767 characters in length (the System.Int16.MaxValue value), unless the operating system returns a COR_E_PATHTOOLONG HRESULT value. The platform this code is being written and tested on is Windows 10 and the App.config file shows that we’re targeting a .NET Framework that exceeds 4.6.2: Keeping those things in mind, let’s see what happens when we test out different path length sizes: As you can see, we’re trying to cover the full spectrum by creating full paths a variety of path lengths. Our logging setup should cover every scenario, so let’s take a look at the output after running this code: Each call is separated by a blank line, along with the explicit output of the full path length for each attempt, so we can see what lengths work and which fail. As expected, a length of 1 far shorter than the base path length, so that was aborted. 90, 255, and 259 all work just fine, successfully creating new files of various lengths so the full path is equal to those sizes. The first interesting result we see is at exactly 260 length. In spite of the documentation claim that full paths must exceed 260 length to be a problem, when our path is exactly 260 characters we get a DirectoryNotFoundException. This seems to be some strange quirk, since obviously the directories in this call are no different than they were in the previously successful calls. Moreover, even though we saw that the .NET Framework 4.7 version we’re running on meets the 4.6.2 or higher requirement, our operating system is disallowed longer paths by default, so 32767 doesn’t work, throwing a System.IO.PathTooLongException our way instead. We also see that, in contradiction to the official documentation, the actual System.IO.PathTooLongException error message indicates that our path length must be less than 260 characters, which could explain the exception when using exactly 260 characters. One potential fix for this issue, depending on your Windows version, is to enable the use of long paths within the registry. Usual caveat: Don’t make changes to your registry unless you know what you’re doing. We take no responsibility for any damages you may incur. That said, to enable long paths for some Windows versions you can set the LongPathsEnabled registry entry to 1 (true):.
https://airbrake.io/blog/dotnet-exception-handling/pathtoolongexception
CC-MAIN-2018-39
refinedweb
1,037
63.8
XContainer.Element Method Namespace: System.Xml.LinqNamespace: System.Xml.Linq Assembly: System.Xml.Linq (in System.Xml.Linq.dll) Parameters - name - Type: System.Xml.Linq.XName Return ValueType: System.Xml.Linq.XElement A XElement that matches the specified XName, or a null reference (Nothing in Visual Basic). Returns a null reference (Nothing in Visual Basic) if there is no element with the specified name. Some axis methods return collections of elements or attributes. This method returns only a single element. This method returns a null reference (Nothing in Visual Basic) if the element with the specified name is not found. All of the methods that allow you to construct elements (the constructor of XElement, Add, and so on) accept a null reference (Nothing in Visual Basic) as a valid argument. This allows you to use a convenient idiom: you can call this method as part of functional construction, and the element is added to the XML tree being constructed if and only if the element exists in the source tree. The following example shows this idiom. In contrast to Elements, this method is not an axis method. It does not use deferred execution; it simply returns an element when called. The following example shows two uses of this method. In one case, the method finds the element in srcTree. In the second case, the method does not find the element in the source tree, no element is added to xmlTree, and no exception is thrown. Note that the Visual Basic example uses the child XML property. It is also allowable to use the Element method directly in Visual Basic. This example produces the following output: The following is the same example, but in this case the XML is in a namespace. For more information, see Working with XML Namespaces. This example produces the following output: .
http://msdn.microsoft.com/en-us/library/system.xml.linq.xcontainer.element.aspx?cs-save-lang=1&cs-lang=fsharp
CC-MAIN-2014-41
refinedweb
305
58.69
Chris Ridpath We resolved that the canonical form of EARL will be XML RDF, but that SBP will create an appendix of the EARL Spec with some EARL examples in n3 and provide references for n3 info. (A "rant space" for SBP who feels that n3 better represents the RDF model than XML RDF). Jim Ley started a thread about date not being sufficient to identify a report uniquely, especially for content that is generated dynamically. We did not come to any conclusions today, but identified the following issues. Date is clearly not sufficient for webpages, as so many pages don't provide accurate last-modified, so you can't tell just from a date of evaluation if they've changed. We would like some way to identify structural identicalness so a report can still be valid. Suggestions: Many pages change continously but in very minor ways, or only in content rather than structure. People put things like "todays date" on a page. Invalidating a report because of such a minor difference is annoying. Adverts are another problem with changing Issues waiting for nick - skip to 2nd agenda item: earl 1.0 wc: it's great! sbp: properties list - incorporated into the spec. wc: what needs to happen next w/1.0? sbp: cmn made good comments. need to agree on canonical syntax. jim's client works by going through xml dom. useful to have earl in rdf syntax. could then do xslt. generally opposed to rdf, due to problems it causes. 2nd issue: how useful is it for people to implement? wanted this to be more talktative. 1/2 way between tutorial and spec. read through and get into lang, as well as define. cmn said: link to syntax examples rather than include in draft. personal preference - want feedback. template might be useful, others link. (useful to keep in) feedback on how easy to read and know what talking about. sbp stable for months, but constantly evolving, but slowly. but can't tell how to evolve, until people implement. rdf good for evolving. when parsing, depends on syntax. how to tell what type of earl, syntactically. important in rdf. earl on cutting edge of rdf. basic rdf langs, like annotea and dc, low level. earl is structured compared to those too complex? wc summary of agenda items from sbp: complexity, feedback and evolution, usability of new spec, canonical form sbp: could do: everything in this doc asserted by... in rdf, implicit defn of what's going on in doc wc asks for clarification of last point NK: Q: I'm using XML (+XSLT) for all new developments. ??? feasible to think about moving to XML::RDF and making it all EARL compliant? Don't know.. sbp: going through -: good to get canonical syntax. people think element tree instead of model, i think in terms of model. xmlschema good idea. * wendy voices nick's questions to thsoe on the phone NK: User review requires subjective statements: "I have trouble with that ..." chaals has been against /* wendy reads nick's question */) sbp is hanging up the phone, and joining via irc [10:33] NK: sbp on one line? yes. NK: metoo :-( WC: jim and i are also hanging up phone. no use if all the action here on irc. WC: so, when sbp joins, we'll finish discussion of how we might change how we make earl assertions. WC: then, there are several other items on the agenda: JL: I think we need multiple "people" saying things within one Earl document, I can't see how it would be useful otherwise /* sbp joins irc. wc and jl hang up phone. from here on out, only method of communication is irc */ NK: Agreed sbp - you just missed: JL: I think we need multiple "people" saying things within one Earl document, I can't see how it would be useful otherwise SBP: Yes, I agree with that sbp notes draft spec. at: NK: Is that the same as the email attachment you sent couple of weeks ago? JL: Yes. SBP: the only thing is that in that case, you simply have to put up with reification; even if there is only one person saying something in the entire document. Of course, it's difficult to say things about the root context anyway, unless you'r using N3 SBP: yes, that is the same attachment; I have played around with it a little bit, but my local copy is basically 99% the same JL: We'll give you reification, if you give us XML-RDF :-) NK: Nick mused earlier: NK: Q: I'm using XML (+XSLT) for all new developments. ??? feasible to think about moving to XML::RDF and making it all EARL compliant? Don't know.. JL: Sean, you said there were some complications in doing this - what were they? SBP: Chaals on a similar subject:- SBP: [[[ SBP: It would also be good for the group to formally agree that the canonical SBP: syntax is XML RDF, or to formally agree that there are two syntaxes and a SBP: defined conversion algorithm, or whatever. SBP: ]]] SBP: the problem with parsing XML RDF as XML is that you're going at it syntactically, and the important thing about EARL is the model SBP: OTOH, it would be possible to define a canonical form, which would then be easy to parse NK: Why is that a problem? SBP: and indeed, write SBP: it's a problem because it's much more difficult to write a proper parser for EARL in XML RDF. Of course, the thinking is that you go via. an RDF parser, and then use that SBP: an RDF parser is a kind of abstract equivalent of an XML DOM interface for a normal XML document tree JL: I like XML, because I have XML parsers available across all servers, and major clients (IE/Mozilla) I don't have RDF parsers available to use. SBP: where a DOM would let you access parts of the XML tree, an RDF parser lets you access parts of the model. Now, the problem is that people want to access parts of the model through the tree. THE only way to get around that is to define a canonical form NK: XML is a representation. When you don't want EARL (e.g. generating HTML from it), just ignore the fact that it's earl-ish NK: Yes, XML offers lots of tools SBP: "When you don't want EARL [...], just ignore the fact that it's earl-ish" pardon me? NK: If I use XML:RDF and can make it both XML and EARL NK: this is what may or may not be feasible SBP: apologies, I still don't follow CMN: I was under the impression taht there are tools to work with RDF in XML format (which is after all the normatively defined syntax for RDF) SBP: yes: NK: OK, leave it for now. If you don't follow, it probably doesn't make sense CMN: which allowed access and manipulation of the model (I agree that is the important thing) SBP: it's the important thing, but if we can get away with having a simple syntactic form too... :-) NK: My Q: is, can't it be both at the same time? SBP: It will be both... but in essence, any DOM implementation would be a hack subset of an RDF parser SBP: Jim's excellent EARL client is bascially doing that; what we want to do is extend the hack that he started SBP: all he does is sniff for a certain URI in the XML RDF EARL, pass or fail, and then use it JL: XML parsers are much more ubiquitous though, if we say XML-RDF for interchange of earl, how you process them yourself is up to you. NK: I thought Jim's client worked by XML-ising it SBP: Jim: yes, that's the thing... we should give a choice; Nick: Jim's client works on XML-ized EARL, of course :-) JL: (the original client did that Sean, the current backend is a little more bright!) SBP: ooh, do you have a pointer? NK: So each of us treads our own little pathway :-) JL: Same url, it's only a little brighter, and there's no front end to it. JL: NK: Jim - did you see my last nights post to the list? Bookmarklet to add user feedback facility to Valet service? NK: Might be interesting fodder for your Client? JL: Yep, my main problem is the crippling of the HTTPRequest object in Mozilla or we could do very nice things in at least 2 browsers. WC: back to the canonical form... NK: I'm licensed to do things with Hotjava .. another thought .... WC: sbp: in you say "the canonical form of EARL will be in XML RDF, and XML RDF is also the only serialization recommended by the W3C. Therefore, throughout this draft, we shall use XML RDF." WC: therefore, sounds like XML RDF it is. however, chaals suggested creating a conversion algorithm between xml rdf and n3. CMN: if we are defining n3 as one of two canonical formats, we need a conversion. WC: chaals - there is an n3 to rdf conversion. aaron swartz wrote it. CMN: right. I suspect there are several. CMN: but we don't need to annoint one if we only have one format. CMN: people can use whatever they like, but they are responsible for checking that it does the round-trip properly JL: I don't believe so Chaals, I only know of Aaron Swartz's and I've yet to get it running under either PythonScript or cygwin python... WC: which brings up the point (again) of an EARL validator. SBP: Aaron Swartz's what? jim - aaron has a web interface - give it the uri of the rdf or n3 and it will convert it. NK: chaals - that's fine, but it would be nice not to have to write it myself ... CMN: if we trust aaron's toy we can use it. JL: His N3 - RDF conversion - yes I know he has a web interface, but that's hardly friendly or efficient if I have to throw any N3 my clients get through his interface. NK: URL? CMN: if we prefer someone else's we can swap to that. SBP: JL: SBP: *please* use the purl.org address... pretty please? :-) WC: true. CMN: If we nominate a conversion as accurate we are bound to make sure it works. I would rather leave that in Aaron's lap SBP: You could define something like a SOAP interface to it. DanBri is keen on it, Aaron hates it CMN: plus he is probably smarter than me anyway at making sure it works ;-) SBP: n3tordf just uses CWM. You can have that running locally JL: on win? I've not yet... SBP: CMN: Right. So if DanBri makes his own SOAP-based toy, anyone who likes SOAP can use that, and people who want it locally can install cwm, and people who want the web thing can use aaron's JL: (and preferably in ActivePython, not a standalone version, so I can interop with ECMAScript easier.) SBP: Jim: do you have Python installed? it should be a simple matter of getting the files and putting them in a directory. That's it SBP: chaals: yep JL: Always missing libraries with both versions of Python I have installed... SBP: ah... why not just scrape 2.1.1 off of the Web? WC: it sounds to me like we might be moving towards n3 as the canonical form if people are able to get the conversion tools working? it seems that nick and jim would prefer xml rdf since they already have tools that work with it. sbp is still pushing/favoring n3 b/c it better represents the rdf model. cmn doesn't care much as long as the conversion works correctly. NK: OK, conversion tools appear crucial SBP: well, I'm fairly neutral on the subject, because I don't have to implement it :-) chaals favours XML because 1) It is the formally defined W3C Recommendation syntax CMN: 2) it also defines the model OK (unless you are intersted in hand-coding RDF, which I am not) WC: the spec currently says, xml rdf. it doesn't sound like anyone has a problem with that. JL: XML unless there's some chance of N3 parsers available on clients, Mozilla, IE ship with XML parsers, neither have N3 parsers. CMN: (My preferred method of building stuff by hand is to use a graphical interface tool like RDFAuthor NK: RDFAuthor .. wozzat? WC: sbp - how about a section in the spec about n3 - a reference section that includes aaron's conversion tools, n3 examples, etc.? WC: schema already in n3... SBP: Even DanC says that N3 is not really a stable transmission format; just a poor-mans authoring tool... but what an authoring tool WC: appendix a CMN: It's an application for drawing node-arc diagrams and making them RDF - works on MacOS, and there is now a port for the folks who don't have Mac OS X SBP: the schema can be translated... SBP: I'm certainly not going to author the schema in XML RDF, though! What a mess WC: ok then - sounds like there is consensus to use xml rdf as canonical form. JL: Agreed. NK: yea sbp stays out of it... WC: also that there is interest in n3 and tools to convert between xml rdf and n3. chaals assumes that Sean can convert the schema to XML RDF with a tool. WC: do people think that there should be an appendix in the spec about xml rdf vs n3? SBP: chaals: yes, I can just drag and drop it onto the CWM icon on my desktop, and press "x" SBP: there should be an appendix in the XML RDF spec about XML RDF vs. N3 :-) JL: If Sean thinks it would be useful to people to think of it in N3, then of course. chaals makes schemas in XHTML and a conversion thing DanC wrote CMN: it is pretty basic, but so is my ability to make schemas ;-) WC: the point of the appendix is to give sbp a place to discuss the beauty of n3 and convince people to use it rather than xml rdf. :) SBP: the problem is that you can't actually use the XHTML at the namespace... that's a real pain in the rear end SBP: heh, heh, my little rant space :-) wendy searches summary of points sbp raised earlier NK: visions of sbp in the pulpit .. and there shall be n3 :-) WC: points sbp raised during earlier comments: complexity of earl, feedback and evolution (process of developing earl), usability of new spec WC: plus, other issues from published agenda: WC: - Schematron - Nick asks "is it useful to continue development on this?" SBP: heh, it was a good way to resolve the issue: use XML RDF, but give Sean a little space to say, "don't use XML RDF - it sucks! use N3!" WC: - Jim's EARL client, and the question that came up about combining results between EARL reports. WC: - date not being sufficient to identify a report uniquely, especially for content that is generated dynamically. WC: what do people want to discuss next? JL: I quite concerned about the DATE thing, and identifying what's been evaluated. WC: and for how long do we want to be here? we aren't limited by telecon schedule...but we usually only go for 1 hour, 1 1/2 max. NK: Time of day issues? Later is better for me CMN: I don't want to be on too much longer. although I can always catch up afterwards... SBP: why not just go until I'm the only one left talking? WC: lol WC: let's go for at least 1/2 hour more. let's discuss date. jim - thoughts? CMN: how will you know? It would be reasonable to assume we are avidly payng attention unless we say otherwise... SBP: [process aside: could someone please mail the logs to ERT when we're done; I've missed a lot of stuff] WC: yes - i'll clean them up and send (i.e. get rid of duplicates and msgs of people coming/going). SBP: cheers NK: Unique id: use standard techniques. Separate data from any such thing JL: Date is clearly not sufficient for webpages, as so many pages don't provide accurate last-modified, so you can't tell just from a date of evaluation if they've changed. SBP: use a hash SBP: you can use any daml:UnambiguousProeprty, in fact NK: Use a message-id type construct SBP: s/daml:UnambiguousProeprty/daml:UnambiguousProperty/ JL: Yep, then we have another problem, many pages which you do evaluations on change continously but in very minor ways, or only in content rather than structure. NK: Do we need a difference-metric? SBP: well, there's a property defined called "sameContentAs" (or something like that), which lets you make processor specific assertions that this bit of content is the same as in another document JL: People put things like "todays date" on a page, invalidating a report because of such a minor difference is annoying. JL: Do you know of any Difference Metrics for HTML Nick (I asked about this in ciwa? a couple of weeks back.) WC: assessing dynamic pages...eeks. CMN: being able to make earl assertions about parts of a page is important - it means that you can do that and then add up the parts to see if it equals the whole. NK: Visual Validator could deal with that, since it's working around the DOM WC: it almost requires the author making an assertion about pieces where the text content changes, but changes do not invalidate report. SBP: there is the tension between cramming as much detail into EARL as possible, and leaving it out to make it easy to implement. It's been a constant struggle WC: we have author assertions already, e.g. "image alt-text is good, i promise." now they need to be able to say, "text content will change but not become inaccessible, i promise." JL: Adverts are another problem with changing ( contains about 5% of urls which change just because of Ads.) WC: true. CMN: no they don't WC: also, portals want to claim (and i'm not sure we should allow) - the structure i've provided is accessible, but the content is provided by someone else and i can't vouch for it. bits x, y, z are those things." CMN: that bit is fine. CMN: portal.com says "this conforms to requirements for structure." CMN: frednerk.com says "I am the author of this ad, and tis ad conforms to content requirements" CMN: squish it together. SBP: lol @ frednerk.com JL: I'm more thinking of telling when you need to re-evaluate a resource - evaluation is likely an expensive activity requiring a human (at least for some reports) if we can't tell if when a report is no longer valid then we need humans to go and look. SBP: TimBL wrote a bit about this, and there are some schema terms: CMN: right. But then if we don't know whether something is good, that is what we actually need anyway. NK: isEquivalent(1.0, "this text", "that text") - no human required when changes NK: (things like date) JL: So could we define a hash within EARL to at least cope with the pages that are static? SBP: problem is that there are different types of equivalence; you can say that one bit of content is the same as another in terms of what it discusses, but that the latter is now written in clearer English NK: ohbugger SBP: well, you can use ?x log:content [ crypto:sha ?y ] . SBP: or I can have earl:sha do the same thing, but it's a bit fecky WC: i like the idea of identifying pages that are static, although concerned that if author's realize using this will cause them to be bugged less, they might use it more often. NK: No, not entirely a problem; different evaluations ahve different equivalences SBP: { ?x earl:sha ?y } log:implies { ?x log:content [ crypto:sha ?y ] } . NK: wendy - Site Valet already does that in effect SBP: If would could agree on a canonical hash format, that'd be good, because then you can merge reports WC: nick - cool. didn't realize that. it asks the author? NK: Use - widely supported, etc SBP: for example, someone asserts something about the page with MD5 hash pj08wjf0e8w, and someone else asserts something with the SHA hash pjsf09wesfg89us089g... you don't know if they're the same pages or not, and if you don't have the original, you never will SBP: no, no new schemes, just a canonical hexified hash JL: I use MD5 hash. SBP: er... hexlified, rather :-) SBP: I prefer MD5 too, but SHA is more secure JL: but I'm easy NK: then how to generate locally unique part doesn't matter SBP: we can set up a Web service that will get the SHA of a page NK: Is security really a big issue? WC: i'm not familiar w/these has algorithms, but a quick glance at makes me wonder SBP: import sys, sha, binascii; f = open(sys.argv[1], 'r'); m = f.read(); f.close(); print binascii.hexlify(sha.new(m).digest()) NK: Ahem - we already have a hash. It's called ETag WC: if the has value will change if just one character on the page has changed. it seems as if that is what it is saying. ETag? NK: Why not use ETag? NK: HTTP header CMN: Yep, seems like a smart has to me SBP: you'll have to use it in conjunction with the server address SBP: and hope that the server doesn't change WC: CMN: (It is the thing that Henrik andd Jose did to solve the Amaya lost update problem...) SBP: and remember that not all servers use ETags NK: lynx -dump -head NK: ... NK: chop JL: The servers? - it's something in control of the author of the page which means they can fool the earl client. NK: ETag: "201c8-fc9-3b9e8a41" SBP: IIS doesn't appear to add ETags to any dynamic (ASP) pages NK: So identify CMN: There are things where a hash isn't appropriate. CMN: and a URI is. SBP: [ earl:hashTag "201c8-fc9-3b9e8a41@" ] . NK: Now when we have multiple reports on that page JL: I also deliberately send identical ETags for pages which have changed... CMN: For example, saying that something which is generated by an ASP meets some requirement about structure, or has an address element in it might be valid for things where the content changes wildly JL: (as I'm happy for the old version to still be viewed.) JL: This is my point Chaals, I'd like some way to identify structural identicalness so a report can still be valid. NK: Structural identicalness? Make a hash of a DOM? CMN: no. CMN: say that whatever the has is,, the URI still meets the requirement. CMN: s/has/hash/ JL: I'm more thinking of external evaluation where you need to tell if the author has changed the page so the assertion is no longer valid, how do we externally know it's changed? CMN: Part of the whoole "how do we use this" thing is whether people are expected to say "that earl fragment doesn't confomr to :theTruthAsWeKnowIt" CMN: knowing it has chagned: you do need to provide enough information to identify the important bits - a kind of partial hash. JL: I think they should, certainly I envisage people reporting "this is wrong" if the client says something, which would schedule it for re-evaluation. CMN: or hashing over one or several XML fragments. NK: We can't know everything about the Now (back to date). We can reevaluate based on Etag or LastModified CMN: wrong: right, but the question is whther you say "that report is wrong" or whethert you produce a conflicting report and have rules about how to deal with merging reports when there is a conflist. CMN: a la CSS JL: I think we need to be able to combine reports which say different things (with potentially different reliabilities) but how to deal with conflicts depends on the use that the EARL is put to. NK: Jim - agreed SBP: yeah... SBP: but that is of course what we do already NK: are we in danger of debating angels on a pinhead here? CMN: rules for merging conflicts: we nned them. SBP: there's merging the reports just as a matter-of-fact "python cwm.py x.rdf y.rdf", and there's coming to conclusions about the result "python cwm.py z.rdf --think" CMN: It might be the easiest way to add more info - use the conlflict rules. SBP: well, I can come up with the rules files SBP: but it's difficult to assess conflicts CMN: if ?x says B and then ?x says A, believe A before B CMN: if A says ?X and B says ?Y believe A before B SBP: well, there's conflicts between people, and there's conflicts within one person (one person saying two different things) CMN: right. there are a few different types of situatuion. CMN: we need to codifyu enough of them to make this workable... chaals needs to go, - I have a call of my own on in a minute. SBP: using RDF makes it very feasable to create standard rules that anyone can use and apply... but the disadvantage is that there's only one decent tool that I know of that can grok them WC: it also means there are a finite number of rules. SBP: c'ya chaals SBP: finite: yeah WC: if several uknown people make assertions about a resource, you then make rules after the fact.. after you know who has made assertions. NK: unnnnh ... NK: several unknown people is crying out for human attention JL: I still think what you do is dependant on the use of EARL, for example if you're using it to inform a user, you can present both and leave it to the user to decide - whereas if you want to make a more automatic choice then the user needs to have set up who to trust, I can't see how in EARL we can define who we should trust to report something. WC: agreed. ok. we've gone almost 2 hours. i know i need a break. this has been good to raise the various issues. NK: EARL can weight "lots of peole say", or "someone says this is very important" WC: how about i summarize those, and then we can add more (if we've missed any) and use that as basis for resolving. CMN: presenting both: this is important - it must be possible to say "I want to see conflicts and decide for myself" SBP: yeah, a precis of the meeting would be cool NK: (the latter being the accessibility case - one person may be uniquely disabled) WC: nick - true. kind of like the discussion on WCAG right now: if 80% of the group agrees that this checkpoint is met, then the checkpoint must be understandable. CMN: I don't think we define canonical rules for everyone, just example rules for people to apply. SBP: good point CMN: In some cases people will swap between one set of rules and another depending on their application. CMN: (see Jim, I am starting to understand what you have been trying to tell me for a while) SBP: when I meant standard rules, I meant rules that can be applied fairly evenly, not that they should be applied by default chaals isslow, but often gets there eventually ;-) NK: metoo, chaals SBP: Homer: Something said, not good... WC: ok. i'm going to end the "meeting" now, but y'all want to keep talking - great! is everyone up for meeting again next week? we've got some interesting issue to discuss NK: Time of day anyone? SBP: nah, let's pack it in and move to QA already WC: lol SBP: :-) WC: actually, we should schedule a joint call or something with QA. i'll chase that up. JL: Hmm... I'll've been in the pub lunchtime, and won't be available evening...(it's me b'day) NK: IRC often active around midnight GMT +- at least get some communication going. CMN: happy birthday Jim. SBP: your birthday today? JL: next monday SBP: Happy Birthday, indeed! JL: Next monday, not today.. SBP: for then :-) NK: welcome to the ranks of the middle-aged :-) JL: Oy, 28 ain't middle-aged... chaals requests that we have a bit of debrief time for ER to explain where it is at to AU at some point. SBP: you can do that for us, chaals :-) WC: midnight GMT is 7 p.m. Eastern US., right? NK: guess so WC: (picking up on Nick's comment that irc is more active then) JL: JL: :-) NK: Me, xover, sbp, aaronsw often enough on SBP: yeah WC: yep, that's what i'm using, but i never feel sure about it. :) JL: I've never seen it it's just at the bottom of your emails.. WC: :) SBP: heh, heh chaals just guesses. WC: monday is out for jim. tuesday is out for me. what about next wednesday? GMT midnight? irc? or are you all around this wednesday? we could pick up on this discussion? SBP: should be NK: wendy, yes to whatever you say JL: Should be.. WC: nick: lol WC: ok then - this wednesday, GMT midnight, irc. we'll continue the discussion of EARL And what-not. I'll summarize today's main points to help with that. $Date: 2001/12/09 01:52:25 $ Wendy Chisholm
https://www.w3.org/WAI/ER/2001/12/03-minutes
CC-MAIN-2016-30
refinedweb
5,039
78.89
I am a beginner I have to write a code in straight "C" the code has to read from a file from c:\temp c:\temp\numbers.txt inside that txt file are the numbers 2 4 6 8 -3 20 30 40 60 80 100 200 It reads the txt in my code perfect It is supposed to multipy by 6 each number that is a positive and less than 100 and show the output I get a calculation and output of all numbers found I cannot get my if statement correct to check the criteria if (i > 0 || i < 100); I also tried if (i > 0, i < 100); also of criteria is not met: print an error message to console stating the problem Bad part is we have to use Miracle C to compile and build I am sure this is simple to all of you. But I am needing assistance with my if statement at least,....error message would be great also too Thank you in advance for at least reading this #include <stdio.h>; int IntegerArray[25]; int i; void main() { FILE*f; // informing to use a file f=fopen("c:\\temp\\numbers.txt","r"); //the file to open with the data while (fscanf(f,"%d",&i)!=EOF) //scanning the file and data to include numbers { if (i > 0 || i < 100); //<<<------supposed to ensure # is positive, less than 100 I ... // ........cant figure out if input fails criteria... //to print error message to console stating the problem with the bad numbers printf(" %d\n",i*6); //if i = criteria times them by 6 and show output to console } fclose(f); getch(); }
https://www.daniweb.com/programming/software-development/threads/198413/greater-than-less-than-in-c
CC-MAIN-2017-30
refinedweb
274
68.44
best practices for cashiering softwarePage 1 of 1 13 Replies - 1020 Views - Last Post: 01 February 2013 - 11:54 AM #1 best practices for cashiering software Posted 27 January 2013 - 05:04 PM So... I guess my question is what would be "best practices" for building the cash register software. Do I want to build an entirely separate project that accesses the same database, since they will be running on separate machines. Or should I build it in the same Solution as a different project. Any input or suggestions would be greatly, greatly appreciated. Thanks All! Replies To: best practices for cashiering software #2 Re: best practices for cashiering software Posted 27 January 2013 - 06:38 PM Anyway, you should try to learn from the experiences of others. As I recall, the major leak of credit card information from the TJ Maxx/Marshalls was by taking advantage of weaknesses in the POS software. #3 Re: best practices for cashiering software Posted 27 January 2013 - 06:45 PM #4 Re: best practices for cashiering software Posted 27 January 2013 - 07:12 PM - A clerk can ring sales but not returns. - A Customer Service rep can do both. - A manager can also - put an item on 24 hour hold, - make new clerk IDs, - correct inventory levels I have a large concern about how you are approaching this project based on this statement: Quote How? How could you have completed all the config and maintenance forms if you haven't architected how the program(s) are going to work? To me this screams of someone that does the easy part of drag-n-dropping a bunch of controls from the toolbox to a form FIRST because its easy and gives them confidence. Then starts thinking about how all of this is really going to function under the hood. Have you worked out how all of this is going to work? Do you have plans for all your objects and their interaction? Have you designed your Product class, Transaction class, SKU class, Vendor class and so on? Do you know how these are going to interact with each other? If you did the GUI first and are now trying to work out the guts of the project: STOP - You've already boned yourself and need to read this article. This post has been edited by tlhIn`toq: 27 January 2013 - 07:14 PM #5 Re: best practices for cashiering software Posted 28 January 2013 - 06:23 PM I have yet to create the tables and interfaces for the Transactions, and TimeCard portions as that is where my question comes into play with the "Cashier" code. Although I do have a road map as to how those pieces will function. The reports piece will also be accessed from the "Office/Management" portion of the software, but cannot really be built until the transactions section is complete. I am pretty experienced with programming, but have yet to build a program that will run in part on multiple machines. So, I guess my primary question would be: Should I code the Cashier portion of the POS as another Project within the same solution or should I make this a new solution that simply uses the same DB? When all is said and done, I would like to create an installer. I've looked into it further and it seems that the best option may be to use the same solution. From what I've read, I could have an option in the installer as to which program to install. Any further advice would be greatly appreciated. Thanks! #6 Re: best practices for cashiering software Posted 28 January 2013 - 07:09 PM Quote This seems like unnecessary hair splitting. Either option leaves you with two different executables.. If you never foresee the client machine needing to access a report or the 'office part' needing to enter an order then make two.. if you don't then make one with two separate group roles that users will be assigned to. #7 Re: best practices for cashiering software Posted 28 January 2013 - 07:27 PM ringorocks08, on 28 January 2013 - 07:23 PM, said: Do you have classes that are best shared? Namespaces best shared? I find it fairly easy/helpful to have a solution with multiple projects that share namespaces & classes that go together. If one is going to be a client and one a server then they both have to use the same definition of a... ReceiptLineItem class. So that would be in a common namespace that both projects use. Namespace RingoRocks Class transaction Class product Class Person ____________________| |_________________ | | Namespace RingoSalesStation Namespace RingoManagement Easily references RingoRocks.product Also references RingoRocks.product This post has been edited by tlhIn`toq: 28 January 2013 - 07:28 PM #8 Re: best practices for cashiering software Posted 28 January 2013 - 07:27 PM #9 Re: best practices for cashiering software Posted 29 January 2013 - 02:25 PM You don't have a program running across two machines. You have a database that multiple pieces of software can access. First put a facade on that data. So the data is consistent on all machines, and if the way that data is stored every changes, you only change the internals of the facade, and as long as the interface to it is the same all your software will continue to work. This is easily done by just having a simple code library project that other programs can reference. So say if it was .Net, it'd create a dll that is referenced by every point of entry. It could also be done as a service api that is directly accessed across the network. I used WCF to do this before, it's pretty nice, and allows updating the service side very easily with the user side never needing recompiling or anything. This was also nice because we wrapped around both SQL and PICK databases. This meant that I could configure a server to be either or, and the client never noticed the difference either way. (note SQL is relational db, where as PICK is a multi-dimensional db) tlhIn'toq brought up a good point about the users. In a piece of POS software I wrote I created a user group permissions system. Then any protectable operation could have groups associated with them that are allowed. And there is always a single super user that can modify this security from the backend (in case some dingle putz blows out user group that they designate to access said security config). I felt this allowed the users of the software to create their own security tiers beyond just 'clerk/manager'. For instance maybe an assistant manager group that's allowed to perform refunds... but not any other managerial task. You'd just create a group and flag them as being allowed to do any refund stuff, then place clerks into that group. As for should you have multiple projects for the backend and frontend? Yeah, I'd say so. This create a physical level of security. Now say I'm an employee who finds out that the manager is an idiot and uses their dogs birthday as their password. I go to MY register and easily just login as my manager and start fiddeling away with all the backend stuff. Now of course afterwards they will find out whose register did the login... that's IF they find out I made changes, and also if I use my own register and not Sally's 2 registers down. Where as if the backend software only exists on the manager's computer in the back (or another computer they designate), I have to not just get their password, but also get myself into said manager's office and computer... that's probably watched by cameras. This post has been edited by lordofduct: 29 January 2013 - 02:29 PM #10 Re: best practices for cashiering software Posted 31 January 2013 - 08:12 PM I went back and forth with making the management GUI available on the same machines as the registers. But, after hearing lordofduct's scenario, I think I will definitely keep them as separate applications. I also think adding a more customizable User Role/permissions system would be beneficial (enumerations here I come!) So, if I were to have the database located on the "Office" computer, and I were to map a drive on the remote computers ("Registers") to point to the database's path, how would I get that path each time the application were opened. My initial thought would be to prompt for the path the first time the application loads and store the path in a file. The application could then look for the path in the file and then look in the path for the database. If it finds the database, the program is happy and moves on, if not, it prompts the user again and asks for the path. Does that sound like a typical solution for such a scenario? #11 Re: best practices for cashiering software Posted 01 February 2013 - 06:15 AM Q: ... save data, save properties, save environmental variables, serialize my data/class? A: - Separating data from GUI - PLUS - serializing the data to XML - Working with environmental variables - Writing a text file tutorial. - Reading a text file tutorial. - Easy Application Settings example #12 Re: best practices for cashiering software Posted 01 February 2013 - 08:36 AM ringorocks08, on 31 January 2013 - 10:12 PM, said: Enums is not the way to go for the user groups. That would mean you would have to churn the code each time a new group is created. Enums for the privileges of a group on the other hand would be appropriate. ringorocks08, on 31 January 2013 - 10:12 PM, said: Danger! Danger, Will Robinson! Danger! Mapping paths to the database is bad. That means you'll need read-write access to that path if you expect the remote computers to update the database. That then means that anybody can just open a command prompt and type in "del *.*" on that path, and no more database. The correct thing to do is for the connection to the database be via your database's established communications port(s), or by creating a web service (with appropriate authentication and authorization). If can have the host and port in a config file that you as the installer hand tweak, or have your remote computers configure the first time by interviewing the administrator installing the software. #13 Re: best practices for cashiering software Posted 01 February 2013 - 09:42 AM Skydiver, on 01 February 2013 - 09:36 AM, said: Personally I don't like user groups all that much. There always seems to be one guy that is supposed to be a supervisor but needs one extra privilege of ... OpenTill or DoEndOfShift. I prefer a Privileges object with plenty of permissions. You can always code a generic template of permissions for a Supervisor or a Manager, but you should allow someone to gain extra needs if their duties require it. #14 Re: best practices for cashiering software Posted 01 February 2013 - 11:54 AM They both have their pros and cons. I like the configuration ease of groups when adding new users, and updating pools of users. "A new operation was added today, who can use it? All members of the cashier group, that's who." I also like the ease of testing it. "What groups can perform this action? Is the current user a member of any of those groups? Done." Privileges aren't that complicated either. I guess its a difference between preferring granularity vs abstraction. I always go for abstraction before granularity...
http://www.dreamincode.net/forums/topic/309743-best-practices-for-cashiering-software/page__pid__1791708__st__0
CC-MAIN-2013-20
refinedweb
1,958
69.92
This page was last modified 07:17, 28 March 2008. Use prototype javascript library : Object Creation topic, we will see how to define a class and its subclass using prototype.js library. Install prototype.js Please go to here for how to install prototype javascript library. Object Creation Classes and subclasses can be defined in new syntax or old syntax, we will define both for a comparison. We will also learn how to add an instance method and class method. Define classes in new syntax To define a class, for example, Animal class, we can call Class.create method and pass properties into this method as follows: // properties are directly passed to `create` method var Animal = Class.create({ initialize: function(name) { this.name = name; }, eat: function(food) { return this.name + ' is eating ' + food; } }); To derive a sub-class from the Animal class -- Cat class, we call the Class.create function again and use Animal class as the first parameter and a method collection for the new class as the second parameter. Note: Class.create can take in an arbitrary number of arguments. // when subclassing, specify the class you want to inherit from var Cat = Class.create(Animal, { // redefine the eat method eat: function($super, food) { return $super(food) + ' or sth.!'; } }); In Cat class, the eat method overrides the same one in parent class. The source code for the "new syntax" test case: function testNewSyntax() { var cat1 = new Cat('Mimi'); alert(cat1.eat('fish')); // ->; "Mini is eating fish or sth!" } Define classes in old syntax Define a class -- Aninal0 class. (We must use a different class name in a global namespace) /** obsolete syntax **/ var Animal0 = Class.create(); Animal0.prototype = { initialize: function(name) { this.name = name; }, eat: function(food) { return this.name + ' is eating ' + food; } }; Define a subclass -- Cat0 class. (Again, we use a different name.) var Cat0 = Class.create(); // inherit from Person class: Cat0.prototype = Object.extend(new Animal0(), { // redefine the eat method eat: function(food) { return this.name + ' is eating ' + food + ' or sth.!'; } }); The source code for the "Old syntax" test case: function testOldSyntax() { var cat1 = new Cat0('Mimi'); alert(cat1.eat('fish')); // -> "Mini is eating fish and sth.!" } Add new methods for an existing class temporarily Add a new method for Animal class, so an instance of a derived class can also call that method. function testAddMethods() { var cat1 = new Cat('Mimi'); // every animal should be able to drink. But here we just let it "eat water" Animal.addMethods({ drink: function() { return this.eat('water'); } }); alert(cat1.drink()); // -> "Mimi is eating water or sth.!" } Use a mixin module when defining a new class First, define a mixin module -- Tunnable. // define a module var Tunable = { down: function(hp) { this.volume -= hp; if (this.volume < 0) this.mute(); }, mute: function() { this.isMute = true; } }; Second, create a class based on the mixin. var Tuner = Class.create(Tunable, { initialize: function() { this.volume = 100; this.isMute = false; } }); And then test it. Here is the source code for this test case. function testMixin() { var tuner = new Tuner; tuner.down(30); alert(tuner.volume); //-> 70 } Add class methods Here we define a class method named "allEatSth" for Cat class. So, you can call the Cat.allEatSth() function directly. function testClassMethods() { Cat.allEatSth = function(n) { var items = []; n.times(function(i) { items.push(new Cat('Teddy').eat( i + 1)); }); return items; } alert(Cat.allEatSth(3)); // -> ["Teddy is eating 1 or sth.!", "Teddy is eating 2 or sth.!", "Teddy is eating 3 or sth.!"] } In addition, there are other ways to define new methods. Please navigate to the references below for more informations. Download Sample Application Download sample wiget of this topic: Image:PrototypeObject
http://wiki.forum.nokia.com/index.php/Use_prototype_javascript_library_:_Object_Creation_in_WRT_application
crawl-001
refinedweb
606
62.04
Ticket #1380 (closed defect: fixed) [PATCH] TG database.py oddity preventing multiple SA databases from being used Description as of TG 1.0.2.2, database.py contains this bit of code (lines 48-54): def create_session(): "Creates a session with the appropriate engine" return sqlalchemy.create_session(bind_to=get_engine()) metadata = activemapper.metadata session = activemapper.Objectstore(create_session) activemapper.objectstore = session Typically, only the metadata needs to be bound to an engine. Remember, metadata keeps track of tables and calls to the database, and session keeps track of class instances and which ones are dirty. When session needs to flush some objects (like when session.flush() is called), it normally just defers to the engine associated with metadata. Since turbogears.database.metadata is already connected to an engine, the custom version of create_session in turbogears.database is unnecessary. Not only that, but it is preventing us from using DynamicMetaData's connect method, which would allow us to support multple engines. If we just used sqlalchemy's create_session instead of our custom version, we'd be able to call turbogears.metadata.connect("sqlite:///another.sqlite") anytime we wanted. That would let people write decorators that switched out the database on a per-connection basis, for instance to support multiple sites with the same app and let each site have its own database. Attached is a patch of database.py from TG 1.0.2.2 that removes the unnecessary custom version of create_session, and uses SQLAlchemy's create_session instead. Attachments Change History Changed 10 years ago by ian - attachment multiple_databases.diff added comment:1 Changed 10 years ago by alberto - Status changed from new to closed - Resolution set to fixed Changed 10 years ago by ian - attachment multiple_databases2.diff added Fix for ActiveMapper? bug pointed out by Paul Johnston comment:2 Changed 10 years ago by ian - Status changed from closed to reopened - Resolution fixed deleted On the turbogears-trunk list, Paul Johnston pointed out that my patch broke apps using ActiveMapper. The reason for this is that the SQLAlchemy code in database.py was written for ActiveMapper, which means it uses ActiveMapper's version of metadata, which was not connected to a database. Because ActiveMapper was a proof-of-concept project that is now discontinued in favor of Elixir, I believe we should eventually move away from code that is ActiveMapper-specific. This is difficult to do however, without breaking apps that use ActiveMapper. In the meantime, a fine solution is just to call bind_meta_data as soon as metadata is defined. I have uploaded another patch (this time from rev 3003) which does just this. I will ask Paul to test this before we apply this patch. I cannot test it, because controllers.py seems to be messed up right now (someone put in tabs instead of spaces!) and I can't run the version of TG in svn. Changed 10 years ago by iancharnas - attachment multiple_databases3.diff added Changed 10 years ago by iancharnas - attachment multiple_databases4.diff added comment:3 Changed 10 years ago by iancharnas I was finally able to reproduce the problems that Dennis and Paul Johnston were reporting on the turbogears-trunk google group, and this latest patch (multiple_databases4.diff) fixes them. At some point in the future, we should consider removing the ActiveMapper code from database.py. There are many SQLAlchemy extensions, why support just one in particular? Also, and perhaps more to the point, ActiveMapper is now discontinued in favor of Elixir. So what can people do who want to use these extensions? Easy! They just have to take care of setting up the extension themselves. For ActiveMapper and Elixir this just involves some particular glue for session and metadata. We should probably wait for a major revision change for this however, because some breakage is sure to happen until people who are still using ActiveMapper find and fix their code. Then again, my only motive for moving the ActiveMapper "glue" code out of database.py is to have cleaner code in TG. Maybe this is too much of a "purist's" motive? Comments requested. -ian charnas comment:5 Changed 10 years ago by iancharnas Ok, this latest patch (multiple_databases4.diff) is working for Paul, and it fixes the problem I was able to reproduce on my machines, let's commit this! -Ian Charnas comment:6 Changed 10 years ago by faide - Status changed from reopened to new - Owner changed from anonymous to faide Patches database.py to support multiple databases
http://trac.turbogears.org/ticket/1380
CC-MAIN-2017-17
refinedweb
745
57.47
100011322432435545 May 18, 2021 The factorization is 100011322432435545 = 3 * 3 * 5 * 911 * 1051 * 48179 * 48179, and the program fails because of the squared factor; Pollard Rho finds both factors at the same time, then enters an infinite loop because the remaining cofactor is 1. This is a known problem with Pollard Rho, and with many other factoring algorithms also. As I advised my correspondent, that is the nature and the fascination of factoring. One solution is to check for squares before applying Pollard Rho, but that can still fail, because Pollard Rho is a probabilistic algorithm, so clearly I need to rewrite my standard “simple” factoring program, which handles numbers up to 25 or 30 decimal digits without trauma, and sometimes much larger numbers: def factors(n): from fractions import gcd # 2,3,5-wheel to cube root of n wheel = [1,2,2,4,2,4,2,4,6,2,6] w, f, fs = 0, 2, [] while f*f*f <= n: while n % f == 0: fs.append(f); n /= f if n == 1: return fs if isPrime(n): fs.append(n) return fs f, w = f+wheel[w], w+1 if w == 11: w = 3 # n must be semi-prime, so use # william hart's fermat variant if isSquare(n): f = isqrt(n); fs.append(f); fs.append(f) return fs for i in xrange(1,n): s = isqrt(n*i) if s*s <= n*i: s += 1 m = pow(s,2,n) if isSquare(m): t = isqrt(m); f = gcd(n, s-t) fs.append(f); fs.append(n/f) return sorted(fs) This uses a 2,3,5-wheel to find factors less than the cube root of n, followed by William Hart’s one-line factoring algorithm; we’ve discussed both in previous exercises. Now my correspondent’s factorization succeeds: >>> factors(100011322432435545) [3, 3, 5, 911, 1051, 48179, 48179] >>> factors(13290059) [3119, 4261] Let’s consider the factorization of 13290059. The cube root of 13290059 is 237, so the prime wheel tries divisors up to 233, finding no factors. The number is not a square, so the one-line factoring algorithm begins. When i reaches 165, ni is 2192859735, s is 46828, m = 1849 = 43² is a perfect square, and gcd(13290059, 46828 – 43) is 3119, which is a factor of 13290059; the cofactor is 4261. You can run the program at.
https://programmingpraxis.com/2021/05/18/100011322432435545/2/
CC-MAIN-2022-27
refinedweb
396
62.41
Nov 06, 2007 04:34 PM|bkinnaird|LINK I am working with Visual Studio Pro SP1 and had some problems converting an old VB.Net web site into a VB.Net Web Application Project. I followed the advice offered here ( ), but ran into a few kinks when using the process on a VB project. The Problem: After creating a new Web Application Project, copying in the old files, and running the "Convert to Web Application Project" process, the site would no longer build. Any classes stored in the "Old_App_Code" folder (previously named "App_Code" before conversion) could not be seen. The original website was written using the root namespace, and when I converted it, VS changed the default namespace to the name of the project. My Solution: First, I changed the default namespace back to the root namespace (set Default Namespace to "" in project properties). Next, and this is the part that confuses me, is that I copied the code from each file in the "Old_App_Code" folder, and pasted it into another newly created *.vb file in the same folder. After I had done this for each file, I deleted the old *.vb files and renamed the new ones with the old names. Viola! Everything builds and works just fine. I converted this project in order to prepare it for integration with MSBuild and Team Foundation server (MSBuild applications need a project file, hence the need to convert), and since most of our existing apps are VB.Net 1.1 or 2.0 Web Sites. (not Web Applications), I'm sure that I will run into this again. Does anybody have an explanation of why the code-copying is necessary, so I can better explain the process to developers as they come on-board for our Visual Studio Team Suite rollout? Thanks, Byron vb.net tfs msbuild namespace "web application" conversion Member 2 Points Nov 15, 2007 10:25 PM|Larry Johnson|LINK I ran the conversion tool also as described on the scottgu site you referenced. It's good, but does miss a few things, some of which I still have not resolved. The conversion tool copies the files in "AppCode" to "OldAppCode" and marks their "build action" as "content" I believe. So by creating a new cs or vb file, you basically set the build action to "compile" as it is by default for new code files. I had started setting namespaces on our files. After seeing your comments, I might start all over again and use your advice for namespaces. All-Star 16870 Points Dec 20, 2007 07:12 PM|atconway|LINK Take a look at Microsoft's documentation on doing this conversion; mabye there is something that can help: Dec 20, 2007 07:27 PM|bkinnaird|LINK Changing the build action to "compile" worked... no need to copy the code into new files. When I was selecting New Item->Class for the new "copy to" file, the default build action is set to "compile" by default for the new classfile. Somehow the conversion process was changing the build action for the converted files (old files) to the "content" setting, which was causing zillions of errors. Thanks for the help. Jun 06, 2008 07:58 PM|kandi8|LINK Hi, I am trying to convert an old ASP.Net 1.1 app to 2.0. These are the steps I followed: 1) Open the 1.1 sln file with VS 2005 - it went through a conversion wizard process and converted the project succesfully. 2) Right click on root folder and select Convert to Web Application - It converted all the files to Partial Class model and created designer files as well. 3) Now I build the web site and it works fine - all the pages come up correctly. The fun starts now..... 1) I add a control to the aspx page and it does not get added to the designer page automatically. 2) I see lots of code highlighted in code behind page with error messages: (example: Control1 is not a member of webform1) there are hundreds of examples like that...though I can see control1 included in the designer class as well) and the page also works and compiles fine. As soon as I make some deliberate compolation error in my code behind file, VS now shows up all these messages as errors in the Error List. I am confused as to what I am missing. Any pointers? All-Star 16870 Points Jun 06, 2008 09:30 PM|atconway|LINK Hello, I reccomend starting a brand new post on your issue in the ASP.NET forum so it gets a little more exposure, than this older post. People may not read to the last post here to understand your problem. Thanks, 6 replies Last post Jun 06, 2008 09:30 PM by atconway
http://forums.asp.net/t/1178898.aspx?+Convert+VB+Net+Web+Site+to+Web+Application+Project
CC-MAIN-2014-49
refinedweb
804
71.55
Hi, The question for the last challenge was this: Create a function called max_num() that has three parameters named num1 , num2 , and num3 . The function should return the largest of these three numbers. If any of two numbers tie as the largest, you should return "It's a tie!" . So when I went to answer it I made this: def max_num(num1,num2,num3): num1 = a num2 = b num3 = c if a > b and a > c: return a elif b > a and b > c: return b elif c > a and c > b: return c else: return "It's a tie!" Which was fine when run alone, but after being run along with this: print(max_num(-10, 0, 10)) received the error message: Traceback (most recent call last): File “script.py”, line 15, in print(max_num(-10, 0, 10)) File “script.py”, line 3, in max_num num1 = a NameError: name ‘a’ is not defined After receiving the error, I fiddled around with the code for a and ended up with a successful solution in this: def max_num(num1,num2,num3): a = num1 b = num2 c = num3 if a > b and a > c: return a elif b > a and b > c: return b elif c > a and c > b: return c else: return "It's a tie!" So my question is, how come the second piece of code was successful but the first failed?
https://discuss.codecademy.com/t/advanced-python-code-challenges-control-flow-challenge-5/491136
CC-MAIN-2020-40
refinedweb
232
77.81
# Running image viewer from Windows XP on modern Windows I have a directory with old images which I collected in the noughties. I move it with all my other files from one computer to another on every upgrade. Every now and then, when I feel a bit nostalgic, I open it and look through the pictures. There are a few GIF files with animation, and every time I notice that the default image viewer from Windows 7 does not support it. I remembered, that the image viewer from Windows XP was able to play GIF animation properly. So, I spent a bit of time to overcome a few obstacles and to run the old image viewer on modern Windows, a small launcher was created for this purpose. Now I can watch these old images in authentic interface of the old image viewer from Windows XP. ![](https://habrastorage.org/r/w1560/getpro/habr/post_images/bd2/3e1/be7/bd23e1be793ad99e00a4d9c5c8f601da.png) **Download:** [shimgvw\_xp32.7z](http://veg.by/files/winsoft/shimgvw_xp32.7z) (includes a binary and source code of the launcher, and the shimgvw.dll from English Windows XP SP3). How has it been done? --------------------- Default image viewer from Windows XP is not just an application. It is executed by the Windows Explorer from the shlimgvw.dll dynamic library. It is not possible to execute it directly, you need a mediator like [rundll32](https://support.microsoft.com/en-us/help/164787/info-windows-rundll-and-rundll32-interface) for this purpose (path to an existing image file is required): ``` rundll32 c:\windows\system32\shimgvw.dll,ImageView_Fullscreen c:\test.gif ``` But this trick doesn't work when you try to run shimgvw.dll from Windows XP on Windows 7, the shimgvw.dll requires Windows XP compatibility mode enabled. It is possible to do it by setting this compatibility mode for a copy of rundll32, but it is an ugly hack, and it will cause displaying of UAC dialog on every run of the viewer, so it is not appropriate. After a short debugging session, I found the culprit. The shimgvw.dll implicitly imports some deprecated shell functions from the shunimpl.dll, and the latter library refuses to load if there is no ATOM “FailObsoleteShellAPIs” (otherwise it loads properly, but the obsolete functions return error codes). Windows XP compatibility mode adds this ATOM (in addition to a lot of other things), that's why the image viewer is able to run in this mode. A lightweight loader for the shimgvw.dll was implemented. It adds ATOM “FailObsoleteShellAPIs”, asks which image should be opened (if it wasn't passed as an argument), and then passes the execution to the shimgvw.dll. The viewer works properly, so I have not investigated what those obsolete shell functions are used for. At least, it is not something crucial.
https://habr.com/ru/post/437436/
null
null
468
56.96
Answered by: DLL and LIB? I'm curious as to how I can have my project compile and produce both a DLL and a LIB file. I have seen it done before (such as SDL does so) and I have been unsuccessful in doing it myself (I have been only successful in building a DLL or a LIB, not both). Any help is appreciated; thanks!Thursday, February 01, 2007 1:07 AM Question Answers - All replies - I assume you mean a static link library, not a DLL import library. I can start a LIB project with the Win32 + Win32 Project template. Next, select "Static library". Not sure if that's available in the Express edition. Not recommended btw, static libraries are a maintenance headache due to their CRT version dependency.Thursday, February 01, 2007 9:28 AMModerator - How would I link my DLL into a new project, then? I don't really want to have to do the whole __dllimport stuff. I mainly just want to link it in and have it work for me (similar to .libs). I have seen a .lib and .dll both be generated by the same project, though - would this be the best way or is there a way to easily link a DLL into my project that wouldn't cause a headache ?Thursday, February 01, 2007 1:14 PM - When the linker builds the DLL, it automatically creates a .lib file for it. That's the import library for the DLL. You can link that .lib with other projects that use the DLL and satisfy the linker without using dllimport. Note that the platform SDK has a bunch of .lib files that work the same way (kernel32.lib, user32.lib etc).Thursday, February 01, 2007 1:46 PMModerator - That's actually the main portion of my problem - I have set my project as being a DLL, but when I do build it, I only have a DLL output with no LIB in sight. I think that part of the problem might be that I am using Visual C++ Express, which does not have a DLL project type to choose from initially (I had to choose 'Application' and modify that to a DLL project).Thursday, February 01, 2007 2:25 PM - Are you exporting any functions? For example: __declspec(dllexport) void Test() { }Thursday, February 01, 2007 2:54 PMModerator - No, I'm not. As mentioned above, I don't really want to have to add the DLLExport to every single function I have. If I compile my library in G++, it creates the .so fine without me having to add any exporting additions at all. Also, I have looked at the SDL library's project and it seems they easily are able to create a .lib and .dll without having to add DLLexport to every function that they have, so I presume it is possible for me to do the same.Thursday, February 01, 2007 3:20 PM - If you don't export anything, either through __declspec(dllexport) or through a .def file, your DLL won't have any entrypoints for functions that can be called by a client. Note that you can dllexport a class, all its methods will become available. I can't comment on g++, it seems highly unlikely it would export every single non-static function. There's probably some kind of .def style file too.Thursday, February 01, 2007 4:25 PMModerator - Ah I see. Is there any resources you would recommend for me to read up on how to create and use these .def files? I checked real quick and found one or two, but they simply provided an example with minimal explanation(s). It also helps me quite a lot that you mentioned that an entire classes can be exported, instead of single functions, since my library is heavily object-oriented (the classes reside in their own namespace, as well; would be awesome if I could export the entire namespace).Thursday, February 01, 2007 4:51 PM - - Thanks I guess I will go ahead and modify my source to have the __declspec(dllexport) commands and (finally) have my working library.Thursday, February 01, 2007 5:35 PM
https://social.msdn.microsoft.com/Forums/en-US/f43623c2-a5fb-49c9-85c6-33bb35fa5d66/dll-and-lib?forum=Vsexpressvc
CC-MAIN-2015-18
refinedweb
699
72.46
With the extreme prevalence of mobile apps, web apps, and desktop apps, REST services are more important than ever to provide data to it's users. This data could be used for the native app, or for 3rd party developers to expand your service's reach in to other apps. Either way, the REST service needs to be easy to use and easily modified in order to keep up with the ever-changing demand of the end users. Java provides many options for creating REST services, including JAX-RS, Apache Camel, and Spring MVC. All are good frameworks and would be sufficient for just about any project, but I personally prefer to use Apache Camel. It is so flexible and easy to use that it's impossible to pass up. The example code given here is intended to be used to authenticate a user via a REST route (keep in mind that there may be security concerns that aren't addressed in this route). Using Jetty, we expose a route on the 'api/v1.0/auth' path, which passes a HttpServletRequest instance to our authenticationProcessor bean. From here, we can extract all of the required information to determine if the credentials are valid. If they are valid, then we set the authenticated header to true in the message, and then pass back a unique token for the client to use. Otherwise we return JSON to notify the client that the authentication has failed. import java.util.UUID; ... private static final String AUTH_FAILED = "{" + "\"success\": false," + "\"message\": \"Authentication failed.\"" + "\"token\": null" + "}"; private static final String AUTH_SUCCEEDED = "{" + "\"success\": true," + "\"message\": \"Authentication succeeded.\"" + "\"token\": \"%s\"" + "}"; ... @Override public void configure() { from("jetty:") .process(authenticationProcessor) .choice() .when(header("authenticated").isEqualTo(true)) .setBody().constant(String.format(AUTH_SUCCEEDED, UUID.randomUUID().toString())) .otherwise() .setBody().constant(AUTH_FAILED) .end(); } This simple example is meant to show how easily we can use Camel for REST services. Sure, other frameworks might take even less code to get authentication to work, but the power of Camel is realized when we start utilizing other Camel components in our route. Maybe, for example, we later decide that we'd prefer that our clients authenticate using Google's OAuth service. In this case, we'd simply replace .process(authenticationProcessor) with the Camel gauth component: .to("gauth:authorize?callback=" + encodedCallback + "&scope=" + encodedScope);, where encodedCallback and encodedScope are callback URLs to fully handle Google's authentication service. See Camel's gauth page for a full example. Given that Camel plays nice with over 100 different information sources, and ServiceMix, it should be obvious that with just a few lines of code we'll be able to add some pretty useful functionality to our REST service.
http://stackabuse.com/example-rest-service-with-apache-camel/
CC-MAIN-2017-47
refinedweb
446
53.31
Hi all ,Finally we have reached the client side of Microsoft Ajax, known by the name "Microsoft Ajax Library". But as usual in this series of posts, a reminder of what has been written and said so far: Microsoft Ajax, from the bottom up Microsoft Ajax, from the bottom up - part 2. Microsoft Ajax, from the bottom up - part 3 Microsoft Ajax, from the bottom up - part 4 Microsoft Ajax, from the bottom up - part 5 Microsoft Ajax, from the bottom up - part 6 If we take a look on the Client side architecture in this figure We can see it has many "things" in it , including the following: 1. It is a JavaScript framework, meaning it contains some js files that can be used independently from ajax , or being used internally by the Microsoft asp.net Ajax, like when using an UpdatePanel. 2. It has a JavaScript base type extensions. What Microsoft did is very simple, They used the native types prototypes and added more functionality to them. i will explain about it later, but for now, take a look at these 2 lines of code for instance: var str1 = " This is some string with white spaces ";alert(str1.trim()); Where did the trim functions came from?JavaScript does not have any trim function in its native string type!!! is this C# like Trim function? The answer is very simple, all that has been done is extending the native string type using its prototype attribute. I will discuss it shortly in this post. 3. It has a JavaScript new types known as Script BCL, organized in a C#/Java like namespaces. Look at these couple of lines of code: var oStringBuilder = new Sys.StringBuilder(); oStringBuilder.append("<Books>"); oStringBuilder.append("<Book name='C# in action'>"); oStringBuilder.append("<Book name='Linq in action'>"); oStringBuilder.append("<Book name='ASP.NET 3.5 in action'>"); oStringBuilder.append("</Books>"); alert(oStringBuilder.toString()); What ta BIP BIP BIP is going on here???? StringBuilder is a C# class , isn't it? Well as it turns out JavaScript combined with "Microsoft Ajax Library" now has new types anyone can used and build a nicer and better code. 4. It has a JavaScript classes being used as the core classes for the internal operations for the Ajax engine in the client side.This part includes among many other JavaScript classes the Sys.Net.WebRequest ClassType ClassSys.WebForms.BeginRequestEventArgs Class and much much more. 4. It has Web services proxies for making the ajax calls to web services (of WCF services). 5. It has a JavaScript serializing the http request results. 6. It has a History solution for partial page updates that can be used in the server side or even in the client side. I will show some very cool sample later. 7. It has a built in objects that can be very helpful for debugging and tracing JavaScript. By the way , a good reference to the asp.net ajax extensions can be found here: So lets begin and Show some of the new types JavaScript has to offer, In the next post i will show how they extended the existing JavaScript native types. JavaScript "new" objects: first of all, in order to use these "new" objects that come out of the box for you, you need to add a ScriptManager to the page. Now lets see a sample of a very useful object that i mentioned earlier, The StringBuilder objects. The Sys.StringBuilder provides a way to concat strings. It has just like C# StringBuilder an append method, an appendLine method and a toString method that returns the concat string so far.Here is a sample code just i like i wrote a couple of lines ago: Lets explain some of the things here, first of all the namespace,how can there be a namespace in JavaScript.Lets say you wish to implement a namespace in JavaScript, all you need to do , is to create an empty objects using the constructor function ,something like: function MyNamespace() { }; MyNamespace.ClassA = function(x, y) { this.x = x; this.y = y; this.toString = function() {alert(this.x + " " + this.y); } } var oClassA = new MyNamespace.ClassA(5,10); oClassA.toString(); Here i created an empty object using constructor functions (If you are not familiar with the term i suggest you read about it)and added to this object "sub object" by the name "Class1". Since every Object in JavaScript is basically a dictionary Adding properties is very simple. If you wish to so this yourself ,"ASP.NET AJAX Extensions" has a built in mechanism thatdoes exactly that using Type class:Type.registerNamespace("Samples"); Type.registerNamespace("Samples"); It adds this namespace to the global window object in your host environment (The browser) So starting from today, any concatenation operations can be done using the new StringBuilder class; In the next post i will show how to use the native types extensions and how they were implemented.
http://blogs.microsoft.co.il/blogs/pini_dayan/archive/2008/11/27/microsoft-ajax-from-the-bottom-up-part-7.aspx
crawl-003
refinedweb
822
72.16
I need to build up a counting function starting from a dictionary. The dictionary is a classical Bag_of_Words and looks like as follows: D={'the':5, 'pow':2, 'poo':2, 'row':2, 'bub':1, 'bob':1} ID={5:1, 2:3, 1:2} values=list(ID.keys()) values.sort(reverse=True) Lk=[] Nw=0 for val in values: Nw=Nw+ID[val] Lk.append([Nw, val]) you can create a sorted array of your word counts then find the insertion point with np.searchsorted to get how many items are to either side of it... np.searchsorted is very efficient and fast. If your dictionary doesn't change often this call is basically free compared to other methods import numpy as np def F(n, D): #creating the array each time would be slow if it doesn't change move this #outside the function arr = np.array(D.values()) arr.sort() L = len(arr) return L - np.searchsorted(arr, n) #this line does all the work... what's going on.... first we take just the word counts (and convert to a sorted array)... D = {"I'm": 12, "pretty": 3, "sure":12, "the": 45, "Donald": 12, "is": 3, "on": 90, "crack": 11} vals = np.arrau(D.values()) #vals = array([90, 12, 12, 3, 11, 12, 45, 3]) vals.sort() #vals = array([ 3, 3, 11, 12, 12, 12, 45, 90]) then if we want to know how many values are greater than or equal to n, we simply find the length of the list beyond the first number greater than or equal to n. We do this by determining the leftmost index where n would be inserted (insertion sort) and subtracting that from the total number of positions ( len) # how many are >= 10? # insertion point for value of 10.. # # | index: 2 # v # array([ 3, 3, 11, 12, 12, 12, 45, 90]) #find how many elements there are #len(arr) = 8 #subtract.. 2-8 = 6 elements that are >= 10
https://codedump.io/share/eg9wwCTjPUSd/1/building-up-a-counting-function
CC-MAIN-2017-43
refinedweb
326
72.56
TS.Scalar¶ TS.Scalar is a header only library that provides scaled and typed numerical values. Using TS.Scalar starts with defining types which have a scale factor and optionally a tag. Values in an instance of TS.Scalar are always multiples of the scale factor. The tag is used to create categories of related types, the same underlying “metric” at different scales. To enforce this TS.Scalar does not allow assignment between instances with different tags. If this is not important the tag can be omitted and a default generic one will be used, thereby allowing arbitrary assignments. TS.Scalar is designed to be fast and efficient. When converting bewteen similar types with different scales it will do the minimum amout of work while minimizing the risk of integer overflow. Instances have the same memory footprint as the underlying integer storage type. It is intended to replace lengthy and error prone hand optimizations used to handle related values of different scales. Definition¶ TS.Scalar consists primarily of the template class Scalar. Instances of Scalar hold a count and represent a value which is the count multiplied by SCALE. Note this quantizes the values that can be represented by an instance. - template<intmax_t SCALE, typename C, typename TAG> class Scalar¶ A quantized integral with a distinct type. The scaling factor SCALE must be an positive integer. Values for an instance will always be an integral multiple of SCALE. The alue of an instance will always be a multiple of SCALE. C must be an integral type. An instance of this type is used to hold the internal count.It can be omitted and will default to int. The size of an instance is the same size as C and an instance of that type can be replaced with a Scalarof that size without changing the memory layout. TAG must be a type. It can be omitted and will default to tag::generic. TAG is a mechanism for preventing accidental cross assignments. Assignment of any sort from a Scalarinstance to another instance with a different TAG is a compile time error. If this isn’t useful TAG can be omitted and will default to tag::genericwhich will enable all instances to interoperate. The type used for TAG can be defined in name only.: struct YoureIt; // no other information about YoureIt is required. typedef Scalar<100, int, YoureIt> HectoTouch; // how many hundreds of touches. Usage¶ In normal use a scalar evaluates to its value rather than its count. The goal is to provide an instance that appears to store unscaled values in a quantized way. The count is accessible if needed. Assigment¶ Assigning values to, from, and between Scalar instances is usually straightforward with a few simple rules. - The Scalar::assign()is used to directly assign a count. - The increment and decrement operators, and the incand decmethods, operate on the count. - All other contexts use the value. - The assignment operator will scale if this can be done without loss, otherwise it is a compile error. - Untyped integer values are treated as having a SCALE of 1. If the assignment of one scalar to another is not lossless (e.g. the left hand side of the assignment has a large scale than the right hand side) one of the two following free functions must be used to indicate how to handle the loss. - unspecified_type round_up(Scalar v)¶ Return a wrapper that indicates v should be rounded up as needed. - unspecified_type round_down(Scalar vs)¶ Return a wrapper that indicates v should be rounded down as needed. To illustrate, suppose there were the definitions typedef Scalar<10> deka; typedef Scalar<100> hecto; An assignment of a hecto to a deka is implicit as the scaling is lossless. hecto a(17); deka b; b = a; // compiles. The opposite is not implicit because the value of a deka can be one not representable by a hecto. In such a case it would have to be rounded, either up or down. b.assign(143); // b gets the value 1430 a = b; // compile error a = round_up(b); // a has count 15 and value 1500 round_up and round_down can also be used with basic integers. - unspecified_type round_down(intmax_t)¶ - unspecified_type round_up(intmax_t)¶ Note this is very different from using Scalar::assign(). The latter sets the count of the scalar instance. round_up and round_down set the value of the scalar, dividing the provided value by the scale to set the count to make the value match the assignment as closesly as possible. a = round_down(2480); // a has count 24, value 2400. Arithmetic¶ Arithmetic with scalars is based on the idea that a scalar represents its value. This value retains the scalar type for conversion checking but otherwise acts as the value. This makes using scalar instances as integral arguments to other functions simple. For instance consider following the definition. struct SerializedData { ...}; using Sector = Scalar<512>; To allocate a buffer large enough for a SerializedData that is also a multiple of a sector would be Sector n = round_up(sizeof(serialized_data)); void* buffer = malloc(n); Or more directly void* buffer = malloc(Sector(round_up(sizeof(serialized_data)))); TS.Scalar is designed to be easy to use but when using multiple scales simultaneously, especially in the same expression, the computed type can be surprising. The best approach is to be explicit - a TS.Scalar instance is very inexpensive to create (at most 1 integer copy) therefore subexpressions can easily be forced to a specific scale by constructing the appropriate scalar with round_up or round_down of the subexpression. Or, define a unit scale type and convert to that as the common type before converting the result to the desired scale. Advanced Features¶ TS.Scalar has a few advanced features which are not usually needed and for which usable defaults are provided. This is not always the case and therefore access to the machinery is provided. I/O¶ When a scalar is printed it prints out as its value, not count. For a family of scalars it can be desireable to have the type printed along with the value. This can be done by adding a member named label to the tag type of the scalar. If the label member can be provided to an I/O stream then it will be after the value of the scalar. Otherwise it is ignored. An example can be found in the <Bytes>_ section of the example usage. Examples¶ The expected common use of TS.Scalar is to create a family of scalars representing the same underlying unit of measure, differing only in scale. The standard example of this is computer memory sizezs which have this property and are quite frequently used in Traffic Server. Bytes¶ The initial use of Scalar will be in the cache component. This has already been tested in some experimental work which will in time be blended back in to the main codebase. The use will be to represent different amounts of data, in memory and on disk. namespace tag { struct bytes { static const char * label = " bytes"; }; } typedef Scalar<1, off_t, tag::bytes> Bytes; typedef Scalar<512, off_t, tag::bytes> CacheDiskBlocks; typedef Scalar<1024, off_t, tag::byteds> KB; typedef Scalar<8 * KB::SCALE, off_t, tag::bytes> CacheStoreBlocks; typedef Scalar<1024 * KB::SCALE, off_t, tag::bytes> MB; typedef Scalar<128 * MB::SCALE, off_t, tag::bytes> CacheStripeBlocks; typedef Scalar<1024 * MB::SCALE, off_t, tag::bytes> GB; typedef Scalar<1024 * GB::SCALE, off_t, tag::bytes> TB This collection of types represents the data size units of interest to the cache and therefore enables to code to be much clearer about the units and to avoid errors in converting from one to another. A common task is to add sizes together and round up to a multiple of some fixed size. One example is the stripe header data, which is stored as a multiple of 8192 bytes, that is a number of CacheStripeBlocks. That can be done with header->len = round_up(sizeof(CacheStripMeta) + segment_count * sizeof(SegmentFreeListHead)); vs. the original code with magic constants and the hope that the value is scaled as you think it is. header->len = (((sizeof(CacheStripeMeta) + header->segments * sizeof(SegmentFreeListHead)) >> STORE_BLOCK_SHIFT) << STORE_BLOCK_SHIFT) Design Notes¶ The semantics of arithmetic were the most vexing issue in building this library. The ultimate problem is that addition to the count and to the value are both reasonable and common operations and different users may well have different expectations of which is more “natural” when operating with a scalar and a raw numeric value. In practice my conclusion was that even before feeling “natural” the library should avoid surprise. Therefore the ambiguity of arithmetic with non-scalars was avoided by not permitting those operations, even though it can mean a bit more work on the part of the library user. The increment / decrement and compound assignment operators were judged sufficient similar to pointer arithmetic to be unsurprising in this context. This was further influenced by the fact that, in general, these operators are useless in the value context. E.g. if a scalar has a scale greater than 1 (the common case) then increment and decrement of the value is always a null operation. Once those operators are used on the count is is least surprising that the compound operators act in the same way. The next step, to arithmetic operators, is not so clear and so those require explicit scale indicators, such as round_down or explicit constructors. It was a design goal to avoid, as much as possible, the requirement that the library user keep track of the scale of specific variables. This has proved very useful in practice, but at the same time when doing arithmentic is is almost always the case that either the values are both scalars (making the arithmetic unambiguous) or the scale of the literal is known (e.g., “add 6 kilobytes”).
https://docs.trafficserver.apache.org/en/latest/developer-guide/internal-libraries/scalar.en.html
CC-MAIN-2019-04
refinedweb
1,637
63.09
David computer and the VAX/VMS operating system. At DEC he. But it's not fair to blame Cutler for this loss; it was Ken Olsen who refused to understand the idea of anyone wanting to have his/her own computer on the desk.[citation needed], would embody the next generation of design principles and have a compatibility layer for UNIX and VMS. The RISC machine was to be based on ECL technology and was one of three ECL projects DIGITAL was undertaking at the time. On the basis of the R&D cost involved in funding multiple ECL projects to yield products that would ultimately compete against each other, Prism was cancelled in 1988 in favor of a system running Ultrix on microprocessors designed by MIPS. Of the three ECL projects, the VAX 9000 was the only one that was commercialised. November 11, 2008 which were awarded on September 29 in a White House ceremony.[4][5] References - ^ Custer, Helen (1993). "Foreword". Inside Windows NT. - ^ Elliott Roper (February 14 2002). "Filesystem namespaces (was Re: Serving non-MS-word *.doc files (was Re: PDP-10 Archive migrationplan))".. - ^ "Professional Developers Conference 2008 Day 1 Keynote: Ray Ozzie, Amitabh Srivastava, Bob Muglia, Dave Thompson". Microsoft Press Release. October 27, 2008.. Retrieved on 2008-10-29. - ^ - ^ - Zachary, G. Pascal (1994). Showstopper! The Breakneck Race to Create Windows NT and the Next Generation at Microsoft. Warner Books. ISBN 0-02-935671-7. External links This entry is from Wikipedia, the leading user-contributed encyclopedia. It may not have been reviewed by professional editors (see full disclaimer)
http://www.answers.com/dave%20cutler
crawl-002
refinedweb
262
58.99
HASHINIT(9) BSD Kernel Manual HASHINIT(9) hashinit - kernel hashtable functions #include <sys/systm.h> void * hashinit(int num, int type, int flags, u_long *mask); The hashinit() function is used to allocate a hashtable of a desired size given by the num argument. The hashinit() function will round this number to the next power of two, and allocate and initialize the requested hashtable. The type and flags arguments are passed to the malloc(9) func- tion unchanged. The mask argument is used to pass back the mask for use with the allocated hashing table. For an example of its use, see hash(9). The hashinit() function returns a pointer to the allocated and initial- ized hash table. free(9), hash(9), malloc(9) The hashinit() function currently only allocates hash tables with LIST bucket pointers at this time. Future enhancements to allocate QUEUE buck- et pointers may be warranted. This may necessitate an API change to ac- commodate. The hashinit function first appeared in 4.4BSD. MirOS BSD #10-current December.
https://www.mirbsd.org/htman/i386/man9/hashinit.htm
CC-MAIN-2016-07
refinedweb
171
66.44
Oct 02, 2011 11:15 PM|frostfang|LINK Contributor 2652 Points All-Star 153416 Points Moderator MVP Oct 03, 2011 03:05 AM|ignatandrei|LINK Did you try with FF/IE and it works? Only in Chrome does not? ( and please wrote the script) Oct 03, 2011 01:41 PM|frostfang|LINK Oct 03, 2011 01:46 PM|frostfang|LINK Oct 04, 2011 03:22 AM|frostfang|LINK Above is the screen shot that shows the request payload. In sencha this is all i'm doing, creating 2 records and then adding them to the store, then sync-ing the store which forces the request back to the server. var sel = Ext.ModelMgr.create({TraumaReviewId: 2, TraumaCategoryId: 46}, 'Trauma.Data.Models.CategorySelection'); var sel2 = Ext.ModelMgr.create({TraumaReviewId: 2, TraumaCategoryId: 47}, 'Trauma.Data.Models.CategorySelection'); Trauma.Data.Stores.CategorySelectionStore.add(sel); Trauma.Data.Stores.CategorySelectionStore.add(sel2); Trauma.Data.Stores.CategorySelectionStore.sync(); All-Star 47028 Points Oct 04, 2011 05:01 AM|bruce (sqlwork.com)|LINK your request is doing a post with a url and a json content body. if you like the json tab you shoudl see the json structure. if you haven't define a .net model to receive the json. then if you use the standard route mapping you have /categoryselection/handler/0 => {controller}/{action}/{id} querystring _dc = <number string> try public ActionResult handler(int id, string _dc, MyJsonObject model) Oct 04, 2011 11:38 AM|frostfang|LINK Oct 04, 2011 11:10 PM|frostfang|LINK Thanks for the help, I had a go at what you said. I tried to keep the model as close to the json as possible. I added a controller that just accepted my Model. Here is the model and controller. //Models public class RequestPayload { public List<record> records; } public class record { public int TraumaReviewId { get; set; } public int TraumaCategoryId { get; set; } public int Id { get; set; } } //Controller public ActionResult Handler(Models.RequestPayload obj) { //Do work } When i debug i do hit the controller and there is a Request Payload object but the internal list of records is null. Is there something i need to do ? Oct 05, 2011 07:00 AM|frostfang|LINK Well i think i found the answer, apparently it's been fixed in MVC 3 but if you are using MVC 2 and need a solution here is what worked for me. so basically the controller needed a bit for serialisation help to understand the json input it was receiving. Hope this helps [Adapters.ObjectFilter(Param = "records", RootType = typeof(Models.RequestPayload))] public ActionResult Handler(Models.RequestPayload records, string selections) { //work here } Oct 06, 2011 02:48 AM|frostfang|LINK Just a note, i upgraded to MVC 3 and tried the same situation without the object filter and it didn't work. It must be a sencha thing and MVC not being able to translate the JSON properly or not recognsing that it is json. 11 replies Last post Oct 06, 2011 02:48 AM by frostfang
http://forums.asp.net/p/1726344/4622641.aspx?Request+Payload+in+chrome
CC-MAIN-2014-15
refinedweb
499
56.25
Min Stack July 27, 2012 If you ignore the requirement that all three operations must perform in constant time, this is easy. One choice creates a stack in the normal way, with push and pop operating in constant time, then performs linear search when the minimum is requested. Another choice uses some kind of balanced tree in which each operation is performed in logarithmic time. But getting a constant-time set of operations is hard. Our solution achieves constant time for all three operations at the expense of auxiliary space equal to the size of the stack. The idea is to keep two stacks, one for the stack itself and the other for the stack of minimums. The push operation puts the new item at the top of the regular stack and, if it is less than the item at the top of the minimums stack, put it on top of the minimums stack as well. The pop operation removes the item at the top of the regular stack; it also removes the item at the top of the minimums stack if it is the same as the item popped from the top of the regular stack. To find the minimum, simply inspect the top of the minimums stack. We represent a min-stack as a cons pair with the regular stack in its car and the min-stack in its cdr; for instance, the min-stack that results from inserting 3, 4, 5, 1 and 2 in order is ((2 1 5 4 3) 1 3), where the entire input is stacked (in reverse order) in the car of the list and the two minimums, 3 and 1, are stacked (in reverse order) in the cdr of the list. Here is the empty min-stack: (define empty (list (list))) (define (empty? x) (equal? empty x)) The push operation first checks if the min-stack is empty, and returns a pair of two singleton lists if it is. Otherwise, the new item is stacked onto the regular stack, and stacked onto the minimum stack only if it is smaller than the current minimum: (define (push lt? x min-stack) (if (empty? min-stack) (cons (list x) (list x)) (cons (cons x (car min-stack)) (if (lt? x (cadr min-stack)) (cons x (cdr min-stack)) (cdr min-stack))))) Since we represent a min-stack as a pair of lists, we get a good opportunity for a workout on the compositions of car (the head of the list) and cdr (the rest of the list) provided by Scheme. The top of the regular stack is the car of the inner list stored in the car of the pair, the caar, which is 2 in the sample shown above. The top of the minimum stack is the car of the cdr of the pair, the cadr, which is 1 in the sample shown above (the second 1, not the 1 in the inner parentheses). Here are two access functions: (define (top min-stack) (if (empty? min-stack) (error 'top "empty stack") (caar min-stack))) (define (minimum min-stack) (if (empty? min-stack) (error 'minimum "empty stack") (cadr min-stack))) All that’s left is the pop operation, which needs to check if the item being popped is the same as the current minimum, in which case the current minimum is also popped; since we only have a lt? comparison, we call it twice to check equality: (define (pop lt? min-stack) (if (empty? min-stack) (error 'pop "empty stack") (cons (cdar min-stack) (if (or (lt? (caar min-stack) (cadr min-stack)) (lt? (cadr min-stack) (caar min-stack))) (cdr min-stack) (cddr min-stack))))) Here are some examples: > (define x empty) > (set! x (push < 3 x)) > (set! x (push < 4 x)) > (set! x (push < 5 x)) > (top x) 5 > (minimum x) 3 > x ((5 4 3) 3) > (set! x (push < 1 x)) > (set! x (push < 2 x)) > (top x) 2 > (minimum x) 1 > x ((2 1 5 4 3) 1 3) > (set! x (pop < x)) > (set! x (pop < x)) > x ((5 4 3) 3) > (set! x (pop < x)) > (top x) 4 > (minimum x) 3 > (set! x (pop < x)) > (set! x (pop < x)) > (empty? x) #t > x (()) You can run the program at. […] today’s Programming Praxis exercise, our goal is to create s stack-like data structure that can push, pop […] My Haskell solution (see for a version with comments): Javascript. I used a function constructor. Python version: For the push operation, I think you need to add the new item to the min stack if it is returns 0, but also clears a 0 from the minimum stack minimum –> should still be zero Sorry, a less than symbol messed up my comment. I think the push operation needs to add the new item to the minimum stack when it is less than or equal to the current minimum. Otherwise, a minimum item could get popped off to soon. Consider this sequence of operations: The problem text states that all items are distinct. Mike, pushing 3 onto the stack twice is actually not legal according the specification: “You may assume that all elements are distinct”. Clojure solution almost similar to the Haskell one Alternate solution, using protocol and an helper constructor Whatever the solution you can use it the same way A Go solution similar to the Python one: Learning a bit of c++: #ifndef CSTACK_H #define CSTACK_H using namespace std; struct node { int x; node *next; }; class CStack { public: CStack(); CStack(const CStack& orig); virtual ~CStack(); void push(int x); int pop(); int minimum(); private: int min; node *head; }; #endif /* CSTACK_H */ #include “CStack.h” #include #include using namespace std; CStack::CStack() { min=1000; } CStack::CStack(const CStack& orig) { } CStack::~CStack() { } int CStack::minimum() { return min; } void CStack::push(int x) { node *current; if(head != NULL){ current = new node; current->x=x; if(min>x){ min=x; } current->next=head; head=current; } else{ head = new node; min=x; head->x=x; } } int CStack::pop() { int ret = head->x; head=head->next; return ret; } […] Pages: 1 2 […] Perl6 version: […] problem: Min Stack Design a data structure that provides push and pop operations, like a stack, plus a third operation […] should rename the method name as, because of names conflict.
https://programmingpraxis.com/2012/07/27/min-stack/2/
CC-MAIN-2017-30
refinedweb
1,047
67.08
Couldn’t find this exact thing elsewhere, so I’m publishing it in case I ever need it again. This trick depends on the fact that docker uses cgroups and the cgroup ID seems to always be equal to the container ID. This probably only works on linux-based docker containers. import re def my_container_id(): ''' If this process is in a container, this will return the container's ID, otherwise it will return None ''' try: fp = open('/proc/self/cgroup', 'r') except IOError: return else: with fp: for line in fp: m = re.match(r'^.*\:/docker/(.*)$', line) if m: return m.group(1)
http://www.virtualroadside.com/blog/index.php/category/uncategorized/
CC-MAIN-2017-09
refinedweb
103
61.46
In this C++ tutorial, you will learn about storage classes, types of storage class variables – Automatic, External and Static explained with examples. Storage classes: In the context of scope of variables in functions exists the important concept of storage class. What is Storage Class? Storage class defined for a variable determines the accessibility and longevity of the variable. The accessibility of the variable relates to the portion of the program that has access to the variable. The longevity of the variable refers to the length of time the variable exists within the program. Types of Storage Class Variables in C++: - Automatic - External - Static Automatic: Variables defined within the function body are called automatic variables. Auto is the keyword used to declare automatic variables. By default and without the use of a keyword, the variables defined inside a function are automatic variables. For instance: void exforsys( ) { auto int x; auto float y; ... ... } is the same as void exforsys( ) { int x; float y; //Automatic Variables ... ... } In the above function, the variable x and y are created only when the function exforsys( ) is called. An automatic variable is created only when the function is called. When the function exforsys( ) is called, the variables x and y are allocated memory automatically. When the function exforsys( ) is finished and exits the control transfers to the calling program, the memory allocated for x and y is automatically destroyed. The term automatic variable is used to define the process of memory being allocated and automatically destroyed when a function is called and returned. The scope of the automatic variables is only within the function block within which it is defined. Automatic variable are also called local variables. External: External variables are also called global variables. External variables are defined outside any function, memory is set aside once it has been declared and remains until the end of the program. These variables are accessible by any function. This is mainly utilized when a programmer wants to make use of a variable and access the variable among different function calls. Static: The static automatic variables, as with local variables, are accessible only within the function in which it is defined. Static automatic variables exist until the program ends in the same manner as external variables. In order to maintain value between function calls, the static variable takes its presence. For example: #include <iostream> using namespace std; int exforsys(int); int exforsys2(int); void main( ) { int in; int out; while(1) { cout << "nEnter input value:"; cin>>in; if (in == 0) break; out=exforsys(in); cout << "nResult : " << out; out=exforsys2(in); cout << "nResult2: " << out; } cout << "n End of Program " ; } int exforsys(int x) { static int a=0; a++; return(a); } int exforsys2(int x) { int b=0; b++; return(b); } In the above program, the static variables a is initialized only once in the beginning of the program. Then the value of the variable is maintained between function calls. When the program begins, the value of static variable a is initialized to zero. The value of the input in is 3 (which is not equal to zero) and is then passed to the function in variable x. The variable a is incremented thus making a as equal to 1, thus, the return of value from function exforsys( ) for the first time is 1, which is printed in the called function. It is the same case for the second function, exforsys2(), the variable b which is not declared static, is incremented thus making it equal to 1, and the return value for the first time is 1. The second time the value of the input in is 7 (which is not equal to zero) and is passed to the function in variable x. The variable a (which is declared as static) has the previous value of 1. This is incremented and the value of a is equal to 2, so the return value is now 2. Now, for the second function, the variable b which was not declared static, starts from 0 again, making it equal to 1 after incrementing it. Being not declared static, it will always start from 0. Thus the output of the above program is:
http://www.exforsys.com/tutorials/c-plus-plus/storage-classes-in-c.html
CC-MAIN-2019-09
refinedweb
697
61.16
Encapsulate the details of an X window. More... #include <window.hh> Encapsulate the details of an X window. This class provides an API for the Python parts of Minx to be able to deal with X windows. It wraps around the relevant parts of Xlib and exposes its functionality to Python via Boost.Python. An enumeration for the different configure values. This enumeration simply provides C++ names for the Xlib value mask for configure requests. These names are exported to Python via Boost.Python's enum exporting facility. The minxlib and corresponding Xlib names for these enums are shown below: An enumeration for the different event masks. This enumeration simply provides C++ names for the Xlib event masks that are exported to Python via Boost.Python's enum exporting facility. minxlib's names for the event masks and their corresponding Xlib names are shown below: Create a wrapper object for an existing Xlib window. Destructor. Clean-up for when a window object is deleted. Really, there's nothing to do because this class is only a thin wrapper around X windows and we only maintain a pointer to the Xlib display structure and an integral ID. We don't actually create or acquire anything when this class is instantiated; consequently, there's nothing to destroy or release. Get this window's children. This function uses XQueryTree() to determine the list of child windows of the X window encapsulated by this object. If the call to XQueryTree() fails, this function will return an empty list and, eventually, X will generate a protocol error. Configure the window. This function calls XConfigureWindow() using v as the value_mask parameter to the Xlib function and using the other parameters to fill out the XWindowChanges structure. The value_mask is a bitwise OR of the configure_mask enums. Please consult Xlib documentation for further details. For example, the following page may be instructive: Reimplemented in minxlib::root_window. Set input focus on this window and raise it. Reimplemented in minxlib::root_window. Retrieve window's size, position, and border width. This function uses XGetGeometry() to determine the window's size, position, and border width. It returns an STL vector of integers containing the following five values: If the call to XGetGeometry() fails, this function will return an empty vector. Reimplemented in minxlib::root_window. Setup a passive keyboard grab. The string s is expected to name a key binding and should be of the form: (([CAS]|M[1-5]?)-)*key The parenthesized part plus the asterisk in the above expression are a regular expression while "key" stands for the string form of a valid X keysym. Here are some examples of key binding specifications: Minx's key bindings specification is designed to be similar to the way key bindings are specified in Emacs. This function interprets its parameter s in the manner described above and infers the appropriate keycode and corresponding modifier mask for the specified key binding. It then sets up a passive grab for that keycode and modifier mask and also records the name of the key binding (viz., s) in a key map that is indexed using the keycode and modifier mask. Later, when the X server sends Minx keyboard events, we will use the event's keycode and modifier mask to look-up the key binding in the above-mentioned key map and return that name as part of the event to Minx's Python core. Hide this window, i.e., unmap it. Reimplemented in minxlib::root_window. Check if window is currently mapped or not. This function uses XGetWindowAttributes() and checks the value of the XWindowAttributes's map_state field to see if the window is mapped or not. It'll return true if map_state equals IsViewable or IsUnviewable and false if either map_state is IsUnmapped or if the call to XGetWindowAttributes() fails. Reimplemented in minxlib::root_window. Kill this window. This method destroys the X window encapsulated by this object by killing the X client application that created the window. If the window supports the WM_DELETE_WINDOW protocol, this method will use that to kill the window and its client application. Otherwise, it will simply use the XKillClient() function to destroy the window and its client by brute force. Reimplemented in minxlib::root_window. Move and resize the window. This function sets the window geometry by calling XMoveResizeWindow(). Please consult Xlib documentation for further details. Reimplemented in minxlib::root_window. Kill this window using brute force. This method destroys the X window encapsulated by this object without trying a graceful shutdown via WM_DELETE_WINDOW. It is meant to be used on those clients whose windows advertise support for WM_DELETE_WINDOW but don't implement the delete protocol properly and stay alive without good cause despite a user-initiated kill request. Reimplemented in minxlib::root_window. Convert to an Xlib Window. This cast operator allows us to pass minxlib::window objects seamlessly to Xlib functions. Window inequality operator. Two window objects are considered equal if they have the same ID and belong to the same display. Window inequality operator. This version of the inequality operator only checks this object's window ID against w. Window equality operator. Two window objects are considered equal if they have the same ID and belong to the same display. Window equality operator. This version of the equality operator only checks this object's window ID against w. Get this window's parent window. This function uses XQueryTree() to determine the parent window of the X window encapsulated by this object. If the call to XQueryTree() fails, this function will return a window object with the id member set to zero. Eventually, on XQueryTree() failure, X will generate a protocol error; that's why we don't bother throwing an exception. Reimplemented in minxlib::root_window. Retrieve window properties from X server. This function gets the WM_NAME, WM_ICON_NAME, and WM_CLASS properties for this window and returns them in an STL map of strings to strings as shown below: If we are unable to retrieve a particular property, that key's value will be an empty string. For example, if some window doesn't have a WM_CLASS property, the "class" and "res_name" keys for that window will be empty. On the Python side of Minx, the above STL map will be returned as a Python dict. Export the window class to minxlib Python module. This function exposes the window class's interface so that it can be used by the Python parts of Minx. It is meant to be called by the Boost.Python initialization code in python.cc. Reparent this window to another. Reimplemented in minxlib::root_window. Get screen number of this window. This function returns the zero-based index of the physical screen this window is on. If Xinerama is active and this window overlaps two or more screens, this function will return the screen that has most of the window. Reimplemented in minxlib::root_window. Set the X event mask for this window. This method allows clients to specify the events they are interested in receiving for this window. The mask parameter should be a bitwise OR of the event_mask enum and is passed as-is to XSelectInput(). See the relevant Xlib documentation for the details about the event mask. Set window's border color and size. This function calls XSetWindowBorderWidth() and XSetWindowBorder() to specify the window's border color and size to the desired values. Reimplemented in minxlib::root_window. Set window properties. This function sets the window properties specified in its prop parameter. The following properties are supported: For example, let's say you have a minxlib::window object w and set its properties as shown by the snippet of code below: That will set the WM_CLASS.res_class and WM_NAME properties of the window w. Reimplemented in minxlib::root_window. Show the window, i.e., map it. Reimplemented in minxlib::root_window.
http://chiselapp.com/user/minxdude/repository/minx/doc/rel1.x/api/classminxlib_1_1window.html
CC-MAIN-2018-43
refinedweb
1,301
58.79
Subject: Re: [geometry] One more compilation error with Boost Geometry 1.56 From: jakka30 (sjakka_at_[hidden]) Date: 2014-11-05 09:50:39 Hi Adam, I could get rid of these compilation errors by NOT including the following header file #include <boost/geometry/geometries/adapted/c_array.hpp> Not sure what is causing not to compile if I include this header file. Any idea? Now we could build our sources using Boost 1.57 and thank you for your help. Suresh -- View this message in context: Sent from the Boost Geometry mailing list archive at Nabble.com. Geometry list run by mateusz at loskot.net
https://lists.boost.org/geometry/2014/11/3170.php
CC-MAIN-2022-33
refinedweb
104
58.38
Asked by: C# app with webview and Cordova for windows 8.1/10.0 I am building a hybrid application in C# and am including a WebView. This WebView needs to include Cordova. This is port of something we already do in IOS (objective C and Cordova WebView) and Android. The problem is that the latest Cordova for Windows 8.1 and even Windows Phone 8.1 is all based on Windows JavaScript runtime. So I took cordova platform generated code and included in a WebView. The issue I ran into is that Windows JavaScript based store app somehow have access to "Windows" namespace in the browser. In case of a webview the "Windows" namespace is missing in JavaScript. Cordova depends on "Windows" runtime api being present in the browser. My guess is that when Windows Javascript based store app is created, Microsoft framework is somehow creating a single WebView with IE and putting in the "Windows" namespace inside it. Is there a way I can add access to the "Windows" namespace inside the a WebView created from C#. In android there is webView.addJavascriptInterface (Windows, "Windows"). I know that if the app is Windows JavaScript based, I can add a C# component that can be called from JavaScript. But that is not what I want, I want C# WebView with Cordova. Any help is appreciatedWednesday, February 18, 2015 11:20 PM Question All replies This won't be possible. The Xaml WebView is strongly isolated from the system. You would need to plumb your own communication between the WebView contents and the Xaml host app to access the Windows Runtime. You'd essentially need to rewrite the entire Cordova app to host communications system. As you note, Cordova apps on Windows run in the JavaScript environment rather than being hosted in a WebView within the Xaml environment. On Windows HTML/JavaScript is a first class UI framework equal to other first class frameworks such as Xaml and DirectX. The HTML environment is not just a web browser hosted in another framework. --RobWednesday, February 18, 2015 11:30 PMOwner I appreciate your answer. The issue with adding my own communication between the WebView and the xaml host app to access the Windows Runtime is that Cordova will not work. None of the Cordova plugins will work either. We heavily depend on Cordova Plugins. The hybrid webview approach works well with IOS and Android. Looks like Cordova went down that route with WP8, but abounded it for WP8.1 in favor of JavaScript app. Any chance that WebView for Windows 10 will add support for it. We are actually targeting Windows 10. Thanks, VenkataWednesday, February 18, 2015 11:58 PM Why do you need to use the Xaml host? Can you write the main application in HTML/JavaScript? That's the only way you'll be able to have a Cordova app with OS integration as well as the surrounding native app. We can discuss only currently available versions here. The developer story for Windows 10 hasn't yet been announced.Thursday, February 19, 2015 12:17 AMOwner Writing the main application in HTML/JavaScript will also not work. We depend on multiple cordova weviews. So I run into the same problem by including "x-ms-webview" inside JavaScript/HTML page. Thanks, VenkataThursday, February 19, 2015 12:22 AM
https://social.msdn.microsoft.com/Forums/en-US/2de62695-ca3c-4cc8-b30e-bb7b72d23676/c-app-with-webview-and-cordova-for-windows-81100?forum=winappswithcsharp
CC-MAIN-2018-30
refinedweb
558
67.04
Output descriptor for DICOMFileReader. More... #include <mitkDICOMImageBlockDescriptor.h> Output descriptor for DICOMFileReader. As a result of analysis by a mitk::DICOMFileReader, this class describes the properties of a single mitk::Images that could be loaded by the file reader. The descriptor contains the following information: Described aspects of an image are: Definition at line 77 of file mitkDICOMImageBlockDescriptor.h. Type specifies additional tags of interest. Key is the tag path of interest. The value is an optional user defined name for the property that should be used to store the tag value(s). Empty value is default and will imply to use the found DICOMTagPath as property name. Definition at line 170 of file mitkDICOMImageBlockDescriptor.h. Definition at line 184 of file mitkDICOMImageBlockDescriptor.h. Get property by its key. Implements mitk::IPropertyProvider. Describe the correct x/y pixel spacing of the mitk::Image (which some readers might need to adjust after loading) the 3D mitk::Image that is loaded from the DICOM files of a DICOMImageFrameList return the number of frames that constitute one timestep. Convinience method that returns the property timesteps Describe how the mitk::Image's pixel spacing should be interpreted. Key-value store describing aspects of the image to be loaded. Query names of existing contexts. Implements mitk::IPropertyProvider. Query keys of existing properties. Implements mitk::IPropertyProvider. Reader's capability to appropriately load this set of frames. SOP Class UID of this set of frames. SOP Class as human readable name (e.g. "CT Image Storage") Describe the gantry tilt of the acquisition. Print information about this image block to given stream. Set a list of DICOMTagPaths that specifiy all DICOM-Tags that will be copied into the property of the mitk::Image. This method can be used to specify a list of DICOM-tags that shall be available after the loading. The value in the tagMap is an optional user defined name for the property key that should be used when storing the property). Empty value is default and will imply to use the found DICOMTagPath as property key. By default the content of the DICOM tags will be stored in a StringLookupTable on the mitk::Image. This behaviour can be changed by setting a different TagLookupTableToPropertyFunctor via SetTagLookupTableToPropertyFunctor(). The 3D mitk::Image that is loaded from the DICOM files of a DICOMImageFrameList. Key-value store describing aspects of the image to be loaded. Reader's capability to appropriately load this set of frames. SOP Class UID of this set of frames. Set a functor that defines how the slice-specific tag-values are stored in a Property. This method sets a functor that is given a StringLookupTable that contains the values of one DICOM tag mapped to the slice index. The functor is supposed to store these values in an mitk Property. By default, the StringLookupTable is stored in a StringLookupTableProperty except if all values are identical. In this case, the unique value is stored only once in a StringProperty. Describe the gantry tilt of the acquisition.
https://docs.mitk.org/nightly/classmitk_1_1DICOMImageBlockDescriptor.html
CC-MAIN-2021-39
refinedweb
502
58.48
This is actually a bit of a tough call. In unref, we're concerned about storage management. Not checking the flag is inconsistent, that's true. But the correct check is `tmp->wstptr != NULL', and that's the check being made. I may add some assertions here and in fmt_val so that both conditions are checked before the free in both places. Thanks, Arnold > Date: Wed, 16 Feb 2005 09:48:53 +0900 > From: =?ISO-2022-JP?B?GyRCTFpCPDlAMGwbKEI=?= <address@hidden> > Subject: gawk: multibyte aware problem > To: address@hidden > > Hi, > > I had checked unofficial patch again. > In node.c/unref() of patch, > > @@ -456,6 +479,13 @@ > return; > } > free(tmp->stptr); > +#if defined MBS_SUPPORT > + if (tmp->wstptr != NULL) > + free(tmp->wstptr); > + tmp->flags &= ~WSTRCUR; > + tmp->wstptr = NULL; > + tmp->wstlen = 0; > +#endif > > here, I guess shoud check (tmp->flags & WSTRCUR) != 0 before > tmp->wstptr != NULL line (other free wstptr routine did check it). > > How though thought whether should do so? > > -- > Kimura Koichi
https://lists.gnu.org/archive/html/bug-gnu-utils/2005-02/msg00130.html
CC-MAIN-2021-31
refinedweb
160
61.02
Sort stack using temporary Stacks in C++ In this tutorial of CodeSpeedy, we will learn how to sort a stack using temp Stacks in C++. We will learn to write the program in C++ in a very cool and easy way. If you don’t know anything about this or how to write a program for the above topic, it’s OK, you are in the right place, let’s learn about it. Here, We will write a C++ program to sort a given unsorted stack into ascending order with the help of another temporary stack. Firstly, we will create a temporary stack name it as tmpStack. And then, we will pop the first element from the given input stack named instack. After that, we will compare the element popped from the input stack with the element present on the top of the temporary stack. If the element is smaller, pop the top element from the temporary stack and then push the element into it. Otherwise, if the element is greater, push it directly into a temporary stack. Repeat the above steps until the input stack is not empty. Now the sorted element is in the temporary stack. Lastly, Print the temporary stack. Examples: Here are some examples of input and output stack: Input : [32, 1, 26, 65, 20, 12] Output : [1, 12, 20, 26, 32, 65] Input : [9, 5, 3, 16, 29, 80] Output : [3, 5, 9, 16, 29, 80] Program: Now, let’s begin to write code for Sorting stack using temporary Stacks using the above concept described – // C++ program to sort a stack using an another stack. #include <bits/stdc++.h> using namespace std; s<int> sortStack(s<int> &instack) { s<int> tmpStack; while (!instack.empty()) { int tmp = instack.top(); instack.pop(); // while temporary stack is not empty //top of stack is greater than temp while (!tmpStack.empty() && tmpStack.top() < tmp) { // pop from temporary stack instack.push(tmpStack.top()); //push it into input stack tmpStack.pop(); } // push temp in tempory of stack tmpStack.push(tmp); } return tmpStack; } // main function int main() { s<int> input; input.push(26); input.push(4); input.push(19); input.push(66); input.push(18); input.push(9); // Print the temporary stack s<int> tmpStack = sortStack(instack); cout << "Sorted numbers are:\t"; while (!tmpStack.empty()) { cout << tmpStack.top()<< " "; tmpStack.pop(); } } Output: Output for the given input in the above-given program. Given Input- [ 26 , 4 , 19 , 66 , 18 , 9 ] Sorted numbers are: [4, 9, 18, 19, 26, 66] Thank you! I hope this will help you. Very nice explanation. Mam please explain how to sort a stack using recursion in C++. Thank you.. A very good and to the point explanation…thanks a lot..it helped me a lot …
https://www.codespeedy.com/sort-stack-using-temporary-stacks-in-cpp/
CC-MAIN-2020-50
refinedweb
456
65.52
Ericbo wrote: Here is what I just bought ... will have to add the Indigo trigger out of the beam output Will let all know once I have a solution working ... UTF8&psc=1 lanbrown wrote: if it fails, then it fails but the device still runs. lanbrown wrote: So using the input side of things only does make sense. Colorado4Wheeler wrote: Without knowing how all the parts interoperate and the nuances of each, I would think that if you put, say, an InlineLinc onto the pump output and know that the pump should run at least every X minutes/hours/etc then it would be simple enough to alert when there was no response after that much time. You could also get a water sensor, as you had mentioned, and instead of relying on it being "poo proof" you could just break it open and solder onto the sensors (generally 3 metal feet) and run wires down to the area you are interested in. set mode to value of variable "Gymaircon_mode" set temp to value of variable "Gymaircon_temp" set fan to value of variable "Gymaircon_fandir" set fanspeed to value of variable "Gymaircon_fan" set theURL to "" & mode & "&stemp=" & temp & "&shum=0&f_rate=" & fanspeed & "&f_dir=" & fan do shell script "curl " & quoted form of theURL pow=str(new_dict['pow']) #update indigo variables indigo.variable.updateValue(493056778, ((pow))) htemp=str(new_dict['htemp']) otemp=str(new_dict['otemp']) #update indigo variables indigo.variable.updateValue(75127650, ((htemp))) indigo.variable.updateValue(194583233, ((otemp))) rehafer wrote: I have a few AirPort Express -> AirPlay setups in my home. Some are connected to Class T amplifiers and full size speakers, those I just leave on unless I’m away a few days. Others I use powered speakers (the kind they sell for use with computers) I plus the speakers and the Express into a 3x1 tap and into a Z-wave on/off switch. Works fine for me. Sent from my iPhone using Tapatalk howartp wrote: I’m not entirely sure what your question is, if indeed there is a question. But with the Airfoil Pro plugin which I think is included by default in Indigo 7, and with Airfoil (from Rogue Amoeba) you can Airplay your Mac to any supported speakers etc. I have three AE’s from eBay, all wireless, with £10 pc speakers plugged in. Never powered off; just use plugin to send or not send audio to them as desired. Sent from my iPhone using Tapatalk Pro /usr/bin/expect '/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/uniFiAP.indigoPlugin/Contents/Server Plugin/dictLoop.exp' userID PASSWORD 192.168.1.x BZ.v xxxThisIsTheEndTokenxxx 40 10 /var/log/message set userID [lindex $argv 0 ] set password [lindex $argv 1 ] set ipNumber [lindex $argv 2 ] set promptOnServer [lindex $argv 3] set endDictToken [lindex $argv 4] set readDictEverySeconds [lindex $argv 5] set mcatimeout [lindex $argv 6] set logfile [lindex $argv 7] set timeout 10 spawn ssh $userID@$ipNumber expect { "(yes/no)? " { send "yes\n" sleep 0.1 expect "assword: " { send "$password\n"} } "assword: " { send "$password\n" } } sleep 1.0; expect "$promptOnServer" {puts "startxxxx\r";} sleep 1.0 set timeout $mcatimeout send "\r" for {set i 1} {$i >0} {incr i 1} { sleep 0.2 expect "$promptOnServer" send "mca-dump | sed -e 's/^ *//' \r" expect "$promptOnServer" puts "$endDictToken$i\r\r" sleep $readDictEverySeconds send "\r" expect "$promptOnServer" if {$logfile != "doNotSendAliveMessage"} { send "echo ThisIsTheAliveTestFromUnifiToPlugin >> $logfile\r" } } expect "$promptOnServer" puts "end\r" send "exit\r" sleep 0.1 expect eof cmd = "/usr/bin/expect '" + \ self.pathToPlugin + self.expectCmdFile[type] + "' " + \ self.unifiUserID + " " + \ self.unifiPassWd + " " + \ ipNumber + " " + \ self.promptOnServer[type] + " " + \ self.endDictToken[type]+ " " + \ str(self.readDictEverySeconds[TT])+ " " + \ str(self.timeoutDICT) if type.find("AP") >-1: cmd += " /var/log/messages" else: cmd += " doNotSendAliveMessage" ListenProcess = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) ##pid = ListenProcess.pid ##self.ML.myLog("all", " pid= " + str(pid) ) msg = unicode(ListenProcess.stderr) if msg.find("[Err ") > -1: # try this again self.ML.myLog("all", type + " error connecting " + msg, type=u"EXPECT") self.sleep(20) continue flags = fcntl.fcntl(ListenProcess.stdout, fcntl.F_GETFL) # get current p.stdout flags fcntl.fcntl(ListenProcess.stdout, fcntl.F_SETFL, flags | os.O_NONBLOCK) return ListenProcess, "" kw123 wrote: I am using expect to send and get data with ssh and sftp to from the rpi If anyone is interested I can post the code. Sent from my iPhone using Tapatalk kw123 wrote: The Expect( I am using ) is its own language for terminal interactions based on tcl And it comes preinstalled on each unix .. even on a mac Sent from my iPhone using Tapatalk kw123 wrote: I am using expect to send and get data with ssh and sftp to from the rpi If anyone is interested I can post the code. Sent from my iPhone using Tapatalk myContent = urllib2.urlopen("" % devIP).read(500) Yes, there is a way to turn on manual irrigation (and yes, I realize it's not documented in our API reference so don't worry, it's us, not you )) It's done using set_port_state_and config.php API call, and you need to pass all the data of your configuration when you call it, you can see it in our reference. What's not mentioned there, is that for a port item in the "ports" array, you can change the "configuration" field from "Auto" to "On" and add a "Duration" number field with the amount of minutes to water, an example port for a zone named "Lawn", zone number 1, to water for 5 minutes: { "number": 1, "name": "Lawn", "configuration": "On", "shown": "True", "presentation_index": "0", "duration": 5 } AndyVirus wrote: FlowerPower yes, GreenIQ no. So i can get the plants data from the sensors but i cant tell greeniq to irrigate based on that data. GreenIQ will be sending my clientid and secret for oauth tomorrow with sample scripts so hopefully they will make the process simpler (hopefully python 2 and not using the above library) #!/usr/local/bin/python3 from heos.heos import * host = '192.168.55.176' heos = Heos(host,True) pid = -3336210 heos._player_id = pid heos.play() heos.close() <CallbackMethod>resumeProgram</CallbackMethod> import pyecobee def resumeProgram(self, valuesDict): index = some_value resume_all = 'true' or 'false' # Presumably the options are true/false. There may be others. return self.pyecobee.resume_program(index, resume_all) def resume_program(self, index, resume_all="false"): ''' Resume currently scheduled program ''' url = '' header = {'Content-Type': 'application/json;charset=UTF-8', 'Authorization': 'Bearer ' + self.access_token} params = {'format': 'json'} body = ('{"functions":[{"type":"resumeProgram","params":{"resumeAll"' ':"' + resume_all + '"}}],"selection":{"selectionType"' ':"thermostats","selectionMatch":"' + self.thermostats[index]['identifier'] + '"}}') request = requests.post(url, headers=header, params=params, data=body) if request.status_code == requests.codes.ok: self._invalidate_cache() return request else: log.warning("Error connecting to Ecobee while attempting to resume" " program. Refreshing tokens...") self.refresh_tokens() bschollnick2 wrote The unofficial restful API is available from here (search for Restful). I haven't updated it in a while, but that's simply because I haven't needed to. viewtopic.php?f=33&t=8804 I certainly would welcome changes, improvements, and other suggestions. - Ben autolog wrote: ... There is an unofficial JSON RESTful API but I am not sure that is the way to go. ... freshwuzhere wrote: Hi Petervon, I looked here and found python code that appears to do what you want. It isn't in a plugin frame work but it looks like most of the hard work has been done to stream and interpret the data. From this starting point (I am making the BIG assumption this code is doing what you want done on the mate3 side) the plugin to place this data into indigo device states that can be used by indigo would be possible I am pretty sure. Not sure my skill levels are up to commercial levels for this nor that I'd have time to do anything in the near future but I'm happy to help you where I can - it won't be before January tho. The big challenge is debugging without a Mate3 unit present (this I think would make it nearly impossible) - the good news I am installing a solar and standby generator unit at my house early next year and every chance it will be a Mate 3 controller! Ian
https://forums.indigodomo.com/feed.php?f=119
CC-MAIN-2019-22
refinedweb
1,365
54.42
Some errors in a program I'm developing Hi all, I'm using the book C++-GUI-Programming-with-Qt-4-2nd Edition, and trying to create a spreadsheet application. That application occupies two chapters (3 and 4) of that book and I have prepared the files and codes in a project named MainWindow. There are some errors and I want to pose one of them each time so that I will make the app run successfully finally. Thanks for your help. The first error says the following in the main.cpp file: C:\Users\Abbasi\Documents\Qt\MainWindow\MainWindow\main.cpp:8: error: 'QSplashScreen' was not declared in this scope QSplashScreen splash = new QSplashScreen; ^* What .cppor .hfile should I check and remove the error please? Hi, To be able to use 'QSplashScreen ' you have to include it like this : #include <QSplashScreen> LA Thank you. The issue is solved. I have another error belonging to two functions, loadModules()and establishConnections(), lines 20 and 24 of the screenshot. They say: C:\Users\Abbasi\Documents\Qt\MainWindow\MainWindow\main.cpp:21: error: 'loadModules' was not declared in this scope loadModules(); ^ C:\Users\Abbasi\Documents\Qt\MainWindow\MainWindow\main.cpp:25: error: 'establishConnections' was not declared in this scope establishConnections(); ^ I looked the functions here to find the header files to include, but didn't find. - mrjj Lifetime Qt Champion @tomy said in Some errors in a program I'm developing: establishConnections loadModules() I think they are part of the sample. Not Qt. But seems not to be included in the book ?!? Maybe they are in the full source code Update: Nope. The source does not contain those calls at all. I made those two functions be comments because they don't seem to be needed to the app. My other error in mainwindow.cppis this. The error: C:\Users\Abbasi\Documents\Qt\MainWindow\MainWindow\mainwindow.cpp:26: error: 'setWindowIdon' was not declared in this scope Although I included the QIconheader file, the problem still exists. :( @tomy said in Some errors in a program I'm developing: setWindowIdon Hi, You have a typo: it's setWindowIcon. Yes, I had many other typos too. :) I corrected them. Thanks. Now the compiler shows only one error which belongs to the void MainWindow::sort()function in mainwindow.cpp. There are two codes in the book each with its error! The first code is: void MainWindow::sort() { SortDialog dialog(this); QTableWidgetSelectionRange range = spreadsheet -> selectedRange(); dialog.setColumnRange('A' + range.leftColumn(), 'A' + range.rightColumn()); if(dialog.exec()) spreadsheet -> performSort(dialog.comparisonObject()); } The errors: error: 'class Spreadsheet' has no member named 'performSort' spreadsheet -> performSort(dialog.comparisonObject()); error: 'class SortDialog' has no member named 'comparisonObject' spreadsheet -> performSort(dialog.comparisonObject()); The second code: void MainWindow::sort() { SortDialog dialog(this); dialog.setSpreadsheet(spreadsheet); dialog.exec(); } And the error: error: 'class SortDialog' has no member named 'setSpreadsheet' dialog.setSpreadsheet(spreadsheet); The errors are clear. The invoked functions don't exist in the corresponding classes. But why has the author written such codes? And how to solve them please? What is the implementation of SortDialog ? It's sortdialog.cpp: #include <QtWidgets> #include "sortdialog.h" SortDialog::SortDialog(QWidget* parent) : QDialog(parent) { setupUi(this); secondaryGroupBox -> hide(); tertiaryGroupBox -> hide(); layout() -> setSizeConstraint(QLayout::SetFixedSize); setColumnRange('A', 'Z'); } //************************************************* void SortDialog::setColumnRange(QChar first, QChar last) { primaryColumnCombo -> clear(); secondaryColumnCombo -> clear(); tertiaryColumnCombo -> clear(); secondaryColumnCombo -> addItem(tr("None")); tertiaryColumnCombo -> addItem(tr("None")); primaryColumnCombo -> setMinimumSize( secondaryColumnCombo -> sizeHint()); QChar ch = first; while(ch <= last) { primaryColumnCombo -> addItem(QString(ch)); secondaryColumnCombo -> addItem(QString(ch)); tertiaryColumnCombo -> addItem(QString(ch)); ch = ch.unicode() + 1; } } It has no setSpreadsheet function. So why has the book written that function for use!? :( Isn't it rather the FilterDialog class and the function is initFromSpreadsheet ? - mrjj Lifetime Qt Champion Hi When such errors, why dont you check with the supplied source code ? The spreadsheet is chap03. Hi, Thank you. I ran the supplied code and with some modifications it worked successfully. Now I'm at the beginning of chapter 5. The spreadsheet program is of chapters 3 and 4. Honestly speaking the code is very huge for a learner of Qt "at this point". although I have good experience of C++, it still needs much work to master the code completely. It contains more than 1500 lines of code!! Since my goal is continuing Qt, I think I should by no way omit this subject and should completely understand the application. It's vast but I want to start it by reading and thinking about the codes for each header and .cpp file there. Do you agree? Do you want to add some comment for helping me? Thanks.
https://forum.qt.io/topic/81879/some-errors-in-a-program-i-m-developing/6
CC-MAIN-2019-26
refinedweb
765
51.44
CHANGES¶ 0.15 (2016-07-18)¶ Removal & Deprecations¶ Removed: morepath.autosetupand morepath.autocommitare both removed from the Morepath API. Use autoscan. Also use new explicit App.commitmethod, or rely on Morepath automatically committing during the first request. So instead of: morepath.autosetup() morepath.run(App()) you do: morepath.autoscan() App.commit() # optional morepath.run(App()) Removed: the morepath.securitymodule is removed, and you cannot import from it anymore. Change imports from it to the public API, so go from: from morepath.security import NO_IDENTITY to: from morepath import NO_IDENTITY Deprecated morepath.remember_identityand morepath.forget_identityare both deprecated. Use the morepath.App.remember_identityand morepath.App.forget_identitymethods, respectively. Instead of remember_identity(response, request, identity, lookup=request.lookup) ... morepath.forget_identity(response, request, lookup=request.lookup) you do: request.app.remember_identity(response, request, identity) ... request.app.forget_identity(response, request) Deprecated morepath.settingsis deprecated. Use the morepath.App.settingsproperty instead. Deprecated morepath.enable_implicitand morepath.disable_implicitare both deprecated. You no longer need to choose between implicit or explicit lookup for generic functions, as the generic functions that are part of the API have all been deprecated. Features¶ - Factored out new App.mounted_app_classes()class method which can be used to determine the mounted app classes after a commit. This can used to get the argument to dectate.query_toolif the commit is known to have already been done earlier. - The morepath.runfunction now takes command-line arguments to set the host and port, and is friendlier in general. - Add App.init_settingsfor pre-filling the settings registry with a python dictionary. This can be used to load the settings from a config file. - Add a resetmethod to the Requestclass that resets it to the state it had when request processing started. This is used by more.transactionto reset request processing when it retries a transaction. Cleanups¶ - Cleanups and testing of reifyfunctionality. - More doctests in the narrative documentation. - A few small performance tweaks. - Remove unused imports and fix pep8 in core.py. 0.14 (2016-04-26)¶ New We have a new chat channel available. You can join us by clicking this link: Please join and hang out! We are retiring the (empty) Freenode #morepath channel. Breaking change: Move the basic auth policy to more.basicauthextension extension. Basic auth is just one of the authentication choices you have and not the default. To update code, make your project depend on more.basicauthand import BasicAuthIdentityPolicyfrom more.basicauth. Breaking change: Remove some exception classes that weren’t used: morepath.error.ViewError, morepath.error.ResolveError. If you try to catch them in your code, just remove the whole exceptstatement as they were never raised. Deprecated Importing from morepath.securitydirectly. We moved a few things from it into the public API: enable_implicit, disable_implicit, remember_identity, forget_identity, Identity, IdentityPolicy, NO_IDENTITY. Some of these were already documented as importable from morepath.security. Although importing from morepath.securitywon’t break yet, you should stop importing from it and import directly from morepathinstead. Deprecated morepath.autosetupand morepath.autocommitare both deprecated. Use autoscan. Also use new explicit App.commitmethod, or rely on Morepath automatically committing during the first request. So instead of: morepath.autosetup() morepath.run(App()) you do: morepath.autoscan() App.commit() # optional morepath.run(App()) Breaking change Extensions that imported RegRegistrydirectly from morepath.appare going to be broken. This kind of import: from morepath.app import RegRegistry needs to become: from morepath.directive import RegRegistry This change was made to avoid circular imports in Morepath, and because Appdid not directly depend on RegRegistryanymore. Breaking change: the variablesfunction for the pathdirective has to be defined taking a first objargument. In the past it was possible to define a variablesfunction that took no arguments. This is now an error. Introduce a new commitmethod on Appthat commits the App and also recursively commits all mounted apps. This is more explicit than autocommitand less verbose than using the lower-level dectate.commit. Automatic commit of the app is done during the first request if the app wasn’t committed previously. See issue #392. Introduce a deprecation warnings (for morepath.security, morepath.autosetup) and document how a user can deal with such warnings. Adds host header validation to protect against header poisoning attacks. See You can use morepath.HOST_HEADER_PROTECTIONin your own tween factory to wrap before or under it. Refactor internals of publishing/view engine. Reg is used more effectively for view lookup, order of some parameters is reversed for consistency with public APIs. Document the internals of Morepath, see implementation document. This includes docstrings for all the internal APIs. The framehack module was merged into autosetup. Increased the coverage to this module to 100%. New cookiecutter template for Morepath, and added references in the documentation for it. See Test cleanup; scan in many tests turns out to be superfluous. Issue #379 Add a test that verifies we can instantiate an app before configuration is done. See issue #378 for discussion. Started doctesting some of the docs. Renamed RegRegistry.lookupto RegRegistry.caching_lookupas the lookupproperty was shadowing a lookup property on reg.Registry. This wasn’t causing bugs but made debugging harder. Refactored link generation. Introduce a new defer_class_linksdirective that lets you defer link generation using Request.class_link()in addition to Request.link(). This is an alternative to defer_links, which cannot support Request.class_link. Morepath now has extension API docs that are useful when you want to create your own directive and build on one of Morepath’s registries or directives. A friendlier morepath.runthat tells you how to quit it with ctrl-C. A new document describing how to write a test for Morepath-based applications. Document how to create a Dectate-based command-line query tool that lets you query Morepath directives. Uses the topological sort implementation in Dectate. Sort out a mess where there were too many TopologicalSortErrorclasses. 0.13.2 (2016-04-13)¶ - Undid change in 0.13.1 where Appcould not be instantiated if not committed, as ran into real-world code where this assumption was broken. 0.13.1 (2016-04-13)¶ Enable queries by the Dectate query tool. Document scanfunction in API docs. Work around an issue in Python where ~(tilde) is quoted by urllib.quote& urllib.encode, even though it should not be according to the RFC, as ~is considered unreserved. Document some tricks you can do with directives in a new “Directive tricks” document. Refactor creation of tweens into function on TweenRegistry. Update the REST document; it was rather old and made no mention of body_model. Bail out with an error if an App is instantiated without being committed. 0.13 (2016-04-06)¶ Breaking change. Morepath has a new, extensively refactored configuration system based on dectate and importscan. Dectate is an extracted, and heavily refactored version of Morepath’s configuration system that used to be in morepath.configmodule. It’s finally documented too! Dectate and thus Morepath does not use Venusian (or Venusifork) anymore so that dependency is gone. Code that uses morepath.autosetupshould still work. Code that uses morepath.setupand scans and commits manually needs to change. Change this: from morepath import setup config = morepath.setup() config.scan(package) config.commit() into this: import morepath morepath.scan(package) morepath.autocommit() Similarly config.scan()without arguments to scan its own package needs to be rewritten to use morepath.scan()without arguments. Anything you import directly now does not need to be scanned anymore; the act of importing a module directly registers the directives with Morepath, though as before they won’t be active until you commit. But scanning something you’ve imported before won’t do any harm. The signature for morepath.scanis somewhat different than that of the old config.scan. There is no third argument recursive=Trueanymore. The onerrorargument has been renamed to handle_errorand has different behavior; the importscan documentation describes the details. If you were writing tests that involve Morepath, the old structure of the test was: import morepath def test_foo(): config = morepath.setup() class App(morepath.App): testing_config = config ... use directives on App ... config.commit() ... do asserts ... This now needs to change to: import morepath def test_foo(): class App(morepath.App): pass ... use directives on App ... morepath.commit([App]) ... do asserts ... So, you need to use the morepath.commit()function and give it a list of the application objects you want to commit, explicitly. morepath.autocommit()won’t work in the context of a test. If you used a test that scanned code you need to adjust it too, from: import morepath import some_package def test_foo(): config = morepath.setup() config.scan(some_package) config.commit() ... do asserts ... to this: import morepath import some_package def test_foo(): morepath.scan(some_package) morepath.commit([some_package.App]) ... do asserts ... Again you need to be explicit and use morepath.committo commit those apps you want to test. If you had a low-level reference to app.registryin your code it will break; the registry has been split up and is now under app.config`. If you want access to lookupyou can use app.lookup. If you created custom directives, the way to create directives is now documented as part of the dectate project. The main updates you need to do are: subclass from dectate.Action instead of morepath.Directive. no more appfirst argument. no supercall is needed anymore in __init__. add a configclass variable to declare the registries you want to affect. Until we break up the main registry this is: from morepath.app import Registry ... config = { 'registry': Registry } reverse the arguments to perform, so that the object being registered comes first. So change: def perform(self, registry, obj): ... into: def perform(self, obj, registry): ... But instead of registryuse the registry you set up in your action’s config. no more prepare. Do error checking inside the performmethod and raise a DirectiveErrorif something is wrong. If you created sub-actions from prepare, subclass from dectate.Composite instead and implement an actionsmethod. group_keymethod has changed to group_classclass variable. If you were using morepath.sphinxextto document directives using Sphinx autodoc, use dectate.sphinxextinstead. Breaking change If you want to use Morepath directives on @staticmethod, you need to change the order in which these are applied. In the past: @App.path(model=Foo, path='bar') @staticmethod def get_foo(): .... But now you need to write: @staticmethod @App.path(model=Foo, path='bar') def get_foo(): .... Breaking change You cannot use a Morepath pathdirective on a @classmethoddirectly anymore. Instead you can do this: class Foo(object): @classmethod def get_something(): pass @App.path('/', model=Something)(Foo.get_something) Breaking change. Brought app.settings back, a shortcut to the settings registry. If you use settings, you need to replace any references to app.registry.settingsto app.settings. Add request.class_link. This lets you link using classes instead of instances as an optimization. In some cases instantiating an object just so you can generate a link to it is relatively expensive. In that case you can use request.class_link instead. This lets you link to a model class and supply a variables dictionary manually. Breaking change. In Morepath versions before this there was an class attribute on Appsubclasses called registry. This was a giant mixed registry which subclassed a lot of different registries used by Morepath (reg registry, converter registry, traject registry, etc). The Dectate configuration system allows us to break this registry into a lot of smaller interdependent registries that are configured in the configof the directives. While normally you shouldn’t be, if you were somehow relying on App.registryin your code you should now rewrite it to use App.config.reg_registry, App.config.setting_registry, App.config.path_registryetc. Ability to absorb paths entirely in path directive, as per issue #132. Refactor of config engine to make Venusian and immediate config more clear. Typo fix in docs (Remco Wendt). Get version number in docs from setuptools. Fix changelog so that PyPI page generates HTML correctly. Fix PDF generation so that the full content is generated. Ability to mark a view as internal. It will be available to request.view()but will give 404 on the web. This is useful for structuring JSON views for reusability where you don’t want them to actually show up on the web. A request.child(something).view()that had this view in turn call a request.view()from the context of the somethingapplication would fail – it would not be able to look up the view as lookups still occurred in the context of the mounting application. This is now fixed. (thanks Ying Zhong for reporting it) Along with this fix refactored the request object so it keeps a simple mounted)
http://morepath.readthedocs.io/en/0.15/changes.html
CC-MAIN-2017-22
refinedweb
2,079
53.17
import Discussion from 'flarum/models/Discussion' attribute(name: String, transform: function): * Generate a function which returns the value of the given attribute. hasMany(name: String): Array | Boolean Generate a function which returns the value of the given has-many relationship. hasOne(name: String): Model | Boolean | undefined Generate a function which returns the value of the given has-one relationship. transformDate(value: String): Date | null Transform the given value into a Date object. getIdentifier(model: Model): Object Get a resource identifier object for the given model. data: Object The resource object from the API. exists: Boolean Whether or not the resource exists on the server. freshness: Date The time at which the model's data was last updated. Watching the value of this property is a fast way to retain/cache a subtree if data hasn't changed. store: Store The data store that this resource should be persisted to. attribute(attribute: String): * Get one of the model's attributes. copyData(): * delete(data: Object, options: Object): Promise Send a request to delete the resource. id(): Integer Get the model's ID. pushAttributes(attributes: Object) Merge new attributes into this model locally. pushData(data: Object) Merge new data into this model locally. save(attributes: Object, options: Object): Promise Merge new attributes into this model, both locally and with persistence. apiEndpoint(): String Construct a path to the API endpoint for this resource.
https://api.flarum.dev/js/v0.1.0-beta.9/class/src/common/models/Discussion.js~Discussion.html
CC-MAIN-2019-43
refinedweb
229
50.43
How To Make a Catapult Shooting Game with Cocos2D and Box2D Part 2 This is a blog post by iOS Tutorial Team member Gustavo Ambrozio, a software engineer with over 20 years experience, including over three years of iOS experience. He is the founder of CodeCrop Software. You can also find him on Google+. This is the second part of a two part tutorial series where we’ll build a cool catapult type game from scratch using Cocos2D and Box2D! In the first part of the series, we added the catapult into the scene, with the ability to shoot dangerous acorns. In this second and final part of the series, we’re going to flesh this out into a complete game, and add targets to shoot at and game logic. If you don’t have it already, grab the sample project where we left it off in the last tutorial. Without further ado, let’s get shooting! Creating Targets The targets creation won’t be anything very complicated as it’s mostly what you already know. Since we’re gonna have to add a bunch of targets let’s create a method to create one body and then we can call this method a bunch of times. First let’s create a few variables to keep track of our new bodies. In the .h file add these variables: NSMutableSet *targets; NSMutableSet *enemies; Go back to the implementation file and add the releases to the dealloc before we forget: [targets release]; [enemies release]; Then add a helper method to create a target right above resetGame: - (void)createTarget:(NSString*)imageName atPosition:(CGPoint)position rotation:(CGFloat)rotation isCircle:(BOOL)isCircle isStatic:(BOOL)isStatic isEnemy:(BOOL)isEnemy { CCSprite *sprite = [CCSprite spriteWithFile:imageName]; [self addChild:sprite z:1]; b2BodyDef bodyDef; bodyDef.type = isStatic?b2_staticBody:b2_dynamicBody; bodyDef.position.Set((position.x+sprite.contentSize.width/2.0f)/PTM_RATIO, (position.y+sprite.contentSize.height/2.0f)/PTM_RATIO); bodyDef.angle = CC_DEGREES_TO_RADIANS(rotation); bodyDef.userData = sprite; b2Body *body = world->CreateBody(&bodyDef); b2FixtureDef boxDef; if (isCircle) { b2CircleShape circle; circle.m_radius = sprite.contentSize.width/2.0f/PTM_RATIO; boxDef.shape = &circle; } else { b2PolygonShape box; box.SetAsBox(sprite.contentSize.width/2.0f/PTM_RATIO, sprite.contentSize.height/2.0f/PTM_RATIO); boxDef.shape = &box; } if (isEnemy) { boxDef.userData = (void*)1; [enemies addObject:[NSValue valueWithPointer:body]]; } boxDef.density = 0.5f; body->CreateFixture(&boxDef); [targets addObject:[NSValue valueWithPointer:body]]; } The method has a lot of parameters because we’ll have different types of targets and different ways of adding them to the scene. But don’t worry, it’s pretty simple, let’s go over it bit by bit. First we load the sprite using the file name we pass to the method. To make it easier to position the objects the position we pass to the method is the position of the bottom left corner of where we want the target. Since the position Box2d uses is the center position we have to use the sprite’s size to set the position of the body. We then define the body’s fixture depending on the desired shape we want. It can be a circle (for the enemies mostly) or a rectangle. Again the size of the fixture is derived from the sprite’s size. Then, if this is an enemy (enemies will “explode” later on and I want to keep track of them to know if the level is over) I add it to the enemies set and set the fixture userData to 1. The userData is usually set to a struct or a pointer to another object but in this case we just want to “tag” these fixtures as being enemies’ fixtures. Why we need this will become clear when I show you how to detect if an enemy should be destroyed. We then create the body’s fixture and add it to an array of targets so we can keep track of them. Now it’s time to call this method a bunch of times to make complete our scene. This is a very big method because I have to call the createTarget method for every object I want to add on the scene. Here are the sprites we’ll be using on the scene: Now all we have to do is place these at the right positions. I got these by trial and error, but you can just use these premade positions! :] Add the following method after createTarget: - (void)createTargets { [targets release]; [enemies release]; targets = [[NSMutableSet alloc] init]; enemies = [[NSMutableSet alloc] init]; // First block [self createTarget:@"brick_2.png" atPosition:CGPointMake(675.0, FLOOR_HEIGHT) rotation:0.0f isCircle:NO isStatic:NO isEnemy:NO]; [self createTarget:@"brick_1.png" atPosition:CGPointMake(741.0, FLOOR_HEIGHT) rotation:0.0f isCircle:NO isStatic:NO isEnemy:NO]; [self createTarget:@"brick_1.png" atPosition:CGPointMake(741.0, FLOOR_HEIGHT+23.0f) rotation:0.0f isCircle:NO isStatic:NO isEnemy:NO]; [self createTarget:@"brick_3.png" atPosition:CGPointMake(672.0, FLOOR_HEIGHT+46.0f) rotation:0.0f isCircle:NO isStatic:NO isEnemy:NO]; [self createTarget:@"brick_1.png" atPosition:CGPointMake(707.0, FLOOR_HEIGHT+58.0f) rotation:0.0f isCircle:NO isStatic:NO isEnemy:NO]; [self createTarget:@"brick_1.png" atPosition:CGPointMake(707.0, FLOOR_HEIGHT+81.0f) rotation:0.0f isCircle:NO isStatic:NO isEnemy:NO]; [self createTarget:@"head_dog.png" atPosition:CGPointMake(702.0, FLOOR_HEIGHT) rotation:0.0f isCircle:YES isStatic:NO isEnemy:YES]; [self createTarget:@"head_cat.png" atPosition:CGPointMake(680.0, FLOOR_HEIGHT+58.0f) rotation:0.0f isCircle:YES isStatic:NO isEnemy:YES]; [self createTarget:@"head_dog.png" atPosition:CGPointMake(740.0, FLOOR_HEIGHT+58.0f) rotation:0.0f isCircle:YES isStatic:NO isEnemy:YES]; // 2 bricks at the right of the first block [self createTarget:@"brick_2.png" atPosition:CGPointMake(770.0, FLOOR_HEIGHT) rotation:0.0f isCircle:NO isStatic:NO isEnemy:NO]; [self createTarget:@"brick_2.png" atPosition:CGPointMake(770.0, FLOOR_HEIGHT+46.0f) rotation:0.0f isCircle:NO isStatic:NO isEnemy:NO]; // The dog between the blocks [self createTarget:@"head_dog.png" atPosition:CGPointMake(830.0, FLOOR_HEIGHT) rotation:0.0f isCircle:YES isStatic:NO isEnemy:YES]; // Second block [self createTarget:@"brick_platform.png" atPosition:CGPointMake(839.0, FLOOR_HEIGHT) rotation:0.0f isCircle:NO isStatic:YES isEnemy:NO]; [self createTarget:@"brick_2.png" atPosition:CGPointMake(854.0, FLOOR_HEIGHT+28.0f) rotation:0.0f isCircle:NO isStatic:NO isEnemy:NO]; [self createTarget:@"brick_2.png" atPosition:CGPointMake(854.0, FLOOR_HEIGHT+28.0f+46.0f) rotation:0.0f isCircle:NO isStatic:NO isEnemy:NO]; [self createTarget:@"head_cat.png" atPosition:CGPointMake(881.0, FLOOR_HEIGHT+28.0f) rotation:0.0f isCircle:YES isStatic:NO isEnemy:YES]; [self createTarget:@"brick_2.png" atPosition:CGPointMake(909.0, FLOOR_HEIGHT+28.0f) rotation:0.0f isCircle:NO isStatic:NO isEnemy:NO]; [self createTarget:@"brick_1.png" atPosition:CGPointMake(909.0, FLOOR_HEIGHT+28.0f+46.0f) rotation:0.0f isCircle:NO isStatic:NO isEnemy:NO]; [self createTarget:@"brick_1.png" atPosition:CGPointMake(909.0, FLOOR_HEIGHT+28.0f+46.0f+23.0f) rotation:0.0f isCircle:NO isStatic:NO isEnemy:NO]; [self createTarget:@"brick_2.png" atPosition:CGPointMake(882.0, FLOOR_HEIGHT+108.0f) rotation:90.0f isCircle:NO isStatic:NO isEnemy:NO]; } Pretty simple stuff – just calls our helper method for each target we want to add. Now add this to that bottom of the resetGame method: [self createTargets]; If you run the project now you won’t be able to see this part of the scene unless you throw a bullet at it. So just until we have the scene figured out, let’s add a line to the end of the init method to make it easier for us to check of the scene is as we envisioned: self.position = CGPointMake(-480, 0); This will show us the right half of the scene instead of the left half. Now run the project and you should see the scene of targets! You can play a little with the scene before moving on to the next step if you want. For example, comment out the 2 bricks at the right of the first block and run the project again and see what happens. Now remove the line that changes the position from the init method and run again. Now throw a bullet at the targets and watch the destruction! Cool! The squirrel attack is underway! Rapid Fire Before we move on to do some collision detection let’s add some code to attach another bullet after we throw one just so we can make some more destruction. Add a new method called resetBullet above resetGame to do this: - (void)resetBullet { if ([enemies count] == 0) { // game over // We'll do something here later } else if ([self attachBullet]) { [self runAction:[CCMoveTo actionWithDuration:2.0f position:CGPointZero]]; } else { // We can reset the whole scene here // Also, let's do this later } } On this method we first check to see if we destroyed all the enemies. This won’t happen now as we’re still not destroying the enemies but let’s prepare for this already. If there still are enemies, we try to attach another bullet. Remember that the attachBullets method returns YES if there are more bullets to attach and NO otherwise. So, if there are more bullets I run a cocos2d action that resets the position of the view to the left half of the scene so I can see my catapult again. If there are no more bullets we’ll have to reset the whole scene, but this will come later on. Let’s have some fun first. We now have to call this method at an appropriate time. But what is this appropriate time. Maybe when the bullet finally stops moving after we released it? Maybe a few seconds after we hit the first target? Well, that’s all open for discussion. To keep things simple for now, let’s call this method a few seconds after we release the bullet. As you remember we do this on the tick method when we destroy the weld joint. So go to that method and find the DestroyJoint call we added and add this line right after: [self performSelector:@selector(resetBullet) withObject:nil afterDelay:5.0f]; This will wait 5 seconds and then call resetBullet. Now run the project and watch the mayhem! One last thing for this section. The mayhem is not very natural in my opinion because of one little detail: the objects that collide with the right border of the scene all stay there as if leaning against a wall but there’s no wall there in our world. The objects should fall to the right of the scene but they don’t. This happens because when we build our world (well, actually this came with the initial cocos2d project) we added fixtures to the 4 corners of the scene. We now can see that the right corner probably should not exist. So go to the init method and remove this lines: // remove these lines under the comment "right" groundBox.SetAsEdge(b2Vec2(screenSize.width*2.0f/PTM_RATIO,screenSize.height/PTM_RATIO), b2Vec2(screenSize.width*2.0f/PTM_RATIO,0)); groundBody->CreateFixture(&groundBox,0); Now run the project again. It should be a little more natural. Well, as natural as a world of war hungry squirrels, anyway. The repository tag for this point in the tutorial is TargetsCreation. It’s Raining Cats and Dogs We’re almost there! All we need now is a way to detect that the enemies should be destroyed. We can do this using collision detection but there’s a little problem with a simple collision detection. Our enemies are already colliding with the blocks so simply detecting if the enemies are colliding with something is not enough because the enemies would be destroyed right away. We could say that for the enemies to be destroyed they have to collide with a bullet. This would be very easy to do but then some enemies would be very hard to destroy. Take the dogs between the two blocks on our scene. It’s very hard to hit it with a bullet but it’s not hard if we throw one of the blocks at it. But we already established that a simple collision with the blocks is not going to work. What we can do is try to determine the strength of the collision and then determine that we have to destroy an enemy based on a minimum strength. To do this using Box2d we have to create a contact listener. Ray already explained how to create one during the second part of the breakout game tutorial. So if you haven’t read the tutorial or don’t remember it go ahead and read at least the beginning of this second part. I’ll wait…. There will be some differences though. First we will use a std::set instead of a std::vector. The difference is that the set does not allow duplicate entries so if we have multiple impacts on a target we don’t have to worry about adding them twice to our list. Another difference is that we’ll have to use the postSolve method as this is where we’ll be able to retrieve the impulse of a contact and thus determine if we have to destroy an enemy. Control-click on your main classes folder and choose New File. Click iOS\C and C++ on the left, choose “C++ file”, and click Next. Name your file MyContactListener.cpp, and click Save. If it created a .h for you too you’re set, otherwise repeat the above but select “Header File” to create a header file called MyContactLister.h as well. Open the newly created MyContactLister.h and add this code: #import "Box2D.h" #import <set> #import <algorithm> class MyContactListener : public b2ContactListener { public: std::set<b2Body*); }; This is almost the same thing as Ray did except for a set instead of a vector. Next go to MyContactListener.cpp file and add this: #include "MyContactListener.h" MyContactListener::MyContactListener() : contacts() { } MyContactListener::~MyContactListener() { } void MyContactListener::BeginContact(b2Contact* contact) { } void MyContactListener::EndContact(b2Contact* contact) { } void MyContactListener::PreSolve(b2Contact* contact, const b2Manifold* oldManifold) { } void MyContactListener::PostSolve(b2Contact* contact, const b2ContactImpulse* impulse) { bool isAEnemy = contact->GetFixtureA()->GetUserData() != NULL; bool isBEnemy = contact->GetFixtureB()->GetUserData() != NULL; if (isAEnemy || isBEnemy) { // Should the body break? int32 count = contact->GetManifold()->pointCount; float32 maxImpulse = 0.0f; for (int32 i = 0; i < count; ++i) { maxImpulse = b2Max(maxImpulse, impulse->normalImpulses[i]); } if (maxImpulse > 1.0f) { // Flag the enemy(ies) for breaking. if (isAEnemy) contacts.insert(contact->GetFixtureA()->GetBody()); if (isBEnemy) contacts.insert(contact->GetFixtureB()->GetBody()); } } } As I mentioned we only implement the PostSolve method. First we determine if the contact we’re processing involves at least one enemy. Remember on the createTarget method that we “tagged” the enemies using the fixture’s userData? That’s why we did it. See, I told you you’d understand soon. Every contact can have one or more contact points and every contact point has a normal impulse. This impulse is basically the force of the contact. We then determine the maximum impact force and determine if this should destroy the enemy. If we determine we should destroy the enemy we add the body object to our set so we can destroy it later. Remember that, as Ray said on his tutorial, we can’t destroy the enemy’s body during the contact processing. So we hold this on our set and will process it later. The value I used as the impulse that should destroy the enemy is something you’ll have to test for yourself. This will vary depending on the masses of the objects, the speed the bullet is impacting and some other factors. My suggestion is to start small and increase the value to determine what’s an acceptable value for your gameplay. Now that we have our listener code let’s instantiate and use it. Go back to HelloWorldLayer.h and add the include of our new C++ class to the imports: #import "MyContactListener.h" And add a variable to hold our listener: MyContactListener *contactListener; No go to the implementation file and add this o the end of the init method: contactListener = new MyContactListener(); world->SetContactListener(contactListener); Now we have to add some code to actually destroy the enemies. Again this is going to be at the end of the tick method: // Check for impacts std::set<b2Body*>::iterator pos; for(pos = contactListener->contacts.begin(); pos != contactListener->contacts.end(); ++pos) { b2Body *body = *pos; CCNode *contactNode = (CCNode*)body->GetUserData(); [self removeChild:contactNode cleanup:YES]; world->DestroyBody(body); [targets removeObject:[NSValue valueWithPointer:body]]; [enemies removeObject:[NSValue valueWithPointer:body]]; } // remove everything from the set contactListener->contacts.clear(); We simply iterate though the set of our contact listener and destroy all the bodies and their associated sprites. We also remove them from the enemies and targets NSSet so we can determine if we have eliminated all the enemies. Finally we clear the contact listener’s set to make it ready for the next time tick gets called and so that we don’t try to destroy those bodies again. Go ahead and run the game. I promise you it’s even cooler now! But you can say there’s something missing here. Something that really tell us we destroyed those freaking enemies. So let’s add some polish to our game and make these little squirrel haters explode. Cocos2d will make it very easy to do this using particles. I won’t go into a lot of details here since this topic can even have a tutorial of it’s own. If you want to dig deeper on this topic you can have a look at Chapter 14 of Rod and Ray’s Cocos2d book. In the meantime I’ll show you how to do this and how to try out other cocos2d built-in particles. Let’s change the inside of the loop we just added to this: b2Body *body = *pos; CCNode *contactNode = (CCNode*)body->GetUserData(); CGPoint position = contactNode.position; [self removeChild:contactNode cleanup:YES]; world->DestroyBody(body); [targets removeObject:[NSValue valueWithPointer:body]]; [enemies removeObject:[NSValue valueWithPointer:body]]; CCParticleSun* explosion = [[CCParticleSun alloc] initWithTotalParticles:200]; explosion.autoRemoveOnFinish = YES; explosion.startSize = 10.0f; explosion.speed = 70.0f; explosion.anchorPoint = ccp(0.5f,0.5f); explosion.position = position; explosion.duration = 1.0f; [self addChild:explosion z:11]; [explosion release]; We first store the position of the enemy’s sprite so we know where to add the particle. Then we add an instance of CCParticleSun in this position. Pretty easy right? Go ahead and run the game! Pretty cool, right? CCParticleSun is one of many pre-configured CCParticleSystem sub-classes that comes with cocos2d. Command-click on CCParticleSun in Xcode and you’ll be taken to the CCParticlesExamples.m file. This file has a lot of sub-classes of CCParticleSystem that you can experiment with. And you may think that CCParticleExplosion would look better for us but you’d be wrong, at least in my opinion. But go ahead and try it out with a bunch of particle systems and see what happens. One thing that I sneaked up on you is the texture file used on this particle. If you look inside the code for CCParticleSun you’ll notice it uses a file called fire.png. This file was already added to the project some time ago when we added all the image files. The repository tag for this point in the tutorial is EnemiesExploding. Finishing Touches Before we wrap this up let’s add a way to reset everything in case we run out of bullets or enemies. This is gonna be pretty easy as we have most of our scene creation in separate methods anyway. The best way to reset our game would be to call resetGame. But if you simply do this you’ll end up with a bunch of old targets and enemies on your scene. So we’ll have to add some cleanup to our resetGame method to take care of this. Fortunately we have kept references of everything so it’s gonna be pretty easy. So go ahead and add this to the beginning of the resetGame method: // Previous bullets cleanup if (bullets) { for (NSValue *bulletPointer in bullets) { b2Body *bullet = (b2Body*)[bulletPointer pointerValue]; CCNode *node = (CCNode*)bullet->GetUserData(); [self removeChild:node cleanup:YES]; world->DestroyBody(bullet); } [bullets release]; bullets = nil; } // Previous targets cleanup if (targets) { for (NSValue *bodyValue in targets) { b2Body *body = (b2Body*)[bodyValue pointerValue]; CCNode *node = (CCNode*)body->GetUserData(); [self removeChild:node cleanup:YES]; world->DestroyBody(body); } [targets release]; [enemies release]; targets = nil; enemies = nil; } This is pretty simple. We just go through the sets we have and remove the bodies and the associated sprites from the scene. The conditional is because we will not have the sets defined the first time we call this method because we didn’t create anything yet. Now let’s call resetGame at the appropriate times. If you remember we left some conditions blank on our resetBullet method. Well, this is the appropriate place. So go there and replace the two comments we left about doing something later for this: [self performSelector:@selector(resetGame) withObject:nil afterDelay:2.0f]; Run the game and you’ll see that when the enemies or the bullets run out the game will reset and you’ll be able to play it again without having to re-run the project. Let’s add just one more nice little detail to our game. When the game starts you can’t see the targets so you don’t know what you have to destroy. Let’s fix this, again, changing something on resetGame. At the end of resetGame we call 3 methods: [self createBullets:4]; [self attachBullet]; [self attachTargets]; Let’s change this a bit and add some action: [self createBullets:4]; [self createTargets]; [self runAction:[CCSequence actions: [CCMoveTo actionWithDuration:1.5f position:CGPointMake(-480.0f, 0.0f)], [CCCallFuncN actionWithTarget:self selector:@selector(attachBullet)], [CCDelayTime actionWithDuration:1.0f], [CCMoveTo actionWithDuration:1.5f position:CGPointZero], nil]]; Now we’ll create the bullets and targets and then start a sequence of actions. These actions will run one after the other. The first will move our scene to the right so we can see our targets. When this movement finishes we’ll call the method that attaches the bullet. This will make the bullet get attached when we’re not seeing it so we’ll avoid the very crude attachment we have now. Then we’ll wait a second so you can get your strategy straight. And finally… we’ll move back to the left so you can start the destruction! Want More? I had a blast working on this tutorial, and everyone I showed it to really liked it (or are all really nice to me!) If you guys are interested, I’d love to keep working on this some more and make a full “Catapult Game Starter Kit” for sale on this site, kind of like the Space Game Starter Kit. The full Catapult Game Starter Kit would take the above tutorial and game and expand it to include the following features: - Adding finger scrolling to review the scene - New artwork and enemies! - Sound effects, music, and animation! - Tons polish to make the game feel better - Using LevelHelper to easily create multiple levels - Adding a neat level selection scene - Adding a title scene and main menu - Creating power ups - Scores and Game Center support! - Anything else you guys want (post if you have an idea!) Before I put the time and energy into creating this though, I’d like to check if this is something you’re interested in. Could you please answer the following poll to let me know if this is something you’d like? [poll id=”20″] It’s OK if you’re not interested, so please answer honestly! I enjoy working on this but have plenty of other stuff to keep me busy :] Where To Go From Here? The repository tag for this point in the tutorial is FinalTouches. You can download the whole project here or get it at any point here. What a trip right? From a few block to some destruction and flying acorns in no time. If you feel adventurous and want to work on this code some more there are some known issues that are somewhat easy to solve and that can be a good exercise. Check out the issues page of the repository. If you have any questions or comments or want to join in on improving this game, please join+.
https://www.raywenderlich.com/4787/how-to-make-a-catapult-shooting-game-with-cocos2d-and-box2d-part-2
CC-MAIN-2017-26
refinedweb
4,063
55.95
Created attachment 589588 [details] [diff] [review] close file descriptors Several users have been confused by and have reported to us 'Failed to create drawable' messages from Mesa. It's also a bit confusing to have the glxtest process dump a XPCOM strings leak log. closing these file descriptors does cause some 'EBADF' errors but afaics it shouldn't matter. Also in the same patch, a little cleanup of the code determining the filename of the GL library. Comment on attachment 589588 [details] [diff] [review] close file descriptors Review of attachment 589588 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/xre/glxtest.cpp @@ +112,5 @@ > { > + // close stdout and stderr to prevent spurious output from the GL from appearing in the terminal. > + // in particular, Mesa "Failed to create drawable" messages have repeatedly confused people. > + close(STDOUT_FILENO); > + close(STDERR_FILENO); Using something like: int fd = open("/dev/null", O_RDONLY); dup2(fd, STDOUT_FILENO); dup2(fd, STDERR_FILENO); close(fd); will avoid the EBADF errors. err, O_WRONLY instead of O_RDONLY, obviously. In fact, you should probably do so for any file descriptor < fd, because XPCOM leaks log may be set to use a file and will pollute there. The code proposed in comment 1 and comment 2 does remove the EBADF, but printf then generates ENOTTY errors as explained there: The idea of comment 3 is neat but seems hard to implement in a portable way: Whatever we do here, being low-maintenance should be the first criterion... (In reply to Benoit Jacob [:bjacob] from comment #4) > The code proposed in comment 1 and comment 2 does remove the EBADF, but > printf then generates ENOTTY errors as explained there: This doesn't happen here on a small testcase. Does it still happen if you fflush(stdout) and fflush(stderr) before dup2()ing? > The idea of comment 3 is neat but seems hard to implement in a portable way: > >- > descriptor The code doesn't need to be very portable, since it's X11 specific. Moreover, we don't need to care about getting the highest allocated file descriptor. We only care about trying to close the xpcom logging ones, which, in all likeliness, are below "fd" (the value we get from opening /dev/null) #include <stdio.h> #include <unistd.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int main() { int fd = open("/dev/null", O_WRONLY); fprintf(stderr, "after open, errno=%d\n", errno); fflush(stdout); dup2(fd, STDOUT_FILENO); fprintf(stderr, "after dup2, errno=%d\n", errno); close(fd); fprintf(stderr, "after close, errno=%d\n", errno); printf("hello\n"); fprintf(stderr, "after printf, errno=%d\n", errno); } Output: $ g++ a.cpp -o a && ./a after open, errno=0 after dup2, errno=0 after close, errno=0 after printf, errno=25 Ok, so it wasn't happening on my small test because i was doing a printf before setting stdout to /dev/null, and that doesn't do ENOTTY. Another interesting thing, if just do a main() { printf() } kind of program and run it redirected to /dev/null (./a > /dev/null), it does ENOTTY as well. So it shouldn't matter much. Is there a reason to believe that EBADF is more of a problem than ENOTTY? anyway, patch coming. Created attachment 593178 [details] [diff] [review] redirect all file descriptors to null Comment on attachment 593178 [details] [diff] [review] redirect all file descriptors to null Review of attachment 593178 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/xre/glxtest.cpp @@ +61,5 @@ > > +#ifdef LINUX > +#include <sys/types.h> > +#include <sys/stat.h> > +#endif What do you need these for? r+ with these removed. They just were mentioned by the open(2) man page, and I seem to remember something like that on Fedora 13 a while ago, but I could be wrong. A version without these includes is now on try: ah, you may need them for the third argument to open, when creating a file, to use macros instead of hardcoding octal values. for normal uses fnctl.h is enough. You were right, these includes weren't needed.
https://bugzilla.mozilla.org/show_bug.cgi?id=719164
CC-MAIN-2016-26
refinedweb
669
64.41
On Wed, Apr 18, 2012 at 03:19:34PM -0300, Mauro Carvalho Chehab wrote:> The edac_align_ptr() function is used to prepare data for a single> memory allocation kzalloc() call. It counts how many bytes are needed> by some data structure.> > Using it as-is is not that trivial, as the quantity of memory elements> reserved is not there, but, instead, it is on a next call.> > In order to avoid mistakes when using it, move the number of allocated> elements into it, making easier to use it.> > Cc: Aristeu Rozanski <arozansk@redhat.com>> Cc: Doug Thompson <norsk5@yahoo.com>> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>> ---> > v14: fixes a badly-solved rebase conflict, uses NULL instead of 0, adds more comments> and renames the counter for the number of structures to "count"> > drivers/edac/edac_device.c | 27 +++++++++++----------------> drivers/edac/edac_mc.c | 31 +++++++++++++++++++++++--------> drivers/edac/edac_module.h | 2 +-> drivers/edac/edac_pci.c | 6 +++---> 4 files changed, 38 insertions(+), 28 deletions(-)> > diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c> index 4b15459..cb397d9 100644> --- a/drivers/edac/edac_device.c> +++ b/drivers/edac/edac_device.c> @@ -79,7 +79,7 @@ struct edac_device_ctl_info *edac_device_alloc_ctl_info(> unsigned total_size;> unsigned count;> unsigned instance, block, attr;> - void *pvt;> + void *pvt, *p;> int err;> > debugf4("%s() instances=%d blocks=%d\n",> @@ -92,35 +92,30 @@ struct edac_device_ctl_info *edac_device_alloc_ctl_info(> * to be at least as stringent as what the compiler would> * provide if we could simply hardcode everything into a single struct.> */> - dev_ctl = (struct edac_device_ctl_info *)NULL;> + p = NULL;> + dev_ctl = edac_align_ptr(&p, sizeof(*dev_ctl), 1);> > /* Calc the 'end' offset past end of ONE ctl_info structure> * which will become the start of the 'instance' array> */> - dev_inst = edac_align_ptr(&dev_ctl[1], sizeof(*dev_inst));> + dev_inst = edac_align_ptr(&p, sizeof(*dev_inst), nr_instances);> > /* Calc the 'end' offset past the instance array within the ctl_info> * which will become the start of the block array> */> - dev_blk = edac_align_ptr(&dev_inst[nr_instances], sizeof(*dev_blk));> + count = nr_instances * nr_blocks;> + dev_blk = edac_align_ptr(&p, sizeof(*dev_blk), count);> > /* Calc the 'end' offset past the dev_blk array> * which will become the start of the attrib array, if any.> */> - count = nr_instances * nr_blocks;> - dev_attrib = edac_align_ptr(&dev_blk[count], sizeof(*dev_attrib));> -> - /* Check for case of when an attribute array is specified */> - if (nr_attrib > 0) {> - /* calc how many nr_attrib we need */> + /* calc how many nr_attrib we need */> + if (nr_attrib > 0)> count *= nr_attrib;> + dev_attrib = edac_align_ptr(&p, sizeof(*dev_attrib), count);> > - /* Calc the 'end' offset past the attributes array */> - pvt = edac_align_ptr(&dev_attrib[count], sz_private);> - } else {> - /* no attribute array specificed */> - pvt = edac_align_ptr(dev_attrib, sz_private);> - }> + /* Calc the 'end' offset past the attributes array */> + pvt = edac_align_ptr(&p, sz_private, 1);> > /* 'pvt' now points to where the private data area is.> * At this point 'pvt' (like dev_inst,dev_blk and dev_attrib)> diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c> index ffedae9..775a3ff 100644> --- a/drivers/edac/edac_mc.c> +++ b/drivers/edac/edac_mc.c> @@ -101,16 +101,28 @@ const char *edac_mem_types[] = {> };> EXPORT_SYMBOL_GPL(edac_mem_types);> > -/* 'ptr' points to a possibly unaligned item X such that sizeof(X) is 'size'.> +/**> + * edac_align_ptr - Prepares the pointer offsets for a single-shot allocation> + * @p: pointer to a pointer with the memory offset to be used. At> + * return, this will be incremented to point to the next offset> + * @size: Size of the data structure to be reserved> + * @count: Number of elements that should be reserved> + *> + * 'ptr' points to a possibly unaligned item X such that sizeof(X) is 'size'.There's no 'ptr' argument anymore. Also, the text doesn't apply anymoresince the ptr is not possibly unaligned but the returned pointer *p isproperly aligned to size * count.Also, this pointer is absolutely needed to keep the proper advancingfurther in memory to the proper offsets when allocating the struct alongwith its embedded structs, as edac_device_alloc_ctl_info() does itabove, for example.> * Adjust 'ptr' so that its alignment is at least as stringent as what the> * compiler would provide for X and return the aligned result.> *> * If 'size' is a constant, the compiler will optimize this whole function> - * down to either a no-op or the addition of a constant to the value of 'ptr'.> + * down to either a no-op or the addition of a constant to the value of '*p'.> + *> + * At return, the pointer 'p' will be incremented.> */> -void *edac_align_ptr(void *ptr, unsigned size)> +void *edac_align_ptr(void **p, unsigned size, int count)'count' is non-descriptive and at least ambiguous as to what it relatesto - call it 'n_elems' instead.> {> unsigned align, r;> + void *ptr = *p;> +> + *p += size * count;> > /* Here we assume that the alignment of a "long long" is the most> * stringent alignment that the compiler will ever provide by default.> @@ -132,6 +144,8 @@ void *edac_align_ptr(void *ptr, unsigned size)> if (r == 0)> return (char *)ptr;> > + *p += align - r;> +> return (void *)(((unsigned long)ptr) + align - r);> }In general, this edac_align_ptr is not really helpful because it requresthe caller to know the exact layout of the struct it allocates memoryfor and what structs it has embedded. And frankly, I don't know how muchit would help but I hear unaligned pointers are something bad on some!x86 architectures.Oh well...--
http://lkml.org/lkml/2012/4/23/260
CC-MAIN-2016-07
refinedweb
835
58.32
You. Previous Part: ClassesNext Part: Fixed Point Getting Started For this tutorial, we’ll be using the same template from the 2nd tutorial: The Problem with Arrays You have already been introduced to arrays in Part 10. Arrays allow you to store a list of values: int x[10], y[10]; float speed[10]; Obviously, you can conquer the world with arrays alone. However, sometimes they are not the most efficient solution to a problem. To illustrate this, let’s start with a small game of snake. Open the game.cpp source file in Visual Studio and replace the Game::Tick method with the following code: int x[8] = { 5, 6, 7, 8, 9, 10, 11, 12 }; int y[8] = { 8, 8, 8, 8, 8, 8, 8, 8 }; int heading = 0; int delta[8] = { 1, 0, 0, 1, -1, 0, 0, -1 }; void Game::Tick( float deltaTime ) { screen->Clear( 0 ); for ( int i = 0; i < 7; i++ ) { x[i] = x[i + 1], y[i] = y[i + 1]; screen->Box( x[i] * 8, y[i] * 8, x[i] * 8 + 6, y[i] * 8 + 6, 0xffffff ); } x[7] += delta[heading * 2], y[7] += delta[heading * 2 + 1]; if (GetAsyncKeyState( VK_LEFT )) heading = (heading + 3) % 4; if (GetAsyncKeyState( VK_RIGHT )) heading = (heading + 1) % 4; Sleep( 100 ); } You will need to add the windows.h header file for the Sleep and GetAsyncKeyState functions: #include <windows.h> That’s pretty short, isn’t it? I do think it requires some explanation though. The snake is represented by eight squares, stored in arrays. Element 0 is the tail, and 7 is the head of the snake. To move the snake forward, a heading is used: 0 is east, 1 is south, 2 is west and 3 is north. The snake thus starts by moving east. All snake segments are supposed to follow the lead of the head (element 7), so we replace the position of each segment by the position of the next segment. This happens in the for loop, which also draws the snake. Next, the head is placed on a new position, based on the current heading. A little trick is used here: array delta contains eight numbers: each pair is a movement in x and y direction. So, looking at the first two elements, we conclude that x[7] is increased by 1 for east, and y[7] is increased by 0. And finally, the heading is controlled by the player, using two: All you need to do after this is setting; int delta[8] = { 1, 0, 0, 1, -1, 0, 0, -1 }; int head = 7, tail = 0; void Game::Tick(float deltaTime) { screen->Clear(0); for (int i = 0; i < 8; i++) screen->Box(x[i] * 8, y[i] * 8, x[i] * 8 + 6, y[i] * 8 + 6, 0xffffff); int headx = x[head] + delta[heading * 2]; int heady = y[head] + delta[heading * 2 + 1]; just a small example of a smart trick to reduce the amount of work that your computer has to do. There are data structures for many different things: for huge arrays that have just a few useful values, for searching through endless piles of values, for stacking values so that you can retrieve them in the opposite order, and so on. Often, a data structure is the key to game performance. You’ve just added the first of many to your arsenal. Assignment Basic - Get rid of the for loop altogether. Just paint the tail in black (color of the background), and the head at the new position. Note: you will not want to clear the screen for every frame. - Add food (blue square) at position ( 20, 15). When the snake eats it, let the snake grow, and put new food at position ( 4, 4). Intermediate - Add a boundary around the screen and check for collisions with this boundary. - Also check for collisions between the head and the body of the snake. Hint: you can do this with a tile map, but it’s perhaps easier to just read the colour of a pixel at the new position of the head. Advanced - Complete the game: print the current score (the number of food pellets eaten), add new food at a random position whenever it has been eaten, restart the game when the snake dies (when the snake hits the edge of the screen or a part of its own body). Previous Part: ClassesNext Part: Fixed Point
https://www.3dgep.com/cpp-fast-track-13-data-structures/
CC-MAIN-2021-10
refinedweb
736
75.03
Writing Backward-Compatible Schema Migrations - How and Why? Your app is running happily on its own without major glitches. What happens when business requirements changed and you are now required to update your database schema? In this article, I'll be discussing several caveats that demand our attention when making schema changes in an app which is already been up and serving users. I'd also share some techniques I'd used to eliminate those risks. The concepts and ideas of making backward-compatible schema changes should be universal regardless of programming languages and frameworks, I'll be using Python Django to illustrate my points. I'll be starting off with a simple scenario, which you are required to update a schema by renaming name to first_name and adding a last_name column as shown below: You may be thinking: "Well, isn't this a straight forward renaming and column addition? How difficult could it be"?. Yes, it is merely a simple schema change, but no, It is much more than that! Making the schema changes recklessly leads you to paralysing bugs Risks When Renaming Columns Unless you are renaming a column right after creating it, or the column hasn't been deployed to production yet, you are most likely walking on a thin line. The first thing that needs to be solved is references to the column. If you are using statically typed language and an ORM, lucky you! This will most likely be caught during compilation time. However, in my situation, I was using Python with Django, referencing errors may not be caught if test coverage is insufficient. So, what can you do to eliminate the potential of referencing error when renaming a column? Naive Solution: Do A Global Search And Replace In most code editors and IDE, you can trigger a global search (or find all) using the keyboard shortcut Ctrl/Cmd + Shift + F. This may allow you to quickly replace all references to name in the codebase but will only work if: - the table profilehasn't been created in the production environment - the app is self-contained, be it a mobile or desktop app - it is a web service but is not consumed by any other app yet Why? If your app is providing web services, you will most likely be using Blue/Green deployment. If you are not familiar with this deployment strategy, it is basically used to ensure there's no downtime when switching from older to a newer version of your app. With it, it is very likely that, for a brief moment, both older and newer versions are running simultaneously. In that case, users may experience weird or even fatal errors during the transition phase. If your app is exposing APIs for other applications (frontend, third party apps, etc), it is almost impossible to ensure all consumer apps are updated to reflect the changes made in the schema at the same time. Thus, the existence of multiple versions will most probably be happening too. Those problems are not easily caught during testing, but is a prevalent problem. So, what is the better solution here? A Better Approach: Ensuring Backward-Compatibility You may have guessed it, a better solution is to ensure schema changes are backward compatible. But, how? What's better than showing some code? The following snippet is a Python Django ORM model representing our profiles table: import uuid from django.db import models class Profile(models.Model): pid = models.CharField(primary_key=True, default=uuid.uuid4) preferred_name = models.CharField(max_length=256) name = models.CharField(max_length=256) Remember, your task is to rename name to first_name, and to add a new column named First, let's rename the column from name to class Profile(models.Model): # ... first_name = models.CharField(max_length=256) # Renamed from `name` To make sure any references made to name still works, you can leverage class property here: class Profile(models.Model): # ... first_name = models.CharField(max_length=256) # Renamed from `name` def name(self): return self.first_name def name(self, value): self.first_name = value By adding a class property name, along with a setter that proxies to your new column name first_name. Any code attempting to access or update name should still work. Personally, I'd also suggest you emit a warning message to inform the developer of such schema change: # ... import logging logger = logging.getLogger(__name__) class Profile(models.Model): # ... first_name = models.CharField(max_length=256) # Renamed from `name` def name(self): logger.warning("The property `name` is renamed to `first_name`.") return self.first_name def name(self, value): # Emit similar warning message self.first_name = value Some of you may also notice the warning mechanism can be better implemented using a decorator, but that is beyond the scope of this article. Up to this point, your code should work harmoniously with referrers pointing to both name and first_name. Hooray 🎉 ? Not so soon... 😅 Risks When Adding New Columns Don't forget, you are also adding a new column last_name to your profiles table. Adding a new column is relatively less complex than modifying existing ones. However, it is often being neglected that any new columns being added to an existing table should be nullable in most circumstances. Why? - Existing code consumers won't have any knowledge of a new column is added. Any attempt to create a new record/row in the table would result in ConstraintError/ not-null violationif the new column is not nullable ( NOT NULL) Let's go ahead and add the new column: class Profile(models.Model): # ... first_name = models.CharField(max_length=256) # Renamed from `name` last_name = models.CharField(max_length=256, null=True) # New, nullable column def name(self): return self.first_name def name(self, value): self.first_name = value Yay! With such implementation, you won't break any clients ignorant of the added column. To mitigate the loss of the null constraint checker in your database, you can implement similar logic in your application code instead. Summary To sum up, when making schema changes, we should always: - think about existing code consumers and team members working on the same codebase - ensure changes are gradually done and all code users are well-informed - ensure code references to both old and new column names are supported - ensure new columns added to any existing table are nullable I hope this article helps. Thumb-ups and claps would definitely drive me further. Have fun hacking!
https://melvinkoh.me/writing-backward-compatible-schema-migrations-how-and-why-ck8bei7a700ojres1iv0pqpjb?guid=none&deviceId=ffa51e09-f502-4c6c-8142-635dc651629d
CC-MAIN-2020-45
refinedweb
1,060
55.13
We figured they were more actual guidelines. -- Pirates of the Caribbean Macros are wonderful things. I love macros. They're exciting and dangerous. Every time I write a macro I salivate at the power I am wielding. It's like using a blowtorch. It is perhaps no coincidence that many coding standards put big warning signs around macroland. "Consider carefully before using macros", some say. "When considering using a macro, see if you can use an inline function instead," some say. "Macros are frequent sources of bugs," some say. "C++ has evolved to the point where, with inline functions and templates, macros are no longer necessary". Heresy. All absolutely true, and yet heresy nonetheless. It is true that there are many bugs out there due to misuse of macros. And yet only a few simple tips are necessary to prevent misuse of macros: (The problem is that the tips don't always get followed). She generally gave herself very good advice, (though she very seldom followed it) -- Alice in Wonderland Let's talk about the "no expressions with side effects" rule a little more. It is OK to do things like if (SUCCEEDED(CoInitialize(...))) { ... } if (FAILED(CoCreateInstance(...))) { ... } return HRESULT_FROM_WIN32(GetLastError()); ... but for different reasons. SUCCEEDED(...) and FAILED(...) only evaluate their arguments once, as can be verified from their definitions in winerror.h. I'm using the Vista RTM version of winerror.h: //// Generic test for success on any status value (non-negative numbers// indicate success).//#define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0)//// and the inverse//#define FAILED(hr) (((HRESULT)(hr)) < 0) Note the heavy (and correct) use of parentheses. I still personally don't think it's a good idea to rely on this, since macros have a habit of changing... but I won't ding anyone on a code review for it. HRESULT_FROM_WIN32(GetLastError()) is OK for a totally different reason. HRESULT_FROM_WIN32(...), classically, does evaluate its argument multiple times... this time I'm using the Windows 2000 version of winerror.h: #define HRESULT_FROM_WIN32(x) (x ? ((HRESULT) (((x) & 0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000)) : 0 ) ... so this looks like a bug... until you realize that GetLastError() is idempotent. If you call it a bunch of times in a row on the same thread, it will (per its contract) always return the same value. Note that the macro is not completely parenthesized! The bold x is missing its protective parentheses. This was fixed in a Windows 2000 service pack. For example, here's the Win2K SP3 version: #define HRESULT_FROM_WIN32(x) ((HRESULT)(x) <= 0 ? ((HRESULT)(x)) : ((HRESULT) (((x) & 0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000))) Much better. I'm still personally leery of using side effects in HRESULT_FROM_WIN32 though. Why? Because it sets a bad precedent. It's easier to have a simple rule (no side effects in a macro call!) than to remember for an infinitude of macros and function calls which macros evaluate the arguments multiple times and which function calls really have side effects. You also get legitimate bugs like this. Macros, macros, macros... you deviate just a little bit from the straight-and-narrow and what happens? You get blown out of the water. Wonderful things, macros. Nasty little bugs arising from harmless-looking violations of the safety tips are the cause of the dirty secret I am about to reveal... As of Vista RTM... HRESULT_FROM_WIN32 is NO LONGER a macro! This is one of those annoying little facts I try so hard to forget because they complicate life unnecessarily. From my point of view, there is no bad consequence of treating HRESULT_FROM_WIN32 as the macro it looks like (and was... and who knows, may be again.) The inline function it has become is uniformly safer. This has apparently been a long time in coming. Here are some excerpts of winerror.h from various releases of Windows: Windows 2000 RTM: Windows XP RTM: // __HRESULT_FROM_WIN32 will always be a macro.// The goal will be to enable INLINE_HRESULT_FROM_WIN32 all the time,// but there's too much code to change to do that at this time.#define __HRESULT_FROM_WIN32(x) ((HRESULT)(x) <= 0 ? ((HRESULT)(x)) : ((HRESULT) (((x) & 0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000)))#ifdef INLINE_HRESULT_FROM_WIN32#ifndef _HRESULT_DEFINED#define _HRESULT_DEFINEDtypedef long HRESULT;#endif#ifndef __midl__inline HRESULT HRESULT_FROM_WIN32(long x) { return x < 0 ? (HRESULT)x : (HRESULT) (((x) & 0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000);}#else#define HRESULT_FROM_WIN32(x) __HRESULT_FROM_WIN32(x)#endif#else#define HRESULT_FROM_WIN32(x) __HRESULT_FROM_WIN32(x)#endif Whew. The net result is that HRESULT_FROM_WIN32 is a macro. Oh, unless you decide to be avant-garde and #define INLINE_HRESULT_FROM_WIN32 before you #include <winerror.h>. Which probably very few people did, except for build engineers running experiments. So this is an "opt-in" inline function. Windows Vista RTM: //// HRESULT_FROM_WIN32(x) used to be a macro, however we now run it as an inline function// to prevent double evaluation of 'x'. If you still need the macro, you can use __HRESULT_FROM_WIN32(x)//#define __HRESULT_FROM_WIN32(x) ((HRESULT)(x) <= 0 ? ((HRESULT)(x)) : ((HRESULT) (((x) & 0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000)))#if !defined(_HRESULT_DEFINED) && !defined(__midl)#define _HRESULT_DEFINEDtypedef __success(return >= 0) long HRESULT;#endif#ifndef __midlFORCEINLINE HRESULT HRESULT_FROM_WIN32(unsigned long x) { return (HRESULT)(x) <= 0 ? (HRESULT)(x) : (HRESULT) (((x) & 0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000);}#else#define HRESULT_FROM_WIN32(x) __HRESULT_FROM_WIN32(x)#endif The experiments appear to have been completed. Apparently no imaginable consequence of changing to an inline function was worse than the known consequence of bugs. People who want the macro can still use __HRESULT_FROM_WIN32. Why would you want to? Hmmm... maybe you're building a switch statement. Something like: #define CASE_HRESULT(x) case x: return #x#define CASE_ERR(x) case HRESULT_FROM_WIN32(x): return #x // need __HRESULT_FROM_WIN32 here?LPCSTR FriendlyNameOf(HRESULT hr) { switch(hr) { CASE_HRESULT(S_OK); CASE_HRESULT(S_FALSE); ... many more... CASE_ERR(ERROR_SUCCESS); CASE_ERR(ERROR_INVALID_FUNCTION); ... } return "Unrecognized";} LPCSTR FriendlyNameOf(HRESULT hr) { switch(hr) { CASE_HRESULT(S_OK); CASE_HRESULT(S_FALSE); ... many more... CASE_ERR(ERROR_SUCCESS); CASE_ERR(ERROR_INVALID_FUNCTION); ... } return "Unrecognized";} I haven't tried it out, but I suspect the compiler will reject the attempt to squeeze the result of an inline function into the value of a case, but will accept a complicated expression involving a bunch of constants (i.e., the macro will work.) Insight is a tricky thing. To a certain degree people are born with it (or without it) - but if you are gifted with a measure of it, you can develop it (as though it were a muscle) by working at it. The late mathematician George Pólya had a number of helpful problem-solving mottos, one of which is the title of this post. There's a nice echo in the chess world, where the maxim "If you see a good move, wait - look for a better one!" is popular (as is the simpler version, "Sit on your hands!") The granddaddy of them all is William of Ockham's "entia non sunt multiplicanda praeter necessitatem"... AKA, Occam's [sic] Razor. KISS, as they say. What am I going on about? In the Computer Science world, it happens very often that your first idea... though it works... is inferior to your second idea. A great tragedy that is played over and over is: I'm exaggerating a bit by calling this a great tragedy. It's also a perfectly good development strategy to begin coding with the knowledge that you will probably come back and redo a large chunk of what you're doing as you become more familiar with the problem domain. The key words here are "with the knowledge"... if you know that what you're coding is experimental, you can avoid a lot of scheduling Sturm und Drang. Bottom line: it happens frequently that a good idea has a better one as a sequel. Keep your eyes open... are you solving a specific case when you could, with less work, solve the general problem? Look at your fixed code fresh - are you introducing another problem with the fix? Is there a more appropriate way to fix the problem? Is it better to fix the symptom instead of the disease? Stop and think. Even if you don't find a better way, it's good exercise for your noodle. There are several ways to get a number that represents "the time right now." Some of them wrap; some of them don't. Some that wrap: Some that don't: A common programming meme is to start an operation and then wait for it to complete... but give up after a certain preset "timeout." There are multi-threaded ways of doing this that are perhaps better, but for better or worse, there is a fair amount of code out there that looks like this: StartSomething();while ( ! Done() ) { if ( BeenWaitingTooLong(Timeout) ) { break; } WaitABit();}if ( Done() ) { Great();} else { Darn();}For this post I want to focus on the BeenWaitingTooLong(Timeout) snippet emphasized above. If the timing function being used wraps, it is all too easy to get this to work most of the time... when it's just as easy to get it to work all of the time. Alas, the consequences of software that works most of the time tend to be more severe than software that never works.I wouldn't last long in the banking business being accurate most of the time! -- The Music ManI'll use GetTickCount() for these examples, but I want to emphasize that the same malady affects all of the wrappy time counters. Here are some different ways to do it: StartSomething();DWORD msTimeout = 10 * 1000; // give up after ten secondsDWORD msAtStart = GetTickCount();// assume Done() always returns within, say, a daywhile ( ! Done() ) { if ( // most of the time, these are the same. // which one will always work? // GetTickCount() - msAtStart > msTimeout // GetTickCount() - msTimeout > msAtStart // GetTickCount() > msAtStart + msTimeOut ) { break; } // assume that WaitABit() always returns within, say, a day WaitABit();}if ( Done() ) { Great();} else { Darn();} The correct answer is: GetTickCount() - msAtStart > msTimeout The other two will work most of the time, but will occasionally fail. There's an easy rule I use to always remember the right one. When dealing with a clock that wraps, only compare intervals. Allow me to redecorate my variable names using Joel Spolsky's "Making Wrong Code Look Wrong" technique. StartSomething();DWORD intervalTimeout = 10 * 1000; // give up after ten secondsDWORD instantStart = GetTickCount();// assume Done() always returns within, say, a daywhile ( ! Done() ) { if ( // which one will always work? // GetTickCount() - instantAtStart > intervalTimeout // GetTickCount() - intervalTimeout > instantAtStart // GetTickCount() > instantAtStart + intervalTimeout ) { break; } // assume that WaitABit() always returns within, say, a day WaitABit();}if ( Done() ) { Great();} else { Darn();} Some thought experiments immediately fall out of this.
http://blogs.msdn.com/b/matthew_van_eerde/archive/2007/12.aspx?PostSortBy=MostViewed&PageIndex=1
CC-MAIN-2015-27
refinedweb
1,732
66.64
HsLua What is Lua? It's a scripting language (like Perl) targeted to be easily integrated into any host application. You can do it in literally 5 minutes. let's try: Contents Example 1: running Lua scripts First, you need to download and unpack the HsLua package: As usual, in order to build and install the package, run the usual commands: cabal configure cabal install Note that the lua version that is linked to can be changed via cabal flags: consult the package docs for details. The simplest work where Lua may be handy is in replacing application config files with scripts. This allows one to define complex data structures and utilize the power of a full-fledged programming your hands on values defined in such an unusual way: import Foreign.Lua main = runLua $ do openlibs dofile "configfile.lua" name <- getglobal "username" *> peek (-1) pwd <- getglobal "password" *> peek (-1) liftIO $ print (name::String, pwd::String) Voila! Are you finished in 5 minutes? :) What we are doing here? The command "openlibs" imports built-in Lua functions into this lua instance. Note that fresh Lua instances only have access to a dozen standard (arithmetic) operations. By careful selection of functions provided to the Lua instance, you can turn it into sandbox - e.g. disallow access to file system, network connections and so on, or provide special functions which can access only specific directory/host/whatever. The next operation, "dofile", runs script from file specified. This script defines the global variables "username" and "password". The function "getglobal" pushes the respective variable to the top of Lua's stack, which is used by Lua to communicate with external programs. We then turn the value at the top of the stack (i.e., at stack index (-1)) into a haskell value by using "peek". Example 2: calling from Haskell to Lua Now imagine that we need more complex config capable of providing for each site we have an account in its own user/pwd pair. We can write it either as the first Haskell program, the reading of variables with a call to the new function 'getuserpwd': (name,pwd) <- callFunc "getuserpwd" "mail.google.com" Foreign.Lua as Lua hsMove :: LuaInteger -> String -> Lua () hsMove (LuaInteger n) direction = do putStrLn $ "going " ++ show n ++ " step(s) " ++ direction main = runLua $ do Lua.registerHaskellFunction "move" hsMove Lua.dofile "game.lua" The only new call here is "registerHaskellFunction" which registers a Haskell function in with Lua instance. Please note that we may call any Lua function/procedure from Haskell (as we've done in previous example) and register any Haskell procedure in Lua as far as their arguments and results has simple enough types (lua numbers, strings, booleans, lists and maps; anything that can be pushed to and received from the Lua :) Exchanging data between Haskell and Lua worlds Lua variables have dynamic types. When we cast these values from/to Haskell world, they are mapped to the appropriate Haskell types. The type classes FromLuaStack and ToLuaStack cover Haskell types that can be casted from/to Lua values and defines the casting rules. Predefined class instances include LuaInteger, String, Bool, Text, [a], and Data.Map.Map a b for maps where a and b may be any type that's an instance of the respective type class again. Heterogenous data can be passed via hslua-aeson, treating Lua values as JSON-like data. HsLua includes two operations which just execute operators in context of a given Lua instance: dofile and dostring (executing contents of file and string, respectively). They return OK on success and an error code otherwise: dofile :: String -> Lua Status dostring :: String -> Lua Status The next important operation is callFunc. It calls a Lua function passing to it arbitrary number of arguments. -- the actual type is slightly different to simulate a variadic function. callfunc :: (ToLuaStack x1, x2 ... xn, FromLuaStack a) => String -> x1 -> x2 ... xn -> Lua a Finally, registerHaskellFunction operation registers in the Lua world any Haskell function/procedure that receives and returns values of StackValue types: registerHaskellFunction :: (FromLuaStack x1, x2 ... xn, ToLuaStack a) => String -> (x1 -> x2 ... xn -> Lua a) -> Lua () n ≥ 0, i.e. register/callfunc/callproc may also register/call functions having no arguments. a base on which you have to. - [LuaBinaryModules] If a a result, LuaBinaryModules allows users of your application to install any libraries they need just by copying their dll/so files into application directory. wxLua wxLua is a cross-platform (Windows, Linux, OSX) binding to wxWindows library, plus IDE written using this binding that supports debugging of Lua code and generation of Lua bindings to C libraries. So, you get a. The Lua part can be easily created/extended by less experienced users meaning that you may spend more time on implementing core algorithms. Isn't it beautiful?. Further reading [1] [2] [3] [4] [5]
http://wiki.haskell.org/HsLua
CC-MAIN-2021-10
refinedweb
801
55.03
It’s really easy to use GMail as an SMTP client: public class GoogleSmtpTest { public void SendEmailViaGmail() { var message = new MailMessage( "xxx@gmail.com", "yyy@joebloggs.com", "Hi via Google SMTP", "some body"); var client = new SmtpClient("smtp.gmail.com") { EnableSsl = true, Port = 587, Credentials = new NetworkCredential("xxx@gmail.com", "xxx's gmail password") }; client.Send(message); } } 3 comments: Do you know if it also works with Google Apps accounts? If you don't I plan to give it a go soon, so I'll get back either way. Yup, works fine with Google Apps for Domains. I like that- nice. Another thing many people don't realise is you can get the .NET mail API to write the mail out to a file, which is damn handy when testing:
http://mikehadlow.blogspot.com/2010/08/how-to-send-email-via-gmail-using-net.html
CC-MAIN-2017-34
refinedweb
130
76.93
import "github.com/ctessum/cdf" Package CDF provides facilities to read and write files in NetCDF 'classic' (V1 or V2) format. The HDF based NetCDF-4 format is not supported. The data model and the classic file format are documented at A NetCDF file contains an immutable header (this library does not support modifying it) that defines the layout of the data section and contains metadata. The data can be read, written and, if there exists a record dimension, appended to. To create a new file, first create a header, e.g.: h := cdf.NewHeader([]string{"time", "x", "y", "z"}, []int{0, 10, 10, 10}) h.AddVariable("psi", []string{"time", "x"}, float32(0)) h.AddAttribute("", "comment", "This is a test file") h.AddAttribute("psi", "description", "The value of psi as a function of time and x") h.AddAttribute("psi", "interesting_value", float32(42)) h.Define() ff, _ := os.Create("/path/to/file") f, _ := cdf.Create(ff, h) // writes the header to ff To use an existing file: ff, _ := os.Open("/path/to/file") f, _ := cdf.Open(ff) The Header field of f is now usable for inspection of dimensions, variables and attributes, but should not be modified (obvious ways of doing this will cause panics). To read data from the file, use r := f.Reader("psi", nil, nil) buf := r.Zero(100) // a []T of the right T for the variable. n, err := r.Read(buf) // similar to io.Read, but reads T's instead of bytes. And similar for writing. doc.go file.go header.go numrecs.go read.go strider.go write.go UpdateNumRecs determines the number of record from the file size and writes it into the file's header as the 'numrecs' field. Any incomplete trailing record will not be included in the count. Only valid headers will be updated. After a succesful call f's filepointer will be left at the end of the file. This library does not use the numrecs header field but updating it enables full bit for bit compatibility with other libraries. There is no need to call this function until after all updates by the program, and it is rather costly because it reads, parses and checks the entire header. func Create(rw ReaderWriterAt, h *Header) (*File, error) Create writes the header to a storage rw and returns a File usable for reading and writing. The header should not be mutable, and may be shared by multiple Files. Note that at every Create the headers numrec field will be reset to -1 (STREAMING). func Open(rw ReaderWriterAt) (*File, error) Open reads the header from an existing storage rw and returns a File usable for reading or writing (if the underlying rw permits). Fill overwrites the data for non-record variable named v with its fill value. Fill panics if v does not name a non-record variable. If the variable has a scalar attribute '_FillValue' of the same data type as the variable, it will be used, otherwise the type's default fill value will be used. FillRecord overwrites the data for all record variables in the r'th slab with their fill values. Create a reader that starts at the corner begin, ends at end. If begin is nil, it defaults to the origin (0, 0, ...). If end is nil, it defaults to the f.Header.Lengths(v). Create a writer that starts at the corner begin, ends at end. If begin is nil, it defaults to the origin (0, 0, ...). If end is nil and the variable is a record variable, writing can proceed past EOF and the underlying file will be extended. A CDF file contains a header and a data section. The header defines the layout of the data section. The serialized header layout is specified by "The NetCDF Classic Format Specification" A header read with ReadHeader can not be modified. A header created with NewHeader can be modified with AddVariable and AddAttribute until the call to Define. The NetCDF defined 'numrecs' field is ignored on reading and set to -1 ('STREAMING') on writing of the header, but can be read and written separately. Newheader constructs a new CDF header. dims and lengths specify the names and lengths of the dimensions. Invalid dimension or size specifications, repeated dimension names, as well as the occurence of more than 1 record dimension (size == 0) lead to panics. Until the call to h.Define() the version of the header will not be set, and the header will mutable, meaning it can be modified by AddAttribute or AddVariable. readHeader decodes the CDF header from the io.Reader at the current position. On success readHeader returns a header struct and a nil error. If an error occurs that prevents further reading, the reader is left at the error position and err is set to badMagic, badVersion, badTag, badLenght or badAttributeType, or the error from the underlying call to binary.Read. The returned header is immutable, meaning it may not be modified with AddVariable or AddAttribute. AddAttribute adds an attribute named a to a variable named v, or to the global attributes if v is the empty string. Use of a nonexistent variable name or an existent attribute name leads to a panic. The value can be of type []uint8, string, []int16, []int32, []float32 or []float64, and will be stored as NetCDF type BYTE, CHAR, SHORT, INT, FLOAT, DOUBLE resp. The header must be mutable, i.e. created by NewHeader, not by ReadHeader. AddVariable adds a variable of given type with the named dimensions to the header. Use of an existing variable name, or a nonexistent dimension name leads to a panic, as does use of the record dimension for any other than the first. The datatype is determined from the dynamic type of val, which may be one of []uint8, string, []int16, []int32, []float32 or []float64. Any other type will lead to a panic. The contents of val are ignored. The header must be mutable, i.e. created by NewHeader, not by ReadHeader. Variables returns a slice with the names of all attributes defined in the header, for variable v. If v is the empty string, returns all global attributes. Check verifies the integrity of the header: - at most one record dimension - no duplicate dimension names - no duplicate attribute names - no duplicate variable names - variable dimensions valid - only the first dimension can be the record dimension - offsets of non-variable records increasing, large enough and all before variable records - offset of variable records also increasing, large enough Define makes a mutable header immutable by calculating the variable offsets and setting the version number to V1 or V2, depending on whether the layout requires 64-bit offsets or not. Dimensions returns a slice with the names of the dimensions for variable v, all dimensions if v == "", or nil if v is not a valid variable. May panic on un-Check-ed headers. Return the fill value for the variable v. If the variable has a scalar attribute '_FillValue' of the same data type as the variable, it will be used, otherwise the type's default fill value will be used. GetAttribute returns the value of the attribute a of variable v or the global attribute a if v == "". The returned value is of type []uint8, string, []int16, []int32, []float32 or []float64 and should not be modified by the caller, as it is shared by all callers. IsRecordVariable returns true iff a variable named v exists and its outermost dimension is the header's (unique) record dimension. Lengths returns a slice with the lengths of the dimensions for variable v, all dimensions if v == "", or nil if v is not a valid variable. May panic on un-Check-ed headers. numRecs computes the number or records from the filesize, returns the real number of records. For fsize < 0, returns -1. String returns a summary dump of the header, suitable for debugging. Variables returns a slice with the names of all variables defined in the header. writeHeader encodes the CDF header to the io.Writer at the current position. If an error occurs that prevents further writing, the writer is left at the erroring position and err is set to the error from the underlying call to binary.Write. ZeroValue returns a zeroed slice of the type of the variable v of length n. If the named variable does not exist in h, Zero returns nil. For type CHAR, Zero returns an empty string. type Reader interface { // Read reads len(values.([]T)) elements from the underlying file into values. // // Values must be a slice of int{8,16,32} or float{32,64}, // corresponding to the type of the variable, with one // exception: A variable of NetCDF type CHAR must be read into // a []byte. Read returns the number of elements actually // read. if n < len(values.([]T)), err will be set. Read(values interface{}) (n int, err error) // Zero returns a slice of the appropriate type for Read // if n < 0, the slice will be of the length // that can be read contiguously. Zero(n int) interface{} } A reader is an object that can read values from a CDF file. A ReaderWriterAt is the underlying storage for a NetCDF file, providing {Read,Write}At([]byte, int64) methods. Since {Read,Write}At are required to not modify the underlying file pointer, one instance may be shared by multiple Files, although the documentation of io.WriterAt specifies that it only has to guarantee non-concurrent calls succeed. type Writer interface { // Write writes len(values.([]T)) elements from values to the underlying file. // // Values must be a slice of int{8,16,32} or float{32,64} or a // string, according to the type of the variable. if n < // len(values.([]T)), err will be set. Write(values interface{}) (n int, err error) } A writer is an object that can write values to a CDF file. Package cdf imports 7 packages (graph) and is imported by 3 packages. Updated 2018-12-01. Refresh now. Tools for package owners.
https://godoc.org/github.com/ctessum/cdf
CC-MAIN-2019-51
refinedweb
1,674
65.42
13 November 2012 16:42 [Source: ICIS news] HOUSTON (ICIS)--Tronox is confident that titanium dioxide (TiO2) pigment demand will improve next year, even as its 2012 third-quarter pigment sales fell by 30% and demand is expected to stay weak in the 2012 fourth quarter and the 2013 first quarter, the CEO of the US-based producer said on Tuesday. Tronox reported third-quarter pigment sales of $279.8m (€221.0m), down from $399.4m in the 2011 third quarter because of lower volumes, particularly in ?xml:namespace> “While demand for our pigment products has been weak, we believe the fundamental conditions underlying the demand for these products have begun to recover and we believe sales will begin to increase next year,” CEO Tom Casey told analysts during Tronox’s third-quarter results conference call. “We remain convinced that demand will recover in 2013, and we strongly believe that our vertically integrated structure gives us a material cost advantage,” he said. Casey said that Tronox’s customers in the paints, coatings and plastics industries have completed or soon will complete their destocking. Meanwhile, US housing and construction markets are gaining strength, and demand in “ In The stronger Chinese economy will boost Tronox’s direct TiO2 sales there. At the same time, Chinese TiO2 exports to Asia-Pacific and “This should have a positive effect on pricing in the region, into which that surplus [Chinese TiO2] supply has been shipped over the last year,” he said. Tronox’s margins will improve with higher plant utilisation rates and the benefits from its feedstock integration, Casey said. “As the market strengthens in the second half of 2013 and into 2014, we believe these advantages will contribute to a more rapid recovery and higher margins, cash flows and net income for us than other firms not similarly structured,” he said. However, ongoing short-term economic uncertainty prompted Tronox to hold back on paying out special dividends for the time being, Casey said. “We think there will be strengthening in the market in the second half of [2013], but we cannot predict what happens with the ‘fiscal cliff’ negotiations in the US, and what happens with Greece and Spain and other eurozone considerations, or what happens with the effects of the leadership transition in China,” he said. “The prudent course for us was to say, we are not going to [pay special dividends] now, and whether we will be doing it in the future will be a function of the cash we generate.” In June, Tronox had said it was considered issuing a special dividend as a way to return capital to shareholders. ($1 = €0.79) Additional reporting by Muhamad Fadhil in Singapore
http://www.icis.com/Articles/2012/11/13/9613699/us-tronox-confident-on-tio2-outlook-despite-q3-sales-decline.html
CC-MAIN-2013-48
refinedweb
449
52.53
Now, let's also ask the caller if she wants to talk to a real monkey. If she does, connect her to Koko, the famous Gorilla, whose phone number we happen to know is 310-555-1212 :) Here is our server file. We're going to add a second method to handle requests at. In the file below, add the highlighted lines to gather input from the caller. from __future__ import with_statement # Only necessary for Python 2.5 from flask import Flask, request, redirect from twilio.twiml.voice_response import VoiceResponse, Gather app = Flask(__name__) callers = { "+14158675309": "Curious George", "+14158675310": "Boots", "+14158675311": "Virgil", "+14158675312": "Marcel" } @app.route("/", methods=['GET', 'POST']) def hello_monkey(): from_number = request.values.get('From', None) if from_number in callers: caller = callers[from_number] else: caller = "Monkey" resp = VoiceResponse() # Greet the caller by name resp.say("Hello " + caller) # Play an mp3 resp.play("") # Say a command, and listen for the caller to press a key. When they press # a key, redirect them to /handle-key. g = Gather(numDigits=1, action="/handle-key", method="POST") g.say("To speak to a real monkey, press 1. Press any other key to start over.") resp.append(g) return str(resp) @app.route("/handle-key", methods=['GET', 'POST']) def handle_key(): """Handle key press from a user.""" # Get the digit pressed by the user digit_pressed = request.values.get('Digits', None) if digit_pressed == "1": resp = VoiceResponse() # Dial (310) 555-1212 - connect that number to the incoming caller. resp.dial("+13105551212") # If the dial fails: resp.say("The call failed, or the remote party hung up. Goodbye.") return str(resp) # If the caller pressed anything but 1, redirect them to the homepage. else: return redirect("/") if __name__ == "__main__": app.run(debug=True) The output of a request to your server at example.com will look like this: <?xml version="1.0" encoding="UTF-8"?> <Response> <Say>Hello Curious George</Say> <Play></Play> <Gather action="/handle-key" method="POST" numDigits="1"> <Say>To speak to a real monkey, press 1. Press any other key to start over.</Say> </Gather> </Response> When Twilio sees a <Gather> block, it starts looking for input from the caller's key pad. Because the <Say> is nested inside the <Gather>, Twilio will detect if the caller presses a key, even if the key is pressed while the <Say> is still running. When the caller presses a key, the pressed key is POSTed to the URL specified by the 'action' handler attribute of the <Gather> verb. In this case, the URL is /handle-key. You can read more about TwiML verbs and acceptable parameters in our TwiML Documentation. We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.
https://www.twilio.com/docs/quickstart/python/twiml/connect-call-to-second-person
CC-MAIN-2017-47
refinedweb
463
67.86
Caldera vs. Microsoft Goes to Jury Trial 141 aculeus writes "TechWeb reports that Judge Lee Benson has dismissed all eight of Microsoft's motions for summary judgment on antitrust grounds, clearing the path for a trial to begin in Utah on Jan. 17. " Yes, the other court battle, the one that doesn't get talked about as much. The judge's decision to go with a jury means that he thinks that Caldera has basis for their legal complaints - a good sign, I suppose. The case itself is based upon Caldera's ownership of DR-DOS and fighting with Microsoft over that. Re:Anti-Trust? huh? (Score:1) Re:MS Spokesman Summarizes, plus other great stuff (Score:1) Deliberately stifling a competing OS by altering a package they control so it will only work with an OS they control. So that's the definition of "tying"? Gotcha. That's anti-competitive behaviour, and while it may or may not be legal (up to the jury) it certainly sucks. Got it now? Well, I've always gotten the part about why it was a crummy (and not very intelligent) thing to do; I was just wondering why it's illegal, or at least civilly vulnerable. Re:lawyer: no, that's not what it means (Score:2) No, you are gravely wrong. It is much harder to buy of a judge than a whole jury, because... Juries are extremely fickle. Microsoft will try to sway the decision by arguing, not facts, but that MS is unfairly beaten upon. The jury will then decide that it's true, why *should* these companies be allowed to keep suing MS for being successful, and Microsoft will get a vafourable decision.-Brent -- Re:Relforn, I have read your posts in this thread (Score:1) Maybe not a shill for any particular interest. Re:No, no, no! (Score:1) But what those remedies would do -- and what I hope a combination of DoJ action and private lawsuits _will_ do -- is kill M$ _as it exists now_, as this giant rampaging monster crushing the rest of the computer industry. I wish Gary Kildall were here to see it Re:MS Spokesman Summarizes, plus other great stuff (Score:3) >What did they mean by "tying", as in what MS did >to DOS and Windows 3.1? U.S. antitrust law prohibits the "tying" of other goods to monopoly goods, even if the monopoly is legal. Tying is the refusal to by the monopoly good (DOS) unless the tied good (windows) is also purchased. . Only until you explain it. DR-DOS had 10% of the market, and growing. It worked better. What are the damages for stealing this? Ten per cent of today's desktop OS market? It's the remedies that really become interesting here. How do you put DR-DOS where it would have been? A full, royalty-free, license to all windows source code? An ownership interest in ms to reflect that share of the OS market--which would then be tripled (as an anti-trust verdict)? Or perhaps just 10% (before trippling) of microsoft's DOS revenue since then? Then again, maybe microsoft shows the allegations aren't true and wins . . . Re:naytewe (Score:1) Re:MS Spokesman Summarizes, plus other great stuff (Score:1) That's really the question, isn't it? I think the answer is in the fact that MS has/had a monopoly. When millions of customers depend on Microsoft products, and MS can make one little code snippet that effectively scares people away from their competitors product, then that is illegal. It's not our moral principles that should then be questioned but theirs. For example, BeOS could have little messages showing up saying that their OS won't work if Windows is installed on another partition (even though it certainly does, as win3.1 did with DR-DOS), and it's not illegal, because there aren't millions of customers who are effectively being forced/scared into using BeOS and deleting their Windows partitions. At least that's my take on the whole situation. LL Re:DR-DOS vs MS-DOS (Score:1) This is a corporate-sized case of the ambulance chasing lawyer. With or without Microsoft's guilt, Caldera should get nothing. Ray Noorda (the soreheaded ex-Novell exec who runs Caldera) is engaging in this activity because of his personal hatred of Bill Gates. It's really unfortunate, because Caldera is using Linux as a budgeon to pound on Microsoft for the exact same purpose. They don't have any of the vision of Red Hat. Re:Can Any Company Survive So Many Attacks? (Score:2) I would say, offhand, that you've nailed the exact reason(s) why MS is in dire straits. You can only defend so many fronts at once; that's basic military strategy. No one company will ever be the end-all server / desktop / game / application / content author all at one time. They've simply spread themselves too thin, and are probably terrified to realize that they're now competing against extremely agile, tightly-written and narrowly-scoped projects, such as Sendmail, Apache, PS2, etc. (I deliberately left Linux and BSD out of this - I wouldn't exactly call them narrow in scope, although some might debate it). No, I don't think that it's the DOJ who is writing Microsoft's eulogy. Their own half-baked global domination scheme seems to be doing it quite nicely. Re:MS Spokesman Summarizes, plus other great stuff (Score:1) Disclaimer: IANAL I believe the reason it's illegal is because it was artificial. Windows didn't require anything MS-DOS-specific in order to run; Microsoft merely implemented some checks and utilized some poorly-/un-documented tricks in order to prevent Windows 95 from operating on DR-DOS. Similarly, IE was hacked into the existing codebase of Windows for the "inseperable" defense they used in the DOJ trial. If a product legitimately requires some underlying product to run, then I don't believe it's tying. The whole Caldera case, in that light, is about whether Microsoft legitimately had a reason to glue MS-DOS and Windows 95 together, or whether they introduced some artificial dependencies/incompatabilities in order to destroy the market for other *-DOS operating systems. A similar theme was brought up in the DOJ trial with regards to IE, and whether IE has a legitimate reason to be so heavily "integrated" with Windows, or whether Microsoft resorted to some cheap hacks and word games to get a leg up on Netscape. lawyer: answer (what a summary judgment is) (Score:2) A summary judgment motion is an attempt to win without a trial. It claims that the evidence being offered by the other side, even if believed (at least the portions that a reasonable person could believe), isn't enough for the other side to win, and that judgment should therefore be entered now. Microsoft filed separate motions for each claim made by caldera, claiming that that particular act didn't violate anti-trust law, and that therefore that portion of caldera's claim should be dismissed. On many of these, microsoft would be right if the facts were viewed on their own. However, it is the combination of actions (the course of action) that was called illegal, and thus microsoft failed. Re:MS Spokesman Summarizes, plus other great stuff (Score:1) I must've accidentally typed a instead of a when doing some formatting. *sigh* Re:MS Spokesman Summarizes, plus other great stuff (Score:1) (I think I'll just stop, now that I've made an ass out of myself...) Anti-Trust? huh? (Score:1) DR-DOS vs MS-DOS (Score:3) There were minor compatability problems, but Digital Research (the DR in DR-DOS) had solutions for 'em. Of course, telling a PHB that you have to tell the OS to lie to the application didn't go over well, and within a year we were a pure MS shop. The DOJ suit was, well, interesting...but this one has teeth and claws. DR went bust, in part because of this, so there's definite claims for damages. And as for the MS FUD of "it's old technology", dog $hit! Caldera is positioning DR-DOS as a low-end embedded OS. Think about it...an army of experienced programmers, a well-tested well-understood very small kernel. Makes sense. Meow Re:naytewe (Score:1) About time that this case got resolved one way or another... by the time this one comes out, nobody's even going to be using dos-derived systems any more and Red Hat will be the new Ultimate Evil. At which point it'll all have to start over. Things are looking grim. (Score:2) Its going to be really interesting to see what happens. Most people seem to have pretty much accepted that Microsoft will come out on the bottom of the "Findings of Fact", and these are pretty difficult to challenge on appeal. In fact, the judge was apparently openly sceptical of Microsoft during the trial! Personally though, I think the just punishment would be to make Microsoft port everything to Linux, including Bill G's "Smart House". Hold it... That would make them Anyway... I really hope that they do something real this time, and not the kind of slap on the wrist they did in the early nineties -- they basically said "Bill, play nice now" and he said "alright dad" and that was the end of it. What was absurd about that was that the original judge turned down the settlement as too lenient and they had to take it to an appeals court to get the settlement approved. Outrageous! Where does your money go? (Score:1) If this situation keeps growing Microsoft's sales will hardly be enough to pay all the lawyers working for them. Re:Anti-Trust? huh? (Score:1) Re:Go Caldera (Score:1) Cutting-edge computers, AT&T UNIX, communications satellites, multilayer digital switches, etc. What did the breakup do for you and I? Doubled the phone rates. These are MY opinions and not those of AT&T, unless they want them. Re:MS Spokesman Summarizes, plus other great stuff (Score:1) Um..isn't that kinda like Ford parts only fit on Ford automobiles. I don't think that the fact that Windows 3.X would work only on a MS operating system is anti-competitive. Should Windows 3.X been made to also run on OS2 and whatever else that there was available at the time? Is Windows 3.X considered an operating system by itself? I Don't think so simply because it does need a version of Dos. You may disagree. The arguement put forth is MS simple developed a piece of software, granted a very influencial piece of software, that ran on a MS operating system(MS-DOS). Isn't that what software companies do to-day. A product is developed to work on a certain operating system. Be it Linux, Windows, Mac ect.. The software manufacturer has the right to decide, usually decided by consumer demand, what operating system/s that their software is compatible with. MS has done some incredibly anti-competitive things in the past. They deserve support from no-one. But, in this case, I think that Caldera are simply ambulance chasing hoping to nail the jack-pot. A large part of their case seems to be "He said, She said". I hope the justice system hasn't collapsed to the point that that's all you need. Re:Where does your money go? (Score:1) READ before reacting (Score:1) That would prevent blunders as this one.... Re:Go Caldera (Score:2) Doubled the phone rates. I think you are quite mistaken here. Phone rates have gone down dramatically, especially for long distance. Local rates were largely unaffected for many years because of the lack of competition at that level until recently. Now that there are CLECs giving the RBOCs competition, we are starting to see local rates go down as well. It has taken longer than it should at the local level, but I don't see any evidence in my phone bill that consumers have seen anything but benefits from the AT&T breakup. Re:MS Spokesman Summarizes, plus other great stuff (Score:1) If that is the case, it is more comparable of a Ford refusing to drive on tires not authorized by the Ford Motor Company... Re:MS Spokesman Summarizes, plus other great stuff (Score:1) Um..isn't that kinda like Ford parts only fit on Ford automobiles. No, it's more like Ford cars work only on Ford gas and Ford roads - in the 50's, when you more or less HAD TO buy Ford if you were in US. Re:naytewe (Score:3) I'm not sure I believe this. It's certainly not the reason I despise them. (OK, maybe you weren't talking about me and my ilk -- you said hate, not despise.) Also, don't forget that the media made BG a star a decade ago on account of his success. He was portrayed as a culture hero for being a nerd that dropped out of school and climbed to the top. Yes, I know he started higher up the slope than most of us will ever rise, but the media has always played that down. This does not sound like a jealous response to his success either. I just don't think the jealousy explanation holds water. I think geeks despise BG & MS due to the quality of their products, their tendancy to deliver denials and excuses rather than fixes, and the stiffling impact that they have had on various facets of the business. And admittedly for some selfish reasons too, because we don't want to spend the rest of our lives using and supporting crappy MSware. And I think the same feelings are spreading into the non-geek population. Probably only a few understand the bit about stiffling various facets of the business, but many, many, many are getting sick of years of losing their work and/or waiting for a techie to come around and re-install Windows so they can get started reproducing that lost work, and all the while shelling out for product upgrades year in and year out, to the accompaniment of endless promises of "forget what we promised (and failed to deliver) last time -- this time it's really going to be everything you ever hoped for!" The non-geek population aren't fools. They hear the "ease of use claims", and wonder why their computers are such a pain in the butt to use. Some of them try phone support, and find out first-hand what we geeks discuss in the forums. Some overhear tech support's wry comments about "you expect that kind of problem with Microsoft" (I heard that very thing this week, AAMoF.) If Microsoft's success is to be blamed at all, it's not because of jealousy, but rather because success has made their warts available for close inspection by such a large portion of the public. If MS had directed some of the tangible rewards of their success into wart cures over all these years, they might now be one of the world's most loved corporations rather than one of the most despised. -- It's October 6th. Where's W2K? Over the horizon again, eh? Re:Things are looking grim. (Score:2) Not every computer user would be punished if Microsoft was punished. Every Microsoft user might be, but not all of us are, contrary to popular belief. What would the downside for Linux, *BSD, Solaris, Mac, BeOS or other non-Microsoft OS users be? As for Microsoft users, one could argue that they were an enabler of Microsoft, and therefore any punishment to Microsoft that flows down to them would be fair. I'm not sure I would completely buy that argument, because I think that most Microsoft customers were more or less unwitting or essentially forced into it (due to bundling deals and peer pressure). At any rate, it might not seem like it in the short term, but in the long run consumers would benefit if Microsoft was forced to play in a competitive market. Re:MS Spokesman Summarizes, plus other great stuff (Score:1) See the problem now? Another interesting MS trick. (Score:2) A standard proceedure for saving files used in "single user" apps, like word processors and spreadsheets, was developed many, many years ago, and used almost universally. The proceedure was you DON'T just overwrite the old file, you do the following: * write the new file to a temporary file name * Delete the old file -- or rename it to * Rename the temporary file to the original file name. This made sure that at no time was the only copy of the file on the disk deleted or dammaged. If the program crashed durring the save cycle, the original copy still existed. Great idea. Saved a LOT of people, and this is why it was used almost universally, and at Microsoft through Office v4.3. Starting with Office 95, however, they changed the saving proceedure: * Reset file pointer to beginning of file * Overwrite existing file with new data Obviously, this leaves the system at a fairly delicate point, should the app or OS crash after the file has started to be overwritten. So far, things look just stupid. However, if we remember one of MSs chief rivals, Novell, and a feature of Netware 3.x and above, things look a little less innocent. Netware has a very nifty "undelete" feature, they refer to as "Salvage"ing files. Unlike most other OSs where this feature is provided by third party add-ons, with Netware, this is a CORE part of the OS. A deleted file is marked as deleted and put into the free disk space pool, but it isn't overwritten until the entire disk has been used, at which point the oldest deleted files are overwritten (Actually, Macintosh does much the same thing). Novell provides you a nifty utility (SALVAGE in NW3.x, FILER in NW4+) which can bring these files back up to the point they are physically overwritten (or Netware is told to "PURGE" the deleted files). This is a really neat feature, or at least, WAS until MS re-did their file writing process. This ment you could bring back virtually ANY revision of a document, often weeks old. File get corrupted at 4:00pm? Don't loose an entire day's work by going to last night's tape, just SALVAGE the previous save! As far as I am aware, no other common OS has this kind of recovery feature standard (as I indicated earlier, Mac has 90% of it, but you have to get a third party program to actually recover the file). This was a clear advantage of Netware over NT as a file server, and it is something I walked people through many times, to much praise, I might add. 8) Obviously, SALVAGE doesn't replace a good backup system, but it is an appreciated feature. It doesn't work any more. Word and Excel in Office 95 and later seem to go out of their way to never "Delete" the old file (thus, making it availble to SALVAGE). I'm not pleased with this. And, knowing Excel's tendancy to corrupt files, it is a very sorely missed feature. In case you were wondering, Lotus Smart Suite DOES follow the "Temp file/Delete/Rename" proceedure, so it isn't an issue of Windows 9x API. As I said, I can't prove that it was an attempt to minimize a Netware feature or if it was simple incompetence, but it is gone. It appears that MS has shot themselves in their customer's foot. Nick. Re:How can Caldera sue for damages? (Score:2) The issue, for some, isn't the market value of DR-DOS, but rather a consistent pattern of behavior [theregister.co.uk] on the part of Microsoft. The current value of DR-DOS is a symptom, not the core issue. -- It's October 6th. Where's W2K? Over the horizon again, eh? Re:Go Caldera (Score:1) My mother paid $90+ for the priveledge of haveing a phone. No long distance, no local tolls. That was her base rate + phone rental (the area she livs in didn't allow personal ownership of the phones). Almost any call was LD since anything more than five miles was considered LD. (There was nothing to call within 5 miles except Cows in the field). Since the breakup that has drop to around $30. (Base rate, no phone rental since they change the rules). I totally agree that AT&T did some amazing things, but so did IBM and I can only see good things coming from the fall from grace of big blue. [Poss. Bias Note: My father was employeed by IBM until the early 70's] Maybe that's why I purchase so few MS products... (Score:1) Re:MS Spokesman Summarizes, plus other great stuff (Score:1) I think the basic principles of antitrust law in the US are: It's ok to get a monopoly through the standard free-market techniques, but once you've got it, there are certain things you can't do with it. So, for example, if so many consumers buy Acme hammers that Acme gets 90% of the market share, that's just fine. Once that happens, though, if Acme goes to Sears and says, "you can only buy Acme hammers if you buy Acme nails to go with them", or pulls various other tricks that take advantage of its monopoly position, then the Federal government takes an interest. Linux users should care about this (Score:1) In a way, I think this is true - DR-DOS is a dead product. However, I do think that Caldera has the right to sue Microsoft over this because of the development practices Microsoft had with respect to DR-DOS (ie. making applications that would work on MS-DOS, but break on DR-DOS, where the only difference in the code was some assembly that found out which operating system the product was running on). In any case, what could the trial mean to Caldera if they win? OpenLinux is a good product and hopefully, the money Caldera would win from this trial will be funneled (in part, at least) to the development of more easy-to-use features for Linux. Re:MS Spokesman Summarizes, plus other great stuff (Score:2) Ford lost their dominance of the US auto industry in the 1920's and 1930's. The companies that would be put together to build General Motors were able to push Ford into second place because Ford was too slow to improve their designs. Who would buy a 4 cylinder Ford Model T, which was available only in black when you could get a 6 cylinder Chevrolet in any one of several available colors for only a little more money? Frankly, there was a lot more competition in the US auto market in the 1950's than there is now, in that there were 7 or 8 credible players (GM, Ford, Chrysler, Nash, Hudson, Studebaker, Packard, etc) and now there are only 3. Of course even that is a much better situation than what we have in the desktop OS and desktop office software markets, because even at their strongest, none of the big 3 auto makers controls more than 50% of the domestic market, and that is without considering competition from imports. It would be nice if the computer industry was able to self-regulate that way, but it doesn't seem like it can when the only OS that seems to be able to make any headway against Microsoft is one that is essentially available for free. But Netware does NOT use FAT! (Score:1) It uses NetWAre filesystem as it's antive filesystem, on which you can mount namespaces, like, for example, Sun's NFS, Mac, OS/2, and VTAM (I believe, or some other IBM badass mainframe-related filesystem) and others. Today with NetWare 5 you have the option of using NSS (NetWare Storage Services) which is an incredibly scalable and fast native filesystem. It uses a balanced tree database instead of a FAT/Directory. The database is object oriented, and allows mount times of about 15 seconds for volumes of Terabyte size (which Novell actually demonstrated a year ago). Will I be flamed if I say Novell rules!? Re:More on Microsoft... (Score:1) Re:Haha, finally a LEGAL RULING (Score:1) Re:Can Any Company Survive So Many Attacks? (Score:1) Internal e-mail revealed. (Score:2) Interesting reading, indeed. -- It's October 6th. Where's W2K? Over the horizon again, eh? Re:naytewe (Score:1) There are plenty of successful companies that don't get the negative attention that Microsoft does. There's a reason for that. Re:DR-DOS vs MS-DOS (Score:2) The other problem was that many NetWare admins were unaware that they even had to install Windows drivers for client. Many installs were done by hand or with batchfiles and didn't get all the *.386 files in the right places. This would cause Windows 3.1 to choak on network access. -- Thanks SoftwareJanitor.. (Score:1) Re:Can Any Company Survive So Many Attacks? (Score:1) I've thought about this...why they would do it, that is. I think the idea (Microsoft's) has been that they would try to corner as many technology markets as possible. Certainly they knew they wouldn't win every battle, but they would be able to take over many and tie them to Windows, the center of their empire. Since geography isn't really an issue this could actually work. Except that their center (Windows) is beginning to rot. Of course this leads to an interesting idea--if everything is tied to Windows and Windows dies out, where does that leave the rest of the empire? Well, at that point I think Microsoft will cease to be an empire and become just another big software company instead. numb ?syntax error Re:AT&T breakup side effects (Score:2) Re:MS Spokesman Summarizes, plus other great stuff (Score:1) I don't mean to imply at all that BeOS doesn't work when Windows is around (in fact it is set up to be pretty compatible with Windows). What I was trying to illustrate was that a smaller OS who doesn't own the mindshare of every computer user _could_ do whatever they wanted - "no matter how heinous" - it would be up to the market to decide whether the change was for the better. With MS, that isn't the case. If Windows changes, 99% of users just take the change, better or worse. Sorry for any confusion. LL Re:Justice/rewards (Score:1) Re:DR-DOS vs MS-DOS (Score:3) The DOS-detection code in Win 3.1 (aka the "AARD" code), had the following interesting characteristics: I would love to hear MS's spin on all of this...why did they feel such a need to hide an irrelevant check for a competitive DOS product? Re:Internal e-mail revealed. (Score:2) -- It's October 6th. Where's W2K? Over the horizon again, eh? Hmmm...speculations (Score:2) Let's look at it like MS getting it's fingers tied off and immobilized, or at least impared: 1. DoJ trial is giving MS fits, despite the spin-doctoring. Exposure of arrogant attitudes towards gov't investigators and some really weird Alice-in-Wonderland shenannigans. 2. This case now going to trial with some very specific legal meat wrt provable anti-trust actions on MS's part. 3. Win2k not being all that MS promised - more vaporware-type pronouncements from MS. Ship-dates slipping and features being dropped. 4. Corporate IT folks more concerned with Y2k fixes rather than going through another Sisyphus-like upgrade dance wrt NT 4.0 -> winy2k 5. More and more high-profile hardware vendors slipping into bed with Linux/*BSD for a quickie - and realizing it feels better. 6. More and more anti-MS press - not just the usual complaints, but talk about Alternatives! 7. Linux, and as a result other alternatives oses, getting a lot of media attention as well as financial/corporate recognition. Hmmmm..... seven fingers? Not too bad. With that much clout tied down or impared, I think the time is just right for even more alternative os business planning on the part of the major hardware and applications vendors. Even if the trials that MS is involved in last for months, or years, this is still good. The more MS is distracted, the more mistakes it will make - publicly. The more distracted MS is, the more breathing room hardware vendors will have to really look at alternatives - and promote them. And, more importantly, the more time alternative oses have to make inroads on traditional MS territory, the less impact, economically, a break-up of, whatever-punishment for, MS will have. Nothing new here, but just my Friday $0.02. Re:AT&T breakup side effects (Score:1) So? The fee was a direct result of the breakup, and it came out of my (then-impoverished) wallet. I can't get enthusiastic about a fee^H^H^Htax imposed on the people who aren't using the service. Something about subsidizing those long distance savings for others really bugged me. Pete Re:Haha, finally a LEGAL RULING (Score:1) If an operating system is code designed to load programs and provide mechanisms for things like task-switching, file management, and power cycling, then even Windows 3.1 is an OS. It provided (non-preemptive) task-switching, a mechanism for starting and stopping programs (double-clicking the icon), file management, and cycling power. Not to get too cosmic, but I'm reminded of what Tanenbaum once wrote, that there really is no disctinction between software and hardware. Similarly, operating system layers (like Windows 3.1, BASH, or the DOS shell itself) become the operating system. That's all an operating system every really is: An abstraction layer. (None of this is meant to imply that MS wasn't being predatory with IE-bundling in Win98. Putting something as unintuitive as a web browser interface on a file manager is a totally monopolistic move, regardless of how "operating system" is defined.) Doctors amputate Turkish earthquake survivor's arm [This story contains video] Re:Where does your money go? (Score:1) Re:Another interesting MS trick. (Score:1) Re:AT&T breakup side effects (Score:2) Re:Another interesting MS trick. (Score:1) 1. Create temporary filename. 2. Create temporary file. 3. Copy entire file into another temporary file. 4. Dance on that file for a while. 5. Delete Original File. 6. Rename Temp file to Original filename. 7. Touch the file to update the file modification date and creation dates to match the original file. Failure to use this mechanism will result in a slow and painful death, as administered by Nick, because as we all know, in computing there's only one TRUE way of doing anything, and anything other than the way you know and understand is obviously (1) inferior, (2) error prone, and (3) the spawn of Satan. Pending Standards: Mouse button click duration; accurate to the nearest millisecond. Button-clicks by users outside of this 1ms time window will be ignored. Standard function names. All function names must begin with the word "Fondue" for no apparent reason, other than because when I started programming 9 years ago, it seemed like a good idea at the time. All programs must be written in C. No other languages are allowed. When performing large file updates, you must create a delta file, which you then run through and create a "child" file from, by comparing the delta file to the parent file. You then must backup the parent file. You must perform all actions as three separate processes: add new records, sort, remove duplicates. Preferably overnight, when most people won't be using the mainframe time. (Oh sorry - home users don't have mainframes? Well, tough titty). I became aware of another potentially anti-competitive thing MS did some years back, which, as far as I am aware no one else has mentioned in the press before. If it wasn't anti-competitive, it was at least stupid, and MS users are the ultimate victims. You should get out more. You'll be telling me that it's anticompetitive to support HTML 4.0 in web documents soon, because "Mosaic 1.0 doesn't support it". Re:MS Spokesman Summarizes, plus other great stuff (Score:1) lawyer: no, that's not what it means (Score:3) That a jury will be empaneled means two things 1) that one party ortheother demandeda jury, and 2) that there are "questions of fact" to be determined--i.e., someone needs to determinewhich sides' version of what happened is true. In the DOJ case, the judge was also the trier of fact (2). In this case, my guess (someone can go to the courthouse and check the pleadings to make sure) is that Caldera demanded the jury, expecting sympathy for the little guy (if I represented ms, I would want a bench trial [judge instead of jury]). Once the jury decides the facts, the judge will then decide how the law applies to the facts. The way the judge's opinion would enter at this point is in a ruling for summary judgment. If the facts as alleged by caldera were insufficient for caldera to win, the case would be dismissed. This could also happen if the evidence produced during discovery showed that no reasonable jury could find in caldera's favor. ack: also (Score:3) The problem is that caldera wasn't suing for a bunch of different bad things, they were suing over the course of action consisting of *all* of the bad things *put together*. Once more, microsoft seems to have been represented by the law firm of Larry, Mo, and Curly . . . DR-DOS and Multiuser DOS (Score:1) Haha, finally a LEGAL RULING (Score:2) MS Spokesman Summarizes, plus other great stuff (Score:2) Cullinan reiterated Microsoft's position that Caldera's claims are ... based on an attempt "to get money from Microsoft." Well, I figured that we were well past the "suing for an injunction stage". Furthermore, he said the case is about obsolete technology. I guess this wouldn't be the first MS person to admit it.. There were a couple of items that I'd appreciate some clarification on: I'm quite sure that some of this has been hashed out in great length already. Therefore, a synopsis or a pointer to the discussion would be very welcome. Re:ack: also (Score:1) "No individual raindrop ever considered itself responsible for the flood" - originator unknown. Re:DR-DOS vs MS-DOS (Score:2) But can Caldera demonstrate that they lost out because of DR going bust? They probably picked up DR-DOS (from Novell, IIRC) for a snip because of that! Re:MS Spokesman Summarizes, plus other great stuff (Score:1) Re:MS Spokesman Summarizes, plus other great stuff (Score:2) No, not illegal, but I don't think it compares directly to the Caldera-MS thing. In the case of IM, every client had to access servers owned and operated by AOL. So, when a "clone" client came out, it could be argued that every time that client was used to access the server it was incurring an expense for AOL, and expense which could not be offset by using the client to carry ads, or using the client to reinforce the AOL "brand". Those privileges suddenly belong to someone else who is not incurring the server and network costs! In the case of Windows 3.1, MS was not protecting itself against an expense, it was protecting itself against a loss of sales of MS-DOS. If Win 3.1 could run on DR-DOS installations, they would get money for sales of those copies of Win 3.1, and their brand (not Caldera's) would be what the user saw when they used their computer in Windows. However, it could be that the mishandling of this whole issue by AOL was part of a larger PR scheme: make it look like AOL is under attack by MS, and maybe some people would forget why they don't like AOL - enemy of my enemy and all that. On the Caldera case, my wish is that somehow courts or legislators could decide that interoperability and thoroughly documented, published APIs are consumer, and developer RIGHTS where commercial software is concerned. No more hidden APIs that only an OS developer insider knows how to use properly. No more strange behaviour because somebody decided to "customize" or "extend" a standard necessary for interoperability. No more "upgrades" that break properly-written 3rd-party software in order to force adoption of a product or gimmick written by the OS developer. Also: end to all wars, eradication of poverty ... Re:Can Any Company Survive So Many Attacks? (Score:1) Re:MS Spokesman Summarizes, plus other great stuff (Score:1) He says, "For example, BeOS could have little messages showing up saying that their OS won't work if Windows is installed on another partition (even though it certainly does, as win3.1 did with DR-DOS)..." What he means is, "For example, BeOS could have little messages showing up saying that their OS won't work if Windows is installed on another partition (even though it certainly does work, as win3.1 did with DR-DOS)..." Does that make things clearer? Re:naytewe (Score:1) Re:Eh (Score:1) I did not know that there was a statute of limitations on anti-competitive behaviour. The bottom line is that Microsoft gets away with far more heinous acts than they will ever be brought to trial for. Any form of justice and/or retribution is just fine by me and I suspect a lot of other people as well. I did use DR-DOS and it was far superior to what Microsoft was offering at the time. Just another casualty of MS dirty tricks left on the information highway.... AT&T breakup side effects (Score:1) Aye, there's the rub. For many years, I had an almost nonexistant long distance need, and I was paying about $5 bucks a month for service. After the breakup, one of the key things implemented was an access fee for long distance. IIRC, I was paying an extra $3 bucks a month for the long distance service I wasn't using, even if I never called out of the area. Yes, my long distance charges went down. However, my wallet was thinner for many years because of the breakup. OTOH, breaking up MS wouldn't bother me so much... Pete Brooks I'm sure that MS-DOS 6 had undelete like that (Score:1) Re:Don't forget their Pyramid Scheming... (Score:1) Cry havoc! (Score:1) No one suit (not even the DoJ's) is likely to bring Microsothoth down, but enough of these attacks will nibble away at them until they're too weak to stand, and then it's all over Obsolete Technology (Score:1) If DOS is obsolete technolgy, why is it being used as your flagship OS with a GUI, and why is it in use in 90% of home PC's? Shouldn't you be selling us new technology (NT), or maybe you can't get that working properly for the home..... ----------------------------------------------- Seriously, Windows 9x is an illegal MS-DOS/Windows combination, as Windows 9x is just a GUI for DOS. But, how come no-one has written or altered a version of DOS so it can replace MS-DOS 7 on a win9x install? Even if there was no technical bnifit, I would run the 9x shell on DR-DOS, just because it is less M$... Re:lawyer: no, that's not what it means (Score:1) What this means here is that you can bet that anyone with any sort of computer background won't make it on that jury. What you'll get is a panel of neophytes whose only knowledge of Bill Gates is what they read in the papers. These will be the people who think that Bill Gates invented the PC, and then went on to invent the internet. Personally, I'd much rather a judge were trying this case, for this very reason. (I've actually used Dr-Dos, BTW. It was round one in my quest to have a Non-MS PC. I'm on round three, now.) Maybe Microsoft asked for a jury trial (Score:1) IANAL. Could it be that Microsoft asked for a jury trial if/once their summary motions for dismissal were denied? They haven't fared so well in their latest DOJ bench trial, if the press has been at all accurate about the judge's reactions. Trial by a jury "of your peers" doesn't mean they'll get a bunch of techies. More likely they'll get a panel of people who don't know an awful lot about computer science or engineering. And these would have to be people who, if they have ever heard of DR-DOS, have no decided opinion one way or the other about Microsoft's conduct. So isn't it at least remotely possible that Microsoft requested trial by jury? Perhaps in the hopes that average citizens could be swayed by Microsoft's assertion of the need for compatibility, or an argument that the only way Digital Research could have created DR-DOS to be as compatible as it was, was by--gasp!--hacking? Just a thought. Re:How can Caldera sue for damages? (Score:1) Occasionally the holder of an asset is spectacularly wrong about the true value, IPO offerings being a familiar case but you might also look at the value of the UK pound a few years back, the sad case of Bre-X, or the wild ride of Barings bank for some examples. DR-Dos seems to be one of those cases if Caldera wins. Novell can then add the selling of DR-DOS to their long line of missed opportunities. TML MS-DOS=QDOS=CP/M-86 (Score:1) Re:Eh (Score:1) TML Re:DR-DOS vs MS-DOS (Score:1) I called MS to report the problem and they said I had to "upgrade" to MS-DOS. I phoned the DR-DOS rep, and within less than a day it was all working again. Everything worked fine in the earlier beta versions of Win 3.1. Re:lawyer: no, that's not what it means (Score:1) Isn't is possible that a jury finding of fact might be fairly irrational; influenced more heavily by emotion than fact? If that's the case I see it going either way--I know a lot of corporate types who think that all this "persecution" of Microsoft is way out of line. (Of course I try to avoid them whenever I can!) Then again, this is Microsoft, so we have to rejoice at the fact that it's harder to buy off an entire jury than it is to influence a single judge! Once this is over, is Caldera "Open Dos" again (Score:1) Once Caldera and Microsoft are through playing, Caldera may open up OpenDos again, possibly GPL it. Re:MS Spokesman Summarizes, plus other great stuff (Score:1) Windows is their product, yes. MS-DOS also. DR-DOS was a competing product written by Digital Research. Completely (well, 99.x%) compatible. So what does MS do? Set up Windows 3.1 to read the make of the DOS it's running on top of, and error if it's not MS-DOS. Deliberately stifling a competing OS by altering a package they control so it will only work with an OS they control. That's anti-competitive behaviour, and while it may or may not be legal (up to the jury) it certainly sucks. Got it now? Meow. Re:MS Spokesman Summarizes, plus other great stuff (Score:2) Ordinarily, I'd agree with you. However, MS abused a monopoly position to try and put their competitors (Digital Research, among others) out of business. It's the monopoly position that makes the difference. They're behaving in a means that is not in the public interest, and the only way to stop them is through the laws set up to prevent it. That's what this (and the DoJ case) is all about. Re:Same old Rhetoric (Score:1) //rdj Re:But Netware does NOT use FAT! (Score:1) Not by me, you won't! Netware is my choice for file and print services. I don't do NT. I have yet to see an NT network I'd have been proud to put my name on. (I told this to an NT installer once. He listened to my points, agreed with them. Then said "Yeah, but you make much more MONEY with NT!") I haven't become comfortable enough with Linux and FreeBSD's problem recovery process to put it at my clients as a file/print sharing system yet. But hopefully, soon. 8) Nick. Re:Win 9x on DR-DOS *works*! (Score:1) Re:I'm sure that MS-DOS 6 had undelete like that (Score:1) Hmm....now that I think about it, DOS v6 *did* include an optional device driver which would track deleted files in a comparatively primative way, but it was there (and I assume it worked, at least if you remembered to load it BEFORE you made a mistaken deletion!). I'm curious if it worked only from the command line (i.e., it watched for use of the DELETE command, like the Win9x recycle bin) or if it worked at the API level (so a program (like MS-Office 4.x) that deleted a file would have it tracked). No idea -- I never played with the deletion tracking feature of DOS. (In case you were wondering, the Netware deletion tracking tracked at the API level..doesn't matter if you DEL *.*'ed or the program deleted the file, Netware tracked it. Netware even tracks the file if you delete its parent directory). Virtually any file system on any OS can have files recovered from deletion if new files haven't actually overwriten the "ashes" of the old files. This has not a thing to do with the MS-DOS FAT file system. DOS's file system was simple enough, however, that it was fairly easy to write undeletion programs. The first one I saw was a customer of mine wrote one on MS-DOS v1 (a FANTASICLY clever kid, but a bit clumsy when it came to deleting files). Under CP/M, undeleting files was SO easy, I always just used a disk editor (I think undelete programs existed, they were just barely needed). Netware is rare in that it actually TRACKS those old "ashes" and keeps them around and intact, with all information (including the userID of the deleter!) so they can be reliably and successfully recovered as long as possible (or until told to do otherwise). I do seem to have wandered well off-topic.. I wasn't writing in praise of Netware (I am very willing to do this, as people have undoubtably noticed!), as I have the knawing suspicion in this forum, most people wouldn't care. My point was to bring up Yet Another potentially anti-competitive action of Microsoft. The idea of writing a temporary file before deleting the original would give you an improved likelyhood of being able to undelete a newly replaced file even under DOS if you got to it soon enough. However, this Temporary/Delete/Rename process did WONDERFUL things when combined with the Netware deletion tracking system. Nick. Y'all can wake up now, I'm finished. Re:lawyer: no, that's not what it means (Score:1) Re:MS Spokesman Summarizes, plus other great stuff (Score:1) GM Makes Cars. Ford has a monopoly on engines for GM cars. Ford also makes roads.... so does Honda. So Ford designs its engines so the break down whenever they are not on Ford roads. Honda gets forced out of business. Fair? Or better yet, Ford designs it's roads so they cause engines from any other manufacturer to break down. Howz that? Re:naytewe (Score:1) 1.) Is it the amount of development they've contributed to Linux? 2.) Is it the fact that they are at the forefront of trying to broaden the Linux user base ( I know how we all hate that?) 3.) Or is it the fact that they've somehow made billion$ on their IPO selling software that can be downloaded for free from any ftp site or for a buck at cheapbytes.com? Don't hate them because their successful....if U have to hate someone hate MS for selling an OS in which the disk check utility overwrites your boot sector with garbage (Win98 ScanDisk bug bit me 2wice) or where power management is so screwy your machine turns of and random (had to spend more $$$ on Win98 SE)... Oh yeah hope everyone's still boycoytting Amazon. Bad Command Or File Name Re:lawyer: no, that's not what it means (Score:2) I don't think that this case will really have all that much technical evidence--it's really the conduct of microsoft that'sin question. That is, the jury doesn't have to know how the alleged code worked, but decide whether or not microsoft put it in there. Th DOJ trial, on the other hand, hade to adress issues such whether or not IE is really part of the OS. And I can think of judges I've known who would be much inferior to a randomly selected jury . . . Also, even though juries deciding certain cases might be scary, that's not as scary as a system without juries. The jury's most important role is as a check on the system, and as a limit on the potential for judicial corruption. Re:Haha, finally a LEGAL RULING (Score:1) Re:DR-DOS vs MS-DOS (Score:2) yes, and it's trivial to do so. >They probably picked up DR-DOS (from Novell, >IIRC) for a snip because of that! And here you almost answer your own question. Part of the value of DR/DR-DOS was the claim against ms. This is reflected in the price paid by Novell, and then by caldera. DR didn't have the resources for the fight, and Novell didn't want a fight with ms and/or didn't think the chances of winning were good enough. Caldera disagreed, and bought the asset, claims & all. It's an x% chance of relief, with Caldera and Novell disagreeing about the value of x. Can Any Company Survive So Many Attacks? (Score:2) In the handheld market Palm is not only surviving against Windows CE, but thriving. A few years ago a lot of people took it for granted that Palm would be road kill. Now if you were developing for the handheld market you wouldn't think about ignoring Palm's huge market. In the low-end server market NT continues to be strong, but Linux & the BSDs are making progress in shops which a few years ago wouldn't have chosen anything but NT. Cost of the OS and the lower system requirments make NT a less attractive alternative to a lot of people. In the high-end server where cost is less of an issue, the commercial Un*x makers & OS/390 continue to be the standard. They've got amazing reliability and can deal with many more users than NT currently can. In the gaming market Microsoft is aparently fearing the growing power of game consoles like the PS2. Now they're reportedly making an entry into that market as well. The desktop is one area where Microsoft really isn't facing a competative threat. Here the government & Caldera are persuing them for antitrust violations. On the portal phase I don't think MSN has ever turned a profit despite a large amount of investment by MS. Sure, MS makes tons of money and they certainly won't disappear from the market, but can even they fight so many battles? How much money can they spend on new markets, lawyers, & unprofitable segments before the markets they currently dominate start to suffer? Re:lawyer: no, that's not what it means (Score:2) Watch out though, the outcome may not be what you think. A jury tends to, especially in high-visibilty cases, base their decision more on public opinion. A judge will decide on facts and rule of law. Because Microsoft has a high public opinion, it is more likely that the jury would decide for them. After all, it's just the little guy picking on a big guy who did nothing but be successful, right? That's why I'm glad the DOJ trial did not have a jury. If it did, I would predict the outcome would have been strongly in MS' favour. The judge though will look and facts and laws, and not how MS is doing in the polls.-Brent -- Re:MS Spokesman Summarizes, plus other great stuff (Score:2) Well...as much as it pains me to say this... I would have to say that I really don't understand that either. But then again I'm not a lawyer. In a sense this is what AOL was trying to do to MS when they kept tweaking their IM protocol so it wouldn't work with MS clients. I don't recall anybody stating that AOL was doing anything illegal, amusing...yes... illegal.. no. I would be interested to see how much Caldera is spending on laywers. Lawsuits like this tend to hurt the smaller company more because they are spending big bucks for lawyers that could be dumped into R/D. Meanwhile time does not stand still. Even if they win a large settlment they have lost time that cannot be recouped. Seems like a pretty big gamble for Caldera.
https://slashdot.org/story/99/11/05/0814243/caldera-vs-microsoft-goes-to-jury-trial
CC-MAIN-2017-26
refinedweb
9,152
71.34
Manning leads Broncos past Kansas City, breaks Chiefs’ perfect streak Sports, B-1 Locally owned and independent Monday, November 18, 2013 75¢ SFPD use of sick time declines Numbers leave police chief to defend assertion that force has intentionally abused policy By Chris Quintana The New Mexican Santa Fe Police Chief Ray Rael raised plenty of eyebrows last month when he said he suspected that police officers were deliberately taking sick leave to protest a 2011 change in policy that forced them to work five days a week instead of four. Sick pay in fiscal year 2012-13 shot up 30 percent from the previous year, he told the city Finance Committee in October. “Some of the usage is intentional to subvert the system to say that the eight-hour shifts Ray Rael aren’t working,” he said. But an analysis by The New Mexican of sick time used by officers over the past two and half years paints a picture that is more difficult to interpret. Sick pay did go up by about the amount Rael said, although the overall increase in the number of sick time hours used was slightly less, about 25 percent. But since then, sick time has fallen sharply and is on pace to fall below fiscal 2011-12, when the workweek policy was changed. Rael’s claims have stoked long-simmering tensions between him and the Santa Fe Police Officers Association, the union that represents most of the force’s 150 officers. Less than a month left for those in federal pool despite website issues Northern Rio Grande Sportsman’s Club says it was unfairly saddled with bill for range it doesn’t own By Staci Matlock The New Mexican Key dates for those in Federal high-risk pool Nov. 30: Complete a Medicaid application for faster processing Dec. 15: Last date to enroll for those on the federal high risk pool to have insurance coverage by Jan. 1, 2014 Dec. 31: Last coverage day under federal pool Today Mostly sunny. High 56, low 30. Man faces up to 32 years in prison for slaying his pregnant girlfriend and her father. Page A-10 Nonprofit under fire for back taxes High-risk group faces deadline to switch Please see SWITCH, Page A-4 Severe storms leave at least six people dead after flattening entire neighborhoods. Page A-3 Double-homicide plea Please see SICK, Page A-4 Health insurance About 1,250 of the most seriously ill New Mexicans are coming up on a critical deadline for switching health insurance. They are in a federal high-risk pool and have until Dec. 15 to get into the Medicaid program or to enroll in the federal health care exchange as part of the federal Patient Protection and Affordable Care Act. About 250 people insured through the federal highrisk pool live in Santa Fe County. Currently, if they don’t enroll and switch plans by Dec. 15, their insurance coverage will end on Dec. 31. These are the people who were considered “uninsurable” under previous health care laws, the ones with diseases such as cancer, end-stage renal disease, heart disease, HIV and some mental health conditions. About 200 seriously ill children with extremely rare conditions are part of the pool, according to Reena Szczepansski, executive director of the New Mexico Medical Insurance Pool. Tornadoes hit Midwest By Tom Sharpe The New Mexican T Northern rio grande Sportman’s club tax bill breakdown $143,888 total amount due, which includes: $91,047 $6,570 for six years of delinquent property taxes (2005-10); in penalties; $48,314 $125 in interest; in state costs. This shooting range in La Puebla is the source of a property tax debate between the county and the nonprofit that runs it. The 148-acre site has a rifle range, right, as well as areas for archery, pistol, trap and skeet shooting. Photos by Clyde Mueller The New Mexican he Northern Rio Grande Sportsman’s Club, a nonprofit that runs a shooting range in La Puebla, owes the county more than $143,000 — the biggest delinquent property tax bill in Santa Fe County. The county didn’t begin taxing the 148-acre shooting range property until 2005, after decades of it not being on the tax rolls. But for several years after the switch, the Treasurer’s Office sent the bill to the wrong address — and overvalued the land. The club’s land patent from the U.S. Bureau of Land Management restricts the use of the property to a shooting range, and thus its value. Even since the county agreed to reduce the valuation in 2011, it has continued to try to collect property taxes for the earlier years. “This isn’t a matter of the sportsman’s club not wanting to pay their taxes,” said club President Toran Maynard of Española. “It’s wanting to make sure that everything is done correctly and not just on somebody’s whim.” The list of delinquent property tax bills, released to The New Mexican last month, shows the club’s $143,888 bill includes $91,047 for six years of delinquent property taxes for 2005-10, $48,314 in interest, $6,570 in penalties and $125 in state costs. In June 2011, the club sued the Santa Fe County Commission, Assessor Domingo F. Martinez and Treasurer Victor Montoya, arguing that it should be exempt from property taxes because it doesn’t own the property at 42 E. Arroyo Alamo in La Puebla, near Española, but only uses it under a patent from the BLM. State District Judge Raymond Ortiz dismissed the club’s complaint in March 2012, ruling that he lacks jurisdiction because the club never applied for a exemption from property taxes as set down in the state property tax code. Northern Rio Grande Sportsman’s Club was incorporated in 1965 as a domestic nonprofit, but is no longer in good standing as a corporation, according to records of the Secretary of State’s Office. Maynard said it is now registered as a 501(c)(7) — the IRS designation for a social club. Please see TAXES, Page A-4 Page A-12 Pasapick Weekly all-ages informal swing dances Lessons 7-8 p.m., dance 8-10 p.m., Odd Fellows Hall, 1125 Cerrillos Road, dance only $3, lesson and dance $8, 473-0955. More events in Calendar, A-2 and Fridays in Pasatiempo Index 150 years later, paper prints a Gettysburg redress By Tina Susman Los Angeles Times NEW YORK — Four score and 70 years ago, a Pennsylvania newspaper chided Abraham Lincoln’s Gettysburg Address as “silly remarks.” Late last week, just in time for the speech’s 150th anniversary, Harrisburg’s Patriot-News apologized for “a judgment so flawed, so tainted by hubris, so lacking in the perspective Calendar A-2 Classifieds B-6 Comics B-12 Family A-9 El Nuevo A-7 Opinions A-11 Editor: Ray Rivera, 986-3033, rrivera@sfnewmexican.com Design and headlines: Kristina Dunham, kdunham@sfnewmexican Police notes A-10 Sports B-1 Tech A-8 Time Out B-11 Main office: 983-3303 Late paper: 986-3010 through Saturday Please see REDRESS, Page A-5 Two sections, 24 pages 164th year, No. 322 Publication No. 596-440 A-2 THE NEW MEXICAN Monday, November 18, 2013 NATION&WORLD DORIS LESSING, 1919-2013 Nobel Prize winner dies at age 93 By Danica Kirka The Associated Press TYPHOON SURVIVORS WAIT FOR FLIGHT OUT OF PHILIPPINES A typhoon survivor kisses his son during a brief rainfall as they wait for a flight out of Tacloban airport, in Leyte province, Philippines, on Sunday. Hundreds of thousands of people were displaced by Typhoon Haiyan, which tore across several islands in the eastern Philippines on Nov. 8. AARON FAVILA/THE ASSOCIATED PRESS In brief Aid missions boost troops’ readiness, image. Military sexual assault bill splits Senate. Former Pakistan leader to go on trial for treason ISLAMABAD —. Syrians flee to Lebanon as heavy fighting flares BEIRUT — Thousands of Syrians poured into Lebanon, taking shelter in wedding halls Contact us Tamara Hand Classified line adsbefore-displayed items from his three-day state funeral, including the flag that draped his casket and notes written by First Lady Jacqueline Kennedy. UNIQUE THIS WEEK Home delivery Ginny Sohn Advertising Director Website asks people to share stories of JFK The Associated Press. Publisherheld suburbs south of Damascus and taking two towns and a military base outside the northern city of Aleppo. Doris Lessing Monday, Nov. 18 LECTURE AT MUSEUM OF SPANISH COLONIAL ART: Lecture by historian Rob Martinez titled The Casta System in New Mexico and New Spain, 2-3 p.m., 750 Camino Lejo, Museum Hill. SUSAN TOPP WEBER AT COLLECTED WORKS: The author discusses her book Nativities of the World, 6 p.m., 202 Galisteo St. TALK AT HOTEL SANTA FE: Aboriginal Cotton Production in Northern New Mexico: Archaeological and Ethnographic Perspective, a Southwest Seminars lecture with Richard I. Ford and Glenna Dean, 6 p.m., 1501 Paseo de Peralta. TALK AT ST. FRANCIS AUDITORIUM: Growth of the Galleries with Katherine Ware, New Mexico Museum of Art curator of photography, chronicles the impact that photography has had on New Mexico art history, from photographic surveys to commercial galleries, 10-11:30 a.m., 107 W. Palace Ave. NIGHTLIFE Monday, Nov. 18 BACK STREET BISTRO: Paintings, prints and clocks by Hillary Vermont, reception Corrections 5:30-7:30 p.m., through Jan. 4., 513 Camino de los Marquez. COWGIRL BBQ: Cowgirl karaoke with Michele Leidig, weekly, 9 p.m., 319 S. Guadalupe St. EL FAROL: Jazz saxophonist Trey Keepin, 7 p.m., 808 Canyon Road. LA FIESTA LOUNGE AT LA FONDA: Blues band Night Train, 7:30 p.m., 100 E. San Francisco St. TINY’S: The Great Big Jazz Band, 7 p.m., 1005 St. Francis Drive. VANESSIE: Geist cabaret with David Geist and vocalist Julie Trujillo, 6 p.m., 427 W. Water St. WEEKLY ALL-AGES INFORMAL SWING DANCES: Lessons 7-8 p.m., dance 8-10 p.m., 7 p.m., 1125 Cerrillos Road. PARKS SKATEBOARD PARKS: In De Vargas Park, 302 W. DeVargas St.; Franklin Miles Park, 1027 Camino Carlos Rey. FORT MARCY/MAGER’S FIELD COMPLEX: 490 Washington Ave. 955-2500. GENOVEVA CHAVEZ COMMUNITY CENTER: 3221 Rodeo Road. 955-4000. HERB MARTINEZ/LA RESOLANA PARK: 2240 Camino Carlos Rey. MUNICIPAL RECREATION COMPLEX: 205 Caja del Rio Road. 955-4470. SALVADOR PEREZ PARK AND SWIMMING POOL: 610 Alta Vista St. 955-2604. VOLUNTEER DOG WALKERS WANTED: The Santa Fe animal shelter needs volunteer dog walkers for all shifts, but especially our cast.net or call 670-6835. THE AMERICAN CANCER SOCIETY: Volunteers are needed to support the Cancer Resource Center at the Christus St. Vincent Cancer Center. Training is for the various shifts that are worked dur- In an article that appeared on Page C-7 of the Sunday, Nov. 17, edition about Richard McCord’s new book on the history of the College of Santa Fe, Brother Donald Mouton’s surname was misspelled as Moulton. Also, it was Brother Cyprian Luke who began recruiting women to the college, not Brother Benildus as erroneously reported in the same article. The New Mexican will correct factual errors in its news stories. Errors should be brought to the attention of the city editor at 9863035. ing business hours Monday through Friday. Call Geraldine Esquivel with the American Cancer Society at 463-0308. PEOPLE FOR NATIVE ECOSYSTEMS: Volunteers are needed to join the feeding team for the endangered prairie dog colonies in Santa Fe. If you can give two to three hours a week to help, call Pat Carlton at 988-1596. For more events, see Pasatiempo in Friday’s edition. To submit an events listing, send an email to service@sfnew mexican.com. NATION & WORLD Monday, November 18, 2013 THE NEW MEXICAN A-3 Boeing plane crash Storms, tornadoes ravage Midwest in Russia kills 50 By Jim Heintz released photographs from the nighttime scene showing parts of the aircraft and debris MOSCOW — A Boeing 737 scattered across the ground. jetliner crashed and burst into Ambulances lined up in front flames Sunday night while try- of the airport building. ing to land at the airport in the It was not clear why the Russian city of Kazan, killing plane’s first landing attempt all 50 people aboard in the lat- was unsuccessful. Boeing said est in a string of deadly crashes it would provide assistance across the country. to the investigation into the The Tatarstan Airlines cause. plane was trying to make a “Boeing’s thoughts are with second landing attempt when those affected by the crash,” it touched the surface of the the company said in a staterunway near the control tower ment on its website. and was “destroyed and caught A journalist who said she fire,” said Sergei Izvolky, the had flown on the same airspokesman for the Russian craft from Kazan to Moscow’s aviation agency. Domodedovo airport earlier in The Emergencies Ministry the day told Channel One state said there were 44 passengers and six crew members aboard television that the landing in Moscow had been frightening the evening flight from Mosbecause of a strong vibration cow and all had been killed. during the final minutes of the Kazan, a city of about 1.1 milflight. lion and the capital of the “When we were landing it Tatarstan republic, is about was not clear whether there 450 miles east of the capital. was a strong wind, although The ministry released a list in Moscow the weather was of the dead, which included fine, or some kind of technical Irek Minnikhanov, the son of Tatarstan’s governor, and Alex- trouble or problem with the flight,” said Lenara Kashafutander Antonov, who headed dinova. “We were blown in the Tatarstan branch of the different directions, the plane Federal Security Service, the was tossed around. The man main successor agency to the sitting next to me was white as Soviet-era KGB. a sheet.” Some Russian air crashes Tatarstan is one of the have been blamed on the use wealthier regions of Russia of aging aircraft, but industry because of its large deposits of experts point to a number of other problems, including poor oil. It is also is a major manufacturing center, producing trucks, crew training, crumbling airports, lax government controls helicopters and planes. About half of the people who live in and widespread neglect of safety in the pursuit of profits. the republic are ethnic Tatars, most of whom are Muslims. The Emergencies Ministry The Associated Press GORMAN Lightning&&Surge Surge Lightning Protection Protection Protecting Structures & Lives in New Mexico for 15 years. 505-989-3564 By David Mercer and Don Babwin in the far southern part of the The Associated Press state, said Patti Thompson of the Illinois Emergency Management WASHINGTON, Ill — Dozens Agency. She did not provide of tornadoes and intense thundetails. derstorms swept across the MidWith communications difficult west on Sunday, leaving at least and many roads impassable, it six people dead and unleashing remained unclear how many powerful winds that flattened people were killed or hurt. The entire neighborhoods, flipped Illinois National Guard said it over cars and uprooted trees. had dispatched 10 firefighters Illinois took the brunt of the and three vehicles to Washington fury as the string of unusually to assist with immediate search powerful late-season tornadoes and recovery operations. tore across the state, injuring In Washington, a rural comdozens and even prompting offimunity of 16,000, whole blocks cials at Chicago’s Soldier Field to of houses were erased from evacuate the stands and delay the the landscape, and Illinois State Bears game. Police Trooper Dustin Pierce “The whole neighborhood’s gone. The wall of my fireplace is said the tornado cut a path from one end of town to the other, all that is left of my house,” said knocking down power lines, Michael Perdun, speaking by cellphone from the hard-hit cen- rupturing gas lines and ripping tral Illinois town of Washington, off roofs. An auto parts store with sevwhere he said his neighborhood eral people inside was reduced to was wiped out in a matter of a pile of bricks, metal and rebar; seconds. “I stepped outside, and I heard a battered car, its windshield impaled by a piece of lumber, it coming. My daughter was was flung alongside it. Despite already in the basement, so I ran downstairs and grabbed her, the devastation, all the employees managed to crawl out of the crouched in the laundry room rubble unhurt, Pierce said. and all of a sudden I could see “I went over there immedidaylight up the stairway and my ately after the tornado, walking house was gone.” through the neighborhoods, and An elderly man and his sister I couldn’t even tell what street I were killed when a tornado hit was on,” Washington Alderman their home in the rural southTyler Gee told WLS-TV. ern Illinois community of New “Just completely flattened -Minden, said coroner Mark some of the neighborhoods here Styninger. A third person died in town, hundreds of homes.” in Washington, while three othAmong those who lost ers perished in Massac County Make this your tastiest and easiest Thanksgiving ever. Let Joe do it! Order your Thanksgiving Dinner A.S.A.P. All prepped to heat and serve. Local organic turkey. 471-3800 joesdining.com Rodeo Rd at Zia Open 7 days a week all day 7:30am - 9:00pm Ray Baughman embraces family shortly after his home was destroyed by a tornado that left a path of devastation through the north end of Pekin, Ill. FRED ZWICKY/JOURNAL STAR. Save HUNDReDS (even thousands) of dollars on every spa at our TRUCKLOAD SALE! OveR 20 SpaS available. These models are available for this special annual event. Hot Spring is the #1 SelliNG Spa iN THe WORlD! Built for a lifetime of relaxation.© 3985 Cerrillos Rd. • in front of Lowe’s • 438-0099 *See store for details. OAC. • Mon–Sat 10–5pm A-4 THE NEW MEXICAN Monday, November 18, 2013 Sick: Union president sees ‘no discernable pattern or conspiracy’ Continued from Page A-1 Sgt. Adam Gallegos, the president of the union, has disputed Rael’s assertions and said the recent decrease in sick time shows that “no discernible pattern or conspiracy” exists. The chief, however, continued to defend his claims when told of the decrease in numbers and said he is continuing to investigate whether there is a pattern of abuse. The New Mexican obtained the sick pay and hours used by officers and supervisors through an Inspection of Public Records Act request. In the 2011-12 fiscal year, officers and supervisors took a combined $342,337 in sick pay for a total of 12,820 hours, and in 2012-13 the same group took $451,572 in sick pay for a total of 16,113 hours. That’s a 32 percent increase in sick pay, and a 25 percent increase in sick hours. That said, payroll data from July 2013 to Oct. 25 suggests that officer sick leave may actually be on a downward trend this year, which Gallegos contends contradict Rael’s claim that some members of the forces were initially abusing sick leave. In the first nine weeks of the current fiscal year, officers have taken 3,647 hours of sick leave. In contrast, during the first nine weeks of the 2012-13 fiscal year, officers had already taken 5,133 hours, which means the current sick leave use is down by 29 percent in comparison. And in the first nine weeks of fiscal year 2011-12, officers took 3,973 hours of sick time, putting current sick leave use down by 8 percent in comparison. Rael’s claims emerged during a discussion about the union’s displeasure over a shift change in June 2011 that required officers to work five eighthour-a-day workweeks instead of four 10-hour-a-day workweeks. 1,000 Source: Santa Fe Police Department Brian Barker/The New Mexican HIGH 886.92 FY 2013-14 FY 2012-13 FY 2011-12 800 Pay period 18, March 2011 2013-14 TOTAL 3,647.89 2011-12 TOTAL 600 12,820.67 400 Santa Fe police sick leave hours used Fiscal years 2011 to 2013 LOW 200 Pay period 1, July 2013 102.3 PAY PERIOD 1 2 3 4 5 6 7 8 The chief has said repeatedly that the switch allows his administration to put more officers on the street, which has resulted in lower property crime rates. Gallegos disputes the chief’s claim and said that, in contrast, the five-day workweek has dampened officer morale. Gallegos also said the schedule adds unnecessary stress and exhaustion for officers because they don’t have enough off-duty time to decompress. Rael said he’s happy to see the decrease, but Celina Westervelt, the department’s spokeswoman, cautioned that this year’s numbers don’t include the cold and flu season. But the analysis showed that sick pay is following a nearly identical seasonal trend as in the previous two years, although at lower rates. At the current rate of usage following those trends, the total sick time used is pro- 9 10 11 12 13 14 15 16 17 18 jected to be about 32 percent less than the 2012-13 fiscal year, which ended June 30. The chief said, however, the overall numbers only tell part of the story. Rael said he’s more interested in trends and patterns of when officers use sick leave. For example, officers may not be using more sick leave than they have allotted, but they may be using it to extend their weekends or once a month when they’re not actually sick. The process of proving that claim is a lengthy one, and it’s especially challenging given that many officers don’t work a Monday-through-Friday week. Westervelt said that the names of officers who may fit those patterns will not be released at this time because the department’s investigation is still ongoing. But that claim is one that Gallegos 19 20 21 22 2012-13 TOTAL 16,113.85 23 24 25 26 27 said is baseless. He said he’s still waiting for the chief to present concrete evidence. Gallegos admitted that some officers may use sick leave to get an extended weekend, but it’s not something he or anyone else in the union planned. He added that he believes that initial increase in sick leave came as a result of the stress from the shift change. In an interview last week, he said the chief’s claims had “destroyed any bit of morale left.” Sick leave policies According to the union contract, officers can take sick leave for personal injuries, sickness, medical appointments or the injury or illness of immediate family members. Anything outside those parameters, Rael said, could be considered abuse. Sick leave accrual rates depend on the length of time that an officer has served on the force, but a new cadet is eligible for up to 72 hours of sick leave per calendar year, whereas officers who have spent more than 20 years with the department are eligible for up to 159 hours of sick leave per year. The same union contract states that an employer may require a doctor’s note to go along with sick leave in scenarios where “abuse of such leave is suspected.” The city, Westervelt said, is not required to pay officers for unused sick leave when they leave or retire from the force, but officers do have the ability to sell up to 96 hours of leave back to the city in a single year. But before officers can do that, they already have to possess 500 hours or more of sick leave, and they can’t sell so many hours that they drop below the 500-hour threshold. Officers only get one hour of regular pay for every two hours of sick leave they sell to police. That payout scheme, however, is dependent on the city’s available funds, and Westervelt said no one’s been able to sell their sick leave in the past decade. Another provision allows officers with more than 12 years of employment to use sick leave as a part of an early retirement program and might explain why some officers have more than 700 sick leave hours on the books. Rael said he did not consider those cases to be possible sick leave abuse. Westervelt said that when officers call in sick, administrators may or may not need to call someone to fill their shifts. “It’s on a case-by-case basis,” she said. Contact Chris Quintana at 986-3093 or cquintana@sfnewmexican.com. Switch: Transition not smooth Continued from Page A-1 The skeet/trap range at the Northern Rio Grande Sportsman’s Club Inc. in La Puebla. Taxes: County says the group has never filed for an exemption Continued from Page A-1 Nonprofits usually are exempt from federal taxation, but the New Mexico Constitution exempts only churches and property used for educational or charitable purposes. And even church property can be taxed if it is not used for religious purposes. “They’ve never given the assessor a chance to determine whether it fits [an exemption] or not because they’ve never filed for an exemption,” said County Attorney Stephen Ross. Chief Deputy Assessor Gary Perez also said he had no knowledge of the club applying for an exemption. The club’s lawyer, John Hays, said there has been no attempt to seek an exemption from property taxes since Ortiz’s ruling in 2012, but after the County Assessor’s Office put the value at nearly $3 million, the club protested and the valuation was reduced to $98,460. The reduction meant the club’s annual property taxes are now about $600, instead of about $6,000 as they were in both 2005 and 2006. The taxes tripled in 2007 and reached $20,857 in 2010 — the most recent year on the list. Hays said the club has been paying the smaller amount, which is fair, but he does not think it’s fair to continue to try to collect taxes levied on the higher valuation. “We have a bigger issue [than The nonprofit charges dues of $100 for two years of access to the shooting range in La Puebla. ‘We definitely don’t have $140,000 sitting around,’ said club President Toran Maynard. PHOTOS BY CLYDE MUELLER/THE NEW MEXICAN an exemption], which is how to deal with these retroactive taxes that were a result of the association never getting notice that they were back on the rolls so they couldn’t protest it,” Hays said. “We’ve got a complicated procedural situation that we’ve been trying to figure our way out of. It’s a big mess.” Maynard said state tax officials understand the land is essentially valueless because if it were seized and sold for back taxes, the buyer could only use it as a shooting range or it would be returned to the BLM. But, he said, county officials don’t seem to get that. “Once a mistake has been made, from the county side, there is really no way to take care of it,” he said. “The way everything is written, there’s no way for reasonable people to get together and come to a solution. “They basically close their eyes and close their mouths and their ears and they say, ‘Nope. You can pay the back bill and then protest it.’ Well, we’re a tiny little nonprofit. Our dues are $100 for two years. So we definitely don’t have $140,000 sitting around.” Contact Tom Sharpe at 986-3080 or tsharpe@ sfnewmexican.com. The club’s annual property taxes are now about $600, instead of about $6,000 as they were in 2005 and 2006. The taxes tripled in 2007 and reached $20,857 in 2010. Under the ACA, insurance companies have to offer insurance to high-risk individuals and anyone with a pre-existing condition of any kind. But the transition right now to one of the new plans isn’t smooth. The ongoing problems and delays associated with enrolling in health insurance plans under the federal exchange make it even more difficult for people with severe medical challenges. “What we see with this group are people who can’t leave home, are hospitalized, are navigating extensive treatments and are on multiple medications,” Szczepansski said. “It makes it hard when they are trying to transition (off the federal high-risk pool) that this may be more than just a one-hour process to transition. It is one reason we have to be very thoughtful about the transition.” “A lot of them can’t work, they are on fixed income, or they live with family members who take care of them,” she said. The Dec. 15 deadline does not apply to 8,700 New Mexicans in the state’s high-risk Medical Insurance Pool. Of those, 1,555 live in Santa Fe County. New Mexicans in the state pool can continue to be covered at least into 2014, Szczepansski said. But their premiums, already high compared to other insurance plans, will go up 12 percent in January. Szczepansski said those in the high risk pool may find they can reduce their premiums through the federal health insurance exchange once they can enroll. “We’re encouraging state pool members to look at their options,” Szczpansski said. The federal and state medical insurance plans for people with high-risk medical conditions cover about the same thing and for similar premiums. The big difference is that the state’s program — started in 1987 — requires people to wait six months after a diagnosis to join the insurance pool. The federal program, started in 2010, has no waiting period. “That was an incredible boon for people,” said Szczepansski. But the federal pool stopped accepting new applicants in March, in preparation for people to roll over to the new health insurance exchange by December. Ongoing problems with the federal health care exchange are forcing the state to make sure it has a backup plan. “We are watching very closely how the transition is going,” Szczepansski said. “We are having a meeting Dec. 6 to decide what to do. The bottom line is the pool has been committed to WhAT you need To Apply To apply for Medicaid or for coverage through the federal health insurance exchange, you will be required to give the following information for every household member who will be on the insurance plan: u Identity and age u N.M. residency u U.S. citizenship or qualifying immigration status u Income Paperwork to have on hand before you enroll in an insurance plan: u Copy of tax forms or pay stub; IRS Schedule C if you are self-employed u Copy of a utility bill u Address, including ZIP code u A list of your family’s medical history and past medical costs. (This can help determine the level of coverage you want — bronze, silver, gold or platinum.) u If you like your health provider, find out which insurance companies cover them in the new exchange. on The WeB u Find out more at bewellnm.com u Review the various insurance plans available through the exchange at nmhealthratereview.com/about.aspx u Find out if you qualify for a health insurance tax credit subsidy at kff.org/ interactive/subsidy-calculator u Compare the rates of various plans on the health insurance exchange for your county at dataset/New-Mexico-QHP-IndividualMarket-Medical-Landscape/mq97-jxwi our members for 25 years. The Affordable Care Act doesn’t change that.” “We know the struggles they are going through,” she said. “We in no way want there to be a gap in coverage for these folks.” Find out more at. Contact Staci Matlock at 986-3055 or smatlock@sfnewmexican.com. Follow her on Twitter @stacimatlock. Colorado mining accident kills 2 workers, injures 20 OURAY, Colo. —- more Associated Press Monday, November 18, 2013 THE NEW MEXICAN A-5 More oil and gas drillers turn to water recycling By Ramit Plushnick-Masti The Associated Press plenti- ful sites in South Texas and New Mexico, Manager Jimmy Davis said. “We face the same problems,” Davis said. “There’s not an abundance of freshwater.” New Colorado? Some of state’s rural residents back secession idea to grab the attention of a Democratic-controlled Legislature. They say the vote results emphaDENVER — The nation’s size a growing frustration in connewest state, if rural Colorado servative prairie towns with the residents had their way, would more populous and liberal urban be about the size of Vermont Front Range, which has helped but with the population of a solidify the Democrats’ power. small town spread across miles “We can’t outvote the metroof farmland. There wouldn’t be politan areas anymore, and the civil unions for gay couples, new rural areas don’t have a voice renewable energy standards, or anymore,” said Perk Odell, 80, limits on ammunition magazines. a lifelong resident of Akron in After all, those were some Washington County, which voted of the reasons five counties on to secede. the state’s Eastern Plains voted The five counties share borearlier this month to approve the creation of a 51st state in the first ders, covering about 9,500 square miles and have a combined place. Secession supporters know the population of about 29,200. Four votes were symbolic, designed of the counties — Philips, Yuma, By Ivan Moreno The Associated Press struc- tures.” CUSTOM TORNADOS Sanbusco Center • 989-4742 papers across the South, had “acted with gross neglect” in the Harrisburg editors until not covering pivotal civil rights their editorial, which ran Thurs- events. day with a column explaining “We did it through omission, the decision to declare: “The by not recording for our readers Patriot-News regrets the error.” many of the most important civil Donald Gilliland, the reporter rights activities that happened who wrote the explanatory in our midst, including protests article, noted that the dismisand sit-ins. That was wrong,” the sive comments about Lincoln’s Meridian Star said. address did not appear until The Patriot-News apology five days after he had delivered lacks the somber tone of those them. Days earlier, the paper apologies, but it is no less signif— then called the Patriot & icant, said Todd Gitlin, a profesUnion — had devoted extensive sor of sociology and journalism coverage to the president’s visit at Columbia University. to the Pennsylvania city, includ“An apology is sort of a port of ing printing the full text of his entry to a recognition of what’s speech without editorial comat stake and what our values ment, Gilliland noted. are,” Gitlin said. Gilliland also said the critical He said Lincoln’s message — editorial was not aimed only at that the nation was in a fight for Lincoln’s words, but also at what democracy — is as true today editors considered the political as it was then, citing the current theater of the Gettysburg event, battles over issues such as voter which was held to dedicate a ID laws, which civil rights activcemetery to Union soldiers ists say are designed to limit killed during the battle there minority voting. four months earlier. “The reason why I think it Whatever the context, Gilmakes sense … to take note liland wrote that the words of the retrograde position the that appeared on Nov. 24, 1863, paper held is because this prinearned the newspaper “an ciple is still being fought over,” enduring place in history for Gitlin said. having got Lincoln’s Gettysburg Five copies of the speech Address utterly, jaw-droppingly exist: two in the Library of Conwrong.” gress, one in the White House, This isn’t the first time a one at the Illinois State Historinewspaper has apologized many cal Library and one at Cornell. years after the fact. In 2004, All are written in Lincoln’s neat the Lexington Herald-Leader penmanship, but they contain in Kentucky apologized for its slight differences. failures in covering the civil The copy at Cornell, for rights movement in the 1960s. example, reads “on this contiThe Meridian Star in Mississippi nent” instead of “upon this continent” in the famous first line. issued an apology to coincide That sets it apart from the with President Barack Obama’s two in the Library of Congress, 2009 inauguration, saying in which were written before Linan editorial that it, and many New Shipments of Cotton & Linen Robes, and Pj’s university police officer while it is on display. Hamill marveled at the idea that a president with a war to run had taken the time to write out his speech five times. And in perfect penmanship. The Patriot-Union said that with the anniversary of the speech, “the time was ripe” to clear the air. “Really, this isn’t a question of “Family Owned & Operated Since 1965” $179 95 Chain SpeCial B uy 3 get 1 F ree journalism ethics, as would be the case with a serious retraction,” the paper’s deputy opinion editor, Matthew Zencey, wrote to iMediaEthics.org, which monitors media errors, apologies and retractions. “It was more a way of using the 150th anniversary to say, with a wink, ‘Gee, can you believe what rock heads ran this outfit 150 years ago?’ ” “Family Owned & Operated Since 1965” MS170 Chain SaW authorized Dealer Mon-Fri 8-5 Sat 8-12 1364 Jorgensen ln. (off Cerrillos Rd.) 471-8620 • 877-211-5233 48th Anniversary Specials $179 95 Chain SpeCial B uy 3 get 1 F ree MS170 Chain SaW authorized Dealer Mon-Fri 8-5 Sat 8-12 1364 Jorgensen ln. (off Cerrillos Rd.) 471-8620 • 877-211-5233 48th Anniversary Specials Brian McPartlon Roofing LLC. Ask us about roof maintenance on your house 505-982-6256 • Multimedia Graphic/Web Designer Multimedia Graphic/Web Designer needed for ad layout for the pages of The Santa Fe New Mexican, its magazines and its website. Full Time/Full Benefits Medical/dental insurance w/dependent & domestic partner coverage available • Paid vacation • Paid sick days & holidays, personal day • 401K • Paid term life insurance Requirements 982-3298 Sanbusco Center SOUTHWEST PLASTERING COMPANY, INC. MAINTAIN YOUR ROOF & STUCCO Over 30 years experience in roof repair Michael A. Roybal coln delivered the address, a time lag that probably explains the different wording. Lincoln wrote the Cornell copy a few days after the speech at the request of George Bancroft, a historian who wanted to make reproductions of the document to raise money for wounded soldiers. Hamill said Lincoln used highquality linen-based paper and iron gall ink derived from gall nuts. He sent it to Bancroft, but the effort fell flat. That’s because Lincoln had written on both sides of a piece of paper, and technology did not allow the reproduction of double-sided documents. Bancroft asked for another copy. “Imagine, this is a time of war and you’re asking Lincoln again to do this thing,” Hamill said. The president sent Bancroft a fresh copy, using two pieces of paper. Bancroft was left with what at the time seemed to be a “piece of useless paper,” Hamill said, but he held onto it and willed it to his grandson, a chemistry professor at Cornell. During the Great Depression, the document was sold to a New York City dealer, but it eventually ended up back in Cornell’s hands, where it is guarded by a 505-438-6599 • High competence with Mac platform Adobe CS Suite • Competent in HTML, CSS and web design • Accurate, fast keyboard skills • Flexible personality & good sense of humor • Can-do, problem-solving attitude • Excellent memory & detailed-oriented • Bend, lift & carry 25 pounds regularly Apply by cover letter and resume to: Tamara Hand The Santa Fe New Mexican, PO Box 2048, Santa Fe 87504; or by email to: thand@sfnewmexican.com NO PHONE CALLS PLEASE. You turn to us. 164 Years of Trust and Reliability in the Santa Fe Community ERT AU TO Continued from Page A-1 E XP Redress: Anniversary of Lincoln’s speech is Tuesday SUBARU SPECIALISTS 438-7112 City of Santa Fe MEETING LIST WEEK OF NOVEMBER 18, 2013 THROUGH NOVEMBER 22, 2013 MONDAY, NOVEMBER 18, 2013 1:30 PM SANTA FE MPO TECHNICAL COORDINATING COMMITTEE – Market Station, 500 Market Street, Suite 200 5:00 PM FINANCE COMMITTEE – City Council Chambers, City Hall, 200 Lincoln Avenue TUESDAY, NOVEMBER 19, 2013:00 PM SANTA FE MPO TRANSPORTATION POLICY BOARD - Market Station, 500 Market Street, Suite 200 4:30 PM SANTA FE PUBLIC LIBRARY BOARD – Main Library, Pick Room, 145 Washington Avenue 5:15 PM SANTA FE REGIONAL JUVENILE JUSTICE BOARD – CYFD Offices, 1920 Fifth Street 6:00 PM CHILDREN AND YOUTH COMMISSION - Market Station Conference Room, 500 Market Street WEDNESDAY, NOVEMBER 20, 2013 9:30 AM DIVISION OF SENIOR SERVICES SENIOR ADVISORY BOARD OF DIRECTORS – Mary Esther Gonzales Senior Center, 1121 Alto Street 3:30 PM COMMUNITY DEVELOPMENT COMMISSION – City Councilors’ Conference Room 5:30 PM BICYCLE AND TRAIL ADVISORY COMMITTEE – City Council Chambers 6:00 PM SANTA FE CIVIC HOUSING BOARD OF COMMISSIONERS – 664 Alta Vista THURSDAY, NOVEMBER 21, 2013 8:30 AM OCCUPANCY TAX ADVISORY BOARD – City Council Chambers 9:00 AM SANTA FE CITY AND COUNTY ADVISORY COUNCIL ON FOOD POLICY – Angel Depot Conference Room, 1222 Siler Road 9:00 AM SANTA FE REGIONAL EMERGENCY COMMUNICATIONS CENTER BOARD – Santa Fe County Public Safety Complex, South Highway 14, #35 Camino Justicia 4:30 PM ARCHAEOLOGICAL REVIEW COMMITTEE – City Councilors’ Conference Room 4:45 PM MAYOR’S YOUTH ADVISORY BOARD – Santa Fe High School, 210 Yucca Road FRIDAY, NOVEMBER 22, 2013 NO MEETINGS SCHEDULED SUBJECT TO CHANGE For more information call the City Clerk’s office at 955-6520 A-6 NATION THE NEW MEXICAN Monday, November 18, 2013 IMMEDIATE Teacher killings bring profession’s risks to light A 2011 survey found that The Associated Press 80 percent of teachers reported being intimidated, harassed, When a 16-year-old student assaulted or otherwise victimslammed a metal trash can onto ized at least once during the Philip Raimondo’s head, it did previous year. more than break open the hisOf the 3,000 teachers surtory teacher’s scalp, knock him veyed, 44 percent reported out and send him bleeding to physical offenses including the floor. thrown objects, student attacks “It changed my whole world,” and weapons shown, according Raimondo said about the attack to the American Psychologiin the school where he taught cal Association Task Force on for 22 years. Violence Directed Against Experts say the phenomenon Teachers, which conducted the of student-on-teacher violence national web-based survey. is too often ignored. The task force recommended “There’s some reluctance creating a national registry to to think that the teaching protrack the nature and frequency fession can be unsafe,” said of incidents, saying this would Dr. Dorothy Espelage of the help develop plans for prevenUniversity of Illinois. tion and intervention. It also The educational psychology suggested that all educators be professor recently headed a required to master classroom national task force on classroom management before they are violence directed at teachers. licensed to teach. The group found that little has Raimondo, who taught in Bufbeen done to try to understand falo, N.Y., was diagnosed with or prevent such incidents post-traumatic stress disorder despite the potential implicaand thought about suicide after tions on teacher retention and suffering a concussion and student performance, among other head injuries that required other things. 32 staples and more than But the October deaths, one 40 stitches. day apart, of Nevada middle Unable to return to teachschool math teacher Michael ing, the history teacher who Landsberry, who was shot on coached cross-country, girls’ a basketball court by a suicidal basketball and softball remains 12-year-old, and Massachusetts in therapy and on medication high school math teacher Coltoday, nearly 10 years later. leen Ritzer, who authorities said “I trusted kids,” Raimondo was attacked by a 14-year-old said, becoming emotional as he student inside a school bathtold The Associated Press his room, have brought the issue to story for the first time. “I loved the forefront. what I did. For 22 years, that About 4 percent of public was my identity.” His attacker, one of two girls school teachers reported they he had stopped from fighthad been attacked physically during the 2007-08 school year, ing, pleaded guilty to assault and was sentenced to up to six according to the U.S. Departmonths in jail. ment of Education, citing a The National Education 2012 school safety report. Seven Association, the largest teachpercent were threatened with ers’ union, has reported anecinjury by a student. By Carolyn Thompson PAYMENT FOR dotal Dr. Gerald Juhnke of the University of Texas at San Antonio, an expert on the disorder. Fine Jewelry • Diamonds • Platinum um Gold Watches • Coins & Silver SPECIAL 3 DAY BUYING EVENT 18th, & March 20th Thurs.,November March 1st thru19th Sat.,, changes are you won’t wear it os use it again.” YOU SLEEP AT A HOTEL, WHY WOULD YOU SELL YOUR JEWELRY THERE? • MEET OUR EXPERT APPRAISERS • Jewelry. OUR KNOWLEDGEABLE BUYERS CAN MEAN MORE MONEY FOR YOU. You may rest assured that your property will be accurately and professionally appraised for it’s MAXIMUM CASH MARKET VALUE by our expert appraisers. APPRAISALS ARE FOR PURCHASE ONLY - NO CURIOSITY SEEKERS, PLEASE. WANTED - Diamond. WANTED - Fine Antique Jewelry. Empty stocking NA fund ®. DONATE TODAY For more than three decades, The Empty Your gift makes all the difference to a local family in need — restoring hope and strengthening our community. Stocking Fund has Contibute online at: santafenewmexican.com/emptystocking served as a critical or by check to: safety net for those The New Mexican’s Empty Stocking Fund c/o The Santa Fe Community Foundation, P.O. Box 1827, Santa Fe, NM 87504-1827. community. Solid gold chains, bracelets, rings, earrings, charms, pendants, pins, broaches, clips. Gold nuggets, dental gold (white and yellow), broken bits and pieces of gold. If you can provide a needed service such as roofing, car repair, home repairs, etc. contact Roberta at Presbyterian Medical Services at 505-983-8968. YES. WE BUY ALL OLD AND UNWANTED GOLD IN ANY CONDITION. PLEASE SEE US FOR YOUR BEST OFFER. We Offer Top Dollar Our Expert Appraisers known the International Markets and are prepared to offer you top New York Prices. Don’t Sell for less. If you can contribute food, clothing, toys, housewares or furniture in good condition or other items or services, please contact The Salvation Army at 505-988-8054. santafe newmexican .com / EMPTYST experiencing financial challenges in our WANTED - Fine Sterling Silver.. 100% THURSDAY & FRIDAY 10AM TO 6PM November 18th, 19th & 20th SATURDAY 10AM TO 4PM Mon.,Tues., Wed.2ND • 10AM-6PM MARCH 1ST, & 3RD of your tax deductible donation goes to those in need. 171 Paseo deNO Peralta Santa Fe,NEEDED. NM • 505-988-8009 APPOINTMENT GEM GALLERY RJ-0000408364 Founded by the Santa Fe New Mexican and jointly administered by these organizations. Lunes, el 18 de noviembre, 2013 THE NEW MEXICAN EL NUEVO MEXICANO Hombre de muchos talentos De Uriel J. Garcia ación, en 1963, se mudó a Colorado para ingresar a la universidad Fort Lewis College, universidad de humaniichard Jay era sólo un infante dades en Durango. Pero su carrera cuando se mudó a Santa Fe de universitaria fue truncada cuando fue la Costa Este en 1946 y siempre llamado al servicio militar en 1964, a la la ha llamado su casa, dice. edad de 19, para servir a su país en la “Algunos caminos ahora pavimenGuerra de Vietnam. Sirvió en la Fuerza tados antes no eran más que tierra,” Aérea de 1964 a 1968. recuerda Jay. Aunque la Guerra de Vietnam no fue Su padre, veterano de la Segunda bien vista, su época en la Fuerza Aérea Guerra Mundial y la madre de Jay, se es un motivo de orgullo en su vida, mudaron junto con tres familiares a dice Jay. Especialmente porque viene Pojoaque, ubicado a 16 millas al norte de una familia de veteranos, añade. de Santa Fe, al final de la guerra, dice. “Decidí ir a servir al país porque Desde entonces, Jay, de 69 años, ha mi padre fue veterano de la Segunda apreciado el área de Santa Fe y lleva Guerra Mundial,” dice, al igual que su dentro el moto de Nuevo México, “La tío. Tierra del Encanto,” dice. “Pero nadie nos quería cuando “Definitivamente creo en las palregresamos a casa,” dice, recordando abras La Tierra del Encanto, que son el ambiente del país al regresar a tan ciertas,” dice. “Con los cielos mara- Nuevo México después de haber servillosos [del estado], los atardeceres y vido en la Fuerza Aérea. sus amaneceres.” Continuó con su vida en el estado Asistió a la preparatoria St. y asistió a la Universidad de Nuevo Michael’s, dice, después de su graduMéxico después de su tiempo en el The New Mexican R Richard Jay añade. “He sido muy afortunado,” dice. En 1974, tuvo otro giro en su carrera y comenzó el negocio de bienes raíces, menciona. Con casi cuatro décadas en este campo, cuenta que ha conocido el área de Santa Fe como la palma de su mano. “Lo he disfrutado mucho, es una profesión increíble,” dice. “El placer está en conocer a compradores y servicio militar. Aunque se tituló en vendedores, de los cuales algunos lleAntropología, nunca ejerció su carrera, gan a ser amigos al pasar los años.” así que buscó algo que disfrutara más, Dice que el estar en este negocio, dice. le ha permitido ver quien va y viene Una de las razones por las que a en Santa Fe, aprendiendo así mucho Jay le encanta Santa Fe y el estado en sobre la historia de la comunidad. general es por las actividades al aire “Pienso que [Santa Fe] ha crecido de libre, dice. Al graduarse de UNM, fue una manera hermosa,” dice. “Santa Fe gerente de una tienda de esquiar por ha crecido bien y la parte histórica de varios años. La práctica de canotaje, la ciudad se ha preservado, manteniéesquí y ciclismo de montaña son ndose intacta gracias a las cláusulas algunas de las actividades que ha dishistóricas.” frutado con sus tres hijos y sus cuatro nietos. También ha disfrutado de los Traducción de Patricia De Dios para cielos de Nuevo México como piloto, The New Mexican. ha trabajado en el negocio de bienes raíces en Santa Fe por casi cuatro décadas. Su presupuesto esta temporada festiva un estricto monto en dólares. u Abra una cuenta de La temporada de fiestas es ahorros reservada para sus una época de amigos, familia gastos de las fiestas. Cuando y buen ánimo. Pero también terminen las fiestas, empiece puede ser un momento de a ahorrar para el próximo año presión, discusiones, obligaen la misma cuenta. Aunque ciones y gasto de dinero. … algunos bancos aún ofrecen mucho dinero. cuentas “Club navideño,” a “La gente se deja atrapar menudo tienen mayores tasas por la temporada, las luces y de interés que las cuentas de las emociones de las fiestas, ahorros tradicionales. Una a menudo permitiendo que cuenta de ahorros en línea su buen sentido financiero también se tome unas vacacio- facilita la programación de los depósitos cada día de pago y nes,” dice Michael McAuliffe, puede ayudar a asegurar su Presidente de Family Credit éxito. Management, una agencia de u Averigüe lo que necesita asesoría de crédito sin fines apartar cada día de pago y de lucro. añada fondos a la cuenta de “Incluso si hace una lista, ahorros cada vez que pueda. la comprueba dos veces y se u Inicie una lista de ideas ajusta a ella, es mucho más de regalos y empiece a estar fácil ahorrar en incrementos atento a esas ofertas. Y esté más pequeños de antemano, consciente de las políticas de en lugar de conseguir varios cientos de dólares más tarde,” devoluciones. No planificar puede llevar dice McAuliffe. a una genuina catástrofe Así que, ¿qué puede empefinanciera, dicen los expertos. zar a hacer hoy para disfrutar “Nunca falla que cada mes de una feliz temporada libre de enero estamos inundados de estrés financiero? con personas que gastaron en u Cree una lista de todas exceso y planificaron de modo las personas para las que va a comprar regalos y establezca insuficiente sus gastos de fiesDe StatePoint Tuesday has LOCAL BUSINESS Tuesday, January 15, 2013 LOCAL BUSINESS BUSINESS BEAT Home sales in Santa Fe rise 23 percent By Bruce Krasnow The New Mexican T he Santa Fe Association of Realtors will announce the details at its media breakfast Jan. 16, but the news is now official: 2012 was the best year for residential home sales since 2007. Alan Ball, an agent with Keller Williams Santa Fe who keeps monthly sales data, reports residential sales hit 1,641 last year — up 23 percent from 2011. But as we’ve reported here all year, that does not mean all is well with the sellers. Due to distressed short sales and foreclosures, the average sales prices dropped 6 percent in 2012 to $421,577. But the year ended with a bang as December saw 150 sales — and the fourth quarter itself saw three strong months in a row, and that despite the fiscal uncertainties coming from Washington, D.C. uuu When it comes to brewing, Jami Nordby says, ‘There are so many directions people can go. Imagination is the only limit.’ Nordby owns Santa Fe Homebrew Supply. PHOTOS BY LUIS SÁNCHEZ SATURNO/THE NEW MEXICAN His business is hopping Knowledge about beer-making given and received at Santa Fe Homebrew Supply By Chris Quintana The New Mexican J ami Nordby doesn’t sell beer — he just sells all the materials a person needs to make it at Santa Fe Homebrew Supply. Nordby stocks wine-making, beercrafting and cheese-curdling materials, though the majority of his business comes from brewers. To that end, he stocks supplies for extract brewing, which he said can be easier but costs more on the ingredients end, and for all-grain-brewing, a more time-intensive process. He said that in the past, beermakers made up 85 percent of his total sales, though he said the recent crop of fruit in the state has sent more winemakers his way. And while he doesn’t have a product he’d call his best-seller, he said he does sell a lot of brewing starter kits and recipe packs that include every ingredient needed for a single batch. To that end, he can also help brewers come up with new recipes or order speciality items. “There are so many directions people can go,” Nordby said at his shop on Thursday. “Imagination is the only limit.” Nordby’s shop is split roughly into two sections: equipment in the storefront and ingredients in the back. In the front, giant glass containers rest on shelves alongside powdered chemicals. Smaller items such as spigots, beer caps and yeast line the smaller shelves. It’s the back of the shop that feels At Santa Fe Homebrew Supply, 3-foot-tall plastic containers house both local and international grain for all-grain brewing. more like a brewery. Three-foot-tall plastic containers house both local and international grain for all-grain brewing, and a couple of freezers hold several varieties of green and earthy-smelling hops, another common ingredient in beer making. Nordby can tell which grain will create a chocolate porter or which hops will make a beer more bitter with an ease that comes from years of familiarity with his craft. But it wasn’t always that way for him. The shop was a gamble, Nordby said, especially given that he didn’t have a lot of brewing experience when he began the venture. Nordby said that he had a passion for the craft, but he did it on a small level — he used to brew in his apartment. But about five years ago, he said, he noticed Santa Fe didn’t have a local brew supply store, so he and a couple of friends financed the store. “We just didn’t know any better,” he said. Part of his success came from an advertising campaign that consumed about 25 percent of his initial budget. From there, people started talking about the shop, which he said kept him in business. His wife also had another child during that five-year period, so he hired some part-time help to keep the doors open during times when he was away. But because the store earnings went to employees, Nordby said, his inventory declined. He is back at work full time now, and Nordby said he’s working on replenishing his once-expansive stock. In the five years since he started, Nordby said that he’s learned a lot from customers who were experienced brewers, and now he can offer that accumulated knowledge to newbies. John Rowley said he is one of the customers who has benefited from Nordby’s knowledge. “He was a great resource for sure,” Rowley said. “He knows a lot, and he wants to help.” Rowely also is president of the Sangre de Cristo Craft Brewers, a group that Rowley said frequents Homebrew. And though it’s located on the south side of town, Santa Fe Homebrew Supply is still the closet supply store for small brewers in Santa Fe, Rowley said. Before Nordby set up shop in 2007, Santa Fe brewers drove to Albuquerque or farther for supplies. Rowley said that while stores in Albuquerque might have more esoteric supplies, he prefers to avoid the trip and support local business. Rowley also said he recommends Nordby’s store to new brewers. “We got a great thing going here; it’s a really supportive shop,” Rowley said. “I wouldn’t go to Albuquerque unless you absolutely have to. It’s almost too much, and it can be intimidating for a new brewer.” Contact Chris Quintana at cquintana@sfnewmexican.com. You turn to us. The restoration project at La Fonda is well under way, and one of the challenges for Jennifer Kimball and her managers is to phase the project so it doesn’t impact visitors. To accomplish that, contractors try to start work at 9 a.m. on the first 100 rooms now under construction. As those rooms come back on line in April or May, the renovation moves to the next 80 rooms with the goal of having all the rooms completely modernized and ungraded by Indian Market weekend. Kimball is also proud that all of the 220 workers will remain employed during the nine-month project and that vacancy rates have not been impacted. Because of the lower supply of rooms, occupancy is close to 100 percent — of course, the $89 a night special La Fonda is offering during the remodeling doesn’t hurt with bargainconscious travelers. Majority ownership in La Fonda still rests with the four daughters of the late Sam and Ethel Ballen — Lois, Penina, Lenore and Marta Ballen. uuu, association chairman and a builder in Drexel Hill, Pa. Growth indicators in the last quarter of 2012 are as follows: u Current business conditions up 2.1 percent since last quarter u Number of inquiries up 3.9 percent since last quarter u Requests for bids up 3.7 percent since last quarter u Conversion of bids to jobs up 3.5 percent since last quarter u Value of jobs sold is up 4.3 percent since last quarter). “Now that the election is over, consumer confidence is starting to grow and so has remodelers’ confidence,” O’Grady says. “NARI members are looking forward to having a well-deserved, productive year Kim Alwell compra algunos regalos en 2011. CLYDE MUELLER/THE NEW MEXICAN tas,” dice Sarabeth O’Neil, Directora de Desarrollo de FCM. Entre atender a los huéspedes, viajar, decorar la casa y hacer regalos, no es ningún secreto que las fiestas vienen con una etiqueta de precio. Hay más sugerencias de gasto sensato en las fiestas y herramientas gratuitas de planificación financiera disponibles en. En lugar de gastar sin pensar en estas fiestas, puede tomar medidas para evitar agotar las tarjetas de crédito, vaciar las cuentas bancarias y otras trampas estacionales. Crucigrama No. 10701 CRUCIGRAMA NO 10701 Horizontales 1. Persona que imita con afectación las maneras, opiniones, etc., de aquellos a quienes considera distinguidos. 5. Pasta de goma laca y trementina, que se emplea, derretida, para cerrar y sellar cartas, documentos, etc. 8. Alero del tejado. 10. Pensión para estudios. 11. En retórica, atenuación. 13. Amebas. 16. Ijadas. 17. Padecerá tos. 18. Juego que consiste en sortear una cosa entre varios (pl.). 20. Nota musical. 22. Líquido transparente y viscoso que lubrica las articulaciones de los huesos. 23. Símbolo del holmio. 24. Símbolo del antimonio. 26. Hermano mayor de Moisés. 27. Siglas inglesas de “knockout” usada en boxeo. 28. Variedad de rosas y frutos muy delicados. 30. Prefijo “detrás”, “después de”. 32. Persona encargada de la tutela de alguien o algo. 33. Pedazo de tela viejo y roto. 34. De hueso. 35. Preposición inseparable “del lado de acá”. 37. Antigua ciudad de Italia, en Lucania. 38. Nave. 39. Estaba encendido. 41. Siglas del ácido desoxirribonucleico. 42. Círculo rojizo que limita ciertas pústulas (pl.). 44. Que es poco concreto, claro o limitado. 45. El que tiene por oficio fabricar o vender armas. Verticales 2. Relativo al nacimiento. 3. Aroma, fragancia. 4. Conjunto de piezas de artillería dispuestas para hacer fuego. 5. De Limoges, región del sur de Francia. 6. Pastor siciliano amado por 7. 9. 10. 11. 12. 14. 15. 19. 21. 23. 25. 27. 28. 29. 30. Galatea. Tener lugar o entrada. Zopisa. De Batavia, antiguo país de Europa. Unir, atar. (Golfo de ...) Golfo de Ysselmeer, cerca de Amsterdam. Terminación de infinitivo. Cavidad orgánica, a veces muy pequeña o microscópica, de los vegetales. Facineroso que anda fuera de poblado, huyendo de la justicia. Delantal pequeño. Recibir uno huéspedes en su casa y darles alojamiento. Acción de golpear con el bate. Mamífero marsupial de Australia cuyas cuatro patas son prensiles y provistas de uñas afiladas. Nombre de varios reyes germánicos. Alabo. Prefijo que indica antelación. O 10700 Solución del No.N10701 SOLUCION DEL 31. Remolcan la nave. 35. Crío (produzco). 36. (Lucio Cornelio, 138-78 a.C.) General y político romano. 39. (... Magna) Obra cumbre de Raimundo Lulio. 40. Río de Suiza. 42. Símbolo del oro. 43. Símbolo del samario. A-7 Grampo discusses ‘inglés’ G rampo, Grama y Canutito estaban todos bien stuffed after having eaten todo el turkey pa’ Thanksgiving. Grampo gave un burp and his regoldido made Canutito look up del pastel de calabaza topped con whipped cream que estaba comiendo. “Which part del ganso did you like the most, grampo?” he asked his grandfather. “Pus ése es un tough call,” Grampo Caralampio began. “I like to roer on the breast part pero después de hacer nibble on it, I like to comer el ostión.” “What part of the turkey es el ‘oyster’, grampo,” Canutito asked him. “Es la juicy meat que está en el hollow del hip socket,” grampo replied. “También es la favorite part de Mana Larry Torres Tiburcia. You Growing up know her. Ella Spanglish es la lady en la iglesia who is always giving you el ‘piece of sign.’ ” “I think you mean que she gives me el ‘sign of peace,’ grampo,” Canutito corrected him. “No, I think que it is called el ‘piece of sign’ just like it is called el ‘piece of pie’ o el ‘piece of cake,’ ” grampo insisted stubbornly. “It’s not ‘piece’ pero ‘peace’,” Canutito mumbled to himself. Pero he decided de hacer test el command of English que su grampo tenía so he asked, “Grampo, can you help me comprender el inglés like you do?” “Pus chur, m’hijo,” grampo replied. I know el Englich murre bien. Just give me unas cuántas words and I’ll give you sentences so that you can see cómo son usadas.” “Okay,” said the little muchachito looking down at la caja de Kleenex que la familia had used como napkins. “Give me una sentence con la word ‘tissue.’ ” “Fácil,” grampo said: “I’m going to tissue how to hacer ride un caballo.” Canutito just looked at him and then down al vaso de agua that was before him antes de decir: “Ahora, deme una sentence con la word ‘water.’ ” Sin hacer bat an eye, grampo said, “Tu grama is toda mad at me pero yo no sé water problem is.” Again Canutito no podía hacer más que stare at su grampo. Then looking down to the mesa donde los dishes todavía estaban scattered, Canutito said: “Ahora deme una sentence con la palabra ‘butter.’ ” Grampo, quien estaba en un hot streak, answered: “Esa muchacha in church tiene un nice body, butter face leaves algo to be desired.” Just then Grama Cuca started to hacer clear away todas las soda pops que estaban en la mesa. Canutito looked at her y dijo: “Ahora give me una sentence con la word ‘sodas,’ grampo.” “Fácil,” Grampo Caralampio replied: “A mí me gustan muncho los frijoles and sodas your grama.” Canutito now glanced pa’l sink donde su grama estaba washing los dishes. Right next to her en la pared estaba un calendario with a picture del Presidente Benito Juárez on it. Canutito said: “Grampo, deme una sentence con la word ‘Juárez.’ ” “No problem,” said Grampo Caralampio: “Cuando your grama pinched me en la iglesia for snoring I just asked her ‘Júarez your problem, vieja?’ ” And then grampo added, “Speaking of la iglesia, I think que Mana Tiburcia just gives you the piece of sign porque ella es una ‘hoochie mama.’ Do you know lo que ‘hoochie’ means, m’hijo?” Pero ahora it was Canutito who decided de ser todo sneaky. He smiled and said, “Pus chur, grampo. It is like, ‘Grama caught you looking a una sexy señorita en la iglesia pero she pinched you porque you didn’t tell her ‘hoochie’ is.” Ahora it was grampo’s turn de hacer stare al muchachito … A-8 THE NEW MEXICAN Monday, November 18, 2013 Monday, November 18, 2013 THE NEW MEXICAN A-8 New game TECH consoles Motorola unveils budget smartphone face altered landscape Company targeting millions who can’t afford costly phones with $179 Moto G By Anick Jesdanun The Associated Press NEW YORK — twoyear, ser- vicea- bytes. TECH REVIEW PLAYSTATION 4 Sony Computer Entertainment President and CEO Andrew House addresses the media as he stands in front of a display showing images of the new PlayStation 4 at the Sony PlayStation E3 media briefing in Los Angeles in June. ASSOCIATED PRESS FILE PHOTO By Lou Kesten The Associated Press Video-game fans who reserved Sony’s PlayStation 4 several months ago shouldn’t have any regrets. Terrific but not essential — yet: u In Ubisoft’s Assassin’s Creed IV: Black Flag, you can see the wind billowing the sails of your pirate ship. u In 2K Sports’ NBA 2K14, you can read LeBron James’ tattoos and see individual beads of sweat of his forehead. u. By Barbara Ortutay The Associated Press NEW YORK — went on sale Friday, and the Xbox One will be released last.” Out now: Games The following games are among those scheduled for release last week, according to Gamestop.com: Nov. 11 u Need for Speed: Rivals (PlayStation 4; rated E10+) Nov. 12 u NBA 2K14 (PlayStation 4, Xbox One; rated E) u XCOM: Enemy Within (PC, PlayStation 3, Xbox 360; rated M) u DuckTales Remastered (Nintendo Wii U, PlayStation 3, Xbox 360; rated E) u SimCity: Cities of Tomorrow (PC; rated E10+) u Transformers Ultimate Autobots Edition (Nintendo DS; rated E10+) u Transformers Ultimate Battle Edition (Nintendo Wii; rated E10+) u Ratchet & Clank: Into the Nexus (PlayStation 3; rated E10+) u Injustice: Gods Among Us Ultimate Edition (PC, PlayStation 3, PS Vita, Xbox 360; rated T) u Frozen (Nintendo 3DS; rated E) u Barbie Dreamhouse Party (Nintendo DS, Nintendo 3DS, Nintendo Wii, Nintendo Wii U; rated E) u Assassin's Creed IV Black Flag (PlayStation 4; rated M) u Just Dance 2014 (PlayStation 4; rated E10+) u Battlefield 4 (PlayStation 4; rated M) u FIFA 14 (PlayStation 4; rated E) u Madden NFL 25 (PlayStation 4; rated E) Nov. 15 u PlayStation 4 console went on sale u Lego Marvel Super Heroes (PlayStation 4; rated E10+) u Girls Fashion Shoot (Nintendo 3DS; rated E) u Injustice: Gods Among Us Ultimate Edition (PlayStation 4; rated T) u Mario & Sonic at the Sochi 2014 Olympic Winter Games (Nintendo Wii U; rated E) Lexington (Ky.) Herald-Leader Monday, November 18, 2013 THE NEW MEXICAN Be careful with consequences — they can backfire Family iPads out of sync at L.A. Waldorf School bucks long tradition of keeping kids tech-free; not everyone is on board By Howard Blume LOS ANGELES he eighth-graders in Stephanie McGurk’s class at Ocean Charter School began a recent day as they usually do: reciting a verse celebrating nature. Next, they played scales on recorders as they sat in a classroom furnished with wooden furniture, lamps, wicker baskets, artwork and plants. Then McGurk did something incongruous in a school that avoids plastic toys, let alone technology: She handed each student an iPad. By chance, Ocean Charter, a school based on the Waldorf educational philosophy, became part of the much-debated $1 billion effort to provide an iPad to every student and teacher in the Los Angeles Unified School District. As a charter school, Ocean is run independently of L.A. Unified. Still, under state law, charters are entitled to roughly equivalent learning conditions, and L.A. Unified decided that charters operating on district property are eligible for iPads. Question: conseJohn quence; second, that consequences, propRosemond erly selected and properly used, work. Living With There is some truth to both of these Children that he was caught is price enough. If it’s part of an overall pattern, then it’s definitely time to apply consequences. You can, for example, human beings. It may rewards can actually lower performance or stimulate an increase in misbehavior, and. Sonny Jennings receives an iPad on Nov. 7 in Stephanie McGurk’s eighth-grade class at the Ocean Charter School in Westchester, Calif., as part of a $1 billion program to provide the devices to all students in Los Angeles public schools. Los Angeles Times T MARK BOSTE LOS ANGELES TIMES. Mack-Fett was discomfited by a promotional video showing a classroom of students plugged into tablets with ear buds. “This technology shouldn’t replace a school community with people interact- A-9 ing. Sixth-grade Ocean.” © 2013 by Vicki Whiting, Editor Jeff Schinkel, Graphics Vol. 29, No. 49 Snails hatch from eggs as teeny, tiny snails. As they grow, the shell grows, too. Snails don’t live just in gardens. They can also be found in ponds and even in the ocean. They are related to oysters, clams and even octopuses. They are part of the group of animals with soft bodies known as mollusks. A snail’s eyes are at the end of its long tentacles. The short tentacles are for smelling. Snails slide along the flat part of their body, called the “foot.” Snails make a trail of silvery slime. This helps them to slide up walls and even crawl upside down. Snails breathe through a hole near their shell. How many snails can you find on this page? Help this snail find its way to the Snail Motel. If the weather turns very cold or very dry, a snail pulls into its shell and waits for the cool, damp weather it loves. It fills up the opening of its shell with a mucus-like slime, that hardens into a snug door. You can make a comfy motel and invite some snails for a visit. Look for snail visitors under rocks and leaves. Circle one snail on this page each time you read 2 column inches of the newspaper. Can you circle all of the snails before the week is out? 1. Partially fill a large jar with moist soil. 2. Add a piece of chalk, some leaves, grass, and chunks of bark. End 3. Give the snails lettuce and cabbage leaves to eat. 4. Keep the jar covered with a piece of nylon stocking or window screen. 5. Keep the Snail Motel in a shady place. 6. Twice a week replace the old soil and food. Standards Links: Reading Comprehension: Follow multiple-step written directions Draw a circle on a large piece of paper. Draw a small circle inside the 17 + 6 + 9 large circle. Put two snails or more in the small circle and watch to see which one slides out to the large circle first. 28 - 6 + 12 Do the math to see which snail will win the race. Highest number wins! 42 - 11 + 5 9+9+9 Standards Link: Math: Compute sums and differences. SNAILS TENTACLE OCEAN WINDOW SLIME CHALK WEATHER SMASH SHELL LETTUCE MOIST TRAIL MOTEL SCREEN CHUNKS Find the words in the puzzle. Then look for each word in this week’s Kid Scoop stories and activities. C H U N K S T W I T E S D S C R E E N S Are you an eagle-eyed reader? Circle the seven errors in the article below. Then, rewrite it correctly. While snails are considered destructive pests to almost everyone with a garden, in in they’re natural environment they perform an important function. Snails feed on decaying plants, recycling them and creating nutritious new soil for a knew generation of plant life. Most snails that destroy our prized petunias come to our gardens as silent, slimey stowaways. Hiding under a leave of a plant sold in garden centers, shiped from other parts of the world, snails arrive and thrive in home gerdens just about everywear. C A T H A E L A E I U M W I M C S T N O T S L I A N S H C M T A L T N H I E H L E S N E E D A R A L L E L L S N O W L S T I L E T O M W K E Standards Link: Letter sequencing. Recognized identical words. Skim and scan reading. Recall spelling patterns. Snails for Sale! Study the ads in today’s newspaper. Rewrite one to sell snails. Include three opinions and three facts. Use this page to gather snail facts. Standards Link: Reading Comprehension: Understand fact and opinion; Writing Applications: Revise writing; Write brief descriptions. Standards Link: Reading Comprehension: Read for a variety of purposes. The snail has a latin name that means “a belly-footed animal.” Use the code to find out what this name is. A= D= F = G= H= N= O= P = R = S = T = U= Finish this sentence and then write five details about your home. Standards Link: Spelling: Spell grade-level words correctly. A-10 LOCAL & REGION THE NEW MEXICAN Monday, November 18, 2013 Police notes The Santa Fe Police Department is investigating the following reports: u Someone took a cellphone from an unlocked car parked at a Giant gas station, 2691 Sawmill Road, at 5 p.m. Friday. u A woman at a store at 905 Cerrillos Road reported that someone had shoplifted several silver bracelets between 1 and 2 p.m. Saturday. u Someone stole a laptop computer and a coat from a car parked in the 200 block of East Cordova Road sometime Saturday. u A 47-inch TV was taken from a home in the 2100 block of Rancho Siringo Road between 9 and 11 a.m. Saturday. u Ariel Garcia, 22, 4333 Paseo de la Acequia, was arrested on a charge of battery against a household member between 5:30 and 6:10 p.m. Saturday. u Marcus Barela, 22, 1964 San Ildefonso Road, was arrested on a charge of possession of drug paraphernalia at San Benito Street and Zafarano Drive between 12:06 and 12:23 p.m. Sunday. u Someone broke the windows of several vehicles parked in the 4200 block of Airport Road early Sunday morning. u A man reported that someone broke a window on his pickup parked in the 5900 block of Larson Loop between 12:01 and 4:04 a.m. Sunday. It appeared as though someone also rammed the victim’s vehicle with a car. u City officers responding to a report of property damage in the 5400 block of Larson Loop found someone had damaged two vehicles in a parking lot between 9 p.m. and 3 a.m. Sunday. u Miguel Martinez-Herrera, 48, 7444 Sandy Creek Road, was arrested on a charge of driving with a revoked license after officers stopped him for a broken tail lamp on Saturday. The Santa Fe County Sheriff’s Office is investigating the following reports: u County deputies investigated the death of a 34-year-old man who was found unresponsive by his family members on Saturday. An investigation revealed the victim had health problems, and he was treated at a local hospital for alcohol-related issues. Criminal activity is not suspected at this time. u A woman reported that someone she knew may have stolen her purse and some cash sometime Saturday. u Someone stole a wallet, Visa debit cards, Social Security cards and $300 in cash after prying open a window of a truck on Calle Marie Luisa sometime Saturday. DWI arrests u Ryan Careswell, 36, 2704 Cerrillos Road, was arrested on his third drunken-driving charge after city officers stopped him for allegedly running a red light at 1:31 a.m. Sunday in the 1300 block of Manhattan Street. u Mark Gadbury, 44, of Madrid was arrested on a charge of aggravated drunken driving and reckless driving after county deputies found his vehicle crashed at General Goodwin Road and N.M. 14 on Friday. A county deputy wrote he could smell “intoxicating liquor” on Gadbury, and deputies attempted to perform sobriety tests but stopped for “the safety of the driver.” u Rosemarie Bermudez, 30, 20 Jose Alfredo Lane, was arrested on charges of aggravated DWI, careless driving and possession of an open container after county deputies found her vehicle crashed along southbound U.S. 84/285 on Friday. Speed SUVs u The Santa Fe Police Department listed the following locations for its mobile speedenforcement vehicles: SUV No. 1 at Kearny Elementary School from 7:25 to 8:15 a.m. and 2:10 to 2:55 p.m., and on Siringo Road at Calle de Suenos at other times; SUV No. 2 at Sweeney Elementary School from 7:25 to 8:15 a.m. and 2:10 to 2:55 p.m., and on South Meadows Road between Jaguar Drive and Airport Road at other times; SUV No. 3 on Rodeo Road between Richards Avenue and Paseo de los Pueblos. Leyba pleads guilty in double homicide Deal carries maximum sentence of 32 years for slaying of pregnant girlfriend, her father tenced to 63 years in prison, but the state Supreme Court overturned the verdict. It ruled in October 2012 that Sarah Lovato’s diary — a key piece of the evidence against Leyba — was inadmissible hearsay. Her diary said that Lebya had hit her in the past, tried striking her in the stomach The Associated Press while she was pregnant and that she was afraid of the man. A Santa Fe man who shot and The New Mexican has previously killed his pregnant girlfriend and her reported that Lebya, 22 at the time, father faces up to 32 years in prison under a plea agreement approved by admitted that he had shot and killed Bennie Lovato in May 2009 because a state district judge. Marino Leyba Jr. pleaded guilty to he thought the man was going to two counts of second-degree murder attack him. Leyba has also said that he thought his pregnant girlfor the deaths of 17-year-old Sarah friend had a knife, and that’s why Lovato and 50-year-old Bennie Ray Lovato. he shot her. Leyba, who was a secuLeyba, 27, will be sentenced Dec. 13. rity guard for his father’s security company, routinely carried mace Leyba was initially convicted of first-degree murder in 2010 and sen- and a 9 mm gun, according to previ- ous reports. Archives show that authorities originally tried charging Lebya with three counts of murder because Sarah Lovato’s unborn fetus also Marino died in the attack. Leyba Jr. But District Attorney Angela “Spence” Pacheco said New Mexico law states that because the child died in womb it was not a homicide. Former Capt. Gary Johnson remarked in a June 2009 article that the case was the “the worst case of domestic violence I’ve ever seen.” Lebya initially fled following the shootings, but he turned himself into authorities a day later. In brief Tracking alcohol abuse in Santa Fe County DWI REPORT DWI arrests DWI/DUI crashes MUI/MIP* Seized vehicles Lebya’s lawyer initially tried to argue in 2010 that the young man had a mental disorder that prevented him from understanding information in complex situations. But Cynthia Hill, the prosecutor in the original case, argued that Leyba planned to kill Sarah Lovato because she had broken off their relationship. After the jury initially found him guilty, former District Judge Michael Vigil handed down two life sentences and an extra two years for Lebya, calling the crime horrific. The Albuquerque Journal reports that Lovato family members told Judge Mary Marlowe Sommer during Friday’s hearing that they were opposed to the plea agreement. The New Mexican’s Chris Quintana contributed to this report. New area found inside caverns Sheriff SFPD NMSP OCT. 6 2 0 4 OCT. 33 2 15 25 OCT. 12 2 0 NA 2013 123 39 11 44 2013 340 39 89 397 2013 174 11 16 NA TOTAL 637 89 116 441 MUI/MIP: MINORS UNDER THE INFLUENCE/MINORS IN POSSESSION OF ALCOHOL SOURCE: SANTA FE UNDERAGE DRINKING PREVENTION ALLIANCE CARLSBAD — It’s been more than 20 years since there was a find this big at Carlsbad Caverns National Park. Park officials say a new room has been discovered high in the ceiling of the main cavern. It was found on Halloween night by caver and volunteer Derek Bristol and cave technician Shawn Thomas. The two had climbed to the “Spirit World” area to finish surveying for a new map of the cave. Once inside, they decided to make their way to an unexplored ledge. To their surprise, it opened up to a long passage and a room decorated with many cave formations. Post leads to cruelty charges ALBUQUERQUE — The Bernalillo County Sheriff’s Department says a concerned citizen’s call Saturday about a picture on Facebook of a tiny dog inside a freezer bag led to the arrest of Mary Snell and her son James Engel on felony animal cruelty charges. Sgt. Aaron Williamson says Snell said she put the dog in the bag to show how tiny it was. Engel took and posted the picture. The dog was not hurt. The Associated Press UNM-Taos plans to expand at town’s convention center tant,” UNM-Taos Executive Director Kate O’Neill told The Taos News Wednesday. “I don’t think I’m exaggerTAOS — Downtown Taos may see ating when I say that everybody we’ve the increased bustle of students and talked to has said this is a good thing.” faculty early next year as part of an O’Neill said the college had 11 difeffort by University of New Mexicoferent locations throughout the comTaos to occupy part of the town conmunity at one point — a layout that vention center on Civic Plaza Drive. made it hard for students and staff to The town and college have get from class to class. O’Neill said approved a lease/purchase agreeestablishing a presence downtown is ment that would turn Río Grande and part of an effort to consolidate the colBataan halls into classroom space for lege into two campuses — the Klauer various programs, media production Campus south of Ranchos de Taos and workforce training. and the forthcoming expansion onto The agreement provides much Civic Plaza Drive. needed additional space — about The deal will also improve UNM13,500 square feet — for the college, Taos’ square-feet-per-student ratio, which has seen enrollment skyrocket which is second worst in the state. to the equivalent of more than 1,800 O’Neill said college staff hoped to full-time students in recent years. have the space ready for students by Classrooms and offices have become January. O’Neill said arrangements cramped, and those who accredit the are being made to provide additional college’s nursing program recently parking adjacent to Parr Field, and she pointed out that more room is needed. expected the influx of students to the For the town government, the neighborhood to be noticeable. arrangement is an opportunity to “I think it’s going to have quite a unload the cost of utilities and mainpositive impact on the downtown tenance for the underused buildings area,” O’Neill said. while providing a location for an eduUnder the agreement, UNM-Taos cational hub in the heart of Taos. will pay $1 a year for use of the build“This was extraordinarily imporings, but it will be responsible for their By J.R. Logan The Taos News upkeep and maintenance. The fiveyear agreement includes a purchase option — also for $1 — that can be exercised at any time. O’Neill said the college would work toward purchasing the buildings as a “parallel track” to occupying them, but it is still not clear when a purchase would happen. Taos Town Councilor Fred Peralta, a longtime proponent of UNMTaos, said the convention center has become a “white elephant” for the town and the government is eager to see it put to good use. He said UNMTaos provides an invaluable resource to the community. Taos Mayor Darren Córdova said the deal represents a commitment to education and to the economy. “Education is clearly the root of a strong economy,” Córdova said. The lease/purchase agreement was approved by the UNM Board of Regents at its meeting Tuesday morning, just hours before it went before the town council. Peralta was at the regents meeting and said there was broad support from that board. He said UNM President Robert Frank described Taos’ campus as a “feather in the cap” of the university. “[Frank] said the campus here shows what education is all about and how it can succeed,” Peralta said. As part of Tuesday’s meeting, the regents heard estimates from the university’s Office of Capital Projects projecting $3.7 million in repairs and future renovation costs for the two buildings. Repairs included roof replacement, re-stuccoing and upgrades to data and phone systems. Site visits from several local contractors found that the only immediate repair needed was roof maintenance before winter, estimated to cost less than $400,000. The office concluded the building was in “good enough shape to warrant a lease or purchase” by the college. A review of the buildings completed last month by local and state construction officials found the building complex “suffers from obvious deferred maintenance issues, none of which would prevent immediate occupancy and use by UNM-Taos.” UNM-Taos currently rents space near Holy Cross Hospital for its medical sciences program. O’Neill said the college would continue to lease that building until renovations can be done at Civic Plaza to relocate. How they voted WASHINGTON — Here’s a look at how area members of Congress voted over the previous week. House votes House vote 1 Realigning Mississippi judicial district: The House has passed a bill (HR 2871), sponsored by Rep. Howard Coble, R-N.C., that would adjust the structure of the southern federal judicial district in Mississippi by realigning the district’s four geographical divisions and changing the placement of the courts for the four divisions. The vote, on Nov. 12, was unanimous with 401 yeas. Yeas: Rep. Michelle Lujan Grisham, D-N.M., Rep. Ben Ray Luján, D-N.M., Rep. Steve Pearce, R-N.M. House vote 2 Supreme Court Police: The House has passed a bill (HR 2922), sponsored by Rep. George Holding, R-N.C., to extend by six years the authority of the Supreme Court Police to protect court officials beyond the grounds of the Supreme Court. The vote, on Nov. 12, was 399 yeas to 3 nays. Yeas: Lujan Grisham, Pearce Not voting: Luján House vote 3 Asbestos anti-fraud measures: The House has rejected an amendment sponsored by Rep. Steve Cohen, D-Tenn., to the Furthering Asbestos Claim Transparency Act (HR 982). The amendment would have exempted asbestos claims trusts that have their own anti-fraud procedures from the requirement to make public quarterly reports on their receipt and handling of the claims. The vote, on Nov. 13, was 198 yeas to 223 nays. Yeas: Lujan Grisham, Luján Nays: Pearce House vote 4 Asbestos health disclosures: The House has rejected an amendment sponsored by Rep. Jerrold Nadler, D-N.Y., to the Furthering Asbestos Claim Transparency Act (HR 982). The amendment would have required defendants that request information from asbestos claims trusts about claims payments to disclose information about how issues related to the requests impact public health and public safety. The vote, on Nov. 13, was 194 yeas to 226 nays. Yeas: Lujan Grisham, Luján Nays: Pearce House vote 5 Asbestos claims transparency: The House has rejected an amendment sponsored by Rep. Sheila Jackson Lee, D-Texas, to the Furthering Asbestos Claim Transparency Act (HR 982). The amendment would have required defendants represented by asbestos claims trusts to disclose information to the trusts and claimants about the name and location of products made by the defendants that contained asbestos. The vote, on Nov. 13, was 195 yeas to 226 nays. Yeas: Lujan Grisham, Luján Nays: Pearce House vote 6 Reporting asbestos claims: The House has passed the Furthering Asbestos Claim Transparency Act (HR 982), sponsored by Rep. Blake Farenthold, R-Texas. The bill would require that trusts established by companies to handle claims for injuries suffered by individuals exposed to asbestos make public quarterly reports on their receipt and handling of the claims. The vote, on Nov. 13, was 221 yeas to 199 nays. Yeas: Pearce R-NM Nays: Lujan Grisham, Luján The vote, on Nov. 14, was 347 yeas to 76 nays. Yeas: Lujan Grisham, Luján Nays: Pearce House vote 7 Senate votes Frivolous lawsuits: The House has passed the Lawsuit Abuse Reduction Act (HR 2655), sponsored by Rep. Lamar Smith, R-Texas. The bill would require lawyers who file lawsuits found to be frivolous to pay attorneys’ fees and court costs for lawsuit defendants. The vote, on Nov. 14, was 228 yeas to 195 nays. Yeas: Pearce Nays: Lujan Grisham, Luján House vote 8 Dam safety and water resources bill: The House has agreed to a motion sponsored by Rep. Sean Patrick Maloney, D-N.Y., to instruct House conferees on negotiations with the Senate over the two chambers’ versions of the Water Resources Reform and Development Act (HR 3080). The conferees were instructed to concur with Senate provisions relating to measures to reauthorize a dam safety program in order to reduce the risk of dam failure. Senate vote 1 Appeals court nominee: The Senate has rejected a motion to end debate on the nomination of Cornelia T. L. Pillard to serve as a judge on the U.S. Court of Appeals for the District of Columbia Circuit. A supporter, Sen. Dick Durbin, D-Ill., cited Pillard’s experience as an official in the U.S. Solicitor General’s office and in the Justice Department’s Office of Legal Counsel, as well as her work as a law professor at Georgetown University. An opponent, Sen. Chuck Grassley, R-Iowa, said adding Pillard to the court would allow President Barack Obama to circumvent Congress by winning approval from the D.C. Circuit Court for administrative actions, such as a cap-and-trade program to limit greenhouse gas emissions, that Congress will not pass into law. The vote, on Nov. 12, was 56 yeas to 41 nays, with a three-fifths majority required to end debate. Monday, November 18, 2013 THE NEW MEXICAN OPINIONS The West’s oldest newspaper, founded 1849 Robin M. Martin Owner COMMENTARY: STEPHEN MIHM Artificial fats: Bad since the 1800s L ibertariansmade United States, A-11 Robert M. McKinney Owner, 1949-2001 Inez Russell Gomez Editorial Page Editor Ray Rivera Editor OUR VIEW Starry nights: Worth preserving O, ulti- mately Bloomberg View’s Ticker. LETTERS TO THE EDITOR ACA: Why has no one been fired? I n any other world, the people responsible for the Affordable Care Act’s online fiasco and the National Security Agency’s lawbreakers would be fired. I am a staunch Barack Obama supporter and worked on his re-election campaign. The fact that no one at the NSA has been held accountable for clear violations of the law, and no one at Department of Health and Human Services has been fired over the health exchange fiasco is mind-blowing. If these had occurred in the private sector, heads would roll, and rightly so. Why doesn’t the president show the American people leadership in these areas? A mea culpa doesn’t cut it. There must be consequences for those responsible. Politics aside, “You take the job, and you take the heat.” Al Schwartz Santa Fe Frustrating stay Having spent more than one week in the hospital recently, I can say that with the exception of one male nurse, the nurses were never there when needed. I had back surgery and waited for more than one hour for a nurse to assist me after numerous tries to get the help I needed. I could not walk and could not get timely help. I also was offered medication I was allergic to — as was noted in my chart. If the CEOs make all that money, how on earth do they expect to attract good, competent health professionals? S. Murray Santa Fe CIR fall summit The Council on International Relations recognizes the outstanding effort made by area high schools to bring seven teams MAllARD FillMORE Section editor: Inez Russell Gomez, 986-3053, igomez@sfnewmexican.com, Twitter @inezrussell of students for presentations at the fifth annual CIR Fall Student Summit. We had a record attendance of more than 125 students and faculty who were the audience for excellent PowerPoint presentations on U.S. bilateral relations. The schools were: Santa Fe Indian School, St. Michael’s, Monte del Sol, Santa Fe Prep, The MASTERS Program and Santa Fe High. We want to recognize all of the area youth who bring careful thought, intelligence and responsibility to analyzing and shaping public policy, and we especially want to mention Alex Wirth, who as a student at Santa Fe Prep, spoke at many of our local CIR summits and recently spoke at the United Nations on youth education and employment. We salute all of our youth and teachers who work very hard on international issues. Jeff Case Ph.D. CIR Board of Directors Santa Fe ur clear, cool nights are perfect for seeing the stars. Vincent van Gogh, the painter of the famous Starry Night, described the night sky in a letter he wrote in 1888: “The deep blue sky was flecked with clouds of a blue deeper than the fundamental blue of intense cobalt, and others of a clearer blue, like the blue whiteness of the Milky Way. In the blue depth the stars were sparkling, greenish, yellow, white, pink, more brilliant, more sparkling gem-like than at home — even in Paris; opals you might call them, emeralds, lapis lazuli, rubies, sapphires.” Or maybe that’s not what we see any more. As the leaves have fallen from the trees this autumn, it’s more likely that we see the neighbor’s new security light shining in our window, or the glare from a recently built parking lot. Each year, the stars over New Mexico grow dimmer, our neighborhoods and commercial districts brighter. Paul Bogard, author of The End of Night: Searching for Natural Darkness in an Age of Artificial Light, the book from which the van Gogh quote was taken, will be in Santa Fe Tuesday to discuss his newly published work. His concern is light pollution — that glare and sky glow that fill our once starry nights. He has traveled the world, visiting some of the brightest cities and most uninhabited places. Bogard has visited Sark, an island in the English Channel with a population of 600 that was recently designated the world’s first International Dark Sky Island. He has visited Las Vegas, Nev., where the Luxor Beam is the world’s brightest light. Some cities, such as Paris, take good lighting seriously. There, the streets and sidewalks are safely lit, but glare does not obstruct nighttime views of its magnificent buildings. Tucson and Flagstaff in Arizona are good examples of growing cities where, because of good and strongly enforced legislation, light pollution has not grown as fast as the population. The city of Santa Fe and Santa Fe County both have good lighting regulations, aimed at keeping our streets safe while eliminating stray light that causes glare and shines upwards to obstruct the stars. Yet unshielded “wall packs” and floodlights that shine onto neighbors’ properties are installed routinely, even though they are against regulations. There is no public outcry. In the city of Santa Fe, government parking lots that sit empty after the workday are fully lit all night, with no objections from taxpayers who foot the electricity bill. The situation is the same across most of the United States. Photographs of the country in Bogard’s book, taken from above, show the rapid increase of light pollution from the 1950s until today. These photos document light (and energy) wasted by shining up into the sky. By 2025, predictions are that a satellite photo will show the country as one big glare, broken only by dark blotches of Western desert. It doesn’t have to be that way. Light pollution can be avoided by installing proper lighting fixtures — those that shine on places that need illumination and nowhere else. But it takes public awareness to pass new laws and enforce those already on the books. Perhaps Bogard’s trip to Santa Fe will be the catalyst needed to remind locals about the loss of our starry nights. iF yOU gO u Courtesy of the Santa Fe Conservation Trust, Paul Bogard will speak and sign copies of his recently published book at 7 p.m. Tuesday in the Driscoll Auditorium at Santa Fe Preparatory School. The past 100 years From The Santa Fe New Mexican: Nov. 18, 1913: Dr. Edgar L. Hewett, distrusted as a scientist by great scientists of the country, was knocked right through the ropes last night when the Santa Fe Chamber of Commerce voted overwhelmingly against the resolution endorsing him and the people responsible for him. The action of the Chamber of Commerce was probably the worst blow “Dr.” Hewett has been dealt since Boas of Columbia came out in print declaring that Hewett, listed in “Who’s Who” as an “archaeologist,” has never been able to convince him that he knows even the objects of archaeological research — or since Dorsey of Chicago University wired The New Mexican that in his opinion a tremendous mistake was made to let Hewett run the school here. DOONESBURy BREAKING NEWS AT A-12 THE NEW MEXICAN Monday, November 18, 2013 The weather 7-day forecast for Santa Fe Today Mostly sunny Tonight Clear Tuesday Wednesday Plenty of sunshine 30 56 Thursday Friday Partly sunny and mild Mostly cloudy 57/32 57/31 Humidity (Noon) Humidity (Midnight) Humidity (Noon) A shower possible 55/32 Humidity (Noon) Saturday Humidity (Noon) Sunday Mostly cloudy 49/28 Humidity (Noon) A mix of snow, ice and rain 47/26 51/27 Humidity (Noon) Humidity (Noon) 35% 63% 37% 34% 42% 51% 45% 45% wind: W 4-8 mph wind: N 3-6 mph wind: W 6-12 mph wind: W 4-8 mph wind: S 6-12 mph wind: ESE 7-14 mph wind: ESE 6-12 mph wind: SSE 4-8 mph Almanac Santa Fe Airport through 6 p.m. Sunday Santa Fe Airport Temperatures High/low ......................................... 54°/35° Normal high/low ............................ 54°/26° Record high ............................... 68° in 2008 Record low .................................. 9° in 1951 Santa Fe Airport Precipitation 24 hours through 6 p.m. yest. ............ 0.00” Month/year to date ................ 1.56”/11.48” Normal month/year to date ... 0.39”/12.44” Santa Fe Farmers Market 24 hours through 6 p.m. yest. ............ 1.06” Month/year to date ................ 1.75”/11.55” New Mexico weather 64 The following water statistics of November 14 are the most recent supplied by the City Water Division (in millions of gallons). Total water produced from: Canyon Water Treatment Plant: 1.283 Buckman Water Treatment Plant: 3.030 City Wells: 0.000 Buckman Wells: 2.058 Total water produced by water system: 6.371 Amount delivered to Las Campanas: Golf course: 0.000, domestic: 0.084 Santa Fe Canyon reservoir storage: 66.7 percent of capacity; daily inflow 1.29 285 64 Farmington 56/30 666 40 Santa Fe 56/30 Pecos 57/30 25 Albuquerque 59/38 25 87 56 412 Clayton 58/32 AccuWeather Flu Index 25 Las Vegas 59/31 54 40 40 285 Clovis 63/38 54 60 60 Sunday’s rating ................................... Good Today’s forecast ................................. Good 0-50, Good; 51-100, Moderate; 101-150, Unhealthy for sensitive groups; 151-200, Unhealthy; 201-300, Very Unhealthy, 301500, Hazardous Source: EPA 64 Taos 54/23 Española 58/37 Los Alamos 55/36 Gallup 57/25 Raton 58/25 64 84 60 25 54 285 380 180 Roswell 71/40 Ruidoso 59/42 25 70 Truth or Consequences 65/41 70 Las Cruces 67/42 70 54 Hobbs 68/44 Carlsbad 74/44 285 10 State cities Hi/Lo W 68/48 s 60/42 s 45/33 s 75/55 s 77/60 s 47/30 s 55/36 s 62/35 s 50/33 s 68/41 s 54/33 s 67/43 s 59/41 s 55/28 s 70/46 s 54/31 s 59/38 s 73/50 s 67/44 s Hi/Lo W 68/39 s 59/38 s 51/21 pc 72/43 s 74/44 s 52/25 pc 59/26 pc 58/32 pc 54/28 s 63/38 s 57/25 pc 69/38 s 58/37 s 56/30 pc 66/38 s 57/25 pc 58/26 pc 68/44 s 67/42 s Hi/Lo W 69/37 pc 61/35 s 50/19 pc 74/44 pc 75/46 pc 51/26 s 61/31 pc 66/38 pc 56/28 pc 68/41 pc 59/32 s 70/38 s 59/34 s 58/32 s 71/43 pc 57/27 s 58/30 s 68/47 pc 70/40 60/36 66/44 51/36 62/40 69/39 61/36 55/29 60/40 75/47 55/41 65/44 61/37 67/41 54/34 68/41 72/46 69/49 56/38 55/32 W s s s s s s s s s s s s s s s s s s s Hi/Lo W 59/31 s 71/46 s 55/36 s 63/34 s 64/38 s 58/25 pc 51/23 pc 60/33 s 71/40 s 59/42 s 65/37 s 65/40 s 65/39 s 54/23 pc 65/41 s 67/41 pc 70/44 s 57/34 s 57/24 pc Hi/Lo W 61/35 pc 73/42 s 55/37 s 64/34 s 69/41 pc 67/29 s 48/19 pc 62/33 s 73/39 pc 62/45 pc 70/43 pc 67/41 s 68/40 s 54/21 s 67/41 s 72/36 pc 73/43 pc 58/36 s 59/29 s Weather (w): s-sunny, pc-partly cloudy, c-cloudy, sh-showers, t-thunderstorms, r-rain, sfsnow flurries, sn-snow, i-ice. Weather for November 18 By Frank Jordans New First Full Nov 25 Dec 2 Dec 9 Dec 17 W s t pc pc sn pc sh sh sh t t r s pc t c pc pc pc t pc s pc Hi/Lo 14/4 69/43 67/40 49/36 42/21 52/39 68/39 78/48 73/40 43/28 53/31 49/32 70/50 60/31 49/28 2/-16 55/24 84/69 76/49 50/29 53/35 67/50 66/55 W s pc s pc s pc r t pc pc pc sh s pc pc sf s pc pc s s s pc Hi/Lo 20/3 60/40 51/29 56/24 42/21 53/41 47/32 63/40 57/34 47/33 47/30 42/26 69/50 65/30 42/29 -6/-18 54/31 84/72 68/46 47/31 58/42 67/47 66/54 W s s s pc pc c pc pc s s s pc pc s pc pc s c pc s pc pc pc Set 4:04 p.m. 7:47 p.m. 1:57 p.m. 10:52 a.m. 4:29 p.m. 3:00 a.m. Forecasts and graphics provided by AccuWeather, Inc. ©2013 Yesterday Today Tomorrow Hi/Lo 20/12 67/60 64/49 45/31 35/30 50/34 55/38 78/56 70/52 69/47 66/58 64/57 87/71 53/27 64/55 2/-14 48/35 84/69 85/75 66/41 67/53 66/48 69/54 Rise 5:06 a.m. 10:27 a.m. 1:19 a.m. 8:31 p.m. 5:49 a.m. 2:38 p.m. Mercury Venus Mars Jupiter Saturn Uranus T Sunrise today ............................... 6:43 a.m. Sunset tonight .............................. 4:56 p.m. Moonrise today ............................ 6:00 p.m. Moonset today ............................. 7:33 a.m. Sunrise Tuesday ........................... 6:44 a.m. Sunset Tuesday ............................ 4:55 p.m. Moonrise Tuesday ........................ 6:48 p.m. Moonset Tuesday ......................... 8:25 a.m. Sunrise Wednesday ...................... 6:45 a.m. Sunset Wednesday ....................... 4:55 p.m. Moonrise Wednesday ................... 7:39 p.m. Moonset Wednesday .................... 9:12 a.m. The planets 69/59 77/67 84/75 65/52 46/39 82/71 61/50 74/62 87/69 69/51 76/55 60/52 56/46 69/51 80/62 55/36 91/74 67/58 63/49 53/45 49/37 66/47 65/52 W t sh c t c c c s r c pc r c pc pc pc pc pc pc sh c pc c Hi/Lo 57/34 62/39 84/70 43/29 39/27 77/52 68/42 64/41 84/66 67/41 77/54 51/31 53/48 74/42 56/32 56/40 77/55 65/56 59/53 51/43 46/27 63/40 67/43 W pc s pc pc pc pc r s sh s s sh r s s pc pc pc pc r s s s Hi/Lo 51/33 57/40 83/70 46/36 47/36 66/53 49/34 62/45 78/61 50/34 77/53 42/26 53/36 55/33 53/38 56/38 67/58 64/56 60/54 49/32 53/31 49/29 53/35 W s s sh s s pc s pc pc s s pc r s s pc c pc r r s s) Sun. High: 95 ............................. Hondo, TX Sun. Low: 0 ............................ Choteau, MT On Nov. 18, 1421, surge from a powerful storm swept inland and destroyed Holland’s dikes. More than 70 villages were swept away; 10,000 people died. Weather trivia™ Q: What causes lake-effect snow? A: Cold air moving over warm water Weather history Newsmakers. Jay Z says he’ll continue Barneys collaboration Jay Z Hi/Lo 50/43 61/54 77/55 90/75 57/53 48/31 45/30 70/43 81/58 75/62 87/71 72/59 50/46 54/47 43/41 77/63 88/73 74/66 65/51 69/60 W c pc pc c r s sh pc s pc s pc pc sh c pc pc s pc c Hi/Lo 47/42 63/50 72/58 92/75 57/51 47/26 48/36 69/49 82/61 72/56 84/66 70/44 46/42 46/34 54/38 76/58 85/67 75/64 62/51 72/58 W c s c pc r s c t pc pc s s c c sh pc pc s c pc Hi/Lo 44/30 62/58 69/59 92/74 57/42 48/29 45/37 63/49 75/59 74/58 83/68 72/44 45/37 40/36 44/34 75/57 84/68 72/65 64/53 72/58 W sh pc c pc c s pc c pc pc pc s c pc r t s pc pc 61/45 49/45 45/36 76/50 54/39 45/34 79/50 43/37 36/30 77/74 68/55 73/52 46/41 84/79 46/42 64/61 66/50 52/36 43/32 41/39 W s c sh pc c r s c c t pc pc pc t s sh pc c c c Hi/Lo 61/52 48/39 54/39 73/52 54/32 41/30 83/50 46/34 46/37 79/71 66/58 77/48 41/28 88/77 45/39 70/57 66/46 45/37 53/41 54/37 W pc r pc pc r s s c pc t c s pc t pc sh s r pc pc Hi/Lo 63/48 41/28 54/36 71/53 36/23 41/32 82/51 41/26 46/36 85/74 64/50 81/48 43/28 88/77 41/32 78/56 61/46 44/26 50/43 47/34 W s pc pc t pc c s r c t r pc pc t c pc pc c pc r Today’s talk shows Journey donates $350K for Philippines relief Arnel Pineda NEW YORK — Associated Press 3:00 p.m. KOAT The Ellen DeGeneres Show James Franco; Anna Faris; Sophia Grace and Rosie; inventor Peyton Robertson; guest DJ Donald Driver. KRQE Dr. Phil KTFQ Laura KWBQ The Bill Cunningham Show A woman asks her daughters for forgiveness.. KCHF The Connection With Skip Heitzig FNC The O’Reilly Factor TBS Conan 10:00 p.m. KASA The Arsenio Hall Show KTEL Al Rojo Vivo CNN Piers Morgan Live MSNBC The Rachel Maddow Show TBS Pete Holmes Show Guest Jeff Garlin. 10:30 p.m. TBS Conan 10:34 p.m. KOB The Tonight Show With Jay Leno TV host Whoopi Goldberg; Totem from Cirque du Soleil. 10:35 p.m. KRQE Late Show With David Letterman Actor Vince Vaughn; Luscious Jackson performs. 11:00 p.m. KNME Charlie Rose KOAT Jimmy Kimmel Live Barbara until a chance customs check three years ago led them to the Munich apartment. BERLIN Authorities in Bavaria and he recluse German Berlin kept the find secret collector who kept for more than a year and a a priceless trove of half. But since the case was art, possibly includrevealed by the German magaing works stolen by the Nazis, zine Focus two weeks ago they hidden for half a century says have come under pressure he did so because he “loved” to find a solution that will them and that he wants them prevent legal obstacles from back. standing in the way of rightful Cornelius Gurlitt told Gerclaims to the art — particularly man magazine Der Spiegel in if Holocaust survivors or heirs an interview published Sunof those persecuted by the day that he wanted to protect Nazis are involved. the collection built up by his Gurlitt told Der Spiegel that late father Hildebrand, an art he won’t just hand over the art. dealer commissioned by the “I won’t talk to them, and I’m Nazis to sell works that Adolf not giving anything back volHitler’s regime wanted to get untarily, no, no,” he is quoted rid of. Bavarian authorities say as saying. they suspect the elder Gurlitt He told the magazine he may have acquired pictures kept his favorite pictures in a taken from Jews by the Nazis small suitcase. Each evening — and that this may lead to he would unpack it to admire restitution claims by the origithem. The magazine said he nal owners or their heirs. also spoke to the pictures. In his first extensive interThe magazine described view since the case was Gurlitt as being in ill health revealed two weeks ago, because of a heart condiGurlitt told Der Spiegel that tion, yet fiercely denying any everybody needs something wrongdoing by himself or his to love. “And I loved nothing more in life than my pictures,” father, whose own Jewish heritage put him in a precarious the magazine quoted him as position when dealing with the saying. The death of his parents and Nazis. Occasionally he sold picsister were less painful to him tures for cash, the magazine than the loss of the 1,406 paintreported. The last time was ings, prints and drawings by in 2011, when he sold Max artists such as Pablo Picasso, Beckmann’s painting The Henry Matisse and Max Lion Tamer for 725,000 euros. Liebermann that authorities Gurlitt kept a little over hauled out of his apartment 400,000 euros, with the rest last year, he told the magazine. going to a Jewish collector Der Spiegel said a reporter who once owned it, according spent several days interviewing the collector while he trav- to the magazine. The heirs of several Jeweled from his home in Munich to visit a doctor in another city ish collectors have already come forward to claim some last week. of the 1,406 works that have Officials are investigating now come to light, saying the whether Gurlitt may have “misappropriated” the pictures pictures were taken from their relatives by force or sold under or committed tax offenses duress. in connection with them. “It’s possible that my father However, a spokesman for was once offered something Augsburg prosecutors, who are handling the case, told The from a private collection,” Associated Press last week that Gurlitt told Der Spiegel. “But he would definitely not have Germany’s 30-year statute of taken it.” limitations may prove to be a Gurlitt told the magazine stumbling block. that he helped his father Hildebrand Gurlitt died in 1956, and his wife Helene died spirit the pictures away from in 1967. Officials were unaware Dresden as the Russian army of their son’s huge collection advanced on the city in 1945. The Associated Press Sun and moon State extremes Yesterday Today Tomorrow Today’s UV index 0-2, Low; 3-5, Moderate; 6-7, High; 8-10, Very High; 11+, Extreme The higher the AccuWeather.com UV Index™ number, the greater the need for eye and skin protection. Sun. High: 77 ................................ Carlsbad Sun. Low 28 .............................. Farmington City Alamogordo Albuquerque Angel Fire Artesia Carlsbad Chama Cimarron Clayton Cloudcroft Clovis Crownpoint Deming Española Farmington Fort Sumner Gallup Grants Hobbs Las Cruces German collector hid art out of ‘love’ 380 285 STAATSANWALTSCHAFT AUGSBURG/AP Today.........................................1, Low Tuesday.....................................2, Low Wednesday...............................2, Low Thursday...................................2, Low Friday ........................................2, Low Saturday ................................... 70 380 Alamogordo 68/39 180 10 Water statistics Air quality index Shown is today’s weather. Temperatures are today’s highs and tonight’s lows. Area rainfall Albuquerque 24 hours through 6 p.m. yest. ............ 0.00” Month/year to date .................. 0.34”/8.36” Las Vegas 24 hours through 6 p.m. yest. ............ 0.00” Month/year to date ................ 0.10”/15.64” Los Alamos 24 hours through 6 p.m. yest. ............ 0.00” Month/year to date ................ 0.78”/11.35” Chama 24 hours through 6 p.m. yest. ............ 0.06” Month/year to date ................ 0.60”/15.89” Taos 24 hours through 6 p.m. yest. ............ 0.00” Month/year to date ................ 1.03”/10.55” Sitzende Frau (Sitting Woman) by French artist Henry Matisse was among the more than 1,400 artworks that were seized by German authorities in an apartment in Munich in February 2012. Investigators are trying to establish the artworks’ legal status and history. For current, detailed weather conditions in downtown Santa Fe, visit our online weather stations at Walters; Josh Gad; Fall Out Boy performs. CNN Anderson Cooper 360 FNC Hannity 11:30 p.m. KASA Dish Nation TBS Pete Holmes Show Guest Jeff Garlin. 11:37 p.m. KRQE The Late Late Show With Craig Ferguson Actor Kunal Nayyar. 12:00 a.m. CNN AC 360 Later E! Chelsea Lately Michael Yo; Jen Kirkman; Ross Mathews; Jeffrey Wright. FNC On the Record With Greta Van Susteren 12:02 a.m. KOAT Nightline 12:06 a.m. KOB Late Night With Jimmy Fallon Comic Bill Cosby; Brad Whitford performs with The Roots. 12:30 a.m. E! E! News 1:00 a.m. KASY The Trisha Goddard Show CNN Piers Morgan Live FNC Red Eye 1:06 a.m. KOB Last Call With Carson Daly TV top picks 1 6:25 p.m. on ESPN NFL Football An interconference clash of teams with postseason aspirations goes down tonight at Bank of America Stadium in Charlotte, N.C. where Cam Newton and the Carolina Panthers defend home turf from Tom Brady and the New England Patriots. Brady will have his hands full against a Panthers defense that is among the league’s best. By contrast, the Pats’ run defense is one of the NFL’s worst, which could mean a field day for stellar Carolina RB DeAngelo Williams. 7 p.m. on FOX Almost Human If androids can be police officers’ partners, why not sex partners as well? In this new episode, Kennex and Dorian’s (Karl Urban, Mark Ealy) investigation of a murder and missing persons case leads them into the high-stakes world of “sexbots,” or Intimate Robot Companions. Kennex tries to come to grips with an issue from his past in “Skin.” 8 p.m. on FOX Sleepy Hollow Ichabod, Abbie and Captain Irving (Tom Mison, Nicole Beharie, Orlando Jones) join forces with Jenny Mills (guest star Lyndie Greenwood) to bring down the Headless Horseman. During the standoff, Ichabod learns something about his 2 3 nemesis’s true motive that changes everything in the new episode “Into Darkness.” 9 p.m. on CBS Hostages When the plot to kill the president is in danger of being exposed, Duncan (Dylan McDermott) is ordered to take out someone who’s in on it. That doesn’t mean the end of the plan, however; in fact, Duncan moves things along by giving Ellen (Toni Collette) the poison she’s supposed to use. Tate Donovan also stars in the new episode “Loose Ends.” 10 p.m. on HBO Movie: Whoopi Goldberg Presents Moms Mabley Before there was Whoopi, there was Moms. Produced and directed by Goldberg,. 4 5 MONDAY, NOVEMBER 18, 2013 THE NEW MEXICAN Scoreboard B-2 NFL B-4 Classifieds B-6 Time Out B-11 Comics B-12 SPORTS COLLEGE FOOTBALL B Last second: Saints beat 49ers with field goal as the clock runs out. Page B-5 LOBOS MENS BASKETBALL Lobos outpace Charleston Southern UNM defense gives up 57 points in 2nd half By Will Webber The New Mexican Baylor Bears running back Shock Linwood points skyward after running in a touchdown against the Texas Tech Red Raiders on Saturday at AT&T Stadium in Arlington, Texas. LOUIS DELUCA/DALLAS MORNING NEWS Baylor closes on Ohio State in BCS standings By Ralph D. Russo The Associated Press ALBUQUERQUE — One look at the stat sheet confirmed something Craig Neal was already feeling by the time he got his first glimpse of the final numbers of Sunday afternoon’s college basketball game in The Pit. In a word, he was grumpy. “I’m not mad at anybody,” C. Southern 93 he said after answering numerous questions about the Lobos’ 109-93 win over Charleston Southern. “I’m just pissed at my team.” The 23rd-ranked Lobos did get the win and they did improve to 2-0 with their second high-octane win at home. For that Neal was happy. What bothered him was his team’s defense in the second half, one UNM 109 in which it gave up 57 points and allowed the visiting Buccaneers to hit 11 3-pointers and convert all 14 of their free throw attempts. “I’m a little bit embarrassed about the way we guarded in the second half,” Neal said, adding that his defensive effort down the stretch was “lackadaisical.” “Probably mental toughness more than anything,” said UNM guard Kendall Williams. “Locking in, being able to finish teams off, especially at home. That’s something that we’ll focus on and take very seriously. Obviously coach Neal is.” To offset the headaches, there was plenty of offense. The Lobos got double-doubles from Williams and Alex Kirk, and a career night from Cameron Bairstow. As a team, they committed just 13 turnovers on 79 possessions and shot nearly 60 percent from the field for the game. Please see LoBos, Page B-3 NFL BRONCOS 27, CHIEFS 17 without a scratch Sack-free Manning throws for 323 yards, leads Denver to win over K.C. Please see BaYLoR, Page B-2 GOLF Stenson wins World Tour title By Bernie McGuire The Associated Press DUBAI, United Arab Emirates — Henrik Stenson won the seasonending.” Broncos quarterback Peyton Manning calls an audible at the line of scrimmage against the Chiefs in the first quarter of Sunday’s game in Denver. JOE MAHONEY/THE ASSOCIATED PRESS By Eddie Pells The Associated Press DENVER eytonhappy defense in Denver’s 27-17 vic- P The protection was outstanding, we ran the ball consistently, “ tried to keep them off-balance.” Broncos quarterback Peyton Manning tory Please see scRatcH, Page B-4 NASCAR Jimmie Johnson wins 6th NASCAR championship title, rank among NASCAR’s greats? “I feel like this team is capable of a lot of great things. There’s still great years ahead HOMESTEAD, Fla. — Soaked in sweat, of us,” Johnson said. “But all of that is in the champagne and success, Jimmie Johnson celfuture, a seventh, an eighth. I don’t want to ebrated yet another NASCAR championship focus on that yet. It’s not time.” by sipping a beer. The time to rank Johnson will be when his A six-pack would have been more appropri- driving career is over. But at just 38 and the ate. youngest driver to win six titles, his career Back on top with only two NASCAR legends could last another decade or more. left to catch, Johnson won his sixth title in “I have six, and we’ll see if I can get seven,” eight years Sunday to stake his claim as one Johnson said. “Time will tell. I think we need of the most dominant competitors in sports to save the argument until I hang up the helhistory. Now looming large in Johnson’s wind- met, then it’s worth the argument. Let’s wait shield is the mark of seven titles held by Rich- until I hang up the helmet until we really start ard Petty and the late Dale Earnhardt. thinking about this.” The party had barely started on No. 6 when Said crew chief Chad Knaus, who trails only the debate began: Where does Johnson, who Dale Inman’s eight championships in the NASon-and-off for two years has used the hashtag ‘6Pack’ on Twitter to describe his bid for this Please see nascaR, Page B-2 By Jenna Fryer The Associated Press Sports information: James Barron, 986-3045, jbarron@sfnewmexican.com Design and headlines: Eric J. Hedlund, ehedlund@sfnewmexican.com Jimmie Johnson celebrates Sunday after winning his sixth NASCAR Sprint Cup Series title in eight years in Homestead, Fla. TERRY RENNA/THE ASSOCIATED PRESS BREAKING NEWS AT B-2 THE NEW MEXICAN Monday, November 18, 2013 HOCKEY Atlantic GP W Tampa Bay 20 14 Boston 19 12 Toronto 20 12 Detroit 21 9 Montreal 21 10 Ottawa 20 8 Florida 21 5 Buffalo 22 5 Metro GP W Washington 21 12 Pittsburgh 20 12 N.Y. Rangers20 10 Carolina 20 8 New Jersey 20 7 N.Y. Islanders21 8 Columbus 20 7 Philadelphia19 7 FOOTBALL FOOTBALL HOCKEY NHL Eastern Conference L OL Pts GFGA 6 0 28 64 50 6 1 25 53 36 7 1 25 57 47 5 7 25 54 60 9 2 22 52 45 8 4 20 58 62 12 4 14 46 70 16 1 11 41 68 L OL Pts GFGA 8 1 25 69 59 8 0 24 56 47 10 0 20 42 50 8 4 20 39 55 8 5 19 42 49 10 3 19 61 68 10 3 17 52 57 10 2 16 35 48 Western Conference Central GP W L OL Pts GFGA Chicago 21 14 3 4 32 78 61 Minnesota 21 13 4 4 30 55 44 St. Louis 19 13 3 3 29 66 46 Colorado 19 14 5 0 28 59 41 Dallas 20 11 7 2 24 58 56 Winnipeg 22 10 10 2 22 57 61 Nashville 20 9 9 2 20 46 63 Pacific GP W L OL Pts GFGA Anaheim 22 15 5 2 32 71 56 San Jose 21 13 3 5 31 72 50 Phoenix 21 14 4 3 31 73 66 Los Angeles 21 14 6 1 29 58 46 Vancouver 22 11 8 3 25 56 58 Calgary 20 6 11 3 15 54 75 Edmonton 22 5 15 2 12 53 83 Note: Two points are awarded for a win; one point for an overtime or shootout Minnesota 2, Winnipeg 1 Dallas 2, Vancouver 1 Monday’s Games Boston at Carolina, 5 p.m. Anaheim at Pittsburgh, 5:30 p.m. Calgary at Winnipeg, 6 p.m. Tuesday’s Games St. Louis at Buffalo, 5 p.m. N.Y. Islanders at Toronto, 5 p.m. Ottawa at Philadelphia, 5 p.m. Minnesota at Montreal, 5:30 p.m. Nashville at Detroit, 5:30 p.m. Boston at N.Y. Rangers, 5:30 p.m. Chicago at Colorado, 7 p.m. Columbus at Edmonton, 7:30 p.m. Florida at Vancouver, 8 p.m. Tampa Bay at Los Angeles, 8:30 p.m. NHL Leaders Through Nov. 16 Scoring GP A. Steen, StL 18 Sidney Crosby, Pit 20 John Tavares, NYI 21 Steven Stamkos, TB17 Corey Perry, Anh 22 Ryan Getzlaf, Anh 19 H. Zetterberg, Det 21 A. Ovechkin, Was 18 Tyler Seguin, Dal 19 Pavel Datsyuk, Det 21 Jamie Benn, Dal 19 Joe Thornton, SJ 20 4 tied with 21 pts. G 17 9 9 14 12 10 10 15 12 11 7 2 A PTS 9 26 16 25 16 25 9 23 11 23 13 23 13 23 7 22 10 22 11 22 15 22 20 22 Capitals 4, Blues 1 St. Louis 0 1 0—1 Washington 3 1 0—4 First Period—1, Washington, Ovechkin 16 (Backstrom, Oleksy), 7:17. 2, Washington, Ovechkin 17 (Alzner, Backstrom), 12:34. 3, Washington, Grabovski 7 (Chimera, Ward), 15:41. Penalties—Strachan, Was (slashing), 9:44. Second Period—4, St. Louis, Sobotka 3 (Shattenkirk, Bouwmeester), 5:29 (pp). 5, Washington, Carlson 5 (Backstrom, Johansson), 9:27 (pp). Penalties—Erat, Was (hooking), 4:05; Reaves, StL, major (fighting), 6:05; Wilson, Was, served by Volpatti, minor-major (roughing, fighting), 6:05; Sobotka, StL (hooking), 8:18; Steen, StL (cross-checking), 19:14. Third Period—None. Penalties—Chimera, Was (interference), 9:48; Laich, Was (high-sticking), 10:29; Backes, StL (interference), 10:52; Backes, StL (roughing), 13:41. Shots on Goal—St. Louis 10-18-19—47. Washington 9-3-8—20. Power-play opportunities—St. Louis 1 of 5; Washington 1 of 4. Goalies—St. Louis, Halak 10-3-2 (6 shots-3 saves), Elliott (15:41 first, 14-13). Washington, Holtby 10-6-0 (47-46). A—18,506 (18,506). T—2:30. Referees—Greg Kimmerly, Brad Watson. Linesmen—Michel Cormier, Jay Sharrers. Blue Jackets 4, Senators 1 Columbus 1 2 1—4 Ottawa 0 0 1—1 First Period—1, Columbus, Johansen 6 (Murray, Wisniewski), 4:50 (pp). Penalties—Methot, Ott (holding), 4:38; Dubinsky, Clm (tripping), 12:03. Second Period—2, Columbus, Umberger 5 (Johansen, Tyutin), 4:13 (pp). 3, Columbus, Tyutin 2 (Foligno), 12:07 (pp). Penalties—Dubinsky, Clm (holding), 1:10; Borowiecki, Ott (roughing), NATIONAL SCOREBOARD 4:05; Columbus bench, served by Atkinson (too many men), 7:42; Gryba, Ott (roughing), 10:10; Borowiecki, Ott (tripping), 11:43; Umberger, Clm (slashing), 16:49. Third Period—4, Columbus, MacKenzie 2 (Letestu, Comeau), 5:27. 5, Ottawa, E.Karlsson 7 (Phillips, Michalek), 17:33 (pp). Penalties— Wisniewski, Clm, served by Comeau, minor-major-misconduct (instigator, fighting), 5:44; Borowiecki, Ott (fighting, elbowing), 5:44; Chaput, Clm (roughing), 15:56; Savard, Clm (holding), 17:13. Shots on Goal—Columbus 10-7-5—22. Ottawa 5-13-12—30. Power-play opportunities—Columbus 3 of 5; Ottawa 1 of 6. Goalies—Columbus, Bobrovsky 6-8-2 (30 shots-29 saves). Ottawa, Anderson 5-6-2 (22-18). A—15,535 (19,153). T—2:31. Referees—Chris Rooney, Francois St. Laurent. Linesmen—Scott Driscoll, Matt MacPherson. Blackhawks 5, Sharks 1 San Jose 0 1 0—1 Chicago 1 1 3—5 First Period—1, Chicago, Pirri 6 (Kane, Versteeg), 16:34. Penalties—Desjardins, SJ (hooking), 13:07; Bollig, Chi (roughing), 17:30. Second Period—2, San Jose, Pavelski 8 (Kennedy, Braun), 8:16. 3, Chicago, Sharp 6 (Kruger, Saad), 12:08. Penalties—Chicago bench, served by Brookbank (too many men), 1:44. Third Period—4, Chicago, Toews 10 (Smith, Sharp), 3:39. 5, Chicago, Versteeg 3 (Saad, Pirri), 15:10. 6, Chicago, Sharp 7 (penalty shot), 18:49. Penalties—None. Shots on Goal—San Jose 9-5-10—24. Chicago 9-8-10—27. Power-play opportunities—San Jose 0 of 2; Chicago 0 of 1. Goalies—San Jose, Niemi 10-3-5 (27 shots-22 saves). Chicago, Crawford 13-3-3 (24-23). A—21,434 (19,717). T—2:20. Referees—Graham Skilliter, Dan O’Halloran. Linesmen—Pierre Racicot, Mark Wheler. Kings 1, Rangers 0 Los Angeles 0 1 0—1 N.Y. Rangers 0 0 0—0 First Period—None. Penalties—Mitchell, LA (interference), 8:18. Second Period—1, Los Angeles, Toffoli 4 (M.Richards, Voynov), 1:23. Penalties—Boyle, NYR (tripping), 2:40; Mitchell, LA (interference), 9:44; Los Angeles bench, served by Williams (too many men), 11:10; Lewis, LA (delay of game), 12:54. Third Period—None. Penalties— Brown, LA (cross-checking), 11:40. Shots on Goal—Los Angeles 6-1311—30. N.Y. Rangers 11-11-15—37. Power-play opportunities—Los Angeles 0 of 1; N.Y. Rangers 0 of 5. Goalies—Los Angeles, Scrivens 4-1-1 (37 shots-37 saves). N.Y. Rangers, Lundqvist 6-8-0 (30-29). A—18,006 (18,006). T—2:27. Referees—Dennis LaRue, Kelly Sutherland. Linesmen—Jonny Murray, Derek Amell. Wild 2, Jets 1 Winnipeg 0 0 1—1 Minnesota 1 0 1—2 First Period—1, Minnesota, Koivu 3 (Parise, Scandella), 16:37. Penalties— Parise, Min (interference), 7:50; Scheifele, Wpg (tripping), 17:52. Second Period—None. Penalties— Cooke, Min (high-sticking), 6:31; Clitsome, Wpg (tripping), 18:12. Third Period—2, Winnipeg, Byfuglien 4 (Little, Wheeler), :54. 3, Minnesota, Koivu 4 (Coyle, Suter), 16:48. Penalties—None. Shots on Goal—Winnipeg 2-14-6—22. Minnesota 9-8-7—24. Power-play opportunities—Winnipeg 0 of 2; Minnesota 0 of 2. Goalies—Winnipeg, Pavelec 8-8-2 (24 shots-22 saves). Minnesota, Harding 12-2-2 (22-21). A—18,283 (17,954). T—2:24. Referees—Tom Kowal, Kevin Pollock. Linesmen—Don Henderson, Steve Miller. Stars 2, Canucks 1 Dallas 1 0 1—2 Vancouver 0 0 1—1 First Period—1, Dallas, Nichushkin 2 (Seguin, Ja.Benn), 9:33. Penalties—Ja. Benn, Dal (tripping), 10:48. Second Period—None. Penalties—Ja. Benn, Dal (cross-checking), :25; Edler, Van (tripping), :46; Horcoff, Dal (hooking), 6:27; Goligoski, Dal (hooking), 9:22; H.Sedin, Van (interference), 14:07. Third Period—2, Dallas, Cole 2 (Eakin, Chiasson), 1:42. 3, Vancouver, H.Sedin 4 (Kesler, Bieksa), 3:06 (pp). Penalties—Garbutt, Dal (cross-checking), 2:48; Burrows, Van (cross-checking), 19:55. Shots on Goal—Dallas 7-6-10—23. Vancouver 13-20-10—43. Power-play opportunities—Dallas 0 of 3; Vancouver 1 of 5. Goalies—Dallas, Lehtonen 10-3-2 (43 shots-42 saves). Vancouver, Luongo 9-6-3 (23-21). A—18,910 (18,910). T—2:32. Referees—Rob Martell, Tim Peel. Linesmen—Lonnie Cameron, Ryan Galloway. The AP Top 25 Poll The Top 25 teams in The Associated Press college football poll, with firstplace votes in parentheses, records through Nov. 16, total points based on 25 points for a first-place vote through one point for a 25th-place vote, and previous ranking: Rec: Minnesota 77, Notre Dame 11, Texas 10, Georgia 5, Cincinnati 1, Nebraska 1. AUTO RACING AUTO RACING NASCAR SPRINT CUP Ford EcoBoost 400 Sunday. Race Statistics Average Speed of Race Winner: 130.693 mph. Time of Race: 3 hours, 3 minutes, 52 seconds. Margin of Victory: 0.799 seconds. Caution Flags: 8 for 37 laps. Lead Changes: 22 among 8 drivers.: Hamlin 1st in race Continued from Page B-1 CAR, win- ner. BASKETBALL BASKETBALL NBA Eastern Conference Atlantic Philadelphia Toronto Boston New York Brooklyn Southeast Miami Atlanta Charlotte Orlando Washington Central Indiana Chicago Cleveland Detroit Milwaukee W 5 4 4 3 3 W 7 6 5 4 2 W 9 5 4 3 2 L 6 7 7 6 6 L 3 4 5 6 7 L 1 3 7 6 7 Pct .455 .364 .364 .333 .333 Pct .700 .600 .500 .400 .222 Pct .900 .625 .364 .333 .222 GB — 1 1 1 1 GB — 1 2 3 41/2 GB — 3 51/2 51/2 61/2 Western Conference Southwest W L Pct GB San Antonio 9 1 .900 — Houston 7 4 .636 21/2 Dallas 6 4 .600 3 Memphis 5 5 .500 4 New Orleans 4 6 .400 5 Northwest W L Pct GB Portland 8 2 .800 — Oklahoma City 6 3 .667 11/2 Minnesota 7 4 .636 11/2 Denver 4 5 .444 31/2 Utah 1 10 .091 71/2 Pacific W L Pct GB L.A. Clippers 7 3 .700 — Golden State 7 3 .700 — Phoenix 5 4 .556 11/2 L.A. Lakers 5 7 .417 3 Sacramento 2 7 .222 41/2 L.A. Lakers 114, Detroit 99 Monday’s Games Portland at Brooklyn, 5:30 p.m. Charlotte at Chicago, 6 p.m. Denver at Oklahoma City, 6 p.m. Philadelphia at Dallas, 6:30 p.m. Golden State at Utah, 7 p.m. Memphis at L.A. Clippers, 8:30 p.m. Tuesday’s Games Minnesota at Washington, 5 p.m. Atlanta at Miami, 5:30 p.m. New York at Detroit, 5:30 p.m. Boston at Houston, 6 p.m. Phoenix at Sacramento, 8 p.m. Lakers 114, Pistons 99 DETROIT (99) Smith 7-12 1-2 18, Monroe 8-14 1-8 17, Drummond 7-9 0-2 14, Jennings 8-22 3-3 23, Caldwell-Pope 3-8 0-0 7, Stuckey 8-16 0-0 16, Singler 1-3 0-0 2, Jerebko 0-1 2-2 2, Datome 0-1 0-0 0, Harrellson 0-1 0-0 0, Mitchell 0-0 0-0 0, Siva 0-0 0-0 0. Totals 42-87 7-17 99. L.A. LAKERS (114) Johnson 6-8 0-0 13, Hill 11-16 2-2 24, Gasol 6-13 0-0 12, Blake 3-7 2-2 9, Meeks 6-11 3-3 19, Kaman 1-4 0-0 2, Young 7-13 3-3 19, Henry 2-4 0-0 4, Williams 2-8 0-0 6, Farmar 3-6 0-0 6. Totals 47-90 10-10 114. Detroit 29 27 15 28—99 L.A. Lakers 27 23 29 35—114 3-Point Goals—Detroit 8-23 (Jennings 4-8, Smith 3-5, Caldwell-Pope 1-5, Singler 0-1, Harrellson 0-1, Datome 0-1, Stuckey 0-2), L.A. Lakers 10-25 (Meeks 4-7, Young 2-5, Williams 2-6, Johnson 1-2, Blake 1-3, Henry 0-1, Farmar 0-1). Fouled Out—None. Rebounds—Detroit 50 (Drummond 13), L.A. Lakers 48 (Hill 17). Assists— Detroit 24 (Jennings 14), L.A. Lakers 33 (Blake 16). Total Fouls—Detroit 10, L.A. Lakers 20. A—18,997 (18,997). Grizzlies 97, Kings 86 MEMPHIS (97) Prince 3-8 0-0 6, Randolph 9-12 4-8 22, Gasol 8-14 3-3 19, Conley 8-12 0-0 19, Allen 5-10 2-2 12, Miller 0-0 0-0 0, Bayless 3-9 1-1 8, Pondexter 2-3 1-2 5, Koufos 2-3 2-2 6, Davis 0-1 0-0 0. Totals 40-72 13-18 97. SACRAMENTO (86) Mbah a Moute 1-6 2-4 4, Thompson 1-2 1-2 3, Cousins 4-11 1-1 9, Vasquez 4-7 0-0 8, McLemore 2-6 0-0 5, Hayes 0-2 0-0 0, Salmons 4-12 2-2 10, Thornton 5-13 1-1 12, Thomas 5-17 2-2 15, Ndiaye 1-2 0-1 2, Outlaw 6-9 4-4 18. Totals 33-87 13-17 86. Memphis 25 22 27 23—97 Sacramento 18 16 31 21—86 3-Point Goals—Memphis 4-13 (Conley 3-5, Bayless 1-3, Pondexter 0-1, Prince 0-1, Allen 0-3), Sacramento 7-23 (Thomas 3-6, Outlaw 2-2, McLemore 1-3, Thornton 1-7, Mbah a Moute 0-1, Salmons 0-4). Fouled Out—None. Rebounds—Memphis 55 (Randolph 10), Sacramento 40 (Ndiaye, Outlaw 6). Assists—Memphis 30 (Conley, Gasol 9), Sacramento 21 (Salmons 5). Total Fouls—Memphis 20, Sacramento 20. Technicals—Sacramento defensive three second. A—15,630 (17,317). GOLF GOLF LPGA TOUR LORENA OCHOA INVITATIONAL Trail Blazers 118, Raptors 110, OT PORTLAND (118) Batum 8-15 3-3 24, Aldridge 11-27 3-7 25, Lopez 1-2 4-4 6, Lillard 10-22 2-2 25, Matthews 6-12 1-2 17, Freeland 1-2 0-0 2, Williams 4-7 2-2 13, Wright 1-4 0-0 2, Robinson 2-8 0-0 4. Totals 44-99 15-20 118. TORONTO (110) Gay 12-27 5-7 30, Johnson 3-5 2-2 8, Valanciunas 8-11 3-3 19, Lowry 3-11 3-4 10, DeRozan 11-27 6-8 29, Hansbrough 2-3 2-3 6, Ross 0-3 0-0 0, Acy 0-0 0-0 0, Buycks 2-3 1-2 5, Fields 1-1 1-2 3, Novak 0-3 0-0 0. Totals 42-94 23-31 110. Portland 31 26 22 23 16—118 Toronto 29 25 15 33 8—110 3-Point Goals—Portland 15-32 (Batum 5-8, Matthews 4-7, Williams 3-5, Lillard 3-10, Wright 0-2), Toronto 3-17 (Gay 1-3, DeRozan 1-5, Lowry 1-7, Novak 0-2). Fouled Out—Lopez, Johnson. Rebounds—Portland 57 (Aldridge 11), Toronto 63 (Gay 10). Assists— Portland 25 (Lillard 8), Toronto 17 (Lowry 10). Total Fouls—Portland 25, Toronto 23. Technicals—Toronto delay of game. A—17,945 (19,800). NCAA MEN’S TOP 25 Sunday’s Results No. 7 Michigan 77 Iowa State 70 Belmont 83 No. 12 North Carolina 80 No. 19 UConn 77 Boston University 60 Indiana State 83 No. 21 Notre Dame 70 No. 22 New Mexico 109 Charleston So. 93 No. 23 Baylor 87 Louisiana-Lafayette 68 No. 1 Kentucky vs. Robert Morris No. 15 Gonzaga vs. Oakland Saturday’s Results No. 9 Syracuse 69 Colgate 50 No. 10 Ohio State 52 No. 17 Marquette 35 No. 11 Florida 86 UALR 56 No. 14 VCU 92 Winthrop 71 No. 16 Wichita State 85 Tennessee State 71 No. 20 Wisconsin 69 Green Bay 66 No. 25 Virginia 70 Davidson 57 NCAA WOMEN’S TOP 25 Sunday’s Results No. 1 UConn 72 No. 13 Penn State 51 No. 2 Duke 92 Alabama 57 No. 3 Stanford 66 UC Davis 48 No. 7 Kentucky 96 Central Michigan 74 No. 10 California 67 Georgetown 52 No. 16 Texas A&M 63 Houston 51 No. 18 Purdue 81 Toledo 79 No. 19 Mich. St. 96 No. 23 Dayton 89 (OT) No. 21 South Carolina 88 Seton Hall 67 No. 24 Georgia 53 Ohio State 49 No. 4 Tennessee vs. Georgia Tech No. 12 North Carolina at UCLA Saturday’s Results No. 6 Notre Dame 96 Valparaiso 46 No. 20 Okla. State 87 Northern Colo. 51 TENNIS TENNIS DAVIS CUP WORLD GROUP Final At Belgrade Arena Belgrade, Serbia Surface: Hard-Indoor Czech Republic 3, Serbia 2 Singles Novak Djokovic, Serbia, def. Radek Stepanek, Czech Republic, 7-5, 6-1, 6-4. Tomas Berdych, Czech Republic, def. Dusan Lajovic, Serbia, 6-3, 6-4, 6-3. Doubles Tomas Berdych and Radek Stepanek, Czech Republic, def. Ilija Bozoljac and Nenad Zimonjic, Serbia, 6-2, 6-4, 7-6 (4). Reverse Singles Novak Djokovic, Serbia, def. Tomas Berdych, Czech Republic, 6-4, 7-6 (5), 6-2. Radek Stepanek, Czech Republic, def. Dusan Lajovic, Serbia, 6-3, 6-1, 6-1. Davis Cup Champions 2013 — Czech Republic 2012 — Czech Republic 2011 — Spain 2010 — Serbia 2009 — Spain 2008 — Spain 2007 — United States 2006 — Russia 2005 — Croatia 2004 — Spain 2003 — Australia 2002 — Russia TRANSACTIONS) Sunday At Guadalajara Country Club Guadalajara, Mexico Purse: $1 million Yardage: 6,633; Par 72 Final Lexi Thompson, $200,000 72-64-67-69—272 Stacy Lewis, $103,449 72-66-67-68—273 So Yeon Ryu, $75,045 68-67-71-69—275 Inbee Park, $58,053 68-68-72-69—277 Suzann Pettersen, $42,479 70-68-70-70—278 Pornanong Phatlum, $42,479 66-69-72-71—278 Amy Yang, $25,884 67-73-70-69—279 Azahara Munoz, $25,884 71-69-69-70—279 Michelle Wie, $25,884 69-73-67-70—279 Lizette Salas, $25,884 70-67-71-71—279 I.K. Kim, $25,884 70-67-67-75—279 Chella Choi, $19,200 74-68-72-66—280 Anna Nordqvist, $19,200 68-67-72-73—280 Ilhee Lee, $16,462 74-66-73-68—281 Jenny Shin, $16,462 69-69-75-68—281 Karine Icher, $16,462 70-68-72-71—281 OHL CLASSIC Sunday At Mayakoba Resort (El Camaleon Golf Club) Playa del Carmen, Mexico Purse: $6 million Yardage: 6,987; Par: 71 Final Harris English (500), $1,080,000 68-62-68-65—263 Brian Stuard (300), $648,000 65-70-65-67—267 Jason Bohn (145), $312,000 67-68-65-68—268 Rory Sabbatini (145), $312,000 68-65-65-70—268 Chris Stroud (145), $312,000 66-68-66-68—268 Justin Hicks (89), $194,250 69-67-66-67—269 Charles Howell III (89), $194,250 67-67-66-69—269 Robert Karlsson, $194,250 63-67-67-72—269 Justin Leonard (89), $194,250 70-67-65-67—269 Bob Estes (73), $156,000 68-69-65-69—271 Tim Wilkinson (73), $156,000 70-63-71-67—271 Freddie Jacobson (61), $126,000 70-69-67-66—272 Will MacKenzie (61), $126,000 69-69-69-65—272 Kevin Stadler (61), $126,000 67-63-68-74—272 Peter Malnati (56), $108,000 69-69-70-65—273 Robert Allenby (52), $84,171 70-68-66-70—274 Jeff Maggert (52), $84,171 69-66-69-70—274 Jay McLuen, $84,171 67-69-69-69—274 Pat Perez (52), $84,171 66-68-71-69—274 Alvaro Quiros, $84,171 67-70-66-71—274 Brendan Steele (52), $84,171 70-66-68-70—274 Scott Brown (52), $84,171 69-66-67-72—274 DP WORLD TOUR CHAMPIONSHIP Sunday At Jumeriah Golf Estates (Earth Course) Dubai, United Arab Emirates Purse: $8 million Yardage: 7,675; Par: 72 Final Henrik Stenson, Swe 68-64-67-64—263 Ian Poulter, Eng 69-68-66-66—269 Victor Dubuisson, Fra 70-66-64-71—271 Joost Luiten, Holland 73-68-65-66—272 Rory McIlroy, NIr 71-67-68-67—273 Luke Donald, Eng 73-66-67-67—274 M.A. Jimenez, Esp 72-66-66-70—274 Peter Hanson, Swe 70-68-70-67—275 Justin Rose, Eng 70-67-68-70—275 Jonas Blixt, Swe 72-65-71-68—276 Francesco Molinari, Ita 70-68-70-69—277 Richard Sterne, Fra 70-70-70-68—278 Rafa Cabrera-Bello, Esp 68-71-68-71—278 Alejandro Canizares, Esp 66-67-70-75—278 Thorbjom Olesen, Den 69-70-71-69—279 TALISKER MASTERS Sunday At Royal Melbourne Golf Club Melbourne, Australia Purse: $1 million Yardage: 7,024; Par: 71 Final Adam Scott, Aus 67-66-66-71—270 Matt Kuchar, USA 71-66-67-68—272 Vijay Singh, Fiji 72-68-63-71—274 Nick Cullen, Aus 65-69-69-72—275 Ryan Fox, NZl 68-71-66-73—278 Matthew Griffin, Aus 69-65-69-75—278 Marc Leishman, Aus 71-71-72-65—279 Aron Price, Aus 73-71-67-68—279 Jason Scrivener, Aus 69-71-70-69—279 Geoff Ogilvy, Aus 71-72-67-69—279 Mathew Goggin, Aus 72-71-67-69—279 B. de Jonge, Zimbabwe 68-70-68-73—279 Matthew Millar, Aus 69-70-71-70—280 Gaganjeet Bhullar, Ind 69-72-69-70—280 Nathan Holman, Aus 68-65-70-78—281 Gareth Paddison, NZl 74-69-72-67—282 Peter Senior, Aus 74-68-71-69—282 Michael Hendry, NZl 72-69-71-70—282 THIS DATE ON ON THIS DATE November. BCS: Bears may pass Buckeyes Continued from Page B. SPORTS TOP 25 MENS BASKETBALL Belmont stuns No. 12 North Carolina The Associated Press Monday, November 18, 2013 THE NEW MEXICAN Northern New Mexico SCOREBOARD CHAPEL HILL, N.C. — J.J. Mann hit the go-ahead 3-pointer with 13.1 seconds left to help BelBelmont 83 mont upset No. 12 N. Carolina 80 North Carolina 83-80 on Sunday in the Hall of Fame Tipoff. Mann finished with a careerbest. Local results and schedules NO. 1 KENTUCKY 87, ROBERT MORRIS 49 In Lexington, Ky., Aaron Harrison scored 19 of his 28 points in the first half, and Kentucky started all freshmen for the first time in rolling to a victory over Robert Morris. After three games of starting four freshmen around sophomore 7-footer Willie CauleyStein, coach John in the rematch of last spring’s NIT game won by Robert Morris. Soccer IOWA STATE 77, NO. 7 MICHIGAN 70 In Ames, Iowa, Melvin Ejim scored 22 points and Iowa State beat No. 7 Michigan, spoiling Wolverines star Mitch McGary’s season debut. Naz Long added 16 for the Cyclones (3-0), who held McGary to just one point in the second half while notching one of their biggest wins under coach Fred Hoiberg. McGary, a preseason firstteam All-American who missed two games with a lower back injury, finished with nine points and six rebounds. Nik Stauskas led Michigan (2-1). NO. 19 CONNECTICUT 77, BOSTON UNIVERSITY 60 In Storrs, Conn., DeAndre Daniels scored 24 points to lead Connecticut to a victory over Boston University. B-3 ON THE AIR Today on TV Schedule subject to change and/or blackouts. All times local. MEN’S COLLEGE BASKETBALL 5 p.m. on FS1 — Vermont at Providence NFL FOOTBALL 6:25 p.m. on ESPN — New England at Carolina NHL HOCKEY 5:30 p.m. on NBCSN — Anaheim at Pittsburgh WOMEN’S COLLEGE BASKETBALL 6 p.m. on FSN — Rice at Baylor ANNOUNCEMENTS Basketball u The Genoveva Chavez Community Center will hold a winter youth league. Divisions include elementary, middle school and high school for both boys and girls, and teams will play an eightgame season with a postseason tournament. Registration packets can be pick up at the Chavez Center. Registration fee is $320 per team. For more information, call Dax Roybal at 955-4074. u The Genoveva Chavez Community Center will hold a 3-on-3 tournament on Dec. 28-29. Divisions include elementary, middle school, high school and adults for both boys and girls. Teams are guaranteed three games, and there will be a single-elimination tournament. Register at the front desk before Dec. 21. Registration is $50 per team. For more information, call Dax Roybal at 955-4074. u The Genoveva Chavez Community Center will host a 3-on-3 indoor tournament from Jan. 4-5. Divisions include elementary, middle school, high school and adults for both boys and girls. Teams are guaranteed three games, and there will be a singleelimination tournament. Register at the front desk before Dec. 28. Registration is $50 per team. For more information, call Mike Olguin at 955-4064. NBA North Carolina’s J.P. Tokoto, right, drives to the basket as Belmont’s Caleb Chowbay defends during Sunday’s game in Chapel Hill, N.C. GERRY BROOME/THE ASSOCIATED PRESSpoint lead with 17. INDIANA STATE 83, NO. 21 NOTRE DAME 70 In South Bend, Ind., Justin Gant scored 17 points, Manny Arop had 13 and Indiana State beat Notre D. NO. 23 BAYLOR 87, LOUISIANA-LAFAYETTE 68 In Waco, Texas, Kenny Chery scored 20 points and had four assists, helping lead Baylor to a victory over Louisiana-Lafayette at home. NO. 15 GONzAGA 82, OAKLAND 67 In Spokane, Wash., Kevin Pangos scored 21 points, making five 3-pointers, to give No. 15 Gonzaga a win over short-handed Oakland.. Lobos: Bairstow has career-high 29 points Continued from Page B-1 Bairstow had a career-high 29 points, giving him 51 points in the season’s first two games. To illustrate his progression, it took him 21 games to score that many during his freshman season, 14 games during his sophomore campaign and seven last season. Kirk’s 24 points came with 13 rebounds and five blocked shots. Williams’ 20 points came on just four shot attempts — he went 3-for-4 while hitting 13 of 14 free throws. He also had 10 assists and three steals. All told, five Lobos finished in double figures in the scoring column. That included true freshman Cullen Neal, whose 11 points came with seven assists and six of the team’s 13 miscues. After UNM opened a 31-point lead midway through the second half, things started to get chippy thanks to the effort of Charleston Southern guard Saah Nimley. The 5-foot-8 guard came off the bench to score a team-high 24 points for the Buccaneers. Fifteen of those came from the free throw line as he continuously drew the attention of the bigger Lobos guards. He also got the attention of the 14,146 fans in attendance. Most of his touches in the second half were accompanied by a chorus of boos from the crowd. Almost All told, five Lobos finished in double figures in the scoring column. every time, Nimley responded with either a big bucket, nifty pass or another trip to the foul line. Neal said he adjusted his defense to run a zone in a futile attempt to keep Nimley off the line. “I think I went to zone just because I got tired of fouling him,” he said. “Saah is, pound for pound, the best point guard in the country,” said Charleston Southern head coach Barclay Radebaugh. “I didn’t say he’s the best point guard in the country. I said pound for pound, inch for inch, you won’t find a better, undersized point guard in America than Saah.” Even with the adjustment, Nimley still produced, as did the rest of the Buccaneers’ backcourt players. “Obviously we still are trying to adjust when we are in zone,” Williams said. “I felt a couple ticky tacks here and there, but that’s the rule. Ticky tack now doesn’t have the same definition as something we adjust to.” The defending Big South champion, Charleston Southern never did have an answer for Bairstow and Kirk. Their 53 combined points were the most for the two in any game during their UNM careers. Collectively, the Lobos attempted 43 free throws, hitting 32. They were 18 for 20 in the second half. “In a game like this when they’re obviously smaller than us, you know, there’s ways to be aggressive and that way was getting fouled a lot,” Williams said. “Against other teams it’s going to be take my shots when I’m open and use my first step to get around guys and make plays.” The Lobos actually head to Charleston, S.C., later this week for the Charleston Classic, a three-game, four-day tournament that tips off Thursday with UNM facing Alabama-Birmingham. As for Charleston Southern, the Buccaneers are just happy they are done facing the Lobos. “These games help us get better,” Radebaugh said. “New Mexico, unless we had some conference realignment that I didn’t know about last night, New Mexico’s not in our league. So, we won’t face that size many more times.” The Raptors’ Kyle Lowry passes the ball past the Trail Blazers’ Damian Lillard during Sunday’s game in Toronto. AARON VINCENT ELKAIM/THE CANADIAN PRESS Blazers beat Raptors in OT for 6th win The Associated Press TORONTO — LaMarcus Aldridge and Damian Lillard each scored 25 points, Nicolas Batum T. Blazers 118 added 24, and Raptors 110. GRIzzLIES 97, KINGS 86 In Sacramento, Calif.,game. LAKERS 114, PISTONS 99 In Los Angeles,. B-4 NFL THE NEW MEXICAN Monday, November 18, 2013 NFL American Conference East New England N.Y. Jets Miami Buffalo South Indianapolis Tennessee Houston Jacksonville North Cincinnati Pittsburgh Baltimore Cleveland West Denver Kansas City Oakland San Diego W 7 5 5 4 W 7 4 2 1 W 7 4 4 4 W 9 9 4 4 L 2 5 5 7 L 3 6 8 9 L 4 6 6 6 L 1 1 6 6 T 0 0 0 0 T 0 0 0 0 T 0 0 0 0 T 0 0 0 0 Pct .778 .500 .500 .364 Pct .700 .400 .200 .100 Pct .636 .400 .400 .400 Pct .900 .900 .400 .400 PF PA 234 175 183 268 213 225 236 273 PF PA 252 220 227 226 193 276 129 318 PF PA 275 206 216 245 208 212 192 238 PF PA 398 255 232 138 194 246 6 3 0 .667 214 115’s Game Indianapolis 30, Tennessee 27 Sunday’s Games Monday’s Game New England at Carolina Thursday, Nov. 21 New Orleans at Atlanta, 6:25 p.m. Sunday, Nov. 24 Minnesota at Green Bay, 11 a.m. Jacksonville at Houston, 11 a.m. San Diego at Kansas City, 11 a.m. Chicago at St. Louis, 11 a.m. Pittsburgh at Cleveland, 11 a.m. Tampa Bay at Detroit, 11 a.m. N.Y. Jets at Baltimore, 11 a.m. Carolina at Miami, 11 a.m. Tennessee at Oakland, 2:05 p.m. Indianapolis at Arizona, 2:05 p.m. Dallas at N.Y. Giants, 2:25 p.m. Denver at New England, 6:30 p.m. Open: Buffalo, Cincinnati, Philadelphia, Seattle Monday, Nov. 25 San Francisco at Washington, 6:40 p.m. Packers 27, Giants 13 Green Bay 0 6 0 7—13 N.Y. Giants 7 3 10 7—27 First Quarter NYG—Randle 26 pass from Manning (J.Brown kick), 5:34. Second Quarter NYG—FG J.Brown 40, 14:03. GB—FG Crosby 24, 10:21. GB—FG Crosby 57, :00. Third Quarter NYG—FG J.Brown 28, 10:06. NYG—Jacobs 1 run (J.Brown kick), :25. Fourth Quarter GB—Lacy 4 run (Crosby kick), 12:43. NYG—Pierre-Paul 24 interception return (J.Brown kick), 10:49. A—79,114. GB NYG First downs 16 19 Total Net Yards 394 334 Rushes-yards 20-55 24-78 Passing 339 256 Punt Returns 3-34 1-32 Kickoff Returns 3-69 2-35 Interceptions Ret. 1-10 3-34 Comp-Att-Int 24-34-3 25-35-1 Sacked-Yards Lost 0-0 4-23 Punts 4-45.0 5-53.0 Fumbles-Lost 0-0 0-0 Penalties-Yards 5-38 3-30 Time of Possession 24:46 35:14 INDIVIDUAL STATISTICS RUSHING—Green Bay, Lacy 14-27, Kuhn 1-12, Tolzien 2-11, Jennings 1-6, Starks 2-(minus 1). N.Y. Giants, A.Brown 18-66, Jacobs 5-9, Manning 1-3. PASSING—Green Bay, Tolzien 24-34-3339. N.Y. Giants, Manning 25-35-1-279. RECEIVING—Green Bay, Nelson 8-117, Boykin 6-91, Kuhn 3-11, J.Jones 2-55, Lacy 2-21, Quarless 2-18, Bostick 1-26. N.Y. Giants, Cruz 8-110, Nicks 4-50, Randle 3-37, Myers 3-32, A.Brown 3-27, Jernigan 2-21, Conner 2-2. MISSED FIELD GOALS—None. Bills 37, Jets 14 N.Y. Jets 0 0 7 7—14 Buffalo 0 20 14 3—37 Second Quarter Buf—FG Carpenter 40, 12:40. Buf—Graham 34 pass from Manuel (Carpenter kick), 4:05. Buf—Summers 3 run (Carpenter kick), 3:17. Buf—FG Carpenter 42, 1:15. Third Quarter NYJ—Ivory 1 run (Folk kick), 7:18. Buf—Goodwin 43 pass from Manuel (Carpenter kick), 4:40. Buf—Searcy 32 interception return (Carpenter kick), 1:14. Fourth Quarter NYJ—Cumberland 13 pass from Simms (Folk kick), 9:36. Buf—FG Carpenter 43, 4:02. A—68,036. NYJ Buf First downs 12 14 Total Net Yards 267 313 Rushes-yards 23-134 38-68 Passing 133 245 Punt Returns 1-16 4-17 Kickoff Returns 5-115 1-26 Interceptions Ret. 0-0 3-41 Comp-Att-Int 12-29-3 20-28-0 Sacked-Yards Lost 4-30 1-0 Punts 6-47.3 6-33.3 Fumbles-Lost 2-1 1-0 Penalties-Yards 4-24 8-64 Time of Possession 26:18 33:42 INDIVIDUAL STATISTICS RUSHING—N.Y. Jets, Ivory 15-98, Powell 5-27, Cribbs 2-9, Smith 1-0. Buffalo, Jackson 12-34, Goodwin 1-17, Manuel 7-9, Spiller 13-6, Summers 2-4, Choice 2-1, Graham 1-(minus 3). PASSING—N.Y. Jets, Smith 8-23-3-103, Simms 4-6-0-60. Buffalo, Manuel 20-28-0-245. RECEIVING—N.Y. Jets, Cumberland 3-25, Holmes 2-71, Salas 2-32, Bohanon 2-5, Winslow 1-17, Nelson 1-12, Powell 1-1. Buffalo, Goodwin 6-81, Hogan 3-29, Graham 2-74, Chandler 2-40, Spiller 2-10, Jackson 2-5, Summers 1-5, L.Smith 1-1, Choice 1-0. MISSED FIELD GOALS—N.Y. Jets, Folk 48 (WR). Steelers 37, Lions-461. Bengals 41, Browns-563. Raiders 28, Texans 23 Oakland 14 0 14 0—28 Houston 0 17 0 6—23 First Quarter Oak—D.Moore 5 pass from McGloin (Janikowski kick), 9:26. Oak—Streater 16 pass from McGloin (Janikowski kick), 3:45. Second Quarter Hou—Graham 42 pass from Keenum (Bullock kick), 11:52. Hou—Martin 87 punt return (Bullock kick), 2:54. Hou—FG Bullock 51, :40. Third Quarter Oak—Rivera 26 pass from McGloin (Janikowski kick), 8:13. Oak—Jennings 80 run (Janikowski kick), 2:26. Fourth Quarter Hou—FG Bullock 26, 12:13. Hou—FG Bullock 30, 8:02. A—71,726. Oak Hou First downs 12 14 Total Net Yards 341 394 Rushes-yards 31-165 21-90 Passing 176 304 Punt Returns 4-30 7-125 Kickoff Returns 3-77 3-65 Interceptions Ret. 1-0 0-0 Comp-Att-Int 18-32-0 25-49-1 Sacked-Yards Lost 2-21 2-21 Punts 11-49.1 9-49.1 Fumbles-Lost 1-0 3-1 Penalties-Yards 8-77 9-50 Time of Possession 31:31 28:29 INDIVIDUAL STATISTICS RUSHING—Oakland, Jennings 22-150, Streater 1-8, Reece 4-6, Ford 1-4, McGloin 3-(minus 3). Houston, Tate 19-88, D.Johnson 2-2. PASSING—Oakland, McGloin 18-320-197. Houston, Keenum 13-24-1-170, Schaub 12-25-0-155. RECEIVING—Oakland, Streater 6-84, Rivera 5-54, Reece 2-17, D.Moore 2-11, Jennings 2-(minus 2), Holmes 1-33. Houston, A.Johnson 10-116, Graham 7-136, Tate 4-29, Martin 2-32, Hopkins 1-7, Posey 1-5. MISSED FIELD GOALS—Oakland, Janikowski 54 (WL). Eagles 24, Redskins 16-yards 38-191 33-126 Passing 236 276 Punt Returns 1-0 2-6 Kickoff Returns 1-23 2-23 Interceptions Ret. 0-0 1-0 Comp-Att-Int 17-35-1 17-26-0 Sacked-Yards Lost 4-28 3-22 Punts 6-37.2 6-50.7 Fumbles-Lost 3-1 0-0 Penalties-Yards 4-39 9-68 Time of Possession 33:42 26:18 INDIVIDUAL STATISTICS26. Buccaneers 41, Falcons 28 Atlanta 0 6 7 15—28 Tampa Bay 3 21 14 3—41 First Quarter TB—FG Lindell 30, 1:45. Second Quarter Atl—FG Bryant 46, 12:07. TB—Rainey 43 run (Lindell kick), 10:14. TB—Foster 37 interception return (Lindell kick), 7:05. TB—Rainey 3 run (Lindell kick), 3:16. Atl—FG Bryant 49, :56. Third Quarter TB—Rainey 4 pass from Glennon (Lindell kick), 9:34. TB—Jackson 3 pass from Glennon (Lindell kick), 1:54. Atl—Douglas 80 pass from Ryan (Bryant kick), 1:02. Fourth Quarter TB—FG Lindell 46, 7:15. Atl—Smith 50 run (Gonzalez pass from Do.Davis), 5:22. Atl—White 6 pass from Ryan (Bryant kick), 1:45. A—55,360. Atl TB First downs 24 24 Total Net Yards 420 410 Rushes-yards 20-152 38-186 Passing 268 224 Punt Returns 2-16 0-0 Kickoff Returns 0-0 5-61 Interceptions Ret. 0-0 2-37 Comp-Att-Int 24-43-2 20-25-0 Sacked-Yards Lost 3-20 2-7 Punts 2-12.0 4-42.0 Fumbles-Lost 1-1 0-0 Penalties-Yards 7-45 11-121 Time of Possession 26:46 33:14 INDIVIDUAL STATISTICS RUSHING—Atlanta, Smith 2-88, Jackson 11-41, Rodgers 6-22, Vaughan 1-1. Tampa Bay, Rainey 30-163, Leonard 4-16, Glennon 1-4, Hill 3-3. PASSING—Atlanta, Ryan 19-36-2254, Do.Davis 5-7-0-34. Tampa Bay, Glennon 20-23-0-231, Koenen 0-1-0-0, Rainey 0-1-0-0. RECEIVING—Atlanta, Douglas 6-134, Gonzalez 6-51, White 3-36, Jackson 2-24, D.Johnson 2-18, Vaughan 2-7, Rodgers 1-8, Toilolo 1-6, Smith 1-4. Tampa Bay, Jackson 10-165, Leonard 4-21, Rainey 2-4, Underwood 1-20, Wright 1-13, Crabtree 1-5, Lorig 1-3. MISSED FIELD GOALS—Tampa Bay, Lindell 55 (WR). Cardinals 27, Jaguars 14 Arizona 7 7 10 3—27 Jacksonville 14 0 0 0—14 First Quarter Jax—Noble 62 pass from Henne (Scobee kick), 12:53. Ari—Fitzgerald 14 pass from Palmer (Feely kick), 7:50. Jax—Jones-Drew 1 run (Scobee kick), 5:08. Second Quarter Ari—Mendenhall 5 run (Feely kick), 1:55. Third Quarter Ari—FG Feely 21, 10:36. Ari—Floyd 91 pass from Palmer (Feely kick), 7:29. Fourth Quarter Ari—FG Feely 32, 7:03. A—59,862. Ari Jax First downs 19 14 Total Net Yards 416 274 Rushes-yards 24-14 16-32 Passing 402 242 Punt Returns 4-22 6-48 Kickoff Returns 0-0 4-144 Interceptions Ret. 2-15 0-0 Comp-Att-Int 30-42-0 27-42-2 Sacked-Yards Lost 3-17 2-13 Punts 8-44.8 8-47.8 Fumbles-Lost 1-0 0-0 Penalties-Yards 5-42 6-40 Time of Possession 35:53 24:07 INDIVIDUAL STATISTICS RUSHING—Arizona, Mendenhall 13-14, Ellington 8-3, Palmer 3-(minus 3). Jacksonville, Jones-Drew 14-23, Todman 2-9. PASSING—Arizona, Palmer 30-42-0419. Jacksonville, Henne 27-42-2-255. RECEIVING—Arizona, Floyd 6-193, Housler 6-70, Fitzgerald 6-61, Roberts 3-14, Mendenhall 3-13, Dray 2-18, Ellington 2-10, Ballard 1-29, Peterson 1-11. Jacksonville, Sanders 8-61, Jones-Drew 4-12, Harbor 3-32, Lewis 3-23, Brown 2-23, Shorts III 2-22, Taylor 2-20, Noble 1-62, Ta’ufo’ou 1-5, Todman 1-(minus 5). MISSED FIELD GOALS—Jacksonville, Scobee 60 (WL). Bears 23, Ravens 20, OT Baltimore 10 7 0 3 0 —20 Chicago 0 13 0 7 3 162.. Dolphins 20, Chargers 16 San Diego 7 3 3 3—16 Miami 3 7 7 3—20 First Quarter Mia—FG Sturgis 22, 9:13. SD—Gates 5 pass from Rivers (Novak kick), :18. Second Quarter Mia—Dan.Thomas 1 run (Sturgis kick), 9:43. SD—FG Novak 27, :54. Third Quarter Mia—Clay 39 pass from Tannehill (Sturgis kick), 7:43. SD—FG Novak 50, 4:00. Fourth Quarter SD—FG Novak 29, 14:52. Mia—FG Sturgis 37, 8:34. A—60,256. SD Mia First downs 22 21 Total Net Yards 435 343 Rushes-yards 26-154 19-104 Passing 281 239 Punt Returns 3-46 0-0 Kickoff Returns 2-43 2-48 Interceptions Ret. 1-0 1-8 Comp-Att-Int 22-34-1 22-35-1 Sacked-Yards Lost 3-17 4-29 Punts 4-43.5 4-52.3 Fumbles-Lost 0-0 0-0 Penalties-Yards 10-76 3-15 Time of Possession 31:24 28:36 INDIVIDUAL STATISTICS RUSHING—San Diego, Mathews 19-127, Woodhead 5-21, Rivers 2-6. Miami, Dan.Thomas 10-57, Tannehill 4-21, Miller 4-17, Thigpen 1-9. PASSING—San Diego, Rivers 22-34-1298. Miami, Tannehill 22-35-1-268. RECEIVING—San Diego, Green 4-81, Gates 4-52, Allen 3-45, Ajirotutu 2-38, Royal 2-20, V.Brown 2-17, Mathews 2-16, Woodhead 2-16, Phillips 1-13. Miami, Clay 6-90, Hartline 5-65, Matthews 4-52, Wallace 4-39, Miller 2-20, Dan.Thomas 1-2. MISSED FIELD GOALS—None. Seahawks 41, Vikings 2022.:22. NO—FG Hartley 21, 7:50. NO—FG Hartley 42, 2:06. NO—FG Hartley 31, :00. A—73,025. SF NO First downs 12 23 Total Net Yards 196 387 23-92 Rushes-yards 22-81 Passing 115 295 Punt Returns 2-23 3-5 Kickoff Returns 0-0 1-82 Interceptions Ret. 1-22 1-43 Comp-Att.-450). AFC Leaders Not including Sunday’s games Quarterbacks Att Com Yds P. Manning, DEN 369 262 3249 P. Rivers, SND 324 232 2691 Rthlisberger, PIT 338 218 2534 Luck, IND 347 206 2430 Dalton, CIN 383 239 2861 Locker, TEN 183 111 1256 Brady, NWE 340 194 2256 Ale. Smith, KAN 315 188 1919 Tannehill, MIA 331 202 2206 Schaub, HOU 233 150 1552 Rushers Att Yds Avg J. Charles, KAN 170 725 4.26 Chr. Johnson, TEN167632 3.78 F. Jackson, BUF 129 557 4.32 A. Foster, HOU 121 542 4.48 Ry. Mathews, SND131 539 4.11 Moreno, DEN 123 521 4.24 Receivers No Yds Avg Ant. Brown, PIT 67 805 12.0 A.. Green, CIN 65 1013 15.6 And. Johnson, HOU62 850 13.7 Ke. Wright, TEN 59 660 11.2 De. Thomas, DEN 55 793 14.4 Welker, DEN 53 576 10.9 TD Int 33 6 18 7 13 10 14 6 18 13 8 4 13 6 9 4 13 10 8 9 LG TD 24 6 30t 4 59 6 23 1 35 2 25t 8 LG TD 45 3 82t 6 62t 5 45 1 78t 9 33 9 Not including Sunday’s games Quarterbacks Att Com Yds Brees, NOR 363 247 3064 A. Rodgers, GBY 251 168 2218 R. Wilson, SEA 257 163 2132 Romo, DAL 370 239 2681 M. Stafford, DET 373 229 2836 M. Ryan, ATL 368 248 2614 S. Bradford, STL 262 159 1687 Cutler, CHI 265 167 1908 C. Newton, CAR 271 170 1970 Vick, PHL 141 77 1215 Rushers Att Yds Avg L. McCoy, PHL 193 932 4.83 M. Lynch, SEA 191 871 4.56 A. Morris, WAS 159 825 5.19 A. Peterson, MIN 173 786 4.54 Gore, SNF 162 700 4.32 Forte, CHI 157 691 4.40 Lacy, GBY 158 669 4.23 Re. Bush, DET 133 623 4.68 De. Williams, CAR 135 565 4.19 D. Murray, DAL 111 548 4.94 Receivers No Yds Avg Garcon, WAS 61 803 13.2 B. Marshall, CHI 60 786 13.1 De. Jackson, PHL 54 903 16.7 J. Graham, NOR 54 805 14.9 Cal. Johnson, DET 53 904 17.1 TD Int 25 7 15 4 17 6 21 6 19 7 16 10 14 4 13 8 13 8 5 3 LG TD 41t 3 43 7 45t 5 78t 9 34t 7 55 7 56 4 39 2 27t 2 41 4 LG TD 44 3 44 8 61t 7 56t 10 87 9 NFC Leaders Scratch: Chiefs hadn’t lost since December game with Broncos Continued from Page B Chiefs’ defense, which came in with a leagueleading. Broncos running back Montee Ball, right, reacts after scoring a touchdown against the Chiefs in the second quarter of Sunday’s game in Denver. JOE MAHONEY/THE ASSOCIATED PRESS NFL Monday, November 18, 2013 THE NEW MEXICAN B-5 Steelers rally past Lions from a horrific second quarter to hold high-powered Detroit in check during the second half. PITTSBURGH — Backed up and Stafford threw for 362 yards with fed up, Ben Roethlisberger provided two touchdowns and an intercepa vivid reminder to his critics and tion, surpassing Bobby Layne’s team the Detroit Lions record for career passing yards in the Steelers 37 of just how danprocess. gerous he and his Lions 27 Calvin Johnson hauled in six suddenly surging passes for 179 yards and both scores, team remain. but Detroit’s two stars disappeared The Pittsburgh Steelers quarterover the final 30 minutes. back passed for 367 yards and four The Steelers limited Stafford to touchdowns, including two in the just 3 of 16 passing after halftime, final 5 minutes as the Steelers rallied while Johnson was shut out. to beat the Lions 37-27. “We knew they’d make plays and The victory capped a contenget yards,” Pittsburgh safety Ryan tious week in which Roethlisberger Clark said. “We just wanted to make refuted speculation he may seek a plays and stop them when it counted trade in the offseason and rumors and we were able to do that.” the franchise would like him to take Still, the Lions entered the fourth a more “cerebral” approach to the quarter with the lead thanks to a game. 27-point deluge in the second quarHe responded by calling most of ter. Detroit had a chance to push the plays against an aggressive but the advantage to a touchdown. immature defense as Pittsburgh put But rather than have David Akers together its most productive offenattempt a short field goal, the Lions sive day in more than two years. opted to run a fake. Holder Sam “It feels awesome to win it the way Martin, however, fumbled while we did,” Roethlisberger said mount- fighting for the necessary 5 yards and ing the 31st comeback victory of his the Steelers recovered. 10-year career. “I got hit by a 350-pound man,” Roethlisberger led the Steelers Martin said. “I don’t think I had the 97 yards for the go-ahead touchfirst down, but regardless, that guy down after the Lions botched a fake made a great play.” field-goal attempt early in the fourth The Lions appeared to take conquarter, hitting Will Johnson for a trol of the NFC North with a win on 1-yard touchdown to put Pittsburgh the road at Chicago last week but up 30-27 with 4:46 remaining. let the momentum vanish during Pittsburgh safety Will Allen picked a meek second half in which they off Matthew Stafford on Detroit’s appeared rattled by soggy conditions next possession and returned it to at Heinz Field and their own mindthe Lions 30. Five plays later Roethboggling success during the highestlisberger lobbed a 20-yard strike scoring second quarter in franchise to Jerricho Cotchery to extend the history. cushion to 10 points as the Steelers “We just didn’t execute,” Stafford (4-6) won their second straight to said. “That’s what it boils down to.” keep the Lions (6-4) winless in PittsDetroit’s collapse was hard to burgh for 58 years and counting. imagine following a dazzling 15 minAntonio Brown caught seven utes in which Johnson and Stafford passes for 147 yards and two scores did whatever they wanted, whenever and Pittsburgh’s defense rebounded they wanted. By Will Graves The Associated Press Saints quarterback Drew Brees is sacked by 49ers outside linebacker Ahmad Brooks in the second half of Sunday’s game in New Orleans. DAVE MARTIN/THE ASSOCIATED PRESS Saints squeak past 49ers catches for 80 yards to become the Saints’ all-time leader in yards receiving with 7,923, passing Eric Martin’s NEW ORLEANS — Bloodied, Drew two-decade-old mark of 7,854. Brees recovered. Garret Hartley made Colin Kaepernick passed for a pair a nifty comeback, too, for the New of scores, but finished with only Orleans Saints. 127 yards and was sacked three times Saints 23 Brees wiped as the Niners (6-4) lost their second 49ers 20 blood off his chin straight. after absorbing a The Saints’ defense, one of the hard hit in the waning minutes and worst in NFL history a year ago, guided the Saints to a pair of late field played well enough to keep the Saints goals, with Hartley kicking a 31-yarder within striking distance despite what as time expired to beat the San Franappeared to be a number of seemingly cisco 49ers 23-20 on Sunday. costly mistakes. The Saints trailed 20-17 when Niners running back Frank Gore Ahmad Brooks leveled Brees and managed only 48 yards on 13 carries. forced a fumble that Patrick Willis New Orleans, ranked in the lower pounced on for the Niners. But Brooks third of the league in rushing, outwas flagged because his forearm gained San Francisco on the ground, whacked Brees at the base of his neck, 91 yards to 82. awkwardly bending back the quarterKaepernick completed 17 of back’s head. The Niners disputed the 31 passes and scrambled only three 15-yard penalty for a hit to the head. times for 25 yards. His last run was Brees moved the Saints into position a 16-yarder that came up just 3 yards for Hartley’s tying 42-yard kick with short of a first down on third-and-long 2:06 left, then set him up to win it. with less than two minutes to go. Hartley, who had missed four field That gave Brees all the time he goals in the Saints’ previous three needed to lead a game-winning drive games, made all three of his field goal in regulation. attempts in the fourth quarter — he Brees completed three passes on earlier hit from 21 yards. the final series: a 9-yarder to Graham, Those kicks and sound defensive the 20-yarder to Colston and then play allowed the Saints (8-2) to overanother 12-yarder to Graham. came three turnovers, a failed fourth Brees finished 30 of 43 for 305 yards down conversion and a 20-14 deficit. and one touchdown, a 3-yard connecMarques Colston finished with five tion with rookie tight end Josh Hill. By Brett Martel The Associated Press. Steelers quarterback Ben Roethlisberger, left, celebrates with wide receiver Antonio Brown after the two connected for a touchdown catch in the first half of Sunday’s game against the Detroit Lions in Pittsburgh. GENE J. PUSKAR/THE ASSOCIATED PRESS Kicker Gould, Bears beat Ravens in overtime after long delay The Associated Press CHICAGO — Robbie Gould kicked a 38-yard field goal to lift the Chicago Bears to a 23-20 victory over Bears 23 Baltimore Ravens 20 on In. Down 24-0 in the fourth quarter, the Redskins rallied behind Robert Griffin III’s TD passes of 62 yards to Darrel Young and 41 yards to Aldrick Robinson and both 2-point conversions. BENGALS 40, BROWNS 21 In. BILLS 37, JETS 14 In Orchard Park, N.Y., show- Bears kicker Robbie Gould celebrates after booting the game-winning field goal in overtime to beat the Ravens in Sunday’s game in Chicago. CHARLES REX ARBOGAST/THE ASSOCIATED PRESS down. ing at halftime of Houston’s game against Indianapolis. CARDINALS 27, JAGUARS 14 In Jacksonville, Fla., Carson Palmer threw for 419 yards and two scores and did not throw an interception for the first time all year, leading Arizona over Jacksonville. Michael Floyd had a careerRAIDERS 28, TEXANS 23 high 193 yards receiving, includIn Houston, Rookie Matt ing a 91-yard touchdown on a McGloin threw three touchdown catch-and-run. Will Blackmon passes in his first NFL start, and was beaten on the play, and then Oakland extended Houston’s fran- slipped off the receiver and rolled chise-record skid to eight games into cornerback Alan Ball to set in Texans coach Gary Kubiak’s Floyd free the rest of the way. return from a mini-stroke. The Cardinals (6-4) won their McGloin, an undrafted free third straight game. agent, was 18 of 32 for 197 yards BUCCANEERS 41, FALCONS 28 in place of an injured Terrelle In Tampa, Fla., Bobby Rainey Pryor. rushed for 163 yards and scored Kubiak wasn’t on the sidethree touchdowns to lead Tampa lines, instead coaching upstairs Bay over struggling Atlanta. from the booth on doctor’s orders two weeks after collapsA waiver wire pickup who’s GIANTS 27, PACKERS 13. SEAHAWKS 41, VIKINGS 20 In In. B-6 THE NEW MEXICAN Monday, November 18, 2013 sfnm«classifieds to place an ad call 986-3000 or Toll Free (800) 873-3362 or email us at: classad@sfnewmexican.com »real estate« SANTA FE PUEBLO STYLE, CUSTOM BUILT LOGIC REAL ESTATE 505-820-7000 10 GALLINA 1 of 8 properties open off of Highway 14. Sunday 11/17 1 p.m. to 3 p.m. Equity New Mexico, 505-819-3195. SANTA FE APARTMENTS UNFURNISHED APARTMENTS UNFURNISHED NEW MOBILE HOME FOR RENT. 2 BEDROOM, 2 BATH. ALL APPLIANCES. WASHER & DRYER INCLUDED. $915 PER MONTH PLUS UTILITIES. SECURITY DEPOSIT IS REQUIRED. LOCATED AT SPACE #21 CASITAS DE SANTA FE M.H.P. SECTION 8 ACCEPTED. SHOWN BY APPOINTMENT ONLY. CALL TIM @ 505-6992955. 1 BEDROOM, 1 BATH RUFINA LANE, Laundry facility on site, fire place, balcony, patio, near Walmart. $625 monthly. 2 BEDROOM, 1 BATH RUFINA LAN E, laundry hookups, fireplace, single story complex. $699 month. 2 BEDROOM, 1 BATH RANCHO SIRINGO ROAD , fenced yard, fireplace, laundry facility on-site. $725 month. One Month Free Rent, No Application Fees. PECOS STUDIO, 3 / 4 BATH. Wood burning stove. Large front yard. $300 monthly plus propane. Also, 2 BEDROOM, 1.5 BATH. Garage, storage. $600. 505-795-2245 OUT OF TOWN 4 bedrooms, 3 bathrooms. Drop dead Sangre views, minutes from the hospital. OPEN HOUSE MANUFACTURED HOMES RE PECOS RIVER CLIFF HOUSE $585,000 OWNER IS NMREL. MLS#2013 03395. PLEASE SEE PHOTOS ON PECOSRIVERCLIFFHOUSE.COM. COMMERCIAL PROPERTY Cozy Cottage Serious inquiries only. $2,175,000 Dankin Business Group 505-466-4744 CONDO RANCHO VIEJO near SFCC. 2 room, 2.5 bath 1642 sq.ft. grades, storage, 2 car garage, AC/Heat, gas fireplace. Views, parks. $1400 pets negotiable. 670-3581 RIVERFRONT & IRRIGATED PROPERTIES FROM $34,000. bedUpW/D, near 505- 2 BEDROOM, 1 bath in quiet fourplex, near Trader Joe’s. Includes washer, dryer, NO pets, NO Smoking. $850 monthly. 626-466-6737. 2 Bedroom Apartmant off Agua Fria Behind Home Depot. Available Now! Call 505-603-4622 for details. 2 bedroom, non-smoker, no pets $600, $1200 deposit required. Appointment only. 505-471-2929 FOR SALE: PROFITABLE PET BUSINESS & REAL ESTATE OPPORTUNITY . In Pecos area, 3 beds, 1 bath on 6 treed acres. Panoramic views of Pecos Wilderness. Horses ok. Shared well. $199,000. JEFFERSON WELCH, 505-577-7001 Chamisa Management Corp. 988-5299 MICHAEL LEVY REALTY 505.603.2085 msl.riverfront@gmail.com PecosRiverCliffHouse.com 813 CAMINO DE MONTE REY: 2 available: Live-in Studio, $680 & 1 Bedroom. $750. Full kitchen, bath. Gas,water paid. 1425 PASEO D E P E R A L T A , 1 bedroom, full kitchen, bath. Tile throughout. Free laundry. $735 all utilities paid. NO PETS! 505471-4405 APPLICATIONS ARE being accepted at Sangre de Cristo Apartments for all units. Apply at: 1801 Espinacitas, Santa Fe, New Mexico. 505-984-1856, TTY: 1-800-659-8331, 1800-659-1779 or 711 (3) 2.5 Acre Lots, Senda Artemisia, Old Galisteo Road, Close to town. Easy building sites. Views, utilities, shared well. Owner financing. No Mobile homes. $119,700- $129,700 each. Greg. 505-690-8503, Equity Real Estate. $1100 plus utilities. 2 BEDROOM, 2 BATH, 1 CAR GARAGE, move-in ready. Very clean, brand new carpet, radiant heat, fireplace. Great location, cul-de-sac, quite & private, walking trails, Chavez Center. Mike, 505-5705795. 2 BEDROOM, 1 1/2 Bath, 2 Car Garage. Washer, Dryer, Dishwasher, Kiva Fireplace, Private Courtyard, Skylights. Sunset, Mountain Views. Walk to Plaza. Small Pets. $1,450 monthly. 505-660-4585. 2 BEDROOM 1 bath. Completely remodeled bathroom and kitchen, new washer and dryer, on 6.2 acres. 3 Wagon Wheel Ln, Santa Fe. Available immediately. $995 monthly. Call, 505238-2900. DOS SANTOS, one bedroom, one bath, upper level, upgraded, reserve parking. $800 Western Equities, 505-982-4201 360 degree views Spectacular walking trails Automated drip watering Finished 2 car garage 2 BDR, 2 ½ bath plus office. »rentals« CHECK OUT THE AMAZING AUTUMN MOVE-IN SPECIALS we’re offering this month on our sunny, spacious Studios & Large 2 Bedroom Apartments! You won’t believe the savings! The new management & 24 hour professional maintenance teams at Las Palomas ApartmentsHopewell Street are ready to show you how easy life can be when you love where you live. Call 888-4828216 for a tour today. Se habla español. Abiquiu 575-694-5444 POSSIBLE OWNER FINANCE. In-town country living, 1.43 acres. 3100 sq.ft. main level, 2400 sq.ft. finished, heated daylight basement with ¾ bath. 2 car garage. 1000 sq.ft. sunroom. $467,000. Peaceful, sublime acreage. Panoramic views. Pedernal, O’Keeffe country. Spiritual Retreat. Near Abiquiu lake, 62 acres. Just $199,000. JEFFERSON WELCH, 505577-7001 Santa Fe Executive Realtors Larry, 505-670-9466 NMDOT PROPERTY FOR SALE ON-SITE FOR SALE SIGN 1.9018 ACRES VACANT LOT: CORNER OF GUN BARREL ROAD AND LA PUEBLA ROAD, ARROYO SECO, NEW MEXICO Asking Price: $298,250.00 PRICE REDUCED! 3 bed 2 bath single level Eldorado home with 3 car garage. $409,000. Ginger Clarke 505670-3645 or Linda Bramlette 505-5700236. Barker Realty 505-982-9836. UNIQUE THREE bedroom, three bath, Park Plazas home offers privacy and Jemez Mountain v i e w s . Large family room - guest suite. Beautiful remodeled kitchen. 438-0701 by appointment. PLEASE SUBMIT PROPOSALS WITHIN 30 DAYS OF THIS AD For more information and Bid Instructions contact Angie Lujan at 505-490-1476 or angie.lujan@state.nm.us WE GET RESULTS! So can you with a classified ad CALL 986-3000 APARTMENTS FURNISHED CHARMING, CLEAN 2 BEDROOM, $800 Private estate. Walled yards, kiva fireplace. Safe, quiet. Utilities paid. Sorry, No Pets. 505-471-0839 FULLY FURNISHED STUDIO, $750. 2 BEDROOM, $800. Utilities paid, fireplace, charming, clean, 5 minute walk to Railyard. No Pets. 505-471-0839 REMODELED ADOBE DUPLEX near railyard. Fireplace, skylights, oak floor, yard. $795 month-to-month. $600 deposit. 505-982-1513, 505-6705579. CLEAN QUIET ADOBE EFFICIENCY APARTMENT Within walking distance to Plaza, $700 monthly. Water, sewage trash pick up paid. No pets. Non-smoker. Lease. 505-690-1077 or 505-988-1397. AWESOME VIEWS, 8 miles from Plaza. 1 bedroom, 1 bath. Short term rental for winter season. Wifi, directtv, sauna, utilities included. VERBO# 406531. $1,500 monthly. 505-690-0473 HOUSES UNFURNISHED $1125 MONTHLY. BRIGHT, A T TRACTIVE, REMODELED HOME, Southside. 3 bedroom, 2 bath. No pets. No smoking. First, last, damage. Dave, 505-660-7057. PARK PLAZAS! 2 Bedroom 1.5 bath, 1,350 sq.ft. Private end unit, attached two car garage. $1,150 monthly plus utilities. No pets or smoking. Available 11/15. 505-471-3725. RANCHO SANTOS, 2 bedroom, 2 bath, pretty unit, 2nd story, 1 car garage. $1000. Western Equities, 505-982-4201. RARELY AVAILABLE NORTH HILL COMPOUND 3 bedroom, 2 bath, 2000 square feet. Minutes to Plaza. Mountain & city light views. 2 Kiva Fireplaces, fabulous patio, A/C, washer & dryer, freezer, brick style floors, garage. $1,950 monthly, includes water. 1 level private end unit. 214-491-8732 2 BEDROOM 1 bath 1 car garage. $1000 includes utilites. $1000 deposit. Available 12/5. Soutside, near National Guard. Indoor pets ok. Month to month. 505-470-5877. 2 BEDROOM, 2.5 BATHS TOWNHOME, RANCHO VIEJO. 1150 sq.ft. 2 car garage. Across from park. $1250 monthly plus utilities. 505-471-7050 3 BED, 1 bath La Madera Stamm home for rent. Available December 1st. $1600 monthly unfurnished. Oneyear lease. Please contact Amy, 970404-1126. 3 bedroom, 2 bath, Park Plaza, 1 level detached, granite counters, fenced, tennis, walking trail. $1450 monthly plus. 505-690-1122, 505-6706190 3 bedroom, 3/4 bath. Single car garage, quiet street, wood floors, washer, dryer, new fridge. $1200 monthly. Non-smokers. Cats okay. 505-603-4196 Chamisa Management Corporation, 505-988-5299 STUDIO APARTMENT for rent. All utilities paid. ABSOLUTLEY NO PETS! $600 a month. (505)920-2648 Sunset views, 5 minutes to town serene mountain location, city lights. 2 bedroom, 2 bath with den. Private gated community. Pet friendly. $2250. 505-699-6161. 2 BEDROOM, 1-1/2 BATH. Country living on Highway 14, Northfork. Approximately 900 square feet. Horse friendly. $850 monthly. Deposit required. Pets negotiable. 505-920-9748. HISTORIC REMODELED ADOBE , 1 bedroom 1 bath with yard. In the downtown area minutes to the Plaza. $850 monthly. Large one bedroom including loft two bath $1350 One bedroom one bath $900 Modern kitchens and appliances, New carpet and paint. 505-603-0052. AFFORDABLE LUXURY ITALIAN VILLA $1425 MONTHLY. BEAUTIFUL Rancho Viejo 3 bedroom, 2 bath hom e with gas rock fireplace, granite counter-tops, evaporative cooler, enclosed spacious walled yard. NonSmoker. 505-450-4721. tures/16 CAMINO CAPITAN, one bedroom, one bath in quiet fourplex, fireplace, off street parking. $650 Western Equities 505-982-420. CHARMING 1 BEDROOM Compound. Private Patio. Lots of light. Carport, Laundry facilities. No pets. Nonsmoking. $600 monthly, $600 deposit. (505)474-2827 HOUSES FURNISHED CONDOSTOWNHOMES BEATUIFUL ZIA Vista Condo. $870 monthly. 2 bedroom 1 bath. Great amenities. Pool, workout facility, hot-tub, gated. 505-670-0339. Lease, deposit. RIO RANCHO ENCHANTED HILLS, SPECTACULAR VIEW, 3 bedrooms, 2 1/2 baths, minutes from I-25, RailRunner. See online ad photos, description $265,000. 505-771-2396 EASTSIDE, WALK TO CANYON ROAD! Furnished, short-term vacation home. Walled .5 acre, mountain views, fireplace, 2 bedroom, washer, dryer. Private. Pets okay. Large yard. 970-626-5936 SUNSET VIEWS: charming 1 bedroom, 700 sq.ft. $655, deposit plus utilities. Laundry access. Cats ok. East Frontage Road. 505-699-3005. LOTS & ACREAGE Now Showing Rancho Viejo Townhome $237,500 GUESTHOUSES REDUCED PRICE FOR RENT OR SALE: T O W N H O U S E , 1200 square feet. 2 bedroom, 1 bath. Garage, patio, storage, large kitchen. Beautifully furnished. Convenient location. $1100 monthly. 866-363-4657 4 bedroom, 2 bath, 2 car garage; approximately 3200 sq.ft. enclosed yard, private cul-de-sac, mountain views. Beautiful house in Rancho Viejo. $1,800 + deposit + utilities. Call Quinn, 505-690-7861. service«directory CALL 986-3000 Have a product or service to offer? Call our small business experts to learn how we can help grow your business! ANIMALS 505 Go K9 Sit Pet Sitting in your home. References available, insured. Call Michelle, 505-465-9748, michelle@petsits.com or visit 505GoK9Sit.com. CHIMNEY SWEEPING CLEANING A+ Cleaning Clean Houses in and out. Windows, carpets. Own equipment. $18 an hour. Sylvia 505-920-4138. Handyman, Landscaping, FREE estimates, BNS. 505-316-6449. FLORES & MENDOZA’S PROFESSIONAL MAINTENENCE. WE GET RESULTS! So can you with a classified ad CALL 986-3000 HANDYMAN Home and Office cleaning. 15 years experience, references available, Licensed, bonded, insured. (505)7959062. GLORIA’S PROFESSIONAL CLEANING SERVICE Houses and Offices, 15 years of experience. References Available, Licensed and Insured. 505-920-2536 or 505-310-4072. LANDSCAPING Cottonwood Services Homes, Office Apartments, post construction, windows. House and Pet sitting. References available, $15 per hour. Julia, 505-204-1677. DEPENDABLE & RESPONSIBLE. Will clean your home and office with TLC. Excellent references. Nancy, 505-986-1338. CASEY’S TOP HAT CHIMNEY SWEEPS is committed to protecting your home. Creosote build-up in a fireplace or lint build-up in a dryer vent reduces efficiency and can pose a fire hazard. Call 505989-5775. Get prepared! CLEANING Full Landscaping Design, All types of stonework 15% discount, Trees pruning winterizing. Free Estimates! YOUR HEALTH MATTERS. We use natural products. 20 years exper ence, Residential & offices. Reliable. Excellent references. Licensed & Bonded. Eva, 505-919-9230. Elena. 505-946-7655 CONSTRUCTION REMODELING. Our Specialty is Showers. Expert workmanship. License #58525 since 1982. Life-time Workmanship Warranty. 505-466-8383 AFFORDABLE HANDYMAN SERVICE Housecleaning, garage cleaning, hauling trash. Cutting Trees, Flagstone Patios, Driveways, Fencing, Yard Work, Stucco, Tile.. Greg, Nina, 920-0493. I CLEAN yards, gravel work, dig trenches. I also move furniture, haul trash. Call George, 505-316-1599. PAINTING ANDY ORTIZ PAINTING Professional with 30 years experience. License, insured, bonded Please call for more information, 505-670-9867, 505-473-2119. 40 YEARS EXPERIENCE. Professional Plastering Specialist: Interior & Exterior. Also Re-Stuccos. Patching a specialty. Call Felix, 505-920-3853. Dry Pinon & Cedar Free Kindling, Delivery & Stack. 140.00 pick up load. WE GET RESULTS! CALL 986-3000 ALL-IN-ONE. Roof Maintenance. Complete Landscaping. Yard Cleaning & Maintenance. Gravel Driveway. Roof Leaking Repair, Complete Roofing Repairs. New & Old Roofs. Painting. Torch Down, Stucco. Reasonable Prices! References Available. Free Estimates. 505-603-3182. PLASTERING FIREWOOD 505-983-2872, 505-470-4117 So can you with a classified ad 505-907-2600 or 505-204-4510. ROOFING TRINO’S AFFORDABLE Construction all phases of construction, and home repairs. Licensed. 505-9207583 A.C.E. Plastering INC. Stucco, Interior, Exterior. Will fix it the way you want. Quality service, fair price, estimate. Alejandro, 505-795-1102 ALL TYPES . Metal, Shingles, Composite torch down, Hot Mop, Stucco, Plaster. Free Estimates! Call Ismael Lopez at 505-670-0760. ROOFING PRO Panel, shingles, torch down. Also restucco parapets, repair plaster and sheet rock damage.All phases of construction. 505-310-7552. Monday, November 18, 2013 THE NEW MEXICAN sfnm«classifieds HOUSES UNFURNISHED MANUFACTURED HOMES to place your ad, call ARCHITECTURAL ENGINEER 986-3000 Have a product or service to offer? Call our small business experts today! MEDICAL DENTAL SALES MARKETING OFFICES 505-992-1205 valdezandassociates.com, $1695 $1100 plus utilities EXQUISITE SANTA FE COMPOUND PROPERTY situated on 5 acres, boasts majestic mountain views, 6200 sqft of living space, 8 bedrooms, 7 baths, 2 car garage. $3500 plus utilities. Call for personal showing $600. 2 SMALL BEDROOMS. V e r y clean, quiet, safe. Off Agua Fria. Has gas heating. Pay only electric. No pets. 505-473-0278 Private desk, and now offering separate private offices sharing all facilities. Conference room, kitchen, parking, lounge, meeting space, internet, copier, scanner, printer. Month-To-Month. Wayne Nichols 505-699-7280 Professional Office in Railyard, beautiful shared suite, with conference space, kitchen, bath, parking, cleaning, internet utilities included. $450 monthly. 505-690-5092 PROFESSIONAL OFFICE SPACE AVAILABLE Great location and parking! $500 monthly includes utilities, cleaning, taxes and amenities. Move in incentives! Brokers Welcome. Call Southwest Asset Management, 505-988-5792. SENA PLAZA Office Space Available Call Southwest Asset Management, 505-988-5792. WAREHOUSES Opportunity Knocks! ELDORADO »announcements« LAS CAMPANAS 3 BEDROOM, 2.5 BATH Furnished. AC. No pets, nonsmoking. 6 month lease minimum. $6500 monthly plus utilities. $14500 deposit. 203-481-5271 STERLING SILVER Women’s Ring, some inlay work and other stones. Found in the area of Rufina Street about 2 weeks ago. 505-473-9594. WOMEN’S WHITE Gold or Silver Ring with 3 stones. Found in La Casa Sena Parking Lot on October 30, 2013. 505660-7913. »jobs« NAVA ADE 3 BEDROOM, 2 BATH. Garage, all appliances. Fireplace, storage unit, Access to clubhouse (workout, pool). Low maintenance. 1500 sq.ft. $1,350. 505-660-1264 ONE BEDROOM, 1000 sq.ft. guest house in scenic Rancho Alegre. Privacy, washing machine, propane, wood burning stove. $800 monthly. 505-438-0631. ACCOUNTING EXPERIENCED BILINGUAL tax preparer wanted. Must have prior experience and be willing to work Saturdays. Directax 505-473-4700. ADMINISTRATIVE SUNNY HOME Tucked Away on Westside. Cozy 2 bedroom, enclosed patio, washer, dryer. Lovely Neighborhood, DishTV. $975 plus utilities. 505-989-3654. LIVE-IN STUDIOS S kylights, overhead doors, 2500 square feet, $975. 4100 square feet, 3 phase electric, $1175. La Mesilla. No dogs. 505-753-5906 LOT FOR RENT TESUQUE TRAILER VILLAGE "A PLACE TO CALL HOME" 505-989-9133 VACANCY 1/2 OFF FIRST MONTH Single & Double Wide Spaces Vehicle Maintenance Technician LABORER. Must have valid drivers license, be experienc ed, dependable, hard worker, able to take direction. Starting wage $12.00. Call for appointment, 505-982-0590. EDUCATION VACANCY NOTICE SANTA FE INDIAN SCHOOL IS ACCEPTING APPLICATIONS FOR A MIDDLE SCHOOL SPECIAL EDUCATION TEACHER & M ID D L E SCHOOL SUBSTITUTE TEACHERS & HIGH SCHOOL SUBSTITUTE TEACHERS.: BLAKE’S LOTABURGER is Hiring Assistant Managers at two Santa Fe Locations! Pay DOE, 35-40 hours per week. Contact Lupe at L F e r n a n d e z Marquez@lotaburger.com to apply. FOUND LIVE IN STUDIOS AUTOMOTIVE MANAGEMENT LEASE & OWN. ZERO DOWN! PAY EXACTLY WHAT OWNER PAYS: $1200 includes mortgage, taxes, insurance, maintenance (HOA). ZIA VISTA’S LARGEST 2 BEDROOM, 2 BATH CONDO. Save thousands. Incredible "Sangre" views. 505-204-2210 TWO-STORY, 2 bedroom, 1.5 bath, 1400 sq-ft, brick floors, vigas, deck, near Chavez Center. Washer, dryer, dish washer, fireplace, garage. No smoking, no cats. $1000 monthly. valmatz@comcast.net. AVAILABLE 11/10/13. CALL 986-3000 CONSTRUCTION 1,500 sq.ft. industrial unit with nice office, half bath, overhead door, high ceilings, sky lights, parking, absolutly no automotive. $900 monthly plus utilities. No better deal in town! Call 505-438-8166. TESUQUE, 1 Bedroom, 1 Bath on horse property, wood stove, no dogs, horses possible. $800 monthly plus electric. 505-983-8042 with a classified ad. Get Results! AN EXTRA LARGE UNIT BLOWOUT SPECIAL Airport Cerrillos Storage. UHaul. Cargo Van. 505-4744330 EASTSIDE ADOBE. 2 BEDROOM, 1 BATH, fireplace, hardwood floors, washer, dryer. Off-street parking $1600 monthly, some utilities included. 303-908-5250 REFURBISHED. 3 BEDROOMS, 2 BATH $1000 monthly plus utilities. Nonsmoking, no pets. Behind DeVargas Mall, 10 minute walk to Plaza or Railyard. 505-690-3116, 505-438-8983. SELL YOUR PROPERTY! Heavy equipment experience preferred, apply in person at Ski Santa Fe, end of State Hwy 475. EOE 2000 SQUARE foot space with high ceilings & 2 overhead doors. Office, bath. Great for auto repair. $1600 monthly. 505-660-9523 LIVE AMONG Pines near Plaza. 2 bedroom, 2 bath townhouse. Wood floors, kiva fireplace, front, back yards, washer, dryer. NO smoking, 2 car garage. $1,700 monthly. 505670-6554 Provides development review project management involving complex physical design and land use regulation planning, as well as technical assistance to City staff, other governmental agencies, neighborhoods and the general public regarding plans and land development regulations of the City. The City of Santa Fe offers competitive compensation and a generous benefit package including excellent retirement program, medical, dental, life insurance, paid holidays, generous vacation and sick leave. For detailed information on this position or to obtain an application, visit our website at. Position closes 11/25/13. STORAGE SPACE ARROYO HONDO (SF) award winning contemporary gated 4 acres. Bright, spacious 4 bedrooms, 3 baths, plus guest quarters - studio. $5000 monthly + utilities. 505-9860046 NEW, LARGE 3 bedroom, 3 bath, hilltop home. 12-1/2 acres. Energy efficient. All paved access from US 285. 505-660-5603 LAND USE PLANNER SENIOR Please call (505)983-9646. RETAIL ON THE PLAZA Discounted rental rates. BDD Safety Officer & Training Administrator Responsible for planning, developing and administering the implementation of the comprehensive health and safety program for the Buckman Direct Diversion facility (BDD), including measuring and evaluating the program’s effectiveness and conducting safety training. The City of Santa Fe offers competitive compensation and a generous benefit package including excellent retirement program, medical, dental, life insurance, paid holidays, generous vacation and sick leave. Closes 12/5/13. For detailed in fo rm a tio n on this position or to apply online, visit our website at. Wanted: Marketing Coordinator - Administrator for international real estate company providing sales marketing to the world’s finest resort real estate. Must be a flexible, highly organized, self-motivated, forward thinking professional. Must have excellent computer skills, letter writing, phone presence and followup skills. Experience in real estate is desired but not required. S e n d resume to peter@kempfintl.com COMPUTERS LGI HOMES would like to invite you to the LGI Homes Albuquerque Recruiting Event on November 25th at 7:00 PM at Hotel Parq Central. 2 BEDROOM Mobile Home in LAMY, NM. Fenced yard, fruit trees. $600 monthly, $500 Deposit; 505-466-1126, 505-629-5638 , 505-310-0597 NEW SHARED OFFICE $300 - 2ND STREET STUDIOS B-7 MANAGER FOR day-to-day operations of non-profit homeowner’s associations. HOA management experience or related background desired (real estate, property management, escrow, title experience). Background, drug screens apply. Submit cover letter, resume, salary requirements to hr@hoamco.com with subject "Manager-SF". Southwestern Ear, Nose & Throat Associates, PA is now hiring for a Full Time “Float” position. We are looking for an outgoing, friendly customer service representative who would be interested in training and covering different departments within our facility. The preferred candidate will be a skilled customer service professional who is comfortable with computers, various software systems, and telephone systems, as well as possessing the ability to learn new systems and performing new tasks quickly and proficiently. The candidate must quickly learn to monitor patient flow and multitask. The ideal candidate has a positive attitude and can adapt to changing expectations and a fastpaced work environment. The selected candidate will fit into our team environment by contributing to process improvement efforts, and improving customer service. Experience in the Medical Field if preferred but not necessary. If you are interested, please fax your resume AND a cover letter indicating why you are the best candidate for this job based on the requirements above to (505) 946-3943. MISCELLANEOUS JOBS FULL TIME HOUSEKEEPER TO LIVE ON PROPERTY Call, 505-660-6440 The Santa Fe New Mexican is seeking a motivated candidate to join the Pre-Press team working behind the scenes in the daily production of the newspaper.. Application deadline: Friday, November 22, 2013. Equal Employment Opportunity Employer So can you with a classified ad WE GET RESULTS! CALL 986-3000 SALES MARKETING DENTAL ASSISTANT ORAL SURGERY based practice seeking to fill the position of an experienced DENTAL ASSISTANT with active NM Board of Dental Healthcare radiology certification and current BLS certification. Qualifications include, but not limited to: team oriented individual, motivated, proactive self-starter, high level computer skills, ability to follow directions and focus with attention to details, exceptional communication skills, positive attitude and highly dependable. Submit resume to: Oral & Maxillofacial Surgery Center of Santa Fe, Att: Cheryl, 1645 Galisteo Street, Santa Fe, NM 87505, Fax: 505-984-0694. Since 2003, LGI Homes has become one of the fastest growing homebuilders in the Unites States, was recognized by Builder Magazine as the only builder to increase closings in 2006, 2007 and 2008, and became a publicly-traded company in November 2013. BDD Public Relations Coordinator Facilitates effective communication with the media, various stakeholder groups and the Santa Fe community for the Buckman Direct Diversion (BDD) Project; develops public education and outreach programs; and, organizes and participates in public education and outreach events. The City of Santa Fe offers competitive compensation and a generous benefit package including excellent retirement program, medical, dental, life insurance, paid holidays, generous vacation and sick leave. Closes 12/5/13. For detailed information on this position or to apply online, visit our website at. AirPort Extreme 802.11n (5th Generation) sold "as is" in excellent condition. $70. Please call, 505-470-4371 after 6 p.m. FURNITURE In addition to an aggressive compensation plan and bonus structure, LGI Homes offers full benefits as well as a 401k contribution. We hope to see you there! This event is RSVP only, so please email us as careers@lgihomes.com to reserve your place! Pella Windows & Doors Southwest is seeking Experienced Sales Candidates with a proven track record in sales and sales growth to join our Trade Sales Team in our Santa Fe location. The right candidate will be responsible for: *Generating new prospects and leads within the builder community. *Demonstrate product emphasizing product features, pricing and credit terms. The qualified candidate: *Must be proactive and self-motivated. Attention to detail is required. *Must be able to problem solve and think creatively. *Must have strong computer skills. Pella Windows provides a company vehicle (or auto allowance), lap top and company paid phone. Submit resume via email to dundonj@pella.com NO PHONE CALLS PLEASE. Sell Your Stuff! Call and talk to one of our friendly Ad-visors today! 986-3000 BEAUTIFUL COUCH WITH LOVELY ACCENTS. FROM A SMOKE AND PET FREE HOME. $350. PLEASE CALL, 505-238-5711 TO SCHEDULE A VIEWING. ETHAN ALLAN DINING ROOM SET. MAPLE WITH DK. GREEN. $2700 NEW. ASKING $399. 982-4435. FABULOUS 1960S HI-END LARGE MIDCENTURY MODERN WOOD COFFEE TABLE. 26W, 16H, 64L. SACRIFICE, $60. 505-982-0975 FOUR SHELF Wooden Book case, $60. Excellent condition. 505-690-5865 »merchandise« ANTIQUES DECORATED MULTI-COLOR 1940’s Mexican Plates. $15-$30. 505-4248584. WANTED: Old Van Briggle and other art pottery, old carved NM furniture, NM antiques. 505-424-8584. APPLIANCES EXCELLENT WORKING CONDITION: Stand up FROST FREE Freezer, 13.8 cubic ft: $299; Whirlpool stove and microwave: $299; & Sleeper Sofa: $249. 505-379-5444 MEDICAL DENTAL needed for busy dental office in tiny mountain town of Angelfire, NM. Must be positive, multi-tasker. Love of snow is a plus. E m a i l resume with cover letter to Daniela: affdentistry@yahoo.com. LGI Homes is actively hiring Sales Managers and Sales Representatives in the Albuquerque area. No Real Estate license or experience required! PRICE REDUCED!! MUST SELL! American Country Collection Knotty Pine Armoire. 8’HX48"W , Perfect Condition. Asking $3,900, paid $11,000. 505-470-4231 SOUTHWEST KING 6 piece Solid Wood Bedroom Set . Custom built at Lo Fino Furniture in Taos includes new box spring. View at Suite. (505)362-7812 WONDERFUL MID-CENTURY MODERN LARGE DESK- TABLE by Eames for Herman Miller. Measures 23Wx71Lx25.5H. Great condition. Sacrifice $50. 505-982-0975 MISCELLANEOUS ARTS CRAFTS SUPPLIES LECLERC "COLONIAL" 4 5 " , 4harness weaving loom with 2" sectional warp beam and add 4 more harness potential. Overhead beater. You move from my studio to yours. $1000 OBO 505-466-2118. SOMEONE to bring Christmas Trees to Portales, NM to sale. Lot, lights and advertising, furnished free of charge. Call Mark 575-760-5275. BUILDING MATERIALS RESTAURANT EQUIPMENT 820 KINNEY OUTDOOR BRICKS. Summit Iron Oxide. 4x8. $500, including some cement & lime bags. In town. 505-474-3647 NEVER BEEN USED 48" sandwich prep table, with under counter refrigeration. 3 year compressor warranty. $1,600 OBO. 505-852-0017 PLYWOOD. CABINET GRADE. 4’x8’ sheets. Never used. Different thicknesses. 505-983-8448. STEEL BUILDING Allocated Bargains 40x60 on up. We do deals. Source# 18X 505-349-0493 TOOLS MACHINERY ROUTER TABLE(STAND) Sears brand, good condition. $100. 505-982-2791. B-8 THE NEW MEXICAN Monday, November 18, 2013 sfnm«classifieds PETS SUPPLIES »animals« to place your ad, call »cars & trucks« 986-3000 Have a product or service to offer? Call our small business experts today! IMPORTS IMPORTS IMPORTS REDUCED! 2012 Honda Odyssey EX-L. Another 1-owner trade! Loaded with leather and navigation, like new condition, clean CarFax. $29,911. Call 505-216-3800. CLASSIC CARS HORSES Jose is an 8 week old pup whose mom was a purebred German Shepherd and dad was a purebred fence jumper. Toy Box Too Full? 2002 LEXUS LS 430 LUXURY SEDAN Local Owner, Carfax, Every Service Record, Garaged, NonSmoker, Manuals, X-keys, New Tires, Loaded, Afford-ably Luxurious, $13,750, Must See! WE PAY TOP DOLLAR FOR YOUR VEHICE! CAR STORAGE FACILITY VIEW VEHICLE santafeautoshowcase.com Paul 505-983-4945 GENTLE, SWEET Arabian Gelding. 25 years. Gorgeous! Companion or kids horse. Free to good home. 505-6607938 Airport Road and 599 505-660-3039 PETS SUPPLIES 2006 Honda Element EX-P 4WD. Another low-mileage Lexus trade! Only 55k, 4WD, sunroof, super nice. $14,471. Call 505-216-3800. PEMBROOK WELCH CORGI- registered, first shots, 8 weeks old, 3 tri males $375 each, 1 tri female $400. 505-384-2832, 505-705-0353 2008 Land Rover LR2 HSE SUV. Bluetooth and Sirius Radio, tires are in excellent condition. 52,704 miles. Very clean interior. No accidents! Well maintained. $17,995. Call 505-474-0888. Classifieds Thanksgiving is almost here but we’re already stuffed! Donate a pet toy, supplies, treats or canned food and your adoption fee is waived on all adult animals, 7 months or older, at the Santa Fe Animal Shelter! This sale extends beyond Thanksgiving - we know leftovers are worth the wait! 2007 MERCEDES C280 4matic. Only 65k miles!, All wheel drive, loaded, recent trade, clean CarFax, must see $15,471. Call 505-2163800. 1962 MERCEDES Unimog 404 . 23,000 original miles. Completely rebuilt. Gas engine. $16,000 OBO. 505-982-2511 or 505-670-7862 2012 Subaru Outback 2.5i Premium. 25,321 miles, AM/FM stereo with CD player, Bluetooth hands-free. $23,771. Call 505-216-3800. CALL 986-3000 95 MITSUBISHI Montero, mechanically sound, second owner, service receipts. $3,200. 505-231-4481. 2012 PRIUS H/B IMPORTS 2008 Land Rover Range Rover Sport Supercharged SUV. 86,695 miles, Rear Seat Entertainment, Bluetooth and Sirius Radio, Roof Rail System, and much more. $29,995. Call 505-474-0888. AMERICAN ESKIMO miniature. 6 weeks, male $650 firm, female $700 firm. Cash only. Call for appointment, 505-459-9331. One owner, accident free, non smoker Prius One. Only 34k miles, still under warranty. Drive a bargain and save at the pump. Clean title, clear CarFax Grand Opening Sale Price $16 995. 505954-1054. , sweetmotorsales.com CHIHUAHUA PUPPIES, 5M, 1F, Pretty colors, long & short hair. Wormed with first shots. Las Vegas,NM. Call or text 505-429-4220. GERMAN SHEPHERD PUPPIES. $300. Only serious calls. 7 weeks old. 505753-6987, call after 5 p.m. 2010 Subaru Impreza 2.5i Premium. Only 24k miles! AWD, heated seats, moonroof, 1 owner clean CarFax $16,951. Call 505-216-3800. POMERANIAN PUPPIES: Tiny, quality double coat. $600 to $800. Registered, first shots. POODLES: White male $350, white female $450. Tiny cream male, $450. Docked tails and dew claws removed. First shots. 505-9012094. ROTWEILER PUPPIES for sale. Docked tails, first shots, de-wormed. $300. Please call, 505-490-1315. ITALIAN WATER DOGS. 4 MONTH OLD PUPPIES, CRATE TRAINED. 25-35 lbs, non-shedding. Free training and daycare. $2,000. Excellent family or active retiree pet. Call Robin, 505-6606666. VIEW VEHICLE santafeautoshowcase.com Paul 505-983-4945 2012 Subaru Outback 2.5i Premium. 25,321 miles, AM/FM stereo with CD player, Bluetooth hands-free. $23,771. Call 505-216-3800. Place an ad Today!, 505-993-4309, ext. 606. WE PAY TOP DOLLAR FOR YOUR VEHICLE Place an ad in the Classifieds 986-3000 Pax is a tiny jack russell mix with more spunk than your average 3 pound puppy! Both pups and more will be at PetSmart on 10248 Coors Bypass NW in Albuquerque on Saturday, November 16 from 10am-4pm. For more information call the Espanola Valley Humane Society at 505-753-8662 or visit their website at Where treasures are found daily Local Owner, Carfax, Garaged, Non-Smoker, 77,768 Original Miles, service RecordS, Custom Wheels, Books, X-Keys, Navigation, Soooo Beautiful! $12,250. Sell your car in a hurry! 4X4s ADOPT A PAL FOR FREE! 2001 JAGUAR-XK8 CONVERTIBLE STANDARD POODLE Puppies, AKC, POTTY TRAINED, houseraised, gorgeous intelligent babies! Champion lines, 9 weeks old. $800 Delivery available. (432)477-2210,. 2006 Acura TL. Another lowmileage Lexus trade! 63k miles, navigation, 2 DVDs, leather, moonroof, clean CarFax. $15,871. Call 505-216-3800. Classifieds 2005 VOLKSWAGEN JETTA. $4400. BEST COLOR COMBO, BLACK MAGIC OVER BLACK. FACTORY RECARO SEATS, ALL WEATHER FLOOR MATS, BLACK MAGIC EXTERIOR, BLACK & GRAY CLOTH INTERIOR. CALL, 224999-0674 2006 LEXUS GS 300 AWD. Just in time for winter, AWD sports sedan, recent trade, absolutely pristine, Lexus for less $17,891. Call 505216-3800. Where treasures are found daily 2008 TOYOTA Sienna LE. Just 59k miles, another 1-owner Lexus trade-in! clean CarFax, immaculate condition $15,941. Call 505-2163800. eisispets Life is pets od dets..pets ... ... pets pets pe good ... 2005 VOLVO XC90. SUV, V-8. Black. AWD. Low mileage, 34,490. Loaded: GPS, Sunroof, Leather Seats, 7passenger. Like new. $16,000. 505881-2711 pets Life is Life Life is is Life is pets good good ... ... good ... good ... pets WHITE AKC Labrador Retriever Puppies! Excellent Bloodlines! Visit or call 719-5880934. Life is good ... Place an ad Today! pets pets CALL 986-3000 make it better. Santa Fe Animal Shelter.Adopt. Volunteer. Love. 983-4309 ext. 610 make it make it better. better. Life is good ... Santa Fe Animal Shelter.Adopt. Volunteer. Love. 983-4309 ext. 610 Santa Fe Animal Shelter.Adopt. Volunteer. Love. 983-4309 ext. 610 ma bet Santa Fe Animal Shelter.Adopt. Santa Fe VolA 983-4309 ext. 610 983-4309 make it better. Santa Fe Animal Shelter.Adopt. Volunteer. Love. 983-4309 ext. 610 make it make it better. better. Santa Fe Animal Shelter.Adopt. Volunteer. Love. 983-4309 ext. 610 Santa Fe Animal Shelter.Adopt. Volunteer. Love. 983-4309 ext. 610 makemake it it better.better. Santa Fe Animal Shelter.Adopt. Santa Fe Volunteer. AnimalLove. Shelter.Adopt. Volunteer. Love. 983-4309 ext. 610 983-4309 ext. 610 Santa Fe Ani 983-4309 ex Monday, November 18, 2013 THE NEW MEXICAN sfnm«classifieds to place your ad, call IMPORTS IMPORTS 2009 TOYOTA MATRIX WAGON-4 AWD 2012 TOYOTA PRIUS-C HYBRID FWD Another One Owner, Carfax, Records, Garaged, Non-Smoker, XKeys, 14,710 Miles, City 53, Highway 46, Navigation, Factory Warranty. $19,850. WE PAY TOP DOLLAR FOR YOUR VEHICE! VIEW VEHICLE santafeautoshowcase.com Paul 505-983-4945 Another One Owner, Local, 74,000 Miles, Every Service Record, Carfax, Garaged, Non-Smoker, New Tires, Pristine. $13,250 986-3000 IMPORTS IMPORTS 2007 Toyota Camry Hybrid. Another 1-owner Lexus trade-in! Super clean, recently serviced, clean CarFax $13,781. Call 505-216-3800. 2005 Volkswagen Toureg V6 AWD. Amazing only 45k miles!, loaded, leather, moonroof, clean CarFax. $15,171. Call 505-216-3800. Have a product or service to offer? Call our small business experts today! SUVs PICKUP TRUCKS WE PAY TOP DOLLAR FOR YOUR VEHICLE! B-9 2007 Toyota FJ Cruiser 4x4. Only 50k miles, clean CarFax, new tires, just serviced, immaculate! $24,331. Call 505-216-3800. 2011 FORD F150 XLT 4X4 CREWCAB Spotless, no accidents, 38k miles, family truck.Satellite radio, bedliner, alloys, running boards, full power. Below Blue Book. Was $29,995. REDUCED TO $25,995. 505954-1054. sweetmotorsales.com VIEW VEHICLE santafeautoshowcase.com Paul 505-983-4945 Have a product or service to offer? Let our small business experts help you grow your business. CALL 986-3000 2006 VOLVO-C70 CONVERTIBLE FWD Sell your car in a hurry! Place an ad in the Classifieds 986-3000 2004 TOYOTA HIGHLANDER-SUV 4X4 2008 TOYOTA SEQUOIA 4X4 PLATINUM Another One Owner, Local, 85, 126 Miles, Every Service Record, Carfax, Garaged, Non-Smoker, XKeys, Manuals, Third Row Seat, New Tires, Pristine. $13,950 WE PAY TOP DOLLAR FOR YOUR VEHICLE! Another One Owner, Local, Carfax, Service Records, Garaged, Non-Smoker, Navigation, Rear Entertainment, Third Row Seat, Leather, Loaded. Pristine $28,300. WE PAY TOP DOLLAR FOR YOUR VEHICLE! VIEW VEHICLE santafeautoshowcase.com Paul 505-983-4945 Were so DOG GONE GOOD! VIEW VEHICLE at: santafeautoshowcase.com Paul 505-983-4945 2011 VOLKSWAGEN-TDI JETTA WAGON MANUAL We Always Get Results! Another One Owner, Carfax, Garaged Non-Smoker 54,506 Miles, Service Records, 42 Highway 30 City, Loaded, Pristine $20,750. Call our helpful Ad-Visors Today! WE PAY TOP DOLLAR FOR YOUR VEHICLE! 986-3000 VIEW VEHICLE santafeautoshowcase.com Paul 505-983-4945 WE PAY TOP DOLLAR FOR YOUR VEHICLE! 2009 TOYOTA Corolla LE. Only 53k miles! Another 1 owner clean CarFax trade-in! Super nice, fully serviced $12,961. Call 505-216-3800. Another One Owner, Local, 36,974 Miles, Every Service Record, Carfax,Garage,Non-Smoker, Manuals, X-Keys, Loaded, Convertible Fully Automated, Press Button Convertible Or Hardtop. Soooooo Beautiful, Pristine. $18,450. VIEW VEHICLE santafeautoshowcase.com Paul 505-983-4945 SUVs »recreational« SEARCHING FOR GREAT SAVINGS? Check out the coupons in this weeks 2006 Toyota Prius III. Only 45k miles! Hybrid, back-up camera, great fuel economy, immacualte, clean CarFax. $12,871. Call 505-2163800. Have an empty house or apartment you need to rent? Read the WANT TO RENT column for prospective tenants. TV book 2009 Volkswagen Tiguan SEL AWD Turbo. Navigation, panoramic roof, NICE, clean CarFax. $16,271. Call 505-216-3800. 2010 Chevy Equinox AWD LT V 6 . 28,748 miles, Pioneer Audio, Leather, Backup Camera, and much more. One owner. No accidents! $20,995. Call 505-474-0888. CAMPERS & RVs PICKUP TRUCKS 1977 Prowler 16ft Trailer, Sleeps 6, Excellent Condition. Oldie but Goodie! Great for hunters or families $3,000 OBO. 505-660-4963. 2000 MAZDA B-3000 Extended Cab, V6 Standard, 2WD. $4,000. 505-473-1309. B-10 THE NEW MEXICAN Monday, November 18, 2013 sfnm«classifieds LEGALS LEGALS LEGALS FIRST JUDICIAL DISTRICT COURT STATE OF NEW MEXICO COUNTY OF SANTA FE, Senovio Rios Petitioner/Plaintiff, ( RG-70151 is currently permitted for the diversion of 3.0 afa for domestic purposes at the above described 3.19 acres of land owned by the applicants. y y November 21 and 22, 2013, beginning at 9:00AM. The hearing was to be held in Morgan Hall, State Land Office, 310 Old Santa Fe Trail, Santa Fe, NM. Any person, firm or Luz Estrada, corporation or other Respondent/Defenda entity having standing to file objections nt or protests shall do Case No.: D101-DM- so in writing (legible, signed, and include 2013-00544 the writer’s complete name and mailing adNOTICE OF dress). The objection PENDENCY OF SUIT State of New Mexico to the approval of the to Luz Estrada. Greet- application must be ings: You are hereby based on: (1) Impairnotified that Senovio ment; if impairment Rios, the above- you must specifically identify your water n a m e d and/or (2) Petitioner/Plaintiff, rights; has filed a civil action P u b l i c against you in the welfare/conservation above-entitled Court of water; if public and cause, The gen- welfare or conservaeral object thereof tion of water within being: To dissolve the the state of New Mexmarriage between ico, you must show the Petitioner and you will be substanyourself, Unless you tially affected. The enter your appear- written protest must ance in this cause be filed, in triplicate, within thirty (30) with Office of the days of the date of State Engineer, Water the last publication of Rights Division, Room this Notice, judgment 102, P.O. Box 25102, by default may be en- Santa Fe, NM 87504, within ten (10) days tered against you. after the date of last Senovio Rios, PO BOX publication of this Facsimiles 4473, Santa Fe, NM Notice. (fax) will be accepted 87502 505-795-8490 as a valid protest as Witness this Honora- long as the hard copy ble T.Glenn Ellington, is sent within 24District Judge of the hours of the facsimFirst Judicial District ile. Mailing postmark Court of New Mexico, will be used to valiand the Seal of the date the 24-hour periDistrict Court of San- od. Protest can be ta Fe/Rio Arriba/Los faxed to the Office of Alamos County, this the State Engineer, 11th day of Septem- 505/827-6682. If no valid protest or obber, 2013. jection is filed, the STEPHEN T. PACHECO State Engineer will CLERK OF THE DIS- evaluate the application in accordance TRICT COURT B Y : M A U R E E N with Sections 72-2-16, NARANJO, DEPUTY 72-5-6, and 72-12-3. CLERK Legal#96059 Published in the SanLegal#95958 ta Fe New MExican Published in the San- on: November 11, 18, ta Fe New Mexican 25, 2013 on: September 11, 18, 25, 2013 NOTICE The public hearing on issues remanded to the Commission by the First Judicial District Court (Judge Ortiz) in the matter titled Multicultural Alliance for a Safe Environment and Amigos Bravos v. New Mexico Mining Commission et al., Cause No. D101-CV-2012-02318 will be scheduled at a later time and notice shall be published in accordance with the Commission’s Open Meetings Resolution. vs. NOTICE is hereby given that on May 7, 2013, Application No. RG-93821 into RG70151 for Permit to Change an Existing Water Right was filed with the OFFICE OF THE STATE ENGINEER by Rebecca and Larry Montano, 1429 Bishops Lodge Road, Santa Fe, NM 87506. The applicant seeks an additional point of diversion to existing adjudicated well RG93821, located at a point where X = 1,737,900.277 and Y = 1,727,124.993 NMSP (NAD 83 - feet), on 3.19 acres described as tract 1 and tract 2 within Section 31, T18N, R10E, NMPM and owned by Rebecca and Larry Montano, for the diversion of 3.0 acrefeet of water per annum (afa) used for domestic and livestock purposes at 1429 Bishops Lodge Road, in Tesuque, Santa Fe County, NM. Existing adjudicated well RG-93821 is not capable of reliably supplying the needs of the property and is inaccessible for repair. Well RG-93821 will be retained for emergency use. Existing permitted well RG-70151 will serve as the additional point of diversion for the 3.0 afa water right associated with RG-93821, and is located at a point where X = 1,737,831.414 and Y = 1,726,837.710 NMSP (NAD 83 - feet). Well Continued... Notice is hereby given that on Thursday November 21, 2013 the New Mexico State Agency for Surplus Property will open Store Front Operations to the public from 9:00am to 4:00pm; at 1990 Siringo Rd., Santa Fe, NM 87505. Items for sale will include: Select Chairs $2.00 ea5967 Published in the Santa Fe New Mexican November 18, 2013 SANTA FE COUNTY IFB# 2014-0154-PW/PL CONSTRUCTION SERVICES FOR THE KEN & PATTY ADAMS SENIOR AND COMMUNITY CENTER RENOVATIONS AND ADDITION The Santa Fe County Public Works Department is requesting bids to procure a licensed construction company to construct renovations and additions to the Ken & Patty Adams Senior and Community Center located at 14 Avenida Torreon, Santa Fe, N.M. 87508. The work consists of renovating the existing 4,612 square foot center and the addition of approximately 3,363 square feet of community center space to the facility. 10:00 AM (MST) on Wednesday, December 18, 2013 at the Santa Fe County Purchasing Division, located at 142 W. Palace Avenue, (2nd floor Bokum Building), Santa Fe, N.M. 87501. By submitting a bid for the requested materials and/or services each firm is certifying that its bid is in compliance with regulations and requirements stated within the IFB package. A Pre-Bid Conference & Site Visit will be held on Monday, November 25, 2013 at 2:00 PM (MST) at the Projects, Facilities & Open Space Division located at 901 W. Alameda, Santa Fe, N.M. 87501. Attendance at Legal#95966 the Pre-Bid ConferPublished in the San- ence & following site ta Fe New Mexican visit is MANDATORY. November 18, 19, 20, 2013 EQUAL OPPORTUNITY EMPLOYMENT: All NOTICE of VACATED qualified bidders will PUBLIC HEARING receive consideration NEW MEXICO MIN- of contract(s) withING COMMISSION out regard to race, color, religion, sex, The New Mexico Min- national origin, aning Commission has cestry, age, physical vacated the public and mental handicap, hearing previously serious mental condischeduled for tion, disability, Thursday and Friday, spousal affiliation, Continued... Continued... to place legals, call LEGALS 986-3000 LEGALS p sexual orientation or gender identity. NOTICE IS HEREBY GIVEN that the underInformation on Invita- signed has been aption for Bid packages pointed Personal is available by con- Representative of this tacting Pamela estate. All persons Lindstam, Santa Fe having claims against County, by telephone this estate are reat (505) 992-6759 or quired to present by email at their claims within plindsta@santafecou two (2) months after ntynm.gov.. A copy of the date of the first the advertisement in- publication of this formation will also be Notice or the claims located on the Santa will be forever barFe County website at red. Claims must be presented either to ounty.org/services/cu the undersigned Perrrent solicitations. sonal Representative, c/o Gerber & BateBid documents will man, P.A., P.O. Box be available at Con- 2325, Santa Fe, New struction Reporter, Mexico 87504, or filed 1609 2nd St. NW, Al- with the First Judicial buquerque, NM District Court of San87102, phone# 505- ta Fe County, Post Of243-9793. A deposit of fice Box 2268, Santa $150.00 per set will be Fe, New Mexico 87504. required from inter- Dated this 7th day of ested bidders re- November, 2013. questing copies of the bid documents /s/Araceli Valencia with a limit of two ARACELI VALENCIA sets per contractor, Personal Representaone set per subcon- tive tractor. The deposit shall be in the form of GERBER & BATEMAN, a cashier’s check, P.A. payable to (Santa Fe Attorney for the PerCounty or [Bidder’s sonal Representative Name]). By: /s/Paul D. Gerber BIDS RECEIVED AFTER PAUL D. GERBER THE DATE AND TIME Post Office Box 2325 SPECIFIED ABOVE Santa Fe, New Mexico WILL NOT BE ACCEPT- 87504 ED. (505) 988-9646 / (505) 989-7335 (Fax) Legal#95969 Published in the San- Legal#95968 ta Fe New Mexican Published in the SanNovember 18, 2013 ta Fe New Mexican November 18, 25, 2013 STATE OF NEW STATE OF NEW MEXMEXICO ICO COUNTY OF SANTA FE COUNTY OF SANTA FIRST JUDICIAL FE DISTRICT COURT FIRST JUDICIAL DISTRICT IN THE MATTER OF A PETITION FOR EVA WOODS, CHANGE OF NAME OF ANGEL GRIEGO , A Plaintiff, CHILD. No. Case No. D-101-CV- D-101-CV-2013-02439 vs. 2013-02847 CHANGE ESTATE OF MATTIE T. COX, ALL UNKNOWN TAKE NOTICE that in HEIRS OF MATTIE T. accordance with the COX, ESTATE OF ORprovisions of Sec. 40- VILLE COX, ALL 8-01 through Sec. 40- MILTON 8-3 NMSA 1978, et. UNKNOWN HEIRS OF MILTON seq. the Petitioner ORVILLE Ying Meng will apply COX, MARTHA BOYto the Honorable Sar- LE AND ah M. Singleton, Dis- UNKNOWN HEIRS OF trict Judge of the First MARTHA BOYLE, Judicial District at the E I L E E N AND Santa Fe Judicial STEIGERWALT Complex in Santa Fe, ALL UNKNOWN OF EILEEN New Mexico, at 1:00 HEIRS EUp.m. on the 6th day of STEIGERWALT, December, 2013, for GENE M. COX UNKNOWN an ORDER FOR ALL CHANGE OF NAME of HEIRS OF EUGENE a child from A n g e l M. COX, G r i e g o to A n g e l ESTATE OF CLINTON Meng . A. GRANT, ESTATE OF Date: November 4, MARY E. GRANT, ARTHUR GRANT, AND 2013 ALL UNKNOWN OF INSTEPHEN T. PACHECO CLAIMANTS CLERK OF THE DIS- TEREST IN THE SUBJECT PROPTRICT COURT ERTY, Defendants. BY: Deputy NOTICE OF PENDENCY OF Submitted by: ACTION Ying Meng TO: ALL UNPetitioner, Pro Se KNOWN HEIRS AND CLAIMANTS TO THE Legal #95941 FOLLOWIN DEPublished in The Santa Fe New Mexican on CEASED PERSONS: November 11 and 18, MATTIE T. COX, ORVILLE MILTONCOX, 2013. EUGENE COX, CLINTON A. GRANT, AND STATE OF NEW MARY E. GRANT; MEXICO ALL UNKNOWN COUNTY OF CLAIMANTS OF SANTA FE MARTHA BOYLE FIRST JUDICIAL AND EILEEN DISTRICT COURT STEIGERWALT; AND ALL OTHER UNNO. D-101-PB-2013KNOWN CLAIMANTS 00188 WHO MAY CLAIM A IN THE MATTER OF LIEN, INTEREST OR TITLE ADVERSETO THE ESTATE OF THE PLAINTIFF. FERNANDO E. VALENCIA, DECEASED GREETINGS: NOTICE TO 1. Plaintiff Eva CREDITORS Woods rightfully NOTICE OF OF NAME Continued... Continued... LEGALS g y owns the following described property in Santa Fe County, New Mexico: Lying and being situated within Exc. 348, P.C. 429; Exc. 349, P.C. 430 and Comp. 165 P.C. 431, within the Santa Clara Pueblo Grant, in Sec. 2, T20N, R8E, N.M.P.M. in the City of Espanola, County of Santa Fe, State of New Mexico, more particularly described as follows: Lot 1 and Lot 2 as shown on survey entitled "Survey of Lands for Mr. and Mrs. Clinton A . Grant" as prepared by A. Dean Miller, PE & LS 2589 and recorded in Book 462, page 153 in February of 1980. Lot 3, Lot 4 and Lot 5 as shown on survey entitled "Survey of Lands for Mr. and Mrs. Clinton A. Grant" as prepared by A. Dean Miller PE & LS 2589 and recorded in Book 462, page 153 in February of 1980. toll free: 800.873.3362 email: legal@sfnewmexican.com LEGALS STATE OF NEW MEXICO FIRST JUDICIAL DISTRICT COURT COUNTY OF SANTA FE IN THE MATTER OF THE ESTATE OF JOE W. WOOD, DECEASED NO.D-0101-PB-201300172 NOTICE TO CREDITORS NOTICE IS HEREBY GIVEN that Rachel C. Wood has been appointed Personal Representative of the Estate of Joe. W. Wood, Deceased. All persons having claims against this estate are required to present their claims within two months after the date of the first publication of this notice or the claims will be forever barred. Claims must be presented either to the undersigned Personal Representative, c/o Hinkle, Hensley, Shanor & martin, LLP, attn: Nancy S. Cusack, Post Office Box 2068, Santa fe, NM 87504, or filed with the District Court of Santa Fe County, New Mexico, 225 Montezuma Avenue, Santa Fe, NM 87501. Easements for underground utilities and road easement for ingress and Rachel C. Wood egress comprising a width of 20 Legal #95935 ft. as platted. Published in The Santa Fe New Mexican on (the Subject Prop- November 11 and 18, erty). 2013. 2. You are directed to serve a pleading or Motion in STATE OF NEW MEXIresponse to the Com- CO IN THE PROBATE SANTA FE plaint on file in this COURT cause within thirty COUNTY (30) days after publication of this Notice IN THE MATTER OF and file the same, all THE ESTATE OF NORMAN GILBERT, DEas provided by law. 3. You are noti- CEASED. No. 2013-0122 fied that, unless you NOTICE TO so serve and file a reCREDITORS sponsive pleading or Motion, the Plaintiffs NOTICE IS HEREBY will apply to the GIVEN that the underCourt for the relief signed has been apdemanded in the pointed personal repComplaint and a De- resentative of this esfault Judgment may tate. All persons having claims against be entered. 4. You may ob- this estate are reto present tain a copy of the quired Complaint by con- their claims within tacting the attorney two(2) months after the date of the first for the Plaintiffs: L o r publication of this notice, or the claims will alee Hunt, Esq. H u be forever barred. Claims must be prent Law, PC 1 1 6 sented either to the undersigned personal E. Country Club Ros representative at the address listed below well, NM 88201 or filed with the Pro( 5 7 5 ) 6 2 3 - bate Court of Santa Fe, County, New Mexi1976 co, located at the fol5. The general lowing address: 102 object of this cause is Grant Ave. Santa Fe, to quiet title to the NM 87501 a b o v e - d e s c r i b e d Dated: September 26, property in the Plain- 2013 tiffs, the true and cor- Jody Kent Signature of Personal rect owners thereof. Representative 6. Once this 26 Camino de Mision cause has been pros- Chimayo, NM 87522, ecuted to its end, the 505-699-0010 ownership of the Subject Property will be Legal#95905 established as set Published in the Sanout in the Complaint ta Fe New Mexican on file herein and any on: November 11, 18, and all Defendants 2013 will be barred and forever estopped STATE OF from having or makNEW MEXICO ing any claim to IN THE PROBATE these interests. COURT SANTA FE DATED this COUNTY 17th day of October, 2013. IN THE MATTER OF Stephen T. Pacheco, THE ESTATE OF STECLERK OF THE DIS- PHEN E. CASE, TRICT COURT OF SANTA FE COUNTY Case No. 2013-0153 By: Court Clerk Deceased. Legal #95796 Published in The SanNOTICE TO ta Fe New Mexican on CREDITORS November 11, 18, 25 2013 NOTICE IS HEREBY GIVEN that Nancy Case has been apTo place a Legal ad Call 986-3000 Continued... LEGALS LEGALS p pointed personal representative of this estate. All persons having claims against this estate are required to present their claims within two (2) months after the date of the first publication of this notice, or the claims will be forever barred . Claims must be presented either to the personal representative, Nancy Case, at the following address: c/o The Engel Law Firm, PO Box 2521, Santa Fe, NM 87504-2521, or filed with the Probate Court of Santa Fe County, New Mexico, located at 102 Grant Avenue, Santa Fe, NM 87501. DATED: This 5th day of November, 2013. Robert A. Engel Attorney for the Estate of Stephen E. Case PO Box 2521 Santa Fe NM 87504 505-424-1404 Legal #95924 Published in The Santa Fe New Mexican on November 11, 18 2013 The Santa Fe Regional Emergency Communications Center (RECC) Board of Directors will meet on Thursday, November 21, 2013 starting at 9:00 am. The RECC Board Meeting will be held at the Santa Fe County Public Safety Complex located at 35 Camino Justicia off of Highway 14. Legal #95920 Published in The Santa Fe New Mexican on November 18 2013 THE STATE OF NEW MEXICO COUNTY OF SANTA FE FIRST JUDICIAL DISTRICT No. 04011 D-101-CV-2009- NATIONSTAR GAGE LLC, MORT- Plaintiff, vs. GIUSEPPE QUINN and DANIELLE REDDICK, Husband and wife; ABC Corporations I-X, XYZ Partnerships I-X, John Does I-X, Jane Does IX, THE UNKNOWNHEIRS AND DEVISEES OF ANY OF THE ABOVE, IF DECEASED, Defendants, NOTICE OF SALE ON FORECLOSURE P L E A S E TAKE NOTICE that the above-entitled Court, having appointed me or my designee as Special Master in this matter with the power to sell, has ordered me to sell the real property (the "Property") situated in Santa Fe County, New Mexico, commonly known as 41 Vereda Corta, Santa Fe, New Mexico 87507, and more particularly described as follows: LOT THREE-C (3C) AS SHOWN ON PLAT ENTITLED, "LAND DIVISION FOR RUDY FERNANDEZ WITHIN SHC 426, TRACT 2 IN SECTION 31, T 17N, R9E, NMPM…" FILED IN THE OFFICE OF THE COUNTY CLERK, SANTA FE COUNTY, NEW MEXICO, ON MARCH 11, 1991, IN PLAT Continued... BOOK 220, PAGE 36, AS DOCUMENT NO. 731171. The sale is to begin at 11:30 a.m. on December 18, 2013, on the front steps of the First Judicial District Courthouse, Nationstar Mortgage LLC. Nationstar Mortgage LLC was awarded a Judgment (IN REM) on August 20, 2013, in the principal sum of $373,681.63, plus outstanding interest on the balance through August 21, 2013, in the amount of $146,388.47 plus late charges of $2,314.04, p l u s recoverable/escrow balance in the amount of $2,096.78, plus corporate advances in the amount of $2,595.87, plus attorneys fees in the sum of $2,990.00 and costs through August 21, 2013 in the sum of $2,353.40, with interest on the Judgment including late charges, property preservation fees, escrow advances, attorney’s fees and costs of this suit at the rate of 7.75% per annum from date of the entry of the Judgment until paid.. Nationstar Mortgage LLC (1) month right of redemption. PROSPECTIVE PURCHASERS AT SALE ARE ADVISED TO MAKE THEIR OWN EXAMINATION OF THE TITLE AND THE CONDITION OF THE PROPERTY AND TO CONSULT THEIR OWN ATTORNEY BEFORE BIDDING. Legal #95919 Published in The Santa Fe New Mexican on November 4, 11, 18, 25 2013 You can view your legal ad online at sfnmclassifieds.com Monday, November 18, 2013 THE NEW MEXICAN ANNIE’S MAILBOX TIME OUT Horoscope Crossword The stars show the kind of day you’ll have: 5-Dynamic; 4-Positive; 3-Average; 2-So-so; 1-Difficult HAPPY BIRTHDAY for Monday, Nov. 18, 2013: This year you often might stray off topic and find that you are mentally distracted. Learn to eliminate distractions by handling the issue at hand. Gemini can be verbal, distracting and charming all at the same time. ARIES (March 21-April 19) HHHH You will state your case or pursue a desire with intention. Those around you could be a little confused by your words and actions. Tonight: Make calls and catch up on a friend’s news. TAURUS (April 20-May 20) HHH You might feel a bit self-indulgent and go overboard. Listen to your instincts in a meeting or perhaps at a get-together with a friend. Tonight: Run some errands. GEMINI (May 21-June 20) HHHHH You smile, and the world smiles with you. You have unusual insight into a friendship and its meaning. Tonight: It is your call. CANCER (June 21-July 22) HHHH You might want to head in a more appealing direction. Do some testing first, and consider that you might not know the whole story. Tonight: Read between the lines with a boss. LEO (July 23-Aug. 22) HHHH Meetings will bring good results. A partner could be in disagreement, as he or she might not have heard all the details. Tonight: Surf the Web. VIRGO (Aug. 23-Sept. 22) HHH Pressure builds and creates a lot of nervous energy. You might wonder what to do about a situation that demands your attention. Tonight: Busy. Super Quiz Take this Super Quiz to a Ph.D. Score 1 point for each correct answer on the Freshman Level, 2 points on the Graduate Level and 3 points on the Ph.D. Level. Subject: LITERARY OPENINGS Use the opening words and the initials to identify the title. (e.g., “Call me Ishmael.” — M.D. Answer: Moby-Dick.) FRESHMAN LEVEL 1. “He was an old man who fished alone in a skiff ...” — The O.M. and the S. Answer________ 2. “When Mrs. Frederick C. Little’s second son arrived ...” — S.L. Answer________ 3. “It is a truth universally acknowledged, that a single man ...” — P. and P. Answer________ GRADUATE LEVEL 4. “Christmas won’t be Christmas without any presents.” — L.W. Answer________ 5. “When he was nearly 13, my brother Jem ...” — To K. a M. Answer________ 6. “What can you say about a 25-year-old girl who died?” — L.S. Answer________ PH.D. LEVEL 7. “A throng of bearded men, in sad-colored garments and gray ...” — The S.L. Answer________ 8. “To the red country and part of the gray country of Oklahoma ...” — The G. of W. Answer________ 9. “The boy with fair hair lowered himself down the ...” — The L. of the F. Answer________ ANSWERS: 1. The Old Man and the Sea. 2. Stuart Little. 3. Pride and Prejudice. 4. Little Women. 5. To Kill a Mockingbird. 6. Love Story. 7. The Scarlet Letter. 8. The Grapes of Wrath. 9. Lord of the Flies. Cryptoquip. LIBRA (Sept. 23-Oct. 22) HHHH Detach. You might wonder which way to go with an important relationship. You and this person have wanted to plan a trip for a while, so get the ball rolling. Tonight: Make some calls. Dear Annie: My brother “Nathan” moved into an apartment with my other brother, “Steven,” who lives with his girlfriend and her son. Nathan has an alcohol problem that already caused him to lose his job and is now creating problems between Steven and his girlfriend. Steven has forbidden my parents to speak with Nathan about his alcoholism for fear of betraying his brother’s trust and embarrassing him. I believe Steven is an enabler. My parents recently visited my brothers and didn’t bring up the subject. I feel as if I’m living in a family of ostriches burying their heads in the sand, hoping the problem will go away. But I’m worried that Nathan will die of his disease if we don’t step up and intervene. How can I get my family to deal with this? — C. Dear C.: The problem with addicts, whether it’s drugs, alcohol or anything else, is that they are often in denial about the extent of the problem and unwilling to be helped. Without their cooperation, there is little you can do. People also use drugs and alcohol to self-medicate — most often for depression — and those symptoms can be hidden because the focus is on the addiction. It does Nathan no good for his family to pretend the problem doesn’t exist. You and your parents can contact Al-Anon (al-anon.alateen.org) for information and support. And if you can convince Nathan to talk to a doctor to rule out other problems, that might help him get on the right track. Dear Annie: My wife and I are good friends with three other retired couples. A few years ago, one couple began looking to buy a second home in Arizona. This required that they put themselves on a strict budget. The problem is, whenever the eight of us make plans together, the “Smiths” make it clear that they can’t afford it. So in order to spend time with them, we have to choose an activity within their limited budget. I understand that they have to CAPRICORN (Dec. 22-Jan. 19) HHH You might be more focused on an idea than you realize. Someone could drop a heavy book right by you, and you would not even hear it hit the floor. Tonight: The unexpected occurs. AQUARIUS (Jan. 20-Feb. 18) HHHH Allow your creativity to emerge. Whether you decide to share some of your ideas will be up to you. Tonight: Act as if there is no tomorrow. PISCES (Feb. 19-March 20) HHH Your intuition comes through regarding what you should do. You could feel as if some element of your life is out of control. Tonight: Head home. Jacqueline Bigar Hint: Force checkmate. Solution: 1. … Bf1ch! 2. gxh4 Rh3 mate! Today in history Today is Monday, Nov. 18, the 322nd day of 2013. There are 43 days left in the year. Hocus Focus prioritize in order to achieve their dream of having a winter home, but this is their goal, not ours. In the interest of maintaining a good relationship, we have accommodated their requests for less expensive outings, but I am beginning to feel that it isn’t quite fair for them to impose their restrictions on the rest of us. Any advice would be helpful. — Not Sure What To Do Dear Not Sure: This isn’t about fairness. It’s about friendship. If this couple were ill, you would never plan activities you knew they couldn’t do and then resent them for being unable to participate. It works the same with income levels. When you want to see them, pick an activity they can enjoy, too. But you don’t need to be held hostage to their budget every time you go out. It’s perfectly OK to occasionally do something more extravagant, knowing they will probably decline. Dear Annie: In your reply to “Sleepyhead’s Mother-In-Law-ToBe,” you missed an opportunity to educate the public about delayed sleep-phase disorder. DSPD is a circadian rhythm disorder that prevents sufferers from falling asleep until some hours after midnight. Consequently, we find it difficult to wake in the morning. We are not lazy. In fact, we are managing the best we can on half of the sleep most people get. DSPD doesn’t respond well to medication, therapy or sleep hygiene (relaxation techniques, avoiding caffeine, adequate light exposure during the day, etc.) because it is not insomnia. It is impossible to force a normal sleep schedule by simply going to bed earlier. But the most difficult aspect may be the social censure from people who are convinced we are lazy and self-indulgent. Future son-in-law is lucky to have found a job and a girlfriend who is understanding about his disability. — No Early Bird in California Sheinwold’s bridge SAGITTARIUS (Nov. 22-Dec. 21) HHHH Defer to others, especially if you are not as sure of yourself as you normally are. Allow someone else who is more confident to take the lead, at least about the issue at hand. Tonight: Say “yes.” BLACK TO PLAY On Nov. 18, 1928, Walt Disney’s first sound-synchronized animated cartoon, Steamboat Willie starring Mickey Mouse, premiered in New York. Family members ignore alcoholism SCORPIO (Oct. 23-Nov. 21) HHHH Deal with others directly if you want to get a reasonable response. Stop wondering what might be best to do. Tonight: Visit over dinner. Chess quiz Today’s highlight in history: B-11 Jumble B-12 THE NEW MEXICAN Monday, November WITHOUT RESERVATIONS 18, 2013 THE ARGYLE SWEATER PEANUTS LA CUCARACHA TUNDRA RETAIL STONE SOUP LUANN ZITS BALDO KNIGHT LIFE GET FUZZY DILBERT MUTTS PICKLES ROSE IS ROSE PEARLS BEFORE SWINE PARDON MY PLANET BABY BLUES NON SEQUITUR
https://issuu.com/sfnewmexican/docs/santa_fe_new_mexican__nov._18__2013
CC-MAIN-2017-17
refinedweb
40,852
64.81
24 January 2011 17:09 [Source: ICIS news] HOUSTON (ICIS)--Endicott Biofuels (EBF) plans to construct a 30m gal/year (114m litres/year) biodiesel refinery in ?xml:namespace> Construction should begin in late January, the company said. EBF signed the agreement with terminal storage and project management firm KMTEX. KMTEX will provide certain construction and operational services, EBF said. The biodiesel refinery will use EBF’s technology to produce its G2 Clear biodiesel, it said. The G2 Clear brand is made from waste fats, oils and greases, EBF said, allowing the process use inedible feedstocks. EBF said the biorefinery would help the Financial terms were not disclosed. In late 2010, the US reinstated the $1/gal blenders’ federal tax credit for biodiesel producers, which industry sources had said would spur increased
http://www.icis.com/Articles/2011/01/24/9428857/endicott-to-build-biodiesel-refinery-in-texas.html
CC-MAIN-2014-42
refinedweb
131
64.2
SPARQL is no longer shipped with core RDFLib, instead it is now a part of rdfextras Assuming you have rdfextras installed with setuptools (highly recommended), you can use SPARQL with RDFLib 3.X out of the box. If you only have distutils, you have to add these lines somewhere at the top of your program: import rdfextras rdfextras.registerplugins() You might parse some files into a new graph or open an on-disk RDFLib store. from rdflib.graph import Graph g = Graph() g.parse("") querystr = """ SELECT ?aname ?bname WHERE { ?a foaf:knows ?b . ?a foaf:name ?aname . ?b foaf:name ?bname . }""" for row in g.query( querystr, initNs=dict(foaf=Namespace(""))): print("%s knows %s" % row) The results are tuples of values in the same order as your SELECT arguments. Timothy Berners-Lee knows Edd Dumbill Timothy Berners-Lee knows Jennifer Golbeck Timothy Berners-Lee knows Nicholas Gibbins Timothy Berners-Lee knows Nigel Shadbolt Dan Brickley knows binzac Timothy Berners-Lee knows Eric Miller Drew Perttula knows David McClosky Timothy Berners-Lee knows Dan Connolly ... The rdfextras.sparql.graph.Graph.parse() initNs argument is a dictionary of namespaces to be expanded in the query string. In a large program, it’s common to use the same dict for every single query. You might even hack your graph instance so that the initNs arg is already filled in. If someone knows how to use the empty prefix (e.g. ”?a :knows ?b”), please write about it here and in the Graph.query docs. As with conventional SQL queries, it’s common to run the same query many times with only a few terms changing. rdflib calls this initBindings: FOAF = Namespace("") ns = dict(foaf=FOAF) drew = URIRef('') for row in g.query('SELECT ?name WHERE { ?p foaf:name ?name }', initNs=ns, initBindings={'p' : drew}): print(row) Output: (rdflib.Literal('Drew Perttula', language=None, datatype=None),) See also the the rdflib.graph.Graph.query() API docs
http://rdfextras.readthedocs.io/en/latest/intro_querying.html
CC-MAIN-2018-26
refinedweb
323
64.91
. Overview Compared to the $30 WiFi smart plugs out there, the SONOFF is a great alternative for making smart home and even industrial IoT projects at a larger scale. Moreover, it is based on the popular ESP8266 Wi-Fi chip, making it compatible with the Arduino environment and other resources like our ESP libraries at Ubidots. The SONOFF comes with its own firmware and mobile app, but we think that its main value actually lies in its form-factor and price. This is why we decided to do some hacking and unleash its full power!: UARTbee SONOFF VCC -------> VCC TX -------> RX RX -------> TX GND -------> GND 3.. 4. Open the Boards Manager from Tools -> Board menu and install ESP8266 platform. Select your ESP8266 board from Tools > Board menu after installation. 5. Download the UbidotsMicroESP8266 library here. 6. Now, click on Sketch -> Include Library -> Add .ZIP Library. 7. Select the .ZIP file of UbidotsMicroESP8266 and then click on “Accept” or “Choose”. 8. Close the Arduino IDE and open it again. Create Ubidots Variables 1. Login to your Ubidots account 2. Go to Sources and click on "Add new data source" 3. Set the name of the Data source. 4. Create four variables inside the Data source: Temperature, Humidity, Heat Index and Relay. 5. Copy the variable ID of all variables into the code snippet below. Create Ubidots Events We'll need two Ubidots Events: one to turn on the relay and another one to turn it off: 1. In your Ubidots account, go to Events and then click on "Add new Event" 2. Select the SONOFF data source you just created. 3. Select the Heat Index variable. 4. Set the trigger condition to "greater than 25", or your desired Heat Index (the SONOFF sends the data in Degrees Celsius) 5. Select "Set a variable" trigger type, then select the SONOFF data source again, then the "Relay variable" 6. Set it to "1" so the Events sets the Relay variable to "1" when the condition is met. 7. Repeat these steps to create a second event, but this time set the condition to "less than 20"and the value sent to the Relay to "0". Coding your SONOFF-TH Here is the code that turns on/off the SONOFF device, to use this code don't forget to change WIFISSID and PASSWORD with your network credentials, and use the IDs of the variables we created. To upload the code into the SONOFF you will need to put it into programming mode: 1. Connect the UARTbee to PC USB. 2. Press SONOFF button and disconnect the USB at the same time. 3. While pushing the button, connect the USB again. #include "UbidotsMicroESP8266.h" #include "DHT.h" #define DHTPIN 14 // what digital pin we're connected to #define DHTTYPE DHT11 // DHT 11 DHT dht(DHTPIN, DHTTYPE); #define ID "My_humedity_id" // Put here your Ubidots variable ID #define ID2 "My_Temperature_id" // Put here your Ubidots variable ID #define ID3 "My_heat_id" // Put here your Ubidots variable ID #define ID4 "My_relay_id" // Put here your Ubidots variable ID #define TOKEN "MY_TOKEN" // Put here your Ubidots TOKEN #define WIFISSID "MY_SSID" #define PASSWORD "MY_WIFI_PASSWORD" #define RELAY 12 #define LED 13 Ubidots client(TOKEN); void setup(){ Serial.begin(115200); dht.begin(); delay(10); pinMode(RELAY, OUTPUT); pinMode(LED, OUTPUT); digitalWrite(LED, HIGH); client.wifiConnection(WIFISSID, PASSWORD); } void loop(){ // Wait a few seconds between measurements. delay(2000); //)) { Serial.println("Failed to read from DHT sensor!"); return; } // Compute heat index in Celsius (isFahreheit = false) float hic = dht.computeHeatIndex(t, h, false); client.add(ID, h); client.add(ID2, t); client.add(ID3, hic); client.sendAll(); float setRelay = client.getValue(ID4); if (setRelay == 1.00) { digitalWrite(RELAY, HIGH); //On relay digitalWrite(LED, LOW); //On led } if (setRelay == 0.00) { digitalWrite(RELAY, LOW); //Off relay digitalWrite(LED, HIGH); //Off led } } When you finish uploading the code, disconnect the UARTbee and SONOFF, then connect the DHT11 sensor. Your SONOFF is ready to connect to a supply of 110-240V and to your air conditioner. Putting it all together We tested this project with a "SAMURAI Eole Crystal" fan. This machine required pushing a button to turn it on after plugging it to the AC outlet, so we soldered the ON/OFF button so it's always ON: We then re-assembled the unit, connected it to AC and done! Taking a step further... Ubidots is a cloud service empowering thousands of engineers around the world to build IoT projects, both in education and the enterprise. To learn how Ubidots can help your business check out our features or leave us a message.
https://www.hackster.io/19847/sonoff-tutorial-a-wi-fi-room-temperature-controller-for-10-b5f4af
CC-MAIN-2020-16
refinedweb
763
65.32
Picking up where we left off, I like Guido's vision of generators fine. The "one frame" version I've described is in fact what Icon provides, and what Guido is doing requires using coroutines instead in that language. Guido's is more flexible, and I'm not opposed to that <wink>. OTOH, I *have* seen many a person (including me!) confused by the semantics of coroutines in Icon, so I don't know how much of the additional flexibility converts into additional confusion. One thing I am sure of: having debated the fine points of continuations recently, I'm incapable of judging it harshly today <0.5 wink>. > ... > def inorder(node): > if node.left: inorder(node.left) > suspend node > if node.right: inorder(node.right) The first thing that struck me there is that I'm not sure to whom the suspend transfers control. In the one-frame flavor of generator, it's always to the caller of the function that (lexically) contains the "suspend". Is it possible to keep this all straight if the "suspend" above is changed to e.g. pass_it_back(node) where def pass_it_back(x): suspend x ? I'm vaguely picturing some kind of additional frame state, a pointer to the topmost frame that's "expecting" to receive a suspend. (I see you resolve this in a different way later, though.) > ... > I thought that tree traversal was one of Tim's first examples of > generators; would I really have to use an explicit stack to create > the traversal? As before, still no <wink>, but the one-frame version does require an unbroken *implicit* chain back to the intended receiver, with an explicit "suspend" at every step back to that. Let me rewrite the one-frame version in a way that assumes less semantics from "suspend", instead building on the already-assumed new smarts in "for": def inorder(node): if node: for child in inorder(node.left): suspend child suspend node for child in inorder(node.right): suspend child I hope this makes it clearer that the one-frame version spawns two *new* generators for every non-None node, and in purely stack-like fashion (both "recursing down" and "suspending up"). > Next, I want more clarity about the initialization and termination > conditions. Good idea. > The Demo/thread/Generator.py version is very explicit about > initialization: you instantiate the Generator class, passing it a > function that takes a Generator instance as an argument; the function > executes in a new thread. (I guess I would've used a different > interface now -- perhaps inheriting from the Generator class > overriding a run() method.) I would change my coroutine implementation similarly. > For termination, the normal way to stop seems to be for the generator > function to return (rather than calling g.put()), the consumer then gets > an EOFError exception the next time it calls g.get(). There's also a > way for either side to call g.kill() to stop the generator prematurely. A perfectly serviceable interface, but "feels clumsy" in comparison to normal for loops and e.g. reading lines from a file, where *visible* exceptions aren't raised at the end. I expect most sequences to terminate before I do <wink>, so (visible) try/except isn't the best UI here. > Let me try to translate that to a threadless implementation. We could > declare a simple generator as follows: > > generator reverse(seq): > i = len(seq) > while i > 0: > i = i-1 > suspend seq[i] > > This could be translated by the Python translator into the following, > assuming a system class generator which provides the machinery for > generators: > > class reverse(generator): > def run(self, seq): > i = len(seq) > while i > 0: > i = i-1 > self.suspend(seq[i]) > > (Perhaps the identifiers generator, run and suspend would be spelled > with __...__, but that's just clutter for now.) > > Now where Tim was writing examples like this: > > for c in reverse("Hello world"): > print c, > print > > I'd like to guess what the underlying machinery would look like. For > argument's sake, let's assume the for loop recognizes that it's using > a generator (or better, it always needs a generator, and when it's not > a generator it silently implies a sequence-iterating generator). In the end I expect these concepts could be unified, e.g. via a new class __iterate__ method. Then for i in 42: could fail simply because ints don't have a value in that slot, while lists and tuples could inherit from SequenceIterator, pushing the generation of the index range into the type instead of explicitly constructed by the eval loop. > So the translator could generate the following: > > g = reverse("Hello world") # instantiate class reverse > while 1: > try: > c = g.resume() > except EOGError: # End Of Generator > break > print c, > print > > (Where g should really be a unique temporary local variable.) > > In this model, the g.resume() and g.suspend() calls have all the magic. > They should not be accessible to the user. This seems at odds with the later: > (The user may write this code explicitly if they want to consume the > generated elements in a different way than through a for loop.) Whether it's at odds or not, I like the latter better. When the machinery is clean & well-designed, expose it! Else in 2002 we'll be subjected to a generatorhacks module <wink>. > They are written in C so they can play games with frame objects. > > I guess that the *first* call to g.resume(), for a particular > generator instance, should start the generator's run() method; run() > is not activated by the instantiation of the generator. This can work either way. If it's more convenient to begin run() as part of instantiation, the code for run() can start with an equivalent of if self.first_time: self.first_time = 0 return where self.first_time is set true by the constructor. Then "the frame" will exist from the start. The first resume() will skip over that block and launch into the code, while subsequent resume()s will never even see this block: almost free. > Then run() runs until the first suspend() call, which causes the return > from the resume() call to happen. Subsequent resume() calls know that > there's already is a frame (it's stored in the generator instance) and simply > continue its execution where it was. If the run() method returns from > the frame, the resume() call is made to raise EOGError (blah, bogus > name) which signals the end of the loop. (The user may write this > code explicitly if they want to consume the generated elements in a > different way than through a for loop.) Yes, that parenthetical comment bears repeating <wink>. > Looking at this machinery, I think the recursive generator that I > wanted could be made to work, by explicitly declaring a generator > subclass (instead of using the generator keyword, which is just > syntactic sugar) and making calls to methods of self, e.g.: > > class inorder(generator): > def run(self, node): > if node.left: self.run(node.left) > self.suspend(node) > if node.right: self.run(node.right) Going way back to the top, this implies the def pass_it_back(x): suspend x indirection couldn't work -- unless pass_it_back were also a method of inorder. Not complaining, just trying to understand. Once you generalize, it's hard to know when to stop. > The generator machinery would (ab)use the fact that Python frames > don't necessarily have to be linked in a strict stack order; If you call *this* abuse, what words remain to vilify what Christian is doing <wink>? > the generator gets a pointer to the frame to resume from resume(), Ah! That addresses my first question. Are you implicitly assuming a "stackless" eval loop here? Else resuming the receiving frame would appear to push another C stack frame for each value delivered, ever deeper. The "one frame" version of generators doesn't have this headache (since a suspend *returns* to its immediate caller there -- it doesn't *resume* its caller). > and there's a "bottom" frame which, when hit, raises the EOGError > exception. Although desribed at the end, this is something set up at the start, right? To trap a plain return from the topmost invocation of the generator. > All currently active frames belonging to the generator stay alive > while another resume() is possible. And those form a linear chain from the most-recent suspend() back to the primal resume(). Which appears to address an earlier issue not brought up in this message: this provides a well-defined & intuitively clear path for exceptions to follow, yes? I'm not sure about coroutines, but there's something wrong with a generator implementation if the guy who kicks it off can't see errors raised by the generator's execution! This doesn't appear to be a problem here. > All this is possible by the introduction of an explicit generator > object. I think Tim had an implementation in mind where the standard > return pointer in the frame is the only thing necessary; actually, I > think the return pointer is stored in the calling frame, not in the > called frame What I've had in mind is what Majewski implemented 5 years ago, but lost interest in because it couldn't be extended to those blasted continuations <wink>. The called frame points back to the calling frame via f->f_back (of course), and I think that's all the return info the one-frame version needs. I expect I'm missing your meaning here. > (Christian? Is this so in your version?). That shouldn't make a > difference, except that it's not clear to me how to reference the frame > (in the explicitly coded version, which has to exist at least at the > bytecode level). "The" frame being which frame specifically, and refrenced from where? Regardless, it must be solvable, since if Christian can (& he thinks he can, & I believe him <wink>) expose a call/cc variant, the generator class could be coded entirely in Python. > With classic coroutines, I believe that there's no difference between > the first call and subsequent calls to the coroutine. This works in > the Knuth world where coroutines and recursion don't go together; That's also a world where co-transfers are implemented via funky self-modifying assembler, custom-crafted for the exact number of coroutines you expect to be using -- I don't recommend Knuth as a guide to *implementing* these beasts <0.3 wink>. That said, yes, provided the coroutines objects all exist, there's nothing special about the first call. About "provided that": if your coroutine objects A and B have "run" methods, you dare not invoke A.run() before B has been constructed (else the first instance of B.transfer() in A chokes -- there's no object to transfer *to*). So, in practice, I think instantiation is still divorced from initiation. One possibility is to hide all that in a cobegin(list_of_coroutine_classes_to_instantiate_and_run) function. But then naming the instances is a puzzle. > but at least for generators I would hope that it's possible for multiple > instances of the same generator to be active simultaneously (e.g. I > could be reversing over a list of files and then reverse each of the > lines in the file; this uses separate instances of the reverse() > generator). Since that's the trick the "one frame" generators *rely* on for recursion, it's surely not a problem in your stronger version. Note that my old coroutine implementation did allow for multiple instances of a coroutine, although the examples posted with it didn't illustrate that. The weakness of coroutines in practice is (in my experience) the requirement that you *name* the target of a transfer. This is brittle; e.g., in the pipeline example I posted, each stage had to know the names of the stages on either side of it. By adopting a target.transfer(optional_value) primitive it's possible to *pass in* the target object as an argument to the coroutine doing the transfer. Then "the names" are all in the setup, and don't pollute the bodies of the coroutines (e.g., each coroutine in the pipeline example could have arguments named "stdin" and "stdout"). I haven't seen a system that *does* this, but it's so obviously the right thing to do it's not worth saying any more about <wink>. > So we need a way to reference the generator instance separately from > the generator constructor. The machinery I sketched above solves this. > > After Tim has refined or rebutted this, I think I'll be able to > suggest what to do for coroutines. Please do. Whether or not it's futile, it's fun <wink>. hmm-haven't-had-enough-of-that-lately!-ly y'rs - tim
https://mail.python.org/pipermail/python-dev/1999-July/000487.html
CC-MAIN-2016-50
refinedweb
2,126
62.88
Before the lifetime of the last pointer that stores the return value of a call to a standard memory allocation function has ended, it must be matched by a call to free() with that pointer value. Noncompliant Code Example In this noncompliant example, the object allocated by the call to malloc() is not freed before the end of the lifetime of the last pointer text_buffer referring to the object: #include <stdlib.h> enum { BUFFER_SIZE = 32 }; int f(void) { char *text_buffer = (char *)malloc(BUFFER_SIZE); if (text_buffer == NULL) { return -1; } return 0; } Compliant Solution In this compliant solution, the pointer is deallocated with a call to free(): #include <stdlib.h> enum { BUFFER_SIZE = 32 }; int f(void) { char *text_buffer = (char *)malloc(BUFFER_SIZE); if (text_buffer == NULL) { return -1; } free(text_buffer); return 0; } Exceptions MEM31-C-EX1: Allocated memory does not need to be freed if it is assigned to a pointer with static storage duration whose lifetime is the entire execution of a program. The following code example illustrates a pointer that stores the return value from malloc() in a static variable: #include <stdlib.h> enum { BUFFER_SIZE = 32 }; int f(void) { static char *text_buffer = NULL; if (text_buffer == NULL) { text_buffer = (char *)malloc(BUFFER_SIZE); if (text_buffer == NULL) { return -1; } } return 0; } Risk Assessment Failing to free memory can result in the exhaustion of system memory resources, which can lead to a denial-of-service attack. Automated Detection Related Vulnerabilities Search for vulnerabilities resulting from the violation of this rule on the CERT website. Related Guidelines Key here (explains table format and definitions) CERT-CWE Mapping Notes Key here for mapping notes CWE-404/CWE-459/CWE-771/CWE-772 and FIO42-C/MEM31-C Intersection( FIO42-C, MEM31-C) = Ø CWE-404 = CWE-459 = CWE-771 = CWE-772 CWE-404 = Union( FIO42-C, MEM31-C list) where list = - Failure to free resources besides files or memory chunks, such as mutexes) 17 Comments Mark Dowd Maybe there needs to special mention of the UNIX realloc() gotcha here - if the size passed to realloc() is 0, realloc() frees the memory you pass, rather than attempting to reallocating it. This can lead to double-free problems.. John McDonald The C standard doesn't say anything about what happens with a size argument of 0, but I checked glibc and openbsd source real quick and they appear to return a valid pointer to a zero-sized object.. e.g. the return of a malloc(0); I mention this because if there was a system where realloc() free'ed the object and then returned NULL, it would make the secure idiom for realloc() exploitable. Here's that idiom, snagged from an openbsd man page: You can see that if nsize was 0, and realloc() free'ed the memory and then returned NULL, it would be a double-free of p. I would guess that no systems actually do this, but it might be worth researching. As it stands, the behavior with an nsize of 0 is pretty interesting and counter-intuitive, and I can see people running into trouble because of it. Robert Seacord OK, I've updated MEM36-C. to talk about reallocating zero bytes. Jonathan Leffler Solaris 10 (UltraSPARC) specifically returns NULL when you realloc 0 bytes. This code yields "s was not null" and "p is null". Stephen Friedl This again points to the benefit of setting pointers to NULL after free(); this doesn't fix the logic error that calls free() twice, but it at least gets rid of the gross security issue of freeing a random pointer. Douglas A. Gwyn I prefer if(x!=NULL)free(x) ; since it doesn't depend on the special case for free(NULL) which some libraries might get wrong. (Before C89, almost all of them croaked.) Jonathan Leffler The document assumes C99 - even if it only assumed C89, free(0) is defined as safe. It is only pre-C89 implementations that might have the problem. Presumably, those who work on such implementations are aware of the problems, and for the large majority who do not work on such archaic systems, there is no issue. Dhruv Mohindra I recall a discussion about the comments that say "handle error". Perhaps the CS would be better if it exits or returns (with an error code) after freeing the memory on error_condition = 1 rather than removing free()altogether from that part of code. David Svoboda I think you are referring to code that does the following: This code clearly frees x just once, and so complies with the rule, but this code has the following drawbacks: xis duplicated inside & outside the if statement. The redundancy leads to code bloat and potential for more errors. I suspect these reasons are why this code sample wasn't included as a 2nd CS. Martin Sebor I agree that the rule would be more "believable" if the error handling was less handwavy. Maybe like so: Dhruv Mohindra The above code by Martin appears to address the return problem/possible memory leak I'd imagined. +1 Martin Sebor I've updated the code examples. David Svoboda MSVC error C6308 addresses an improper use of realloc(). which rule corresponds with this diagnostic? I assume its MEM31-C, but that's not obvious. Whichever rule should handle C6308 needs a NCCE & CS pair to illustrate the problem. Martin Sebor I wonder if MEM08-C. Use realloc() only to resize dynamically allocated arrays could be tweaked to cover the case you mention. As it stands, the problem MEM08-C tries to avoid doesn't seem like one that's specific to realloc()but rather one of converting a pointer to one object to a pointer of an unrelated type. That can just as easily happen with malloc()or in any other situation involving a cast of a pointer to another. David Svoboda We may want to add an exception for dynamically-loaded libraries. Most programs allocate memory to hold dynamically-loaded code (eg the LoadLibrary() function in Windows), and do nothing to free them (expecting that they will persist through the lifetime of the program.) Robert Seacord (Manager) This rule is going to get trashed and replaced by something that looks like the memory portions of this TS 17961 rule: 5.18 Failing to close files or free dynamic memory when they are no longer needed [fileclose] John Whited Even when replaced, the Risk Assessment needs attention. Severity on this page is "Medium". But summary on the "Memory Management" page shows Severity for this rule to be "High". The two should align.
https://wiki.sei.cmu.edu/confluence/display/c/MEM31-C.+Free+dynamically+allocated+memory+when+no+longer+needed
CC-MAIN-2019-09
refinedweb
1,090
58.42
Remember when we discussed how Blazor is a UI framework (or exposed via Web API etc.) The requirement So we need to return a list of tweets when the UI asks for it. The UI will make a request (“please give me a list of tweets”) and our application will respond accordingly. This basic Blazor, React or even WPF/WinForms for our UI! Retrieve a list of tweets using MediatR There are several ways we can go about implementing this application logic and my preferred one is to use a small library by Jimmy Bogard, called MediatR. What we’re aiming to do here is build the “business logic” part of our requirement. We’ve built the UI already, the component(s) which show a list of tweets, now we turn our attention to the “business logic” for the feature. The code we’re about to write is the code that handles things like connecting to a database, runing logic to filter the results we get back etc. before returning the data for our frontend to consume. Either way,. This is where we’re going to represent our Request (query) and Response (model). We’ll start by replacing the contents of List.cs with the following: using MediatR; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks;" } }; } } } That’s all we need (for now). A simple hardcoded list of tweets, but this time served by our application, rather than directly in the Razor component. Hooking it all up There’s just a couple more things to do if we’re going to invoke this request from our component. First we need to tell our application we’re using MediatR (so it can find and wire up all our handlers, like the one we just created above). Head over to Startup.cs and add this anywhere in ConfigureServices: Startup.cs services.AddMediatR(Assembly.GetExecutingAssembly()); You’ll also need two new using statements: using MediatR; using System.Reflection; Now head over to the List.razor component. Remember this code? protected override async Task OnInitializedAsync() { _tweets = new List<string> { "One tweet", "Two tweets", "Three tweets", "Four" }; } We’re going to make our MediatR call here. At the top of List.razor add these two lines. @using MediatR @inject IMediator Mediator This tells our component to inject an instance of IMediator and alias it as Mediator. Now we can call Mediator in our code. Change the @code block in List.razor as follows: @code { private List<string> _tweets; protected override async Task OnInitializedAsync() { var model = await Mediator.Send(new Features.Tweets.List.Query()); _tweets = model.Tweets; } } We’re sending our List.Query request via MediatR, then taking the response and directly assigning the list of Tweets to our _tweets private field. Run your application now, MediatR will kick in and you should see some tweets from the server! Nice! It’s worth taking a moment to reflect on where we’re up to. We now have a clean architecture which enables us to build our application’s logic (queries and commands) in a way which doesn’t box us in to any specific UI framework. Imagine a requirement came in to rewrite part of the UI using React. You could add an API controller and serve this same list of tweets, ready for consumption by a React.js frontend… [Route("api/); } } The query (request and response) stays the same but now you can invoke them via an HTTP call to your API. Pretty neat huh? Next (and finally) let’s look at introducing a lightweight data store for testing so we can make our application handle new tweets.
https://jonhilton.net/modern-web-app/powered-by-mediatr/
CC-MAIN-2022-05
refinedweb
606
66.03
Removing Ads From Yahoo Posts Discussion in 'Javascript' started by Mike32 - Marc Jennings - Apr 4, 2005 removing a namespace prefix and removing all attributes not in that same prefixChris Chiasson, Nov 12, 2006, in forum: XML - Replies: - 6 - Views: - 721 - Richard Tobin - Nov 14, 2006 need help while designing yahoo messenger like yahoo and msn , like on meebo.com - Replies: - 0 - Views: - 653 - checoo - Dec 25, 2006 need help while designing yahoo messenger like yahoo and msn , like on meebo.com - Replies: - 1 - Views: - 603 about "var yahoo = window.yahoo || {}"zhonghua, Jul 10, 2006, in forum: Javascript - Replies: - 2 - Views: - 203 - zhonghua - Jul 10, 2006
http://www.thecodingforums.com/threads/removing-ads-from-yahoo-posts.877541/
CC-MAIN-2015-32
refinedweb
105
62.51
. Update: As of the latest technology preview, the syntax has changed for interpolated strings. I’ve updated the blog post to reflect this. Update: As of the latest technology preview, the syntax has changed for interpolated strings. I’ve updated the blog post to reflect this. Often times, when you want to log information to a file, console, or status label you end up having to format that information into a string. There are, of course, several ways to do this. The problem is that the more complex your formatting gets, the harder it is to understand and maintain the code. For example, let’s say we have a very simple class representing a Point: 1: public class Point 2: { 3: public int X { get; set; } 4: public int Y { get; set; } 5: } And we have a pair of points (perhaps bounding a rectangle) that we wish to log: 1: var p1 = new Point { X = 5, Y = 10 }; 2: var p2 = new Point { X = 7, Y = 3 }; We could, of course, perform string concatenation to do this: 1: Console.WriteLine("The area of interest is bounded by (" 2: + p1.X + "," + p1.Y + ") and (" + p2.X + "," + p2.Y + ")"); This works fine and performs relatively well (multiple string concatenations in the same statement are generally optimized with a behind-the-scenes StringBuilder). However, the problem is that the more things we concatenate together, the harder it is to understand the original intention of the output statement because it is broken up by multiple opening and closing quotes and the concatenation operator (+). To some extent, we can make this a bit better by using String.Format() and other methods (such as Console.WriteLine) that accept a format, for example: 1: Console.WriteLine("The area of interest is bounded by({0},{1}) and ({2},{3})", 2: p1.X, p1.Y, p2.X, p2.Y); This solves the problem of breaking up the formatting with quotation marks and the concatenation operator, however, it also creates new problems. First of all, you have to maintain the position of the placeholders and the order of the arguments. Thus, if you need to add a new item earlier in the string, you’d either have to bump up all the other indexes or add the new item at the end and have your placeholders out of order: // inserting before means bumping the index of each other placeholder up Console.WriteLine("The area of interest for {0} is bounded by({1},{2}) and ({3},{4})", "My Rectangle", p1.X, p1.Y, p2.X, p2.Y); // putting it at the end means your arguments are not in their actual display order Console.WriteLine("The area of interest for {4} is bounded by({0},{1}) and ({2},{3})", p1.X, p1.Y, p2.X, p2.Y, "My Rectangle"); Neither of these are fully desirable since you now have to make sure any change you make to the string or arguments keeps the two in sync. And this can be especially bad if you have a placeholder for an argument index that no longer exists: 1: // Oops, Removed the argument, but forgot the placeholder 2: Console.WriteLine("The area of interest for {4} is bounded by({0},{1}) and ({2},{3})", 3: p1.X, p1.Y, p2.X, p2.Y); It isn’t a compiler error, but a runtime error, which may pop up when you least expect it, especially if it’s not on a well travelled code branch: 1: Unhandled Exception: System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list. 2: at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args) 3: at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args) 4: at System.String.Format(IFormatProvider provider, String format, Object[] args) 5: at System.IO.TextWriter.WriteLine(String format, Object[] arg) 6: at System.IO.TextWriter.SyncTextWriter.WriteLine(String format, Object[] arg) 7: at System.Console.WriteLine(String format, Object[] arg) 8: at VNextScratchpad.Program.Main(String[] args) in C:\source\VNextScratchpad\Program.cs:line 31 There has to be a happy medium between the two. On one hand, concatenation is nice because it has everything right in its actual place in the string, but the syntax is cumbersome as the string gets longer. On the other hand, formatting is nice because it makes the string very clean but then it separates the placeholders from the arguments. Well, that is what string interpolation sets out to fix in C# 6. This is a concept that languages like Perl have had for quite a while, and now we’ll get this ability in C# as well. So, to unlock this ability, we simply prefix the string with a $ (much like we use the @ for verbatim strings). Then, we simply surround the expressions we want to interpolate with curly braces (i.e. { and }): For example, the line of output from before now looks like: // notice how the expressions are now embedded in the string itself Console.WriteLine($"The area of interest is bounded by ({p1.X},{p1.Y}) and ({p2.X},{p2.Y})"); It looks a lot like the String.Format() placeholders, but instead of an index, it is the expression itself inside the curly braces. In fact, it shouldn’t be a surprise that it looks like String.Format() because that’s really all it is – syntactical sugar that the compiler treats like String.Format() behind the scenes. A great part is, the compiler now maintains the placeholders for you so you don’t have to worry about indexing the right argument because you simply place it right there in the string. Because interpolation is really compile-time magic and syntactical sugar for String.Format(), you can use alignment and format arguments (See the MSDN on Composite Formatting) in the placeholder as well. Consider the syntax for a format element placeholder: {index[,alignment][:formatString]} The only difference with interpolation is that we will replace the index with the expression. For example, consider the code on the MSDN Composite Formatting page: for (int ctr = 0; ctr < names.Length; ctr++) { Console.WriteLine("{0,-20} {1,5:N1}", names[ctr], hours[ctr]); } We can change this to take advantage of interpolation and make it: Console.WriteLine($"{names[ctr],-20} {hours[ctr],5:N1}"); This means that names[ctr]’s value will be left justified and padded to 20 spaces, and hours[ctr]’s value will take 5 spaces and be formatted as a number 1 digit behind the decimal point. This feature is currently available in the preview for VisualStudio 2015 and C# 6, though it’s possible they may simplify the syntax in the final release. In fact, if you have an older version of the 2015 CTP you’ll note that there is not a $ string prefix, and the placeholders are marked with an escape backslash first. String interpolation is yet another tool that will be coming out in C# 6 that will allow you to make code easier to maintain. By embedding the values directly in the string to print, there is less confusion as to what values go with what placeholder – but you still maintain the ability to specify formatting as well. Stay tuned for more Little Wonders of C# 6! Print | posted on Thursday, March 26, 2015 9:39 PM | Filed Under [ My Blog C# Software .NET Little Wonders vNext ]
http://blackrabbitcoder.net/archive/2015/03/26/c.net-little-wonders-string-interpolation-in-c-6.aspx
CC-MAIN-2018-17
refinedweb
1,237
62.58
Fast quoting and unquoting of urls. Project description Urlquote Fast percent encoding / decoding for python. This library is not intended to be a replacement for urllib. urllib is part of the Python standard library and should be your go-to choice to quote and unquote URLs. However, should quoting or unquoting of URLs be known to be a performance bottleneck and you are fine with the encoding described below, then by all means have fun using this library. Usage from urlquote import quote quoted = quote('/El Niño/') assert(quoted == '/El%20Ni%C3%B1o/'.encode('utf-8')) Compatibility Since this library uses a cffi interface it should work fine with any version of Python. For Linux the wheel has to be build against a version of libc older or equal to the version of libc on the platform the wheel will be used on. Installation pip install urlquote quote operates on UTF-8-encoded bytes. If passed a string, it will encode it into UTF-8 first. It will always return UTF-8-encoded bytes. unquote behaves the same way. Encoding The following encodings are offered. DEFAULT_QUOTING is used in case the quoting parameter is not specified. Non printable and non standard ASCII characters are always quoted. The PYTHON_3_7_QUOTING is going to work the same way in every Python version the name is only refering to the urllib default encoding used in Python 3.7. Development This library is a thin wrapper around the Rust crate percent-encoding. It exposes part of its functionality to python via a C interface using milksnake. To build it you need to install Rust and Cargo. Than you can proceed to build the wheel with: python setup.py build sdist bdist_wheel To execute the Python tests use: pip install -e . pytest test.py There are also some Rust-only unit tests. To execute them change into the rust subdirectory and call. cargo test With the nightly toolchain installed you may also call the Rust-only benchmarks using: cargo +nightly bench Links - PyPI package: - Conda feedstock: Support This tool is provided as is under an MIT license without any warranty or SLA. You are free to use it as part for any purpose, but the responsibility for operating it resides with you. We appreciate your feedback though. Contributions on GitHub are welcome. Project details 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/urlquote/
CC-MAIN-2022-27
refinedweb
409
66.33
IVRs (interactive voice response) are automated phone systems that can facilitate communication between callers and businesses. If you've ever dialed your credit card company to check on a balance after responding to a series of automated prompts, you've used an IVR. Learn how to build an IVR in minutes using Twilio's powerful TwiMl API.Start Tutorial This Python's. Let's get started! Click the right arrow above to move to the next step of the tutorial. See Also:. See Also: we Play a welcome message. You may have noted we're using an unknown method TwiML. This is a custom view helper that takes a TwiML Response and transforms it into a valid HTTP Response. It's super easy, check the implementation: import flask def twiml(resp): resp = flask.Response(str(resp)) resp.headers['Content-Type'] = 'text/xml' return resp See Also: The gather's action parameter takes an absolute or relative URL as a value - in our case, the menu endpoint.. See Also: This route handles processing the caller's input. If our caller chooses '1' for directions, we use method defined below, _give_instructions, to respond with TwiML that will Say directions to our caller's extraction point. If the caller chooses '2' to call her home planet, then we need to gather more input from her. We wrote another method to handle this, _list_planets, which we'll cover in the next step. If the caller enters anything else we respond with a TwiML Redirect to the main See Also: If our caller chooses to call her home planet we will tell her the planet's directory. This is similar to a typical "company directory" feature of most IVRs. In our TwiML response we again use a Gather verb to receive our caller's input. The action verb points this time to the planets' route, which will switch our response based on what the caller chooses. Let's look at that route next. The TwiML response we return for that route just uses a Dial verb with the appropriate phone number to connect our caller to her home planet. In this route, we grab the caller's selection of the request and store it in a variable called selected_option. We then use a Dial verb with the appropriate phone number to connect our caller to her home planet. The current numbers are hardcoded, but they could also be read from a database or from a file. That's it! We've just implemented an IVR phone tree that will delight and serve your customers. If you're a Python/Flask developer working with Twilio, you might want to check out these other tutorials: Use Twilio to automate the process of reaching out to your customers in advance of an upcoming appointment. Two-Factor Authentication with Authy Use Twilio and Twilio-powered Authy OneTouch to implement two-factor authentication (2FA) in your web app Thanks for checking this tutorial out! If you have any feedback to share with us, we'd love to hear it. Contact the Twilio Developer Education Team to let us know what you think.
https://www.twilio.com/docs/tutorials/walkthrough/ivr-phone-tree/python/flask
CC-MAIN-2017-04
refinedweb
522
62.78
%pylab inline Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.kernel.zmq.pylab.backend_inline]. For more information, type 'help(pylab)'. In this notebook, I am going to show simple example of an Apache access log analysis with pandas. It's my first experience with pandas, and I am sure there are better and more efficient ways to do some of the things shown here. So comments, suggestions and corrections of my broken English are very welcome. You can send me an email, or create a PR for this notebook at github. We will need apachelog module, for parsing the log. We also have to know the format of the log that is set in the Apache config. In my case I have no access to the Apache config, but the hoster provide description of the format on his help page. Below is the format itself and a short description of every element: format = r'%V %h %l %u %t \"%r\" %>s %b \"%i\" \"%{User-Agent}i\" %T' Here (copied mostly from this SO post): %V - the server name according to the UseCanonicalName setting %h - remote host (ie the client IP) %l - identity of the user determined by identd (not usually used since not reliable) %u - user name determined by HTTP authentication %t - time the server finished processing the request. %r - request line from the client. ("GET / HTTP/1.0") %>s - status code sent from the server to the client (200, 404 etc.) %b - size of the response to the client (in bytes) \"%i\" - Referer is the page that linked to this URL. User-agent - the browser identification string %T - Apache request time import apachelog, sys Set the format: fformat = r'%V %h %l %u %t \"%r\" %>s %b \"%i\" \"%{User-Agent}i\" %T' Create the parcer: p = apachelog.parser(fformat)' data = p.parse(sample_string) data {'%>s': '200', '%T': '0', '%V': 'koldunov.net', '%b': '65237', '%h': '85.26.235.202', '%i': '', '%l': '-', '%r': 'GET /?p=364 HTTP/1.0', '%t': '[16/Mar/2013:00:19:43 +0400]', '%u': '-', '%{User-Agent}i': 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11'} log = open('access_log_for_pandas').readlines() Parse every line of it and create a list of dictionaries: log_list = [] for line in log: try: data = p.parse(line) except: sys.stderr.write("Unable to parse %s" % line) data['%t'] = data['%t'][1:12]+' '+data['%t'][13:21]+' '+data['%t'][22:27] log_list.append(data) We had to tweak the time format a bit, since otherwise pandas will not be able to parse it. This will create a list of dictionaries, that can be transformed in to a Data Frame: import pandas as pd import numpy as np from pandas import Series, DataFrame, Panel df = DataFrame(log_list) Show the first two lines of the Data Frame: df[0:2] We are not going to use all the data, so let's delete some of the columns: del df['%T']; del df['%V']; del df['%i']; del df['%l']; del df['%u']; del df['%{User-Agent}i'] and rename columns to something that humans can understand: df = df.rename(columns={'%>s': 'Status', '%b':'b', '%h':'IP', '%r':'Request', '%t': 'Time'}) First five rows of resulting Data Frame: df.head() Convert Time column to datetime format and make an index out of it (pop will drop original Time column): df.index = pd.to_datetime(df.pop('Time')) The Status variable is a string type, so we have to change it to int: df['Status'] = df['Status'].astype('int') Some of the rows in the b column contain '-' string, so we can't convert them with astype: df['b'][93] '-' We can apply a custom function to this column, that will convert all dashes to NaN, and the rest to floats, additionally converting from bytes to megabytes: def dash2nan(x): if x == '-': x = np.nan else: x = float(x)/1048576. return x df['b'] = df['b'].apply(dash2nan) I am sure there is a more elegant way to do this :) Our first, simplest plot: outgoing traffic from the website: df['b'].plot() <matplotlib.axes.AxesSubplot at 0xbf7574c> Look's like somebody downloaded something big from the website around 9 a.m. But actually the first thing that you probably want to know is how many visits (actually hits) your site has, and how they are distributed in time. We resample the series of variable b with 5 minute intervals, and calculate number of requests during every time span. Actually, in this case it doesn't matter what variable we use, these numbers will indicate just how many times information from the the website was requested. df_s = df['b'].resample('5t', how='count') df_s.plot() <matplotlib.axes.AxesSubplot at 0xc14588c> We can not only count number of requests per time, but also calculate the sum of the traffic for every time span: df_b = df['b'].resample('10t', how=['count','sum']) df_b['count'].plot( color='r') legend() df_b['sum'].plot(secondary_y=True) <matplotlib.axes.AxesSubplot at 0xc2d53ac> On the plot you can see, that the number of server requests do not always coincide with the amount of traffic, and correlation is actually not extremely high: df_b.corr() We can have a closer look at the curious morning peak: df_b['2013-03-16 6:00':'2013-03-16 10:00']['sum'].plot() <matplotlib.axes.AxesSubplot at 0xc3f5dac> Seems that this traffic spike was caused by only one request. Let's find out how this request looks. Choose all requests with the size of the response larger than 20 Mb (remember we convert bytes to Mb): df[df['b']>20] It was a .pdf file of a book (look at Request field), and this explains the peak in outgoing trafic at 2013-03-16 09:02:59. Clearly 20 Mb is a large request (for our website at least :)). But what is the typical size of the server's response? The histogram of response sizes (less than 20 Mb) looks like this: cc = df[df['b']<20] cc.b.hist(bins=10) <matplotlib.axes.AxesSubplot at 0xc52374c> So, most of the files are less than 0.5 Mb large. In fact they are even smaller: cc = df[df['b']<0.3] cc.b.hist(bins=100) <matplotlib.axes.AxesSubplot at 0xc5760ec> Very small responses can be all kinds of stuff, but larger ones are probably some relatively big files. Let's have a look at these little spikes between 0.2 and 0.25 Mb: cc = df[(df['b']>0.2)&(df['b']<0.25)] cc.b.hist(bins=100) <matplotlib.axes.AxesSubplot at 0xc57cacc> We now can locate the size of the file more precisely, and find out its name: cc = df[(df['b']>0.220)&(df['b']<0.224)] cc.head() This is one of the image files from the front page of the website. I would like to know how different server responses are distributed through time. Let's first try a not very elegant approach. We create several variables with time series of Status values, each containing only a time series with one particular value. Then a Data Frame is created out of this time series. t_span = '2H' df_404 = df['Status'][df['Status'] == 404].resample(t_span, how='count') df_403 = df['Status'][df['Status'] == 403].resample(t_span, how='count') df_301 = df['Status'][df['Status'] == 301].resample(t_span, how='count') df_304 = df['Status'][df['Status'] == 304].resample(t_span, how='count') df_200 = df['Status'][df['Status'] == 200].resample(t_span, how='count') status_df = DataFrame({'Not Found':df_404, 'Forbidden':df_403, 'Moved Permanently':df_301, 'Not Modified':df_304, 'OK':df_200,}) status_df.head() We plot all values at once: status_df.plot(figsize=(10, 3)) <matplotlib.axes.AxesSubplot at 0xcda1e6c> Show only Error and Redirection status codes as a stacked plot: status_df[['Not Found','Forbidden','Moved Permanently','Not Modified']].plot(kind='barh', stacked=True, figsize=(10, 7)) <matplotlib.axes.AxesSubplot at 0xce27e2c> But there is a better way to receive statistics about different groups of values. Here we group our data by Status: grouped_status = df.groupby('Status') Data are now rearranged in to several groups, each corresponding to a certain value of Status (here, only the first two values of every group are shown): grouped_status.head(2) We can count the number of values in each group: grouped_status.size().plot(kind='bar') <matplotlib.axes.AxesSubplot at 0xcfe76ac> We can look at individual groups: t_span = '30t' grouped_status.get_group(301)['Status'].resample(t_span, how='count').plot(color='g', label='301') legend() grouped_status.get_group(200)['Status'].resample(t_span, how='count').plot(color='b', secondary_y=True, label='200') <matplotlib.axes.AxesSubplot at 0xd0799ec> Now I want to group by IPs and calculate how many requests we get from each of them: ips = df.groupby('IP').size() I don't want to see all of them, just the top 10: ips.sort() ips[-10:].plot(kind='barh') <matplotlib.axes.AxesSubplot at 0xd13c0ec> I just want to have a nice table with the top 10 IPs, so I convert them to Data Frame :) ips_fd = DataFrame({'Number of requests':ips[-10:]}) ips_fd = ips_fd.sort(columns='Number of requests', ascending=False) ips_fd We also can group by both IP and Status: ips_status = df.groupby(['IP', 'Status']).size() ips_status.sort() ips_status[-20:].plot(kind='barh') <matplotlib.axes.AxesSubplot at 0xd3425cc> Import module and initialise data base: import pygeoip gi = pygeoip.GeoIP('./GeoLiteCity.dat', pygeoip.MEMORY_CACHE) This is how output of the pygeoip looks (we test our top IP from the previous section): ipcon = gi.record_by_addr('64.233.161.99') ipcon {'area_code': 650, 'city': 'Mountain View', 'continent': 'NA', 'country_code': 'US', 'country_code3': 'USA', 'country_name': 'United States', 'dma_code': 807, 'latitude': 37.41919999999999, 'longitude': -122.0574, 'metro_code': 'San Francisco, CA', 'postal_code': '94043', 'region_name': 'CA', 'time_zone': 'America/Los_Angeles'} Guess who it is :) Looks like Google Bot is my main reader. That's rather sad :( Loop to create a list of dictionaries with information about IP numbers. We also add information about the number of requests from each of the IPs: ipcon = [] for iip in ips.index: rres = gi.record_by_addr(iip) # rres['ip'] = iip rres['Number'] = ips[iip] #delete some fields we don't need del rres['area_code'] del rres['dma_code'] del rres['metro_code'] del rres['postal_code'] del rres['region_name'] del rres['time_zone'] del rres['country_code'] ipcon.append(rres) Create Data Frame from this list, use ips index: reg = DataFrame(ipcon, index = ips.index) reg.head() Group by Country: country = reg.groupby('country_code3') ff = country.Number.agg('sum').copy() ff.sort( ) ff[-10:].plot(kind='barh') <matplotlib.axes.AxesSubplot at 0xd6c68cc> The website is in Russian, so no surprises here. Group by city: city = reg.groupby('city') ff = city.Number.agg('sum').copy() ff.sort( ) ff[-20:].plot(kind='barh', figsize=(5,8)) <matplotlib.axes.AxesSubplot at 0xd86fa2c> The first 3 are kind of expected, but Tyumen, a Russian city located in the middle of Eurasia thousands of kilometers away from the nearest ocean coast, is a bit of a surprise (the website is about Oceanography). This is something to investigate later on. We have lats and lons for the data, so it is natural to put them on the map: from mpl_toolkits.basemap import Basemap import matplotlib.cm as cm m = Basemap(projection='robin',lon_0=0,resolution='c') x, y = m(reg['longitude'],reg['latitude']) figure(figsize=(15,15)) m.drawcoastlines(linewidth=0.25) m.drawcountries(linewidth=0.25) m.fillcontinents(color='coral',lake_color='aqua') m.drawmapboundary(fill_color='white') m.drawmeridians(np.arange(0,360,30)) m.drawparallels(np.arange(-90,90,30)) m.scatter(x,y,s=reg['Number']*3,c=reg['Number']/5,marker='o',zorder=4, cmap=cm.Paired,alpha=0.5) <matplotlib.collections.PathCollection at 0x15facacc> Have closer look at Europe: m = Basemap(projection='cyl',llcrnrlat=35,urcrnrlat=72,\ llcrnrlon=-10,urcrnrlon=50,resolution='l') x, y = m(reg['longitude'],reg['latitude']) figure(figsize=(15,15)) m.drawcoastlines(linewidth=0.25) m.drawcountries(linewidth=0.25) m.fillcontinents(color='white',lake_color='aqua') m.drawmapboundary(fill_color='aqua') m.drawmeridians(np.arange(0,360,30)) m.drawparallels(np.arange(-90,90,30)) m.scatter(x,y,s=reg['Number']*30,c=reg['Number'],marker='o',zorder=4, cmap=cm.gist_ncar ,alpha=0.3) <matplotlib.collections.PathCollection at 0x169381ec> Spammers are a huge problem, and it would be nice to filter them out. My website has very low user activity, and if somebody tries to POST something more than couple of times it's already suspicious. First we have to get information about what request method is being used for the requests. For this we have to analyse the Request column, which contain strings with requests. Request methods are always located in the beginning of the request string, so it's trivial to get it: def gmet(x): x = x.split() return x[0] We apply this little function to the Request column and create new Method column: df['Method'] = df.Request.apply(gmet) Group by Method and IP: met = df.groupby(['Method', 'IP']).size() met.head <bound method Series.head of Method IP GET 100.44.124.8 26 108.171.252.242 23 109.165.31.156 12 109.171.109.164 4 109.191.82.110 14 109.200.149.88 56 109.205.252.77 32 109.225.55.49 13 109.226.101.186 45 109.230.128.168 9 109.230.128.169 13 109.230.132.244 2 109.87.146.37 4 109.87.148.141 13 111.73.45.49 10 ... POST 46.191.247.15 5 46.29.255.194 5 5.164.227.102 6 66.23.234.10 10 77.222.40.65 58 78.30.212.183 4 81.200.28.126 1 85.114.191.235 2 85.142.104.227 1 91.207.4.78 5 94.190.190.121 5 94.45.180.57 5 95.105.29.56 5 95.27.28.213 5 95.84.137.56 6 Length: 470> Create POST time series (we have to have a copy of the time series to sort the data): post = met['POST'].copy() post.sort() Plot the top 10 IPs that use POST method: post[-10:].plot(kind='barh') <matplotlib.axes.AxesSubplot at 0x16ddaeec> post[-5:] IP 173.208.108.10 10 66.23.234.10 10 213.248.47.229 11 160.75.185.7 15 77.222.40.65 58 What is the winner doing? df[df.IP =='77.222.40.65'][0:5] Making some Wordpress cron requests... This IP looks familiar... Oh, it's actually the IP of my website - this is my Wordpress doing something. Have to investigate later if I can disable this thing (anyway it's not working, getting 403 error) :) Number two: df[df.IP =='160.75.185.7'][0:10] This is suspicious; looks like it tries to get to the website's admin area - candidate for blocking. Number three: df[df.IP =='213.248.47.229'][0:10] This one tries to register on the forum every 5 second or so - clearly forum spammer. Block.
http://nbviewer.ipython.org/github/koldunovn/nk_public_notebooks/blob/master/Apache_log.ipynb
CC-MAIN-2015-18
refinedweb
2,506
59.7
Round Solar Pathway Light Black - Room Essentials™ Little Boy Solar Powered LED Light Garden Statue(6.5"x5.25"x11.75") - Pure Garden. Pure Garden. 3 out of 5 stars with 2 reviews. 2. $21.99. 4pk Hooded Cage Hook Solar Pathway Lights with Remote Antique Brass - Smith & Hawken™Get a Quote Solar Path Deck Light Road Stud LED Garden Driveway Security Lamp Outdoor Stairs. AU $12.99. AU $5.99 postage. or Best Offer. Solar Power 6 LED Road Stud Light For Path Deck Driveway Garden Pathway Light NW. AU $18.98. Free postage. 8Pcs Outdoor Solar LED Deck Garden Stair Step Fence Lights Wall Pathway Post BUY. AU $52.64. manufacturer of solar home light systems offered by starka innovative systems private limited, amravati, maharashtra. starka innovative systems private limited. old bypass, amravati, maharashtra. gst no. 27aaycs9592g1z9. send email. semi [hot item] solar-powered street led lamps.. 100w led solar powered wall light ip65 $ 130.88-30%. add to wishlist 1000lm 188 led solar light motion sensor $ 108.51 $ 75.96-30%. add to wishlist + quick view. 70 trulite energy led and solar street light review with remote $ 74.99 $ 52.49-21%. add to wishlist + quick view. outdoor wireless solar dual infrared hot sale 5000w solar power inverter 24v. rated 5Get a Quote Hot-selling Solar Aluminum 6 Led Driveway Pathway Garden Road Marker Stud Light , Find Complete Details about Hot-selling Solar Aluminum 6 Led Driveway Pathway Garden Road Marker Stud Light,Road Marker Road Light,Stud Decking Solar Lights,Solar Powered Lighting from Traffic Warning Products Supplier or Manufacturer-Cixi Landsign Electric Appliance Co., Ltd. microwave motion sensor 60w all in one modules smd all-in-one solar street light pole 7m price. $125.00 - $138.00 / piece. 1 piece super bright 5m pole mount motion sensor 30w solar powered outdoor street lights. solar led light outdoor waterproof pathway street garden light. $88.00 - $96.00 / piece. 2 piecesGet a Quote Solar Led Garden Pathway Landscape Light With Motion Sensor , Find Complete Details about Solar Led Garden Pathway Landscape Light With Motion Sensor,Solar Led Garden Landscape Pathway Light,Led Solar Garden Path Walkway Light,Solar Garden Path Light from Garden Lights Supplier or Manufacturer-Shenzhen Woqinfeng Electronics Co., Ltd.Get a Quote 4/8 Led Waterproof Fountain Swimming Pool Disk Light Automatic Light Sensor Outdoor in Ground Solar Garden Light for Yard Lawn View details Intelligent Safety Auto On/Off 66 LED Led Solar Sensor Wall Flame Light for Garden Pathway Patio Deck Yard led parking lot light / area light. led street light / area light. led wallpack. led canopy light. led barn light. 24w solar power street lamp used in garden. accessories. case study. north america. south america. europe. asia. news company news industry news. contact us 1 wei er road, taizhou city, zhejiang province, china 318000.Get a Quote Note: Solar power radiation is a vital factor to determine any specifications in any 6M36W solar street light application and that is why geographical position is requested in order to find out the solar radiation in different cities around the globe. Working Principle of 6M 36W Solar Street LightGet a Quote Only US$19.83, buy best waterproof solar powered 6 led outdoor garden ground path road step light sale online store at wholesale price. rdd providing solar street light outdoor lighting prices harijan wasti pakani tal north solapur dist solapur, due date: 28-08-2020, tender value: 537186, city : grampanchayat pakani tal north solapur solapur, location: maharashtra tender notice 25220738Get …Get a Quote SSL-A IOT all in one solar street light with Carema widely used in Urban road, Country road, Industrial park road, Factory road, Park, Sideway, Pathway. Elegant All-in-one integrated design. 140°wide lighting angle, bring same lighting results with shorter poleGet. Product Title Ktaxon Color Changing Solar Powered LED Night Light Average rating: 3 out of 5 stars, based on 1 reviews 1 ratings Current Price $6.99 $ 6 . 99 List List Price $11.99 $ 11 . 99 buy 1/2pcs 100 leds paradise battery-operated solar garden streetlight 1 outdoor solar powered motion sensor wall light waterproof wall light night light with 3 modes 270deg wide angle for garden, patio yard, deck garage, fence, landscape, courtyard at wish - shopping made funGet a Quote Solar Walkway and Path Lights. Solar lights are an Solarellent and economical way to light up the pathways in your garden and around the exterior of your home. Solar garden lights, outdoor lanterns and strings come in plenty of styles and options so youre bound to … 200w led parking lot lighting 22000lm waterproof daylight white outdoor street area road lighting. led lights,split solar road lamp price in Cameroon,pole lamp,solar panels. total revenue: us$5 million - us$10 million. t31a-4 guoyao street light outdoor led ip67 120 watt led street light street light 150w. country/region: china.Get.Get a Quote Garden Outdoor Solar Powered Pathway Shed Wall Led Light Lamp/outdoor Lighting/solar Light Lamp , Find Complete Details about Garden Outdoor Solar Powered Pathway Shed Wall Led Light Lamp/outdoor Lighting/solar Light Lamp,Outdoor Lighting Solar Light Lamp,Outdoor Lighting,Solar Pathway Lights from Garden Lights Supplier or Manufacturer-Guangzhou Solar Energy Technology …Get a Quote BRELONG Solar Lawn Light Outdoor Waterproof Light Solar Flame Light for Garden Road. $37.98. USD $31.74 (2) Pathway Lights 2pcs White Color 8LED Solar Light Solar Powered Solar Buried Floor Light Outdoor Garden Path Ground Light. $22.67.Get a Quote. high -brightness 60w 8w solar integrated street light qingdao from china manufacturer, manufactory, factory and supplier on ecvv.com yangzhou haide lighting co., ltd. china manufacturer with main products: led lamps, solar street light, traffic singal light, lawn lamp,Get a Quote Cheap Solar Lamps, Buy Quality Lights & Lighting Directly from China Suppliers:Solar Powered Ground Light Waterproof Garden Pathway Deck Lights With 8 LEDs Solar Lamp for Home Yard Driveway Lawn Road Enjoy Free Shipping Worldwide! Limited Time Sale Easy Return.Get a Quote: import quality 2021 solar street light waterproof outdoor supplied by experienced manufacturers at global sources. ip65 outdoor waterproof bridgelux abs smd 60w 100w all in one led solar streetlight. us$ 16 - 19 / piece; 1 piece ce,rohs. inquire now compare. hangzhou comax electric appliance co.,ltd. 1stGet a Quote Overview: Our LED solar light features solar powered, light sensor, IP44 water-resistant and auto on/off, which shines brightly warm yellow with 3 inbuilt LEDs and is ideal for lighting walkways, gardens, yards and landscapes. It only requires first time turn-on then automatically turns on … Mar 04, 2021· 3. GardenBliss Outdoor Solar Pathway Lights – 10 Pack GardenBliss is also considered as the best provider for delivering the high-quality solar-powered lights. Design: This solar garden light features a nice design and it adds beauty to your yard, garden, pathway, and so on.Get a Quote Mr.Solar' ALL IN TWO Solar street light series are dedicated to providing real and continuous high brightness output for high-end projects. Difference from the ALL IN ONE solar street light include: the solar panel of the ALL IN TWO is separated from the solar light head; while the two parts are are connected directly to each other by universal MC4 connectors.Get a Quote 2 days ago Major application if wind and solar street light: Highway ,Main road of city ,school campus road ,sidewalk,pathway,farm& ranches lighting,villa lighting ,landscape lighting -park,square etc.Especially used for those area with good wind energy. led solar street light with led alibaba, ip65 outdoor light, waterproof wall light manufacturer / supplier in china, offering solar street lamps and lightings quezon city manufacturer 8m solar power street lamp/light used for highway 60w led 2021 newest led street lampada solar 250w, ground lamp landscape lighting outdoor waterproof rgb led solar power garden light, wholesale ip65 500mm 750mm 1000mm landscape lamp decorated 15w aluminum body solar outdoor led yardGet a Quote
https://www.ilbriccodicarru.it/3add0f0d543490963839c74811b1bfad
CC-MAIN-2021-39
refinedweb
1,330
52.19
Change Xpresso Object Node Ref with Python On 18/02/2018 at 01:00, xxxxxxxx wrote: Hi i have a scene with a null, a cube and a sphere, that null has a xpresso tag on it and a bunch of user data sliders inside xpresso i made connections between null user data and an object node named "MyObject" referenced to the cube which controls cube's position; is it possible to change that "MyObject" node reference from cube to sphere with a python script? On 19/02/2018 at 08:59, xxxxxxxx wrote: Hi, welcome to the Plugin Café forums Actually you don't need any scripting at all to achieve this. Here's option one to solve it in Xpresso, just by assigning another object to an object node: In order to avoid the above mentioned downside, you can use an object reference node, see here: And then lastly, if you want to do it in Python, there's GvNode.OperatorSetData(), which can be used to assign another object to an object node. The mode to use there is GV_OP_DROP_IN_BODY. On 19/02/2018 at 10:46, xxxxxxxx wrote: Hi Andreas, Thanks! actually switch node is a perfect solution for this example but my real situation is a bit more complicated and i think python is the only way! that GvNode.OperatorSetData() helped me but now i don't know how to use it for that specific node named "MyObject" On 20/02/2018 at 02:31, xxxxxxxx wrote: Hi, so you basically need to get hold of the GvNode "MyObject". There are different ways to achieve this, also depending on where you implement it (in a Python Scripting node or a Script Manager script or ...). The following function should help with this: XPressoTag.GetNodeMaster(), GvNodeMaster.GetRoot() (and from there with the usual GeListNode tools). And then it's just calling OperatorSetData(), roughly like so: myObjNode.OperatorSetData(c4d.GV_ATOM, theOtherObject, c4d.GV_OP_DROP_IN_BODY) On 20/02/2018 at 08:05, xxxxxxxx wrote: Thanks Andreas i finally got it workin' that last step could also be achieved by setting GV_OBJECT_OBJECT_ID directly this is the final code: import c4d def main() : Cube = doc.SearchObject('Cube') Remote = doc.SearchObject('Remote') #user data holder RemoteXP = Remote.GetTag(c4d.Texpresso) RemoteNodes = RemoteXP.GetNodeMaster() Root = RemoteNodes.GetRoot() MyNodes = Root.GetChildren() for child in MyNodes: if child[c4d.ID_BASELIST_NAME] == 'MyObject': child[c4d.GV_OBJECT_OBJECT_ID] = Cube #child.OperatorSetData(c4d.GV_ATOM, Cube, c4d.GV_OP_DROP_IN_BODY) doc.EndUndo() c4d.EventAdd() if __name__=='__main__': main()
https://plugincafe.maxon.net/topic/10643/14091_change-xpresso-object-node-ref-with-python
CC-MAIN-2019-22
refinedweb
413
56.15
Introduction: In today's article we discuss the Merge Sort using Java. Merge Sort The Merge Sort algorithm is based on a divide-and-conquer strategy. Merge Sorting was invented by John von Neumann in 1945. Its worst-case running time has a lower order of growth than an Insertion Sort. Here, we divide the array to be sorted into two halves, sort these two sub-arrays separately, and then combine (merge) these sorted sub-arrays to produce a solution to the original problem. For sorting the sub-arrays, we can use recursion. Since we are dealing with sub-problems, we state each subproblem as sorting a subarray A[p .. r]. Initially, p = 1 and r = n, but these values change as we recurse through sub-problems. In comparison to a Quicksort, the divide part is simple in a Merge Sort while the merging is complex. In addition a Quicksort can work "inline", for example it does not need to create a copy of the collection while a Merge Sort requires a copy. 1. Divide StepIf a given array A has zero elements or one element then it simply returns; it is already sorted. Otherwise, partition the n-element sequence to be sorted into two subsequences of n/2 elements each. 2. Conquer Step Sort the divided subsequences recursively using the Merge Sort. 3. Combine StepCombine or merge the divided sorted subsequences, each to generate the sorted array consisting of n elements. The following procedure shows how the data is sorted in a Merge Sort: Advantages Example public class MregeSortEx { public static void main(String a[]) { //Numbers which are to be sorted int n[] = {124,23,43,12,177,25,2,1,67}; //Displays the numbers before sorting System.out.print("Before sorting, numbers are "); for(int i = 0; i < n.length; i++) { System.out.print(n[i]+" "); } System.out.println(); //Sorting in ascending order using bubble sort initializemergeSort(n,0,n.length-1);; //Displaying the numbers after sorting System.out.print("After sorting, numbers are "); for(int i = 0; i < n.length; i++) { System.out.print(n[i]+" "); } } //This method sorts the input array in asecnding order public static void initializemergeSort(int n[], int l, int h) { int low = l; int high = h; if (low>=high) { return; } int middle=(low+high)/2; initializemergeSort(n,low,middle); initializemergeSort(n,middle+1,high); int end_low=middle; int start_high=middle+1; while ((l<=end_low) && (start_high<=high)) { if (n[low]<n[start_high]) { low++; } else { int Temp=n[start_high]; for (int k=start_high-1;k>=low;k--) { n[k+1]=n[k]; } n[low]=Temp; low++; end_low++; start_high++; } } } } Output View All
http://www.c-sharpcorner.com/UploadFile/fd0172/merge-sort-in-java/
CC-MAIN-2017-51
refinedweb
437
54.93
I ’m making a wake-up app, I ’m a swift beginner I want to be able to set it after checking the volume of the alarm with the slider. Applicable source code I want to be able to set it after checking the volume of the alarm with the slider. I saw the code itself while looking at the site, but the mp3 file does not sound even if I tamper with the slider. Please tell me if it is good. Thanking you in advance. TriedTried import UIKit import AVFoundation class FirstSwitchViewController: UIViewController { var audioPlayer: AVAudioPlayer! var volumeSlider = UISlider () @IBOutlet weak var label: UILabel! @IBAction func back (_ sender: UIBarButtonItem) { self.dismiss (animated: true, completion: nil) } @IBAction func volumeChange (_ sender: UISlider) { let value = round (sender.value * 100)/1 volumeSlider.value = sender.value label.text = "\ (value)" audioPlayer.volume = volumeSlider.value } override func viewDidLoad () { super.viewDidLoad () if let url = Bundle.main.url (forResource: "2", withExtension: ". mp3") { do { audioPlayer = try AVAudioPlayer (contentsOf: url) audioPlayer? .play (atTime: 1 * 10) } catch { audioPlayer = nil } } else { fatalError ("Url is nil") } } } I used this site as a reference - Answer # 1 Related articles - ios - [swift] blue check mark does not appear when selecting a cell in edit mode of uitableview - swift - the check mark of the todo app is removed - [swift] question about how to save the state of each check button placed in each cell in user defaults - Swift uses CoreData to implement a small tool to check in to work - swift zip code check - [swift5] i want to make a strike-through line when i check it - swift - how can i check if a variable is empty in a switch statement? - swift i want to amplify the microphone volume so that it can be heard didn't read the question carefully and answered it, but when I tweaked the volume with the slider, Is it okay to check how much volume you want to play without pressing the play button? If playback is possible, Set @ IBAction's connection destination to UISlider to valueChanged (is it the default?) If you play it, will it make a sound when the value changes (probably when you speak your finger from the round part of the slider)?
https://www.tutorialfor.com/questions-100618.htm
CC-MAIN-2020-40
refinedweb
368
61.06
PIR (Passive Infrared) or Motion Sensor is used to detect the motion of moving human body or objects. Whenever someone comes in the range of PIR sensor, it gives High at its output pin. We have previously interfaced PIR with other Microcontrollers: - Arduino Motion Detector using PIR Sensor - IOT based Raspberry Pi Home Security System with Email Alert - Automatic Staircase Light with AVR - 1 Soldering kit - IC 7805 - 12V Adapter - Buzzer - Connecting wires - Breadboard PIR Sensor: PIR sensor is inexpensive, low-power and easy to use Motion Detections Sesnor. PIR sensor only receives infrared rays, not emits that’s why it’s called passive. PIR sense any change in heat, and if there is a change it gives HIGH at OUTPUT. PIR Sensor also referred as Pyroelectric or IR motion sensor. Every object emits some amount of infrared when heated, similar to that human body emits IR due to body heat. Infrared created by every object because of the friction between air and object. The main component of PIR sensor is Pyroelectric sensor. Along with this, BISS0001 ("Micro Power PIR Motion Detector IC"), some resistors, capacitors and other components used to build PIR sensor. BISS0001 IC take the input from sensor and does processing to make the output pin HIGH or LOW accordingly. Learn more about PIR sensor here. You can also adjust distance sensitivity and time duration for which the output pin will be high once motion is detected. It has two potentiometer knobs to adjust these two parameters. Circuit Diagram PIC Microcontroller: In order to program the PIC microcontroller for interfacing PIR, we will need an IDE (Integrated Development Environment), where the programming takes place. A compiler, where our program gets converted into MCU readable form called HEX files. An IPE (Integrated Programming Environment), which is used to dump our hex file into our PIC MCUs. IDE: MPLABX v3.35 IPE: MPLAB IPE v3.35 Microchip has given all these three software for free. They can be downloaded directly from their official page. I have also provided the link for your convenience. Once downloaded install them on your computer. If you have any problem doing so you can view the Video given at the end. To dump or upload our code into PIC, we will need PICkit 3. The PICkit 3 programmer/debugger is a simple, low-cost in-circuit debugger that is controlled by a PC running MPLAB IDE (v8.20 or greater) software on a Windows platform. The PICkit 3 programmer/debugger is an integral part of the development engineer's tool suite. In addition to this we will also need other hardware like Perf board, Soldering station, PIC ICs, Crystal oscillators, capacitors etc. But we will add them to our list as we progress through our tutorials. We will be programming our PIC16F877A using the ICSP option that is available in our MCU. To burn the code, follow below steps: - Launch the MPLAB IPE. - Connect one end of your PicKit 3 to your PC and other end to your ICSP pins on perf board. - Connect to your PIC device by clicking on the connect button. - Browse for the Blink HEX file and click on Program. If you are new to PIC Microcontroller then first go through below tutorials to learn how to use and program PIC: - Getting started with PIC Microcontroller: Introduction to PIC and MPLABX - Writing Your First Program with PIC Microcontroller and Setting up Configuration Bits - LED Blinking with PIC Microcontroller Code and Explanation First, we need to set the configuration bits in the pic microcontroller and then start with void main function. In the below code, ‘XC.h’ is the header file that contain all the friendly names for the pins and peripherals. Also we have defined crystal oscillator frequency, PIR and Buzzer pins connection in below code. #include <xc.h> #define _XTAL_FREQ 20000000 //Specify the XTAL crystall FREQ #define PIR RC0 #define Buzzer RB2 In the void main (), ‘TRISB=0X00’ is used to instruct the MCU that the PORTB pins are used as OUTPUT, ‘TRISC=0Xff’ is used to instruct the MCU that the PORTB pins are used as INPUT. And ‘PORTB=0X00’ is used to instruct the MCU to make all the OUTPUT of RB3 Low. TRISB=0X00; TRISC=0Xff; PORTB=0X00; //Make all output of RB3 LOW As per the below code, whenever PIR get HIGH the buzzer will get HIGH or else it remain OFF. while(1) //Get into the Infinie While loop { if(PIR ==1){ Buzzer=1; __delay_ms(1000); //Wait } else{ Buzzer=0; } } } Complete Code with a Demo Video is given at the end of this project. Working of PIR Sensor with PIC Microcontroller: This project does not have any complicated hardware setup, we are again using the same PIC Microcontroller board (as shown below) which we have created in LED blinking Tutorial. Simply connect the PIR Sensor Module with your PIC Microcontroller board according to the connection diagram. Once you are done with the connections, simply dump the code using your PicKit 3 programmer as explained in previous tutorial and enjoy your output. After uploading the program, PIR sensor is ready to give OUTPUT. Whenever, a human being or object that emits IR comes in the range of PIR it gives HIGH to the OUTPUT. And, based on that output the buzzer will operate. If PIR output is high buzzer input gets high and vice versa. You can control the distance of sensing and time delay by using two potentiometers fixed on the PIR module. To know more about PIR sensor follows the link. // 'C' source line config statements //) // #pragma config statements should precede project file includes. // Use project enums instead of #define for ON and OFF. #include <xc.h> #define _XTAL_FREQ 20000000 //Specify the XTAL crystall FREQ #define PIR RC0 #define Buzzer RB2 void main() //The main function { TRISB=0X00; //Instruct the MCU that the PORTB pins are used as Output. TRISC=0Xff; //Instruct the MCU that the PORTB pins are used as Input. PORTB=0X00; //Make all output of RB3 LOW while(1) //Get into the Infinie While loop { if(PIR ==1){ Buzzer=1; __delay_ms(1000); //Wait } else{ Buzzer=0; } } }
https://circuitdigest.com/microcontroller-projects/pir-sensor-interfacing-with-pic16f877a
CC-MAIN-2019-35
refinedweb
1,026
62.27
JSF 2.0 Support in NetBeans 6.8 M2 JSF 2.0 Support in NetBeans 6.8 M2 Join the DZone community and get the full member experience.Join For Free Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat. NetBeans 6.8 Milestone 2 provides special support for JavaServer Faces 2.0. The IDE's new JSF 2.0 support builds upon its previous support for JavaServer Faces, and includes versatile editor enhancements for Facelets pages, including syntax highlighting and error checking for JSF tags, documentation support, and code completion for EL expressions, core Facelets libraries and namespaces. There are also various facilities for working with entity classes, and a suite of JSF wizards for common development tasks, such as creating JSF managed beans, Facelets templates and composite components. For more information, see JSF 2.0 Support in NetBeans 6.8. To try out the new features, download NetBeans 6.8 Milestone 2. Download Building Reactive Microservices in Java: Asynchronous and Event-Based Application Design. Brought to you in partnership with Red Hat. Opinions expressed by DZone contributors are their own. {{ parent.title || parent.header.title}} {{ parent.tldr }} {{ parent.linkDescription }}{{ parent.urlSource.name }}
https://dzone.com/articles/jsf-20-support-netbeans-68-m2
CC-MAIN-2019-09
refinedweb
206
51.95
* A friendly place for programming greenhorns! Big Moose Saloon Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies Register / Login Win a copy of JavaScript Promises Essentials this week in the JavaScript forum! JavaRanch » Java Forums » Java » Sockets and Internet Protocols Author ftp using java Stephen Huey Ranch Hand Joined: Jul 15, 2003 Posts: 618 posted Aug 04, 2003 08:22:00 0 I tried searching for relevant posts so as not to waste people's time on here, but the search only turned up stuff from as late as 2001, and it didn't exactly clarify my questions. How does one do simple FTP work in Java ? I just need to download a zip file from a server and check that it's up-to-date by parsing the info given on the HTML page and making sure it matches the info on the file I've downloaded. I think I can do that, plus, I know how to parse stuff, and also know about JTidy, as well as the handy code on this page: As for FTPing, I know about and and I also got a bit of code from this thread: However, that last thread mentioned a package called sun.net.ftp and I assume they meant java.net.ftp since they were talking about doing it in Java, but as far as I can tell, there's no ftp package in java.net, so I'm wondering what's up with that! Should I just be able to use all the classes in the java.net package to do this bit of simple FTPing that I want to do, or do I need to know something else, or should I just use one of the free tools from the other two URLs that I mentioned? I definitely don't want to reinvent the wheel, but if the code is simple enough I would just as soon do it on my own (ftp to a site, get a file, do some checking on it, etc). I'm preferring to do this in Java and then schedule it in a batch file a dozen times per day just b/c I'm used to all the exception/error handling I get in Java. Jerry Kreps Greenhorn Joined: Jun 16, 2003 Posts: 12 posted Aug 04, 2003 13:53:00 0 Hi, Stephen -- I was in your shoes not too long ago, looking for a way to do FTP operations in Java. I do not recommend the sun.net.ftp package. It is not intended for public use and is not documented very well. There are several different ftp tools in Java, but the one that I use is the open source Apache Commons Net package that is really slick. You can download it at this location . Here is a procedure that I wrote that uses this tool to perform ftp file transfers of files in a specified source directory and to rename the source files afterward. As you can see, it is pretty simple. However, in getting it to work I did find that one of the object methods in the package had a bug for which I had to find a work-around. For further info on this, see my thread in this forum. import org.apache.commons.net.ftp.*; . . . public class blah { . . . more blah blah . . . private void ftpFileTransfer(String aFtpIpAddress, String aFtpUserName, String aFtpPassword, String aFtpSourcePath, String aFtpTargetPath, String aFtpSkipFilePrefix) throws GenericException { String ftpIpAddress = aFtpIpAddress; String ftpUserName = aFtpUserName; String ftpPassword = aFtpPassword; String ftpSourcePath = aFtpSourcePath; String ftpTargetPath = aTargetPath; String ftpSkipFilePrefix = aFtpSkipFilePrefix; try { // Make ftp connection to the remote ftp server. FTPClient ftpClient = new FTPClient(); ftpClient.connect(ftpIpAddress); if (!ftpClient.login(ftpUserName, ftpPassword)) { throw new FtpOperationException("FTPClient.login() failed. Invalid UserName/Password."); } // Change the working directory on the remote FTP server to the source // directory that contains the files we want to download. if (!ftpClient.changeWorkingDirectory(ftpSourcePath)) { throw new FtpOperationException("FTPClient.changeWorkingDirectory() failed. Path=" + ftpSourcePath); } // Get an array of String objects that are the names of the files in the // source directory of the remote ftp server. String[] fileNames = ftpClient.listNames(); // If fileNames is null, then an error occurred. if (fileNames == null) { throw new FtpOperationException("FTPClient.listNames() failed. Path=" + ftpSourcePath); } // If fileNames array length is greater than zero, then there are files // in the source directory of the remote ftp server. if (fileNames.length > 0) { for (int i = 0; i < fileNames.length; i++) { // If the file name starts with a predefined prefix then it has // already been transfered before. Skip it. if (fileNames[i].startsWith(ftpSkipFilePrefix)) { continue; } // Create a new local file object and a FileOutputStream object that // will load the data into the new local file. File newFile = new File(ftpTargetPath + File.separator + fileNames[i]); FileOutputStream fos = new FileOutputStream(newFile); // Retrieve the source file on the remote ftp server and copy it // to the new local file. if (!ftpClient.retrieveFile( fileNames[i], fos)) { throw new FtpOperationException("FTPClient.retrieveFile() failed. File=" + ftpSourcePath + File.separator + fileNames[i]); } // Close the FileOutputStream object. fos.close(); fos = null; // Rename the source file on the remote ftp server so that it is // marked as previously retrieved and will not be sent again. We // also add the unique job pk to the prefix so that if other files // are sent with the same name they will not get overwritten. if (!ftpClient.rename( fileNames[i], ftpSkipFilePrefix + jobPK + "_" + fileNames[i])) { throw new FtpOperationException("FTPClient.rename() failed. File=" + fileNames[i]); } } } // Logout and disconnect from the remote ftp server. if (!ftpClient.logout()) { throw new FtpOperationException("FTPClient.logout() failed."); } ftpClient.disconnect(); ftpClient = null; } catch (FtpOperationException ftpE) { JobLog.storeError( "Error - FtpFileTransfer()", ftpE); throw new GenericException(); } catch (Exception e) { JobLog.storeError( "Error - FtpFileTransfer()", e); throw new GenericException(); } } } Hope this helps [ August 04, 2003: Message edited by: Jerry Kreps ] [ August 04, 2003: Message edited by: Jerry Kreps ] [ August 04, 2003: Message edited by: Jerry Kreps ] Pallavi Garga Greenhorn Joined: Jan 03, 2013 Posts: 1 posted Jan 03, 2013 23:55:56 0 Hi, But the above code is giving exception at ftpClient.listName(); Line 46 Exception is Connection closed without indication. Please Help I agree. Here's the link: subject: ftp using java Similar Threads downloading zip files from a site to local disk(urgent please) uploading file to mainframe Hi All RMI access denied client/server FileWriter to send a ftp a file All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter JForum | Paul Wheaton
http://www.coderanch.com/t/205879/sockets/java/ftp-java
CC-MAIN-2014-49
refinedweb
1,072
52.49
#include <MItSubdEdge.h> This class is the iterator for subdiv edges. Constructor. Creates an iterator for all edges of the given subdiv surface. Destructor. Frees up storage used by the iterator. Reset the iterator to the first edge. Advance to the next edge in the iteration. Indicates if all of the edges have been traversed yet. Checks if the iterator is valid. Returns the level of the subdiv object. Sets the level of the subdiv object Returns the index of the current edge in the edge list for this subdiv object. Returns true if the edge is sharp. Marks the edge as sharp. Checks if the edge is a boundary.
http://download.autodesk.com/us/maya/2009help/api/class_m_it_subd_edge.html
CC-MAIN-2017-30
refinedweb
110
70.7
Best quality radial fabrica de pneus MONSTER truck tire made in Dongying W-16B E-2 1300x530-533 bias otr tyre US $10.0-20.0 / Piece 1 Piece (Min. Order) China factory monster truck tire 66x43.00-25 for sale cheap US $105.0-105.0 / Piece 50 Pieces (Min. Order) Special monster truck tires 66X43.00-25 with wide pattern US $126-689.6 / Piece 1 Piece (Min. Order) china top brand monster annaite advance tubeless truck tire 12r22.5 US $120-128 / Piece 200 Pieces (Min. Order) monster truck tire 66x43.00-25 tire+wheel with good price US $50-200 / Piece 10 Pieces (Min. Order) commercial monster truck tyres tires 11r22.5 wholesale for sale US $129.0-200.0 / Piece | Buy Now 1 Piece (Min. Order) 4x4 tyres 265/70R17 35X12.5R20 285/75R16 4WD lakesea mud tyres/ 315/75r16 monster truck tires US $59-159 / Piece 150 Pieces (Min. Order) FORLANDER brand 11R22.5 monster truck tire 66x43.00-25 US $110-130 / Piece 1 Piece (Min. Order) monster truck tyre US $113-116 / Piece 1 Piece (Min. Order) cheap wholesale tires 235/75r15 monster truck tire 66x43.00-25 wholesale china motorcycle inner tube US $90.0-100.0 / Pieces 20 Pieces (Min. Order) tires buy monster truck tire 315/80R22.5 tire prices in US $199-399 / Set 1 Twenty-Foot Container (Min. Order) Tyre manufacturers in china Cheap Mining truck tyre Monster truck tire 66/43-25 1600-25 1800-25 US $806-809 / Piece 50 Pieces (Min. Order) New tyres germany monster truck tire 66x43.00-25 forklift industrial tires 6.50-10-10pr US $1780-1790 / Piece 20 Pieces (Min. Order) tire deutsch monster truck tire 225/70R19.5 KTMD5 US $150-200 / Piece 100 Pieces (Min. Order) Wholesale Good Price Monster Truck Tires For Sale 13r22.5 US $150-155 / Piece 100 Pieces (Min. Order) 100% new 2016 Monster Truck tire 11r22.5 12r22.5 tire TBR Tyre for sale US $101.0-101.0 / Pieces 100 Pieces (Min. Order) high quality monster truck tire 66x43.00-25 66X44.00-25 15.00-21popular specially in USA Canada Europe US $1340-1360 / Piece 22 Pieces (Min. Order) chinese truck tires monster truck tires price US $20-200 / Set 1 Set (Min. Order) new product best chinese brand truck tire 9.00R20 for monster truck tire 66x43.00-25 US $75-130 / Piece 1 Piece (Min. Order) monster truck tire 66x43.00-25 US $1180-1200 / Piece 8 Pieces (Min. Order) import high quality truck tires 295/75r22.5 monster truck tires for sale US $50-180 / Piece 10 Pieces (Min. Order) Cheap Mining truck tyre Monster truck tire 66/43-25 1600-25 1800-25 US $99-3000 / Piece 1 Twenty-Foot Container (Min. Order) Monster Truck Tire 66x43.00-25 for US maket US $850-1200 / Piece 3 Pieces (Min. Order) Hot selling durable 11r22.5 12r22.5 monster truck tires on sale US $10-50 / Piece 200 Pieces (Min. Order) Chinese hot sale radial truck tire for Europe market monster truck tire 66x43.00-25 with EU-label US $50-300 / Piece 1 Twenty-Foot Container (Min. Order) monster high the tractor truck tyres 1200R24 11R22.5 11R24.5 US $100-150 / Piece 1 Twenty-Foot Container (Min. Order) Brand New Chinese Truck Tires 315/70R22.5 315/80R22.5 Monster High Tyres For Scooter US $95-135 / Piece 8 Pieces (Min. Order) technology japan wheel barrow monster truck tyre 435/50R19.5 US $100-106 / Piece 100 Pieces (Min. Order) good quality radial truck monster truck tire 66x43.00-25 US $130-150 / Piece 1 Piece (Min. Order) 288000kms!TIMAX Best Chinese Brand Monster Truck Tire 315/80r22.5, 385/65R22.5 66x43.00-25 US $10-30 / Piece 800 Pieces (Min. Order) china monster truck radial tyre in india US $120-160 / Piece 100 Pieces (Min. Order) China wholesale heavy duty radial monster truck tire 66x43.00-25 US $179-199 / Piece 1 Piece (Min. Order) 2018 Hot sale truck tire 12r24 monster truck tire US $173-241 / Piece 317 Pieces (Min. Order) monster truck tires 66x43.00-25 amphibious vehicles for sale US $500-3000 / Piece 5 Pieces (Min. Order) Chinese Wholesale Commercial Heavy Duty / Light Truck Monster Cheap All Steel Radial Truck Tyre 315/80r22.5 US $150-250 / Piece 200 Pieces (Min. Order) the new monster truck tires for sale US $50-180 / Piece 200 Pieces (Min. Order) china hot sale LIONSTONE OHNICE SAIGETAN monster Truck TBR Tyre 295/80R22.5 with warranty US $70-90 / Piece 250 Pieces (Min. Order) - About product and suppliers: Alibaba.com offers 1,056 monster truck tires products. About 83% of these are truck tire, 3% are radio control toys, and 2% are wheel parts. A wide variety of monster truck tires options are available to you, such as > 255mm, 205 - 225mm, and 235 - 255mm. You can also choose from 21" - 24", 25" - 28", and > 28". As well as from inner tube, solid tire, and tires. And whether monster truck tires is iso9001, dot, or gcc. There are 1,056 monster truck tires suppliers, mainly located in Asia. The top supplying country is China (Mainland), which supply 100% of monster truck tires respectively. Monster truck tires products are most popular in Africa, North America, and Mid East. You can ensure product safety by selecting from certified suppliers, including 111 with ISO9001, 87 with ISO/TS16949, and 43 with Other certification. Buying Request Hub Haven't found the right supplier yet ? Let matching verified suppliers find you. Get Quotation NowFREE Do you want to show monster truck tires or other products of your own company? Display your Products FREE now! Related Category Product Features Supplier Features Supplier Types Recommendation for you related suppliers related Guide related from other country
https://www.alibaba.com/countrysearch/CN/monster-truck-tires.html
CC-MAIN-2018-26
refinedweb
973
79.16
. Any music browser without the ability for one site to link to another without permission from the target site will fail to disintermediate the current trend of walled gardens and “Music CompuServes” like iTunes. In the same way that the web’s promiscuous free forming chaotic linking wiped out most BBS like CompuServe, the music browser concept has to allow and encourage linking between artist’s works without “approved” gatekeepers and registries. Therefore, what would make a good model for the following concepts in a web server: - site - directory - page - media and how would those concepts map to serving of albums? Could these concepts just simply be reused and the clients are left to present the information to the user as they see fit? Obviously the browser could do whatever it wants, but the goal of a good set of site and document structure concepts would make it easier on the implementer of a browser. Based on this, I’m going to go with the existing concepts that URLs pointing at directories of files and media on a server stays. No point in changing that because everyone knows it very well and it works just fine. The only concept that needs to be developed for an album is to replace the “page” with an album model that works for the peculiar social system that makes up most musician’s lives. What’s In It For Everyone? Before I go into what I’ve considered might be a good start at a album document model, I’d like to put forward a reason why a music browser could be beneficial to the artists and music world in general: Advertising to fans to generate revenue. Now, I’m not necessarily talking about a musician doing this. They obviously could, but I’m more talking about a company such as Google being able to now conduct their adwords business on a newly opened realm of the internet. With the current walled garden system, a company like Apple is the only one allowed to advertise, and therefore they can control that revenue stream. They use this special status in their little world to cross market other products they have, just like Amazon does. However, this cross marketing only works to give Amazon and Apple more money, so they have an incentive not to open it up. If they do it must come at a very heavy price. If there’s a wide open, user controlled, promiscuously connected browser taking listeners wherever they want to go, then that opens up advertising revenue to all the established internet players. It also means that artists can see a new stream of revenue for their own publishing, and potentially could use tasteful advertising to fund the free release of their albums. With that in mind, it will probably be important to make sure that any browser developed follows the Netscape and IE model of making sure that users are not snooped on while still providing advertising capabilities to publishers. This means the ability to show interactive content. As you’ll see shortly, that won’t be much of a problem using some nice existing technologies. An Album Is A Social Ontology Who played bass guitar on “What’s Going On” by Marvin Gaye? James Jamerson, but could you name him right away? I hang out with musicians at school, and they can recite back to me who the producer of the third song on an obscure album was, then go through all the guitarists that Steely Dan had. When you pop open a CD and look at an album, you find artwork and sometimes lyrics, but what you always find is credits. You’ll see who did what on the album, the guitars they used, amp brands, studios they recorded in, friends that helped them. Everything about producing music is a social network of people working to make the album sound great (or, like crap). In a model for an album document, I want to make this connection between the players and supporting cast of primary importance. It’s important to the musicians and producers, but when you download an MP3 that information is always missing. You just hear a song, not all the people who went into making it. Another important reason to include capabilities to allow for describing the relationships between the people involved is for improved searching. You could punch in a favorite guitarist and pull up all the albums he worked on, even if he was a session musician. This could lead to you finding out that he plays in your city quite frequently, and therefore bring the “eyeballs” to the artist without an approved eyeball enhancing authority watching over the operations. In short, I believe that being able to craft an album document that mentions all the people involved, and then using a format that makes analyzing that information trivial, will open a huge world for artists, even if they are just on the sidelines. Now, the smart people reading are probably screaming what the perfect technology is for such a task. Well, What About The Semantic Web? Exactly what I was thinking. The semantic web is a set of standards and data formats that allow for machine interpreted and searchable information about the relationships between entities. What if an “album” was just an RDF document in N3, Turtle, or RDF XML that described all the related pieces to make that document? There’s already the Friend Of A Friend which supports many of these concepts. There’s also plenty of other technologies available for processing these documents, analyzing them, querying them, sorting them, and everything else you’d need to do to a large collection of information about connections. In the past, RDF was a nightmare. It was classic XML infinite abstraction, with some of the worst syntax ever. Recently though the W3C has taken its head out of its ass and produced some formats that are actually pleasant to work with such as N3, Turtle, and NTuples. Each has their place, and are probably way harder to use than an average musician could deal with, but they are perfect for the coders putting the stuff together. Now, with the new nicer formats and syntax, and the great libraries for semantic web technologies, it’s possible to just use them directly as the way an album is encoded into a document. Since an album is almost entirely information about people and their roles on the album, the semantic web technologies fit almost perfectly. A Simplistic Python Example The library RDFLib is a decent library for Python that supports all the big technologies the semantic web has. To give an idea of how you can use it, I’ll present a simple bit of code that crafts a stripped down album in Python, and then show the output. This will show you both that the Python is simple, but really the resulting N3 output is actually very nice. from rdflib.Graph import Graph from rdflib import URIRef, Literal, BNode, Namespace from rdflib import RDF store = Graph () 1. Bind a few prefix, namespace pairs. store.bind (“dc”, “["]()) store.bind (”foaf“,”["]()) 1. Create a namespace object for the Friend of a friend namespace. FOAF = Namespace ("["]()) 1. create the album as a project wgo = BNode () store.add ((wgo, RDF.type, FOAF[“Project”])) store.add ((wgo, FOAF[“name”], Literal (“What’s Going On”))) 1. create Marvin Gaye marvin = BNode () store.add ((marvin, RDF.type, FOAF[“Person”])) store.add ((marvin, FOAF[“nick”], Literal (“marvin”))) store.add ((marvin, FOAF[“name”], Literal (“Marvin Gaye”))) 1. connect them store.add ((marvin, FOAF[“pastProject”], wgo)) print store.serialize (format=“pretty-xml”) print store.serialize (format=“n3”) What’s going on here is we grab the information for the FOAF and DC namespaces and then we just construct a FOAF record using the FOAF specification and then we print out a XML and an N3 document. The XML document is just to show you the contrast, but first the very nice N3 output: `@`prefix foaf: <[]()\>. `@`prefix rdf: <[.]()\>. [ a foaf:Person; foaf:name “Marvin Gaye”; foaf:nick “marvin”; foaf:pastProject [ a foaf:Project; foaf:name “What’s Going On”]]. Yes, that’s all there is to it. It pretty much looks like a Smalltalk method call or any number of more modern languages. In fact, I like this syntax so much I’m not even going to bother putting the annoying XML on this page. Once we have that document, we can now pull it up and gather information about this person and the projects he’s worked on. There’s even a SQL-like query language called SPARQL that would let you rip through a store of these. The end result is that we can leverage all this work done on making a machine readable store of related knowledge to do something mundane like say James Jamerson played bass guitar on “What’s Going On”. Next up, an actual complete album done in N3 and how it might be displayed. A key component of this will be including information about time and related media files.
http://zedshaw.com/essays/an_album_is_a_social_ontology.html
CC-MAIN-2014-41
refinedweb
1,522
61.16
Feel free to send your feedback or ask for some help here! ANEO Sponsored Puzzle discussion Hi, thanks for this new puzzle! I think there is a little mistake in the summary, the distances can go over 9999m in some tests! 1 ≤ distance ≤ 9999 Shouldn't the 50% and 100% achievements be combined as for other puzzles? And the link at my last gained XP leads my to my profile rather than to the puzzle (but that seems to happen to all links now). Shouldn't the 50% and 100% achievements be combined as for other puzzles? Yes thanks, I'll take care of that immediately That's right! I fixed it for them. I noticed that the speed is in km/h whereas the lights are measured in meters (distance) and seconds (time). The solutions asks for an integer. I would expect that might cause some issues as 1 km/h is 0.277778 m/s. Could someone verify if that's not the case? So long as you get the second right, it all clicks into place. Overcoming the discrepancy you describe is part of the the puzzle. Hmm. Validators says I have a hardcoded solution. But I honestly write the code. How I can fix that? storing the speed in m/s internally was a bad idea, ran on all sorts of rounding problems speed in km/h and distance in meters and duration in seconds is really bad decision. I've got wrong answer because of pow(10, -16) precision. As soon as I added rount(x, 10) I've passed all tests. I am able to get through all of the tests apart from the last one. Maybe I have some fault in my thinking or my mistake comes when calculating with meters per second (in Double) and also converting it to Integer km/h just at the end. I get as result that it should be working with 24.68 m/s (or 88.848 km/h). Has someone an idea? I've used C++ and worked with float speed (m/s) and the other calculations in int and passed the puzzle with 100% success. Hm okay.. I try the other way around, so I don't post any solutions. Shouldn't this code prove that 24.68 m/s get you through without getting redlights? def proveGreenLight(predictedSpeed): distanceArr = [1234, 2468, 3702, 6170, 8638, 13574, 16042, 20978, 23446, 28382, 35786, 38254, 45658, 50594, 53062, 57998] durationArr = [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5] light_count = 16 for i in range(light_count): # how much time do I have to spend to get to the light secondsToLight = distanceArr[i]/predictedSpeed # calculation if it is a green or red phase period = secondsToLight/durationArr[i] if(int(period) % 2 != 0): return "red" return "green" print(proveGreenLight(24.68)) -> "green" That produces the same output: period is odd: int(period) % 2 -> 1 int(period) % 2 != 0 -> True period is even: int(period) % 2 -> 0 int(period) % 2 != 0 -> False If you can drive precisely at 88.848 km/h, so yes all lights will be green. But are you sure your regulator is precise enough to accept a speed with decimal precision? Okay thats probably the point. 88 or 89 km/h will not get you through without getting redlights. Thanks guys
https://forum.codingame.com/t/aneo-sponsored-puzzle-discussion/42954
CC-MAIN-2018-43
refinedweb
562
74.59
I am not sure about EASI's support of NANs, but this is well supported in Geomatica's Python API, which uses NumPy for custom raster processing. Furthermore, PCI will no longer be updating the EASI language going forward (with exception of supporting new PCI functions in future releases), so it is recommended that you consider switching to python in any case. Here is how you can read in data with nan values in Geomatica's python API: import numpy from pci.api import gobs, cts, datasource as ds # get the path to your .tif image with nan values nan_file = r'D:\example\my_nan_file.tif' # create a reader object with the channels from the input file you want to read in reader = ds.BasicReader(nan_file, [1]) # read the whole file read_raster = reader.read_raster(0, 0, reader.width, reader.height) # get the numpy array with the raster data nan_chan = read_raster.data I hope this helps.
https://support.pcigeomatics.com/hc/en-us/community/posts/203638453-how-does-EASI-handle-nan-in-rasters-
CC-MAIN-2019-22
refinedweb
154
57.37
Syntax: #include <string> char& at( size_type loc ); const char& at( size_type loc ) const; The at() function returns the character in the string at index loc. The at() function is safer than the [] operator, because it won't let you reference items past the end of the string. For example, consider the following code: string s("abcdef"); for( int i = 0; i < 10; i++ ) { cout << "Element " << i << " is " << s[i] << endl; } This code overruns the end of the string, producing potentially dangerous results. The following code would be much safer: string s("abcdef"); for( int i = 0; i < 10; i++ ) { cout << "Element " << i << " is " << s.at(i) << endl; } Instead of attempting to read garbage values from memory, the at() function will realize that it is about to overrun the string and will throw an exception. Related Topics: [] operator
http://www.cppreference.com/wiki/string/at
crawl-002
refinedweb
137
66.27
Web Services is a technology with great promise. The idea that we should be able to build our own custom applications that interact with everything from Google searches, Amazon book-stores, weather forecasts, diaries, travel plans, and more, is of course an exciting notion for us developers. But, a big problem is that the most common way that this is achieved is either by aggregating web services on a server and then delivering an HTML user interface to the user, or to use some development application with a SOAP wizard, which generates a static user interface that interacts with the web service. The problem with both of these solutions is that it sets the bar quite high for playing with web services - you either need a server and all its associated software, or at the very least, you need some expensive development environment. And then there is the bigger problem that any solution you come up with can only be further developed by someone with the same programming environment as you. XForms [1] gets us out of this by offering an open standard language that allows us to interact with web services. Using a non-proprietary language allows us to share solutions without requiring that we all run the same development environment. And more than that, since XForms processors can be built for any platform you can think of, the code produced is incredibly portable. But the final advantage that I think out-weighs all others, is that XForms is a declarative language - it means that we can build and test sophisticated solutions incredibly quickly. In this tutorial, we will build a program that interacts with a weather service in less than 50 lines of mark-up - and that includes stylesheet rules, and no hidden 'code behind'! In short, think of the advantages of the Java virtual machine ... but without the headache. To follow along with this sample, all you really need is a simple text editor, like Notepad, and an XForms processor. I'm using formsPlayer [2] here, since it is a plug-in to Internet Explorer 6, and so makes it very easy to mix ordinary HTML with the form, but you could also try others, such as: In this example, we will access a weather report web service. The service we will use has been mentioned in a few other samples in CodeProject [7, 8] and comes from EJSE [9]. The first thing we will do is create a simple XForm that loads the weather report for zip code 02852 from the web service into a DOM. The form will also show the name of the location and the current forecast. The code for the form is made up of a model and a user interface. The model contains a DOM and an instruction to initialize it with the weather forecast, whilst the UI has a couple of output controls wired up to the general weather forecast and the location that corresponds to the zip code. The first thing we need to do when writing our form is establish all of the namespaces we will need. Obviously, we need one for XForms, but we also need one for XHTML (which is hosting our XForms elements), and one for the weather web service: <?xml version="1.0" encoding="utf-8"?> <html xmlns="" xmlns: Next, we need to load formsPlayer, to process the XForms elements. This step is not required if you are using X-Smiles or the Novell Technology Preview, but since they ignore this tag, it won't hurt - in other words, this form will still be cross-platform: <head> <object id="formsPlayer" classid="CLSID:4D0ABA11-C5F0-4478-991A-375C4B648F58"> formsPlayer has failed to load! Please check your installation. </object> <?import NAMESPACE="xforms" IMPLEMENTATION="#formsPlayer" ?> Now, we can establish the data model. In the data model, we simply have an XML document that is initialized to the result of a request to the weather web service for a nine day weather forecast (using the HTTP GET method): <xforms:model> <xforms:instance </xforms:model> </head> The results from the web service consists of nine elements (one for each day of the weather forecast) preceded by an element that contains information about the location, when the report was last updated, a forecast, and so on: <ExtendedWeatherInfo xmlns=""> <Info> <Location>North Kingstown, RI</Location> ... </Info> <Day1> ... </Day1> <Day2> ... </Day2> . . . <Day9> ... </Day9> </ExtendedWeatherInfo> So that we can establish that everything is working fine, we'll build a simple UI that shows some of the information from the Info block: <body> <xforms:group <xforms:label>Current Conditions</xforms:label> <xforms:output <xforms:label>Location:</xforms:label> </xforms:output> <xforms:output <xforms:label>Forecast:</xforms:label> </xforms:output> </xforms:group> </body> </html> If you have opened the zip files, and installed an XForms processor, then open the document fP-and-weather-ws-step-1.html and you should see something like the following: If you want to play with this simple form before moving on, here is a typical content for the Info element: <Info> <Location>North Kingstown, RI</Location> <IconIndex>-1</IconIndex> <Temprature>69�F</Temprature> <FeelsLike>69�F</FeelsLike> <Forecast>Partly Cloudy</Forecast> <Visibility>6.0 miles</Visibility> <Pressure>29.95 inches and rising</Pressure> <DewPoint>64�F</DewPoint> <UVIndex>0 Low</UVIndex> <Humidity>84%</Humidity> <Wind>From the West at 5 mph</Wind> <ReportedAt>Providence, RI</ReportedAt> <LastUpdated>Wednesday, July 21, 2004, at 6:51 AM Eastern Daylight Time.</LastUpdated> </Info> Change any of the @ref values, or add some new outputs, to see what happens. Before we add any more information, let's make the form a little easier to read. Since XForms builds on other W3C standards, it will be no surprise to you to learn that we can use CSS to style our output. The first thing we'll do is get rid of any margins, and set a default font. We insert the following in the head, after the model element: </xforms:model> <style> html, body { margin: 0px; padding: 0px; } body { font-family: "Trebuchet MS", Verdana, Helvetica, sans-serif; } Next, we create a rule for all group elements: xforms\:group { float: left; border: 3px silver window-inset; padding: 5px; background-color: silver; } Finally, we add some rules for the information from the weather forecast: .location, .forecast { display: block; font-size: xx-small; } </style> </head> We can then use these style names by altering the UI as follows: <xforms:output <xforms:label>Location:</xforms:label> </xforms:output> <xforms:output <xforms:label>Forecast:</xforms:label> </xforms:output> The resulting display will now be: Now that we know our form works, and it's starting to look a little better, let's get the data for the nine day forecast. We'll make use of the XForms repeat element which allows us to specify a template that will be used to render each item in a nodeset, no matter how many items there are. The first thing that we need to specify in our repeat is the list of nodes we want to process. As you saw at the beginning, the elements for the forecast are uniquely named ( Day1, Day2, and so on) so we can't use the element name as the selector. However, each forecast has a child element of Day, so we can use that to uniquely identify our nodeset. Add the following after the closing element of the group: </xforms:group> <xforms:repeat [template goes here] </xforms:repeat> </body> We now have a repeat that will iterate over a nodeset that contains all elements with a child of Day. Next, we need to specify the template that will be used for each of these nodes. A typical entry for the forecast for one day is: <Day1> <Day>Thu</Day> <Date>Jul 22</Date> <IconIndex>30</IconIndex> <Forecast>Partly Cloudy</Forecast> <High>80�</High> <Low>65�</Low> <PrecipChance>20 %</PrecipChance> </Day1> So to get us going - and ensure that our repeat is working OK - let's just output Day. We'll add a twist though - when the user hovers over the Day value, we'll render a hint that is derived from the Date. The repeat template now looks like this: <xforms:repeat <xforms:output <xforms:hint </xforms:output> </xforms:repeat> Note that all XPath statements have a context, and in this example, the context for hint is wr:Day - hence the need for " .." before wr:Date. We also need some style for the class 'day': .location, .forecast { display: block; font-size: xx-small; } .day { color: blue; font-weight: bold; } </STYLE> The form should now look something like this: Now that we are sure everything is working, we can modify the repeat template as much as we like. We're not restricted to just echoing data from the instance document with @ref, though. In the next snippet, we can see how we can use @value on output to call functions, and so concatenate two strings together - the low and high temperature values: <xforms:repeat <xforms:output <xforms:hint </xforms:output> <xforms:output </xforms:repeat> The associated stylesheet changes are: .day { color: blue; font-weight: bold; display: block; } .tempRange { font-size: smaller; } With the temperature range added, the form should look like this: The final step in this short tutorial is to show an image associated with the forecast. XForms 1 .0 does not support the rendering of images based on instance data, but this will be included in the forthcoming XForms 1.1. However, formsPlayer does provide a mechanism to do this, which is to use nested mark-up. We'll use that feature here, mindful of the fact that we'll need to change this in the future, when a platform-independent way of specifying images becomes available. As before, the location of the mark-up is in the repeat template. This time we are going to use the IconIndex element from the web service data, and build up an HTML img element with a URL that refers to an image on the EJSE web service server. Our template should now look like this: <xforms:repeat <xforms:output <xforms:hint </xforms:output> <xforms:output' )" > Note that we have also added a hint, so that hovering over the image gives us the forecast. We need to add a further style rule to make our image a 'block', and whilst we're editing the CSS, let's factor a little: .day, .location, .forecast, .image { display: block; } .location, .forecast { font-size: xx-small; } .day { color: blue; font-weight: bold; } We also need to add a rule to control the style of each item within the repeat. This is addressed in XForms using a pseudo-class called repeat-item, although formsPlayer implements this using ordinary class names - but there is no harm in having both formats in the style rules. We'll also make the group used for 'today' have the same style as repeat-items: ::repeat-item, .repeat-item, xforms\:group { float: left; border: 3px silver window-inset; padding: 5px; width: 80px; height: 140px; background-color: white; text-align: center; } Our display should now look like this: One additional step is formsPlayer specific, but involves customizing the branding for the forms in your project. This is easily achieved with an extra attribute on model, which points to a configuration file, which in turn contains information about the splash-page and form-control icons that you want to use. The file is encrypted and will only work with specific URLs, and is obtained when licensing formsPlayer [10]. Note that this does not alter the behavior of formsPlayer, and forms such as the one demonstrated in this article will work on formsPlayer with or without a license. This makes it a great platform for developing web service -based applications. If you do purchase a license, you may find that during testing, you'll want to avoid having to repeatedly deploy your application to a web server. An alternative is to obtain a fully licensed version of XFormation [11], which allows full control over the branding used by formsPlayer. In the following screen-shot, we can see XFormation rendering the form we have just completed, but with no branding: If an application or form has a strong dependency on XML - such as those using web services - then XForms is the language of choice. Its declarative syntax makes it easy to build, test, and deploy applications, many times faster than traditional techniques. And as more XForms processors are developed for more platforms, any application and form you develop now will be able to run in an ever increasing number of environments. General News Question Answer Joke Rant Admin
http://www.codeproject.com/KB/HTML/fP-and-weather-ws.aspx
crawl-002
refinedweb
2,106
54.15
Hey, guys, Thanks for the AMA. GitLab has over 150+ people working remotely. So my question is can you give any tips/advice for working remotely? I think there are two tricks to making it work: Working asynchronously: write everything down and avoid creating bottlenecks. You want everyone to always be able to continue with their work. So if you write everything down (such as we do in our handbook at about.gitlab.com/handbook), people can consult that instead of having to rely of tribal knowledge. Realizing that working remotely requires work: It's a very different way of working and you have to actively think about how to communicate, how to build teams, etc. So instead of relying on those micro-communications you have when you're together in the office (e.g. 'watercooler talk'), you have to create opportunities to bond and share. Working remotely means not doing the exact same things but separated by more air, it means working differently so everyone can be more productive and have a more flexible life. I wrote quite a bit about this, see also here: I 100% agree with what Job said in his response. From my side I can add only minor tips: - Push code frequently, write status update in the issue tracker daily etc. It helps your colleagues know what you are working on without any direct communication. - Provide an async way for colleagues to book meetings with you. For example I use "calendly" tool which allows people book events in my calendar on free time. - Measure your results, not time spent. If you are doing very well, reward yourself with some free time. Today most open source projects are being hosted on GitHub. What are GitLab's initiative to encourage more developers to use GitLab for their open source projects? We believe that by building a product that allows everyone to easily and quickly build, test, deploy and monitor their applications, people will slowly move their open source work to GitLab. We also realise that many people want the largest set of eyes on their open source work, so we allow you mirror your repositories between GitLab and GitHub automatically. Lastly, we offer all our features (CE, EES, EEP) and completely free CI to all open source projects. That means you can use GitLab.com for any stage in building, testing and deploying any open source project. Talking about the product, I think our biggest advantage here is an integrated product that does more compared to GitHub. For example, powerful CI/CD out of the box. You create the project at GitLab.com and you receive not only code hosting and issue tracker but also CI, container registry, auto deploy etc. Company wise we are doing our best to help popular open source projects migrate from old systems to GitLab. I hope to see more of them join us in nearest future. This should encourage developers use GitLab for their next open source project. Also if you use GitLab for your private projects it seems convenient to continue using same platform for open source projects too. I expect us get most of popularity among private projects first. As result it should increase amount of public projects later. GitLab started using Vue and how is it working out for you now? I'd say it's working out really well. We've been building new things in Vue and slowly replacing existing components with Vue. It has allowed us to iterate faster and reuse more. One of our FE engineers gave a talk about how we use Vue recently, it also links to a whole bunch of other things we've written about it. Check it out here: Our frontend engineers love it. We started with using it only for new features and then slowly replace existing components. Working well so far! :) I have to say, the way you fought your downtime with full transparency in February this year was amazing. So, this is my question for you. Just like how buildings have mock fire drills, do you think programmers should simulate failures? Let's face it, downtime is bad and no one wants it. That being said, one should be prepared to handle it. A team of engineers can take the test environment down and another team will try to bring it back up. So, when production actually goes down (god forbid), the engineers will be acclimatized to handling it in a nice way. Interesting question! I think any piece of critical infrastructure should be either resilient against failures or easily brought up again. In practice, I wonder if anyone does this against their test instance. In my experience, test instances are brought down involuntary frequently enough that people are comfortable bringing it up again 😅 I do think it's important that every environment is well-instrumented and alerts go out if anything is off. That's interesting idea around having 2 teams fighting for test env. I think if your test environment is quite stable you should definitely try that. Otherwise, you probably have it failing on regular basis. I think we (not only GitLab but any infrastructure team) should definitely practice recovery on regular basis. Somehow we manage to forget about it until someone accidentally does rm -rf in the wrong terminal :) You are one of the most transparent companies that I have seen. In your opinion how important is it for companies today to be transparent to their users? I think being open is the most user-friendly thing you can do. Now your users can hold you accountable. It forces you to be honest at all times, treat your users more fairly and when you do - you find that your users are more understanding and helpful as well. Not many companies are transparent, but if you are in the position to be more open with your own company, I think that can be a unique advantage. I think it's important because it benefits both users and the company. Why transparency is great: - It's appreciated by users. - Users can actually help you. There were cases when technical users gave us valuable advice to help with our problem. - It also appreciated by employees. No hidden processes, no need to ask around to get answer on basic questions about company processes. - It's appreciated by candidates. People know almost everything about company before first interview - When everything is public its simple to keep in mind what information is not. Hi, Dmitriy, Thanks for the AMA. People might have asked you this question thousands of times previously, but I want to hear your opinion on it. Why should a developer (not so famous) choose to go with GitLab instead of GitHub in 2017? GitHub has many users today, so the chances of getting more visibility are definitely higher if they opted to go with GitHub. - If you need to store private projects, GitLab seems like a good place to do so (unlimited private projects) - If you want fully integrated development. Code hosting, build docker image, store it, test code, deploy it etc. We still have the long road ahead to achieve good visibility in sense of public projects compared to GitHub. But it's getting better year over year. If still in doubt - you can do development on one platform and mirror to another (GitLab.com has nice mirror feature) to achieve both rich functionality and public visibility. I'd say for you to use the tool where you get things done the quickest (GitLab) and just mirror your repository to GitHub (or BB) if you want the most visibility. GitLab is not just for hosting your code. It has a very powerful issue tracker, and full CI/CD built-in. That means you can test, deploy in the same place as you have your code. And that saves so much time and effort. It's also completely free for open source projects (everything), CI/CD included. You can even use our Docker Registry to host your Docker images. Have a look at our comparisons () or even better - give it a try! would you like to prioritize bugs / feature completeness over implementing more and more Enterprise stuff in future? We just want to build a great product. That means fixing bugs and regressions is among our highest priorities, together with building features that our users want and need. Some of those features will land in our Enterprise Editions, of course. But many others will go towards improving Community Edition. Ultimately, we want that anyone that uses GitLab can ship cool stuff, quickly and easily. Independent of which version you use. If you are a big organisation or have similar needs, that'll be easier with Enterprise Edition. But we never choose between fixing bugs and introducing more features. If GitLab was full of bugs every release, there wouldn't be a point for building new features! I think we should do both in order to be a successful company. The more successful Enterprise version is the more resources we can allocate toward product in general. Which leads to better general quality, less bugs and more features for both Community Edition and Enterprise Editions. Hi GitLab, What do you look for in new hires? Thanks for doing the AMA! Of course that strongly depends on the role someone is applying for, but as a remote company there are a few characteristics that help a lot: - ability to work independently: depending on how you organise your time, you might be spending a lot of time working by yourself and having to make decisions without getting direct answers from other people. - great communication/writing skills: you'll be writing a lot! Anything that isn't written down gets lost between timezones and the absence of an office. Great writing skills make that you can easily translate your thoughts into words. We're hiring for a lot of roles and each role has an elaborate job description. Feel free to have a look and apply if you're interested in a particular role: I have one more question for you guys. I believe competition is a very nice thing and it keeps you on your toes. And as an end user, it gives me a variety of options, so everyone's happy. I actually use GitHub, BitBucket and Gitlab, and I love all of them. What would you say are your favorite things about your competition (I would assume, that's GitHub or BitBucket)? GitHub is responsible for making Git the version control system of choice, if they'd be MercurialHub, maybe we'd all be using that now instead. We actually hosted the GitLab repository on GitHub.com before we created GitLab.com, so we're happy that GitHub exists! There is no animosity between GL, GH, BB. We often see each other on conferences and even appear on each other's conferences occasionally. I'm super happy to work in an industry where competitors can treat each other with such respect. Hey guys, thx for the AMA. What is a long-term mission of the gitlab in front of competitors? Any plans to go beyond development platform? Cheers Dmitriy from the former coworker ;) Hi, Our long-term vision is to become the most popular collaboration tool for knowledge workers in any industry. But first, we need to become #1 platform for developers. Which is quite a huge goal considering our scope: from chat and code hosting to CI/CD and monitoring of a deployed applications. Cheers from Kharkiv :) Thanks for building a great product! I love your ideology around CI/CD (Auto devops, Review Apps). Also, the fact that you're the poster child for distributed teams is incredible. I wanted to ask what tools do you use on a daily basis to ensure that everyone on the team is on the same page? Do timezones play havoc in daily sync-ups or meetings in general? We use GitLab for almost everything, but also use: - Calendly to schedule meetings - the Google suite of tools - Slack - Zoom for meetings and webcasts We have no choice but to deal with timezones daily, so we make it work. Working asynchronously makes that you don't need to have everyone present in every meeting, so we often have meetings that work for maybe 2/3 of the world (morning in place A, end of day in place B) and make sure whomever can't attend knows where to read up. I think the key to timezone problem in meeting, as well as any attendance problem, is to write everything down. Then no matter if you can't attend because of time difference or for other reason, you can always read it later. Thanks for hosting this AMA. GitLab is awesome, why do you think many popular open source repositories are not on GitLab today? What are the initiatives you are taking to deal with the elephant in the room? Someone else asked the same question, which both DZ and I answered here: We're actually seeing a lot of open source projects moving to GitLab. Some times on their own instance, some times on GitLab.com. But we're still a magnitude smaller than GH when it comes to open source projects on GitLab.com. We believe it's a matter of time. GH has been around for a very long time and gets the most eyes still. And we understand that, so we've made it easy for you to mirror your repository between GH and GitLab.com. We're making sure that GitLab.com is becoming more stable and much faster. By building the best possible place for someone to build and ship software, we believe it's a matter of time before more open source projects will move to GitLab. Firstly, I must say that I admire your transparency policy in GitLab. It serves as a great source of inspiration for me in my work. However, now I'm using GitLab on a daily basis, and when I see information about downtimes or some issues, it makes me sad. It's because I know that with high probability my work routine will be affected by those failures. So here is my question: in your opinion, what is better for a product or a company – be transparent and let people see that nobody's perfect or make an impression of being reliable and trustworthy? GitLab.com is not stable enough yet, but we're working hard on improving that. Most of our customers run GitLab on their own infrastructure, where this isn't a problem, as GitLab.com is several factors larger than any customers' instance. Trying to give off the impression that your service is reliable while it's clearly not is not inspiring confidence. It's better to be transparent and communicate what you're doing to resolve the issues with reliability. Why did the Gitlab Team choose Ruby for development? GitLab started as the weekend hobby. Ruby was my favorite language back in 2011. I wanted to make something useful and practice my skills at the same time. Thanks to Ruby and Rails I was able to release the first version within a month. To add to DZ: Today we continue to use Ruby, as it allows us to iterate very quickly. We also use Go for specific pieces in the backend and of course plenty of Javascript on the frontend. Hi GitLab, thank you for hosting an AMA! Lot of love to you guys for the work you have put in the community edition. ❤️ Right now CE is available to host on Linux distributions. Do you have any plans for macOS and Windows? Are there any technical bottlenecks that are stopping you to ship the CE to be hosted on these OSes? Thank you for kind words. GitLab can run on macOS (I do development on it for years without any VM). But Windows is the problem. Most of our dependencies are quite Linux/Unix specific and until those are ported to Windows it's unlikely we can run server code on it. There is no real reason to host GitLab on macOS or Windows. You can run GitLab Runner on both platforms, so testing, building, deploying etc all works for everyone! Installing and maintaining GitLab is ridiculously easy: it's never been a reason to not adopt GitLab! For all the way to deploy, see: GitLab's dev kit does work on macOS (and I believe even Windows). First of all, thank you guys for this AMA. I'm interested in designing UI/UX for complex system like GitLab. How do you share ideas and make design decisions? Through any channel we have and with a combination of intuition, research and experience. On of our UX'ers wrote a long article on how we redesigned the navigation, there's a lot more there: We do everything in issues and design is not an exception. When we have idea we create an issue and then someone from UX team comes up with screenshot/mockup of it. Mockups and feedback are posted as comments in the issue. It continues up until approval either from product person or other designer. In the end we have issue with description of what should be done and final screenshot attached. There is also UX channel in Slack where UX team discuss new techniques and approaches. Hi people, you team made a really nice job! I want to ask something kinda particular, but do you guys see GitLab's position at market as a David against a Goliath at the opensource? I asked because opensource software is mainly at GitHub. Codeplex is closed, so is Google Code and maybe SourceForge is going to the same direction. I just see you and Atlassian working a viable alternative, and mainly being used by closed source projects. A little bit! When we were only 5-6 people, our competitors already had teams in the hundreds. Today, we're so lucky that GitLab is well funded and over 180+ people strong. In terms of our product, I think it quickly became clear to us that an integrated product was a massive advantage. We only integrated CI a few years ago and today we were rated as top tool in a comparison with leading CI products in both current offering and strategy by Forrester. So in terms of size: yes! But I think our product is the strongest 😁 We'll catch up. We have a good, feature rich, integrated product. We started as self-hosted product and we have a leading position here now. Next step is making GitLab.com a most popular SAAS for private projects and then we go for public one. Of course, it won't happen in a day. We need to put a lot of efforts to make GitLab.com as stable and performant as we want. But I am quite confident in it. I just created a fresh GCP cluster, successfully linked it to my gitlab.com project settings (under Kubernetes integrations) and now I'm a bit confused by a failing "staging" job that returns Unable to connect to the server: x509: certificate signed by unknown authority ERROR: Job failed: exit code 1. Btw, I'm following this tutorial () and I can't go past editing the.gitlab-ci.yml config file KUBE_DOMAIN value which is the IP of my Kubernetes master. Any reaction is most welcome. And yes I did a kubectl describe -o yaml and copied the ca.crt and token values into the appropriate fields. Sounds like a problem with the certificate authority. I don't think this is the best place to try to resolve you issues, as we don't have the ability to easily follow up. Can you create an issue in our issue tracker? Hey, probably certificate issue. Maybe badly copied credentials from GCP. Btw take a look at quick start guide I made for GKE + GitLab.com. I tested it several times to confirm it works. Hey @Job, I'm working with the default ca.crt PEM in secrets. Is it self-signed? If yes, is that why staging is rejected? I don't mind filing an issue, but I also want to take this opportunity to have a real one-on-one on this live AMA. Hey @Dmitriy... before I make another attempt, I gotta let you understand that GCP is deprecating the Kubernetes dashboard. So I access my secrets using kubectl CLI kubectl describe secret/<default-secret> -o yaml. How badly copied can it be? @Job and @Dmitriy, after looking into issues on gitlab, kubernetes, and GCP online, I found out that after entering http://<cluster-IP>/ui in the browser it automatically resolves to https://<cluster-IP>/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy... And that's the error (at least for me). The fix is to edit the "proxy" at the end and place it here https://<cluster-IP>/api/v1/proxy /namespaces/kube-system/services/kubernetes-dashboard/. In a few words that's how I got it to work. After I was able to copy the ca.crt and token into my gitlab configuration. I can now breathe a little -staging passed, yay!... but I can't open the staging URL 😒. I guess I gotta figure out how to access the pods in the browser. From gitlab.com I am able to make a few edits from the staging terminal, but I can't temporarily view them in the browser using the generated URL. Any pointers? Does GitLab have open salaries? If not, are you considering to do it soon? No and we don't plan to make them open. We believe that is private, personal information. However, we base our salaries on a calculator that is open. You can view the one for developers here, for example: We do a lot of work to update that calculator regularly and actively listen to any feedback. According to you what are main advantages of Gitlab over Bitbucket (Stash) server? With GitLab you can actually go from idea all the way to production, quickly and easily. You don't need to set up and use external integrations and have a powerful issue tracker, CI/CD, wikis, and much more. For instance, to deploy and monitor a simple app, all you have to do is enable AutoDevops in your project and GitLab will take care of the rest. It's very powerful, see the video here: If you still want to use your own tools, like JIRA, GitLab integrates really well with them. And lastly, GitLab is improving every single month with large jumps. We just renewed our navigation and it's now super easy and quick to jump between your projects and groups. I have recently been proofing out a Netlify automatic deploy (JAMStack) project using the API and (oAuth). Do you have any active discussions going on with the JAMStack community on supporting the API going forward? Specifically provider companies like Netlify. By the way, the proof of concept went well so far. Hosting a couple sites from Netlify with automatic deploys from GitLab! I had a quick search and not that I'm aware, but anyone can make an issue on our issue tracker to suggest it - or even contribute it! Would love to hear more what you'd need. Feel free to create an issue on The build runner that can be run on our servers is the main feature why we use gitlab. Most competitors are lacking this. Do you plan to kill it and move to managed builds at some point? No. We'll never take that away. We realise it's a big strength of GitLab. We already offer shared runners to build/test/deploy your code. They are free for open source projects and private projects have a limit in build minutes, which can be expanded through our subscriptions for GitLab.com (). Most of our customers run their own instance on their own infrastructure and they should be able to use GitLab to its fullest as well. So we make sure they can use GitLab Runner no matter what or where. No way. This is one of my favorite features in CI architecture. It stays for long. P.S. Glad you like it :) First of all thank you guys for this AMA! Would you consider an "on-demand" plan? Eg. per pipeline minute, per feature per month, etc. For users (like me) who just need 1 or 2 features in silver/gold plan package. And, what about "codeowners"? Is it on your plan? It's not a smart move on our part to charge you per-feature, because that makes it hard to create an integrate experience and give you powers you never knew you needed! We might introduce per-X billing in the future for pipeline minutes or additional storage. Yes, I do hope to bring code owners to GitLab in the near future! I don't think we'll ship it this year, but I can imagine it somewhere next year. Issue for it here: Hi Guys, thanks for the AMA. Who is your perfect customer? There is nothing more important to us than feedback. A customer that uses GitLab and provides us feedback is 🚀 What I've personally really enjoyed is getting customers with new use cases or a new scale. Today there are teams of 1 and teams of 30,000 using GitLab intensively. That is exciting. We love them all. They contribute to product in many ways, from feedback and bug report to actual feature contributions. Yeah, that's a cool thing: customers contributing code. That only happens in a company like GitLab and make the product 1000x better.
https://hashnode.com/ama/with-gitlab-cj7uu549m01pq2qwurkkssz6k
CC-MAIN-2017-43
refinedweb
4,316
73.88
Are you tired with the same old 2D plots? Do you want to take your plots to the next level? Well look no further, it’s time to learn how to make 3D plots in matplotlib. In addition to import matplotlib.pyplot as plt and calling plt.show(), to create a 3D plot in matplotlib, you need to: - Import the Axes3Dobject - Initialize your Figureand Axes3Dobjects - Get some 3D data - Plot it using Axesnotation and standard function calls # 3D data X = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] Y = [2, 5, 8, 2, 10, 1, 10, 5, 7, 8] Z = [6, 3, 9, 6, 3, 2, 3, 10, 2, 4] # Plot using Axes notation and standard function calls ax.plot(X, Y, Z) plt.show() Awesome! You’ve just created your first 3D plot! Don’t worry if that was a bit fast, let’s dive into a more detailed example. Try it yourself with our interactive Python shell. Just execute the code and look at the generated “plot.png” file: Related article: Matplotlib 3D Plot Example If you are used to plotting with Figure and Axes notation, making 3D plots in matplotlib is almost identical to creating 2D ones. If you are not comfortable with Figure and Axes plotting notation, check out this article to help you. Besides the standard import matplotlib.pyplot as plt, you must also from mpl_toolkits.mplot3d import axes3d. This imports a 3D Axes object on which a) you can plot 3D data and b) you will make all your plot calls with respect to. You set up your Figure in the standard way fig = plt.figure() And add a subplots to that figure using the standard fig.add_subplot() method. If you just want a single Axes, pass 111 to indicate it’s 1 row, 1 column and you are selecting the 1st one. Then you need to pass projection='3d' which tells matplotlib it is a 3D plot. From now on everything is (almost) the same as 2D plotting. All the functions you know and love such as ax.plot() and ax.scatter() accept the same keyword arguments but they now also accept three positional arguments – X, Y and Z. In some ways 3D plots are more natural for us to work with since we live in a 3D world. On the other hand, they are more complicated since we are so used to 2D plots. One amazing feature of Jupyter Notebooks is the magic command %matplotlib notebook which, if ran at the top of your notebook, draws all your plots in an interactive window. You can change the orientation by clicking and dragging (right click and drag to zoom in) which can really help to understand your data. As this is a static blog post, all of my plots will be static but I encourage you to play around in your own Jupyter or IPython environment. Related article: Matplotlib 3D Plot Line Plot Here’s an example of the power of 3D line plots utilizing all the info above. # Standard imports import matplotlib.pyplot as plt import numpy as np # Import 3D Axes from mpl_toolkits.mplot3d import axes3d # Set up Figure and 3D Axes fig = plt.figure() ax = fig.add_subplot(111, projection='3d') # Create space of numbers for cos and sin to be applied to theta = np.linspace(-12, 12, 200) x = np.sin(theta) y = np.cos(theta) # Create z space the same size as theta z = np.linspace(-2, 2, 200) ax.plot(x, y, z) plt.show() To avoid repetition, I won’t explain the points I have already made above about imports and setting up the Figure and Axes objects. I created the variable theta using np.linspace which returns an array of 200 numbers between -12 and 12 that are equally spaced out i.e. there is a linear distance between them all. I passed this to np.sin() and np.cos() and saved them in variables x and y. If you just plotted x and y now, you would get a circle. To get some up/down movement, you need to modify the z-axis. So, I used np.linspace again to create a list of 200 numbers equally spaced out between -2 and 2 which can be seen by looking at the z-axis (the vertical one). Note: if you choose a smaller number of values for np.linspace the plot is not as smooth. For this plot, I set the third argument of np.linspace to 25 instead of 200. Clearly, this plot is much less smooth than the original and hopefully gives you an understanding of what is happening under the hood with these plots. 3D plots can seem daunting at first so my best advice is to go through the code line by line. Matplotlib 3D Plot Scatter Creating a scatter plot is exactly the same as making a line plot but you call ax.scatter instead. Here’s a cool plot that I adapted from this video. If you sample a normal distribution and create a 3D plot from it, you get a ball of points with the majority focused around the center and less and less the further from the center you go. import random random.seed(1) # Create 3 samples from normal distribution with mean and standard deviation of 1 x = [random.normalvariate(1, 1) for _ in range(400)] y = [random.normalvariate(1, 1) for _ in range(400)] z = [random.normalvariate(1, 1) for _ in range(400)] # Set up Figure and Axes fig = plt.figure() ax = fig.add_subplot(111, projection='3d') # Plot ax.scatter(x, y, z) plt.show() First, I imported the python random module and set the seed so that you can reproduce my results. Next, I used three list comprehensions to create 3 x 400 samples of a normal distribution using the random.normalvariate() function. Then I set up the Figure and Axes as normal and made my plot by calling ax.scatter(). fig = plt.figure() ax = fig.add_subplot(111, projection='3d') ax.scatter(X, Y, Z) plt.show() In this example, I plotted the same X, Y and Z lists as in the very first example. I want to highlight to you that some of the points are darker and some are more transparent – this indicates depth. The ones that are darker in color are in the foreground and those further back are more see-through. If you plot this in IPython or an interactive Jupyter Notebook window and you rotate the plot, you will see that the transparency of each point changes as you rotate. Matplotlib 3D Plot Rotate The easiest way to rotate 3D plots is to have them appear in an interactive window by using the Jupyter magic command %matplotlib notebook or using IPython (which always displays plots in interactive windows). This lets you manually rotate them by clicking and dragging. If you right-click and move the mouse, you will zoom in and out of the plot. To save a static version of the plot, click the save icon. It is possible to rotate plots and even create animations via code but that is out of the scope of this article. Matplotlib 3D Plot Axis Labels Setting axis labels for 3D plots is identical for 2D plots except now there is a third axis – the z-axis – you can label. You have 2 options: - Use the ax.set_xlabel(), ax.set_ylabel()and ax.set_zlabel()methods, or - Use the ax.set()method and pass it the keyword arguments xlabel, ylabeland zlabel. Here is an example using the first method. fig = plt.figure() ax = fig.add_subplot(111, projection='3d') ax.scatter(X, Y, Z) # Method 1 ax.set_xlabel('X axis') ax.set_ylabel('Y axis') ax.set_zlabel('Z axis') plt.show() Now each axis is labeled as expected. You may notice that the axis labels are not particularly visible using the default settings. You can solve this by manually increasing the size of the Figure with the figsize argument in your plt.figure() call. One thing I don’t like about method 1 is that it takes up 3 lines of code and they are boring to type. So, I much prefer method 2. # Set Figure to be 8 inches wide and 6 inches tall fig = plt.figure(figsize=(8, 6)) ax = fig.add_subplot(111, projection='3d') ax.scatter(X, Y, Z) # Method 2 - set all labels in one line of code! ax.set(xlabel='X axis', ylabel='Y axis', zlabel='Z axis') plt.show() Much better! Firstly, because you increased the size of the Figure, all the axis labels are clearly visible. Plus, it only took you one line of code to label them all. In general, if you ever use a ax.set_<something>() method in matplotlib, it can be written as ax.set(<something>=) instead. This saves you space and is nicer to type, especially if you want to make numerous modifications to the graph such as also adding a title. Matplotlib 3D Plot Legend You add legends to 3D plots in the exact same way you add legends to any other plots. Use the label keyword argument and then call ax.legend() at the end. import random random.seed(1) fig = plt.figure() ax = fig.add_subplot(111, projection='3d') # Plot and label original data ax.scatter(X, Y, Z, label='First Plot') # Randomly re-order the data for data in [X, Y, Z]: random.shuffle(data) # Plot and label re-ordered data ax.scatter(X, Y, Z, label='Second Plot') ax.legend(loc='upper left') plt.show() In this example, I first set the random seed to 1 so that you can reproduce the same results as me. I set up the Figure and Axes as expected, made my first 3D plot using X, Y and Z and labeled it with the label keyword argument and an appropriate string. To save me from manually creating a brand new dataset, I thought it would be a good idea to make use of the data I already had. So, I applied the random.shuffle() function to each of X, Y and Z which mixes the values of the lists in place. So, calling ax.plot() the second time, plotted the same numbers but in a different order, thus producing a different looking plot. Finally, I labeled the second plot and called ax.legend(loc='upper left') to display a legend in the upper left corner of the plot. All the usual things you can do with legends are still possible for 3D plots. If you want to learn more than these basic steps, check out my comprehensive guide to legends in matplotlib. Note: If you run the above code again, you will get a different looking plot. This is because you will start with the shuffled X, Y and Z lists rather than the originals you created further up inb the post. Matplotlib 3D Plot Background Color There are two backgrounds you can modify in matplotlib – the Figure and the Axes background. Both can be set using either the .set_facecolor('color') or the .set(facecolor='color') methods. Hopefully, you know by now that I much prefer the second method over the first! Here’s an example where I set the Figure background color to green and the Axes background color to red. fig = plt.figure(figsize=(8, 6)) ax = fig.add_subplot(111, projection='3d') ax.plot(X, Y, Z) # Axes color is red ax.set(facecolor='r') # Figure color is green fig.set(facecolor='g') plt.show() The first three lines are the same as a simple line plot. Then I called ax.set(facecolor='r') to set the Axes color to red and fig.set(facecolor='g') to set the Figure color to green. In an example with one Axes, it looks a bit odd to set the Figure and Axes colors separately. If you have more than one Axes object, it looks much better. # Set up Figure and Axes in one function call fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(8, 6), subplot_kw=dict(projection='3d')) colors = ['r', 'g', 'y', 'b'] # iterate over colors and all Axes objects for c, ax in zip(colors, axes.flat): ax.plot(X, Y, Z) # Set Axes color ax.set(facecolor=c) # Set Figure color fig.set(facecolor='pink') plt.show() In this example, I used plt.subplots() to set up an 8×6 inch Figure containing four 3D Axes objects in a 2×2 grid. The subplot_kw argument accepts a dictionary of values and these are passed to add_subplot to make each Axes object. For more info on using plt.subplots() check out my article. Then I created the list colors containing 4 matplotlib color strings. After that, I used a for loop to iterate over colors and axes.flat. In order to iterate over colors and axes together, they need to be the same shape. There are several ways to do this but using the .flat attribute works well in this case. Finally, I made the same plot on each Axes and set the facecolors. It is clear now why setting a Figure color can be more useful if you create subplots – there is more space for the color to shine through. Conclusion That’s it, you now know the basics of creating 3D plots in matplotlib! You’ve learned the necessary imports you need and also how to set up your Figure and Axes objects to be 3D. You’ve looked at examples of line and scatter plots. Plus, you can modify these by rotating them, adding axis labels, adding legends and changing the background color. There is still more to be learned about 3D plots such as surface plots, wireframe plots, animating them and changing the aspect ratio. If you want to master everything about 3D plots, check out part 2 of this article..
https://blog.finxter.com/matplotlib-3d-plot/
CC-MAIN-2020-40
refinedweb
2,319
75.91
smoke 0.3.6+3 Smoke . 0.3.6+2 - Eliminate errors reported by analyzer in strong mode. 0.3.6+1 - Update to use the transformer_testpackage instead of code_transformersfor tests. 0.3.6 - Update to analyzer '^0.27.0' and update to the test package. 0.3.5 - Update to analyzer '<0.27.0' 0.3.4 - Add excludeOverriden to QueryOptions which removes declarations that were overriden within the class hierarchy. 0.3.3+1 - Update logging package to <0.12.0. 0.3.3 - Update to analyzer <0.26.0. 0.3.2 - Work around an issue running Dart analyzer on the generated code, if the dynamictype appeared in the output. Smoke will now use Objectinstead. 0.3.1+1 - Updated dependency versions. 0.3.1 - Add canAcceptNArgs method. 0.3.0 - Change SUPPORTED_ARGS limit for minArgs and maxArgs method from 3 to 15. 0.2.1+1 - Fix toString calls on Type instances. 0.2.0+3 - Widen the constraint on analyzer. 0.2.0+2 - Widen the constraint on barback. 0.2.0+1 - Switch from source_maps' Spanclass to source_span's SourceSpanclass. 0.2.0 - Static configuration can be modified, so code generators can split the static configuration in pieces. - breaking change: for codegen call writeStaticConfigurationinstead of writeInitCall. 0.1.0 - Initial release: introduces the smoke API, a mirror based implementation, a statically configured implementation that can be declared by hand or be generated by tools, and libraries that help generate the static configurations. Use this package as a library 1. Depend on it Add this to your package's pubspec.yaml file: dependencies: smoke: ^0.3.6+3 2. Install it You can install packages from the command line: with pub: $ pub get Alternatively, your editor might support pub get. Check the docs for your editor to learn more. 3. Import it Now in your Dart code, you can use: import 'package:smoke/smoke.
https://pub.dev/packages/smoke
CC-MAIN-2020-29
refinedweb
319
61.43
Display script version in top status bar I program my scripts on my ipad, in local Pythonista folders. But some scripts are written for my wife, then I copy these scripts on Pythonista iCloud folder, and they are executed by tapping an home screen icon pointing to pythonista3://script_name?action=run&root=icloud. But, sometimes, I forget to copy my modified script from local to iCloud. Thus, I've decided to display in the status bar (at top) of the iDevice, a label showing the version of the running script, so I can check if the script executed by my wife is the last version. For that: - a module VersionInStatusBar.py is installed in site-packages folder here - these lines are added at top of my scripts from VersionInStatusBar import VersionInStatusBar version = 'nn.n ' VersionInStatusBar(version=version) - this line is added in the will_close def, to remove the label from status bar VersionInStatusBar(version=False) Don't be estonished by the green "log" label. My pythonista_startup.py displays that when the logging of @dgelessus is active (thanks and happy new year to him)
https://forum.omz-software.com/topic/5334/display-script-version-in-top-status-bar
CC-MAIN-2020-29
refinedweb
183
50.16
class confusion tim huntington Greenhorn Joined: Aug 26, 2004 Posts: 4 posted Aug 26, 2004 00:14:00 0 coming from basic i am confused by the way events in a class happen.for example... class whatHappend { int i = 1; int j = 2; void f() { int i = 3 int j = 4 } } now when i view that i think of how it would work in basic,i and j are both given a number and f() then runs.but what i think happens in java is when that class is called,nothing happens,is that correct?it becomes like vb in a way i think,you need to say whatHappend.* in order to get the line of code you want to work correct?so if i called whatHappend.i then i would become 1? [ August 26, 2004: Message edited by: tim huntington ] omar bili Ranch Hand Joined: Aug 13, 2004 Posts: 177 posted Aug 26, 2004 01:15:00 0 class whatHappend { int i = 1; int j = 2; void f() { int i = 3 // this i is != than then i in the class it is a local variable in // then function f int j = 4// the same for j } } this class has a default constructor so whatHappend what = new whatHappend () ; System.out.println(""+what.i) ; // 1 System.out.println(""+what.j) ; // 2 f() ; System.out.println(""+what.i) ; // 1 nothing changes System.out.println(""+what.j) ; // 2 to modify the value of i and j just change the function f to : void f() { i = 3 ; j = 4 ; } hope i helped. sever oon Ranch Hand Joined: Feb 08, 2004 Posts: 268 posted Aug 26, 2004 03:40:00 0 Your take is kind of right but kind of wrong. In Basic, statements are executed in the sequence in which they appear...that is, everything is executed "in time". In Java, objects exist "in space". Methods of a particular object do not run until called. So, let me mix it up on you a bit to help you understand with your own example. public class WhatHappened { public void foo() { int x = 4; int y = 5; } private int i = 3; private int j = 4; } In the above example, the assignments of 3 and 4 to variables i and j occur before foo() could ever run, even though they appear below the statements in foo(). In fact, the Java compiler expands the above code to the following: public class WhatHappened { private int i; private int j; public WhatHappened() { this.i = 3; this.j = 4; } public void foo() { int x = 4; int y = 5; } } The order in which the statements appear within the class is insignificant. The scope of those statements within the class is not (i.e., whether a statement appears within the scope of a method, a constructor, etc). For instance, assignments to instance variables i and j occur in the constructor, which is called when a new instance of class WhatHappened is created. The variables x and y are local to the method foo()--in other words, they don't even exist until some other bit of code in the application creates a WhatHappened object and calls its foo() method. Here's an example of that happening: public class Example { public static void main( String[] args ) { WhatHappened wh = new WhatHappened(); // create an instance of class WhatHappened and name it "wh" // in the above line of code, the new operator requests a block of memory from the JVM // large enough to contain a WhatHappened object, requests that the JVM run the constructor // to initialize that block of memory, and then hands back a reference to the newly created // object. // At this point, the reference to this new object becomes the argument of the assignment // (=) operator, which assigns the reference to the variable "wh". wh.foo(); // foo() is called in the above statement, so x and y are created locally within the // scope of that method and given values. The method returns after that and the variables // go immediately out of scope (they are purposeless in this example program). } } So you see, in Java, when you implement a class, the code in that class is not necessarily going to run at all. It completely depends on whether some other bit of code creates an instance of that class (in which case the specified constructor runs) and calls its methods (in which case those methods will run). sev [ August 26, 2004: Message edited by: sever oon ] tim huntington Greenhorn Joined: Aug 26, 2004 Posts: 4 posted Aug 26, 2004 11:10:00 0 how do you pick which are things automatically done when the class is called and which happen only when they are called by using the class name then the dot and the object you want to call.like say i want a class called Alpha,and when Alpha is called i want it to i want it to set a,b,c as int,run beta(),and make a object that can be called from the class,like Alpha.one(). class whatHappend { // how do you tell one to run when, whatHappend what = new whatHappend() // happens,and one that will only work when whatHappend.*() is called // without placing one in the constructor void h() { int i = 1; int j = 2; } void f() { int i = 3 int j = 4 } } [ August 26, 2004: Message edited by: tim huntington ] Jason Fox Ranch Hand Joined: Jan 22, 2004 Posts: 114 posted Aug 26, 2004 13:07:00 0 I'm not sure what you mean by automatically, but ClassName.Method refers to static methods. There are two ideas here, both interrelated. You have a Class, which is sorta like a blueprint, and then you have an Object, which is the actual thing (Floorplans vs. the actual building) static members are methods and variables that are associated with the Class, not the Object. So, you do not need to instantiate the Object, just call the method directly, using ClassName.MethodName (or ClassName.VariableName for a variable). For all other methods and variables, you must create an Instance of the Class (usually using the new operator), and then use that instance. Example: Math.abs(12); // call static method abs in Math class with a parameter of 12 // instantiate StringBuffer into actual Object 'stringbuffer' StringBuffer stringbuffer = new StringBuffer("Hello Worl"); // use object to access non-static method append(String) stringbuffer.append("d"); I hope that clears up some of your questions fred rosenberger lowercase baba Bartender Joined: Oct 02, 2003 Posts: 11687 18 I like... posted Aug 26, 2004 13:57:00 0 Java is not like basic... the code is not executed line by line. in your original post, NO SINGLE LINE OF YOUR CODE would be executed, until somebody created a whatHappend object. i could write, in MY code //other code to get to this point whatHappend myVariable = new whatHappened(); //more code at this point, i would have a reference to a hunk of memory that has a whatHappened object. the "new whatHappend()" would cause a spot in memory to be allocated, with enough room to hold the two variables. also, if this is the first time anybody has created on of these, a special place in memory is reserved for the METHODS of the class... in other words, if i create 300 objects of this type, there are 300 sets of the i and j in memory. but the methods are only stored once. so when does the f() method run? at any time in my code where i do something like: myVariable.f(); NOW that code will run. due to other reasons we probably don't need to go into here, how you have this written, the i and j that my object are holding will not change, but that's another thread topic. There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors I agree. Here's the link: subject: class confusion Similar Threads initialization sequence Static Variables Compilation Passing an array to a method "Non-static method cannot be referenced from a static context" ? Nested Control Structures All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter JForum | Paul Wheaton
http://www.coderanch.com/t/397036/java/java/class-confusion
CC-MAIN-2015-14
refinedweb
1,366
67.28
Ads Via DevMavens There are two things in LINQ to SQL that I've been fretting about quite a bit and it has to do with issues of getting stuck either by the possibilty of LINQ not being able to express a query and the fact that LINQ queries need to be expressed as cold, hard types that cannot easily be created dynamically. The first scenario I haven't actually run into in my experiments directly although I can see it potentially happening. LINQ is statically typed so there's a limited set of SQL features that are actually supported through the LINQ language set. While common queries and joins may very work just fine, more complex queries that rely on internal functionality may have much less luck with. For example try to express > and < in strings with LINQ. C# doesn't support < and > on strings so this fails: var query11 = from c in context11.Customers where c.CompanyName > "D" && c.CompanyName < "F" select c; Instead you have to resort to the somewhat less intuitive C# compatible syntax of: where c.CompanyName.CompareTo("D") > -1 && c.CompanyName.CompareTo("G") < 1 It works, but then again it produces an interesting query: SELECT [t0].[CustomerID], [t0].[CompanyName], [t0].[ContactName], [t0].[ContactTitle], [t0].[Address], [t0].[City], [t0].[Region], [t0].[PostalCode], [t0].[Country], [t0].[Phone], [t0].[Fax] FROM [dbo].[Customers] AS [t0] WHERE (( (CASE WHEN [t0].[CompanyName] < @p0 THEN -1 WHEN [t0].[CompanyName] = @p0 THEN 0 ELSE 1 END)) > @p1) AND (( (CASE WHEN [t0].[CompanyName] < @p2 THEN -1 WHEN [t0].[CompanyName] = @p2 THEN 0 ELSE 1 END)) < @p3) Hoo boy.That might be just a little suboptimal if you run that against a largish database (which is probably the only reason you'd ever use string segmenting with < and > in the first place). So this might be a query you'd want to optimize. But lets say you wanted to create a query that includes a function not supported - like say Rand() and newid() in SQL Server. How would you express an admittedly contrived query like this? select CAST(Rand(CAST(CAST(newid() AS binary(4)) AS int)) * 10 as int) + 1 as Random,* from Customers C# has a random number function as well as Guid generation but you can't necessarily use it in a query. Option 1 - Create a Stored Procedure or View Ok so lets say you do hit the wall with some query. One option you have is to create a stored procedure or View that simplifies the result and input parameters significantly so that you can in fact get the results you want. Stored procedures are certainly an option if you have the power to force change in the database. In many scenarios however that's not possible as Admins have the database locked down - you're just a slave working against the data and SP model provided. If you can create a Stored Procedures or a view you can simply drag the stored procedure or view onto the LINQ designer and then consume the result. The Entity editor will automatically create a new type for the result set including the dynamic value: NorthwindDataContext context11 = new NorthwindDataContext(); ISingleResult<RandomCustomersResult> res = context11.RandomCustomers(); foreach (RandomCustomersResult randomResult in res) { Response.Write(randomResult.Random.ToString() + " " + randomResult.CompanyName + "<br/>"); } And it works. It's one of the easier ways to create result sets that don't fit LINQ syntax. Rather than writing code on the client you can write it on the server and parameterize it as an SP or View. Assuming the code is complex enough that you can't express it with LINQ it's probably not a bad idea to have as an SP on the server in the first place. If this option is available to you it's probably a good idea to take advantage of it as it's the easiest way to get around problem queries. Option 2 - Create your own Sql Command Strings Matt Warren posted a comment on a recent post I had about using a LINQ query to retrieve a DataReader instead of an IEnumerable list in order to improve databinding performance where perf is critical. I lamented that there was no matching method to do the opposite - take a SQL statement and turn it into an entity list. So Matt also mentioned something I missed: You can create a LINQ result set by providing your own SQL command string using context.ExecuteCommand() or providing an existing DataReader with context.Translate(). This solves a problem for the > and < query shown above nicely. So I could express the > and < query much more simply: string lowBound = "D"; string highBound = "G"; string sql = "select * from Customers where CompanyName > {0} and CompanyName < {1}"; var query11 = context11.ExecuteQuery<Customer>(sql, lowBound, highBound); Now, this isn't the kind of thing you'll want to do unless you are otherwise stuck, but at least it gives the opportunity to work around data. Couple of interesting things here. Above I'm using select * to grab all the fields and it appears that LINQ is doing the right thing grabbing each field and mapping it. Internally the DataReader assignment still works the same, looking for resulting field values to match property names. But the following works as well: string sql = "select contactname,company from Customers where CompanyName > {0} and CompanyName < {1}"; Note that here I'm returning only contactname and company, but a Customer entity is still created and the two values are assigned so cust11.CompanyName still works. That's nice. You do need a concrete type however - you can't return a list of anonymous types so you either need to create an explicit result type for a specific non-entity query or use an entity type for the result list.>(); This code retrieves a single instance of an object unhooks, then makes changes to it and submits changes. Even though the Customer was loaded off a 'manual' query, change tracking works. Impressive - but something you have to be careful with. SubmitChanges works in this scenario as long as the primary key is part of the download list. If you try to update without the pk field set the update fails. The following also works as well although it may seem like it shouldn't: string sql = "select CustomerId,CompanyName,ContactName from Customers where CustomerId={0}"; IEnumerable<Customer> custList = context11.ExecuteQuery<Customer>(sql, "ALFKI"); cust11.CompanyName = "Alfreds Futterkiste " + DateTime.Now.ToString("d"); In this code only a few fields are retrieved for the entities, but when you update LINQ only updates fields that have actually changed. Since CompanyName has been changed that change is written to the database, but all the NULL values for the fields that weren't retrieved don't have any effect. If you assign a value say to the Address field: cust11.CompanyName = "Alfreds Futterkiste " + DateTime.Now.ToString("t"); // *** Field that wasn't retrieved above - still works! cust11.Address = "Obere Strasse " + DateTime.Now.ToString("t"); the update still does the right thing. The Orders also come down via delayed loading and they can be updated as well by submit changes. One thing to keep in mind is that ExecuteQuery<> requires a concrete type - I don't see how you can return an anonymous type from it so if you look back at the Random query I stuck in the stored procedure I'd have to create an explicit type for the result first: public class RandomResult public int Random = -1; public string CompanyName = ""; public string ContactName = ""; then use ExecuteQuery with the above type: string sql = "select CAST(Rand(CAST(CAST(newid() AS binary(4)) AS int)) * 10 as int) + 1 as Random," + "CompanyName,ContactName,CustomerId from Customers"; IEnumerable<RandomResult> result = context11.ExecuteQuery<RandomResult>(sql); foreach (RandomResult res in result) Response.Write(res.Random.ToString() + " " + res.CompanyName + "<br/>"); return; And that works as well. All of this provides a solution for the 'fear of the black box' syndrome I've been having with LINQ to SQL. Hitting the wall a long way into a project because you can't express a query would be a disaster - both of the above address this scenario to some degree. Going to string based SQL may not be the most elegant solution, but at least it will get you out of a tight spot. But more importantly it will allow framework level code to get access to dynamic code execution with SQL which is crucial at the framework level that knows nothing of your actual data model. Dynamic Expressions - Manual Sql The above actually also addresses the dynamic expressions issues scenario I mentioned a bit back. The issue is that LINQ requires hard typed expression on the left side of an expression. For example, it's difficult to create an expression that dynamically uses a field name in a SQL query to retrieve data. So in a generic business layer you may have a Load(int Pk) method that loads an individual entity which would be generic in the base business object class. So the simplified scenario is this where you have TEntity and TContext as a generic types on the base business object: public TEntity Load(int pk) TContext context = this.CreateContext(); Table<TEntity> table = context.GetTable( typeof(TEntity) ) as Table<TEntity>; string pkField = this.PkField; TEntity entity = table.Single( c => ?????? == pk) return entity; The problem is how do you specify pkField as the expression on the left in the effort to retrieve this single entity. So one way to solve this problem is to use a manual SQL statement which is probably the most efficient way: try {(); if (entity == null) { this.SetError("Invalid Pk"); return null; } } catch (Exception ex) this.SetError(ex); return null; return null; This works. Notice that I have the get the table name from the Mapping object which provides schema information for the database or rather its mapped types. This allows retrieving the tablename that the entity belongs to which is required for generic operation. The query retrieves a list rather than a single entity, so .Single() is used to convert the result into a single entity. This code could probably be optimized by retrieving the table name only once in the constructor or in a property get. But this ends up running an efficient query and it's fully dynamic. So here's a scenario where using a manual SQL statement actually makes sense. Ok, so that works. Dynamic Query Another way - as was mentioned by several commenters in my previous post - is to use DynamicQuery. DynamicQuery is one of the samples installed with the 101 LINQ samples and you can find it by clicking on Help | Samples in Visual Studio. If you drill into the sample folders there's a DynamicQuery sample project, which basically consists of a class that provides string based lambda expression parsing. The class DynamicQuery class is self contained and you can simply add it to your project. It provides additional extension methods that let you use string expressions for various of the query methods including the .Where() method (but unfortunately for the above example not the .Single() method). So with Dynamic Query the above .Load() method can also be written as follows: // *** using System.Linq.Dynamic Sample code // *** equivalent of: TEntity entity = table.Single(c => c.Pk == pk); Table<TEntity> table = context.GetTable(typeof(TEntity)) as Table<TEntity>; List<TEntity> entityList = table.Where(this.PkField + " == @0", pk).ToList(); This code is a little easier to read - it simply uses a string expression instead of a Lambda expression for the .Where() clause call, which allows injecting the dynamic Pk field name into the left side of the expression. The syntax here is different - for the manual SQL statement I was basically using T-SQL code, here I need to write a C# expression as a string. Not only that the expression must also evaluate into something that makes sense in LINQ to SQL. What comes out of the string .Where() is essentially the same c=> c.Pk == pk. That's handy, but looking under the covers of dynamic query it's easy to see that there's a ton of code running to perform this kind of expression parsing. This akin to Reflection code only more resource intensive. So using the .CreateQuery() method in the previous example is probably much more performant than the method using DynamicQuery, but DynamicQuery is a little more inline with LINQ's syntax. The thing to remember is that these kind of dynamic expressions are probably not all that common in the front end or middle tier layers of an application where you do have access to the data model. They are most likely going to be found in framework level code and base classes where the actual data model is not directly accessible to the framework and so lots of fields and expression are going to be somewhat dynamic. In these scenarios performance is probably most important and so performance probably outweighs the 'politically correct' approach <g>... I'd venture to guess that using ExecuteQuery<> is considerably faster than using DynamicQuery for expression parsing since there's no query parsing to do for LINQ if you provide the query yourself.
http://west-wind.com/weblog/posts/143814.aspx
crawl-002
refinedweb
2,198
53.51
Simple example of assignment in my language: x = 3 -> [('statement', ('assignment', 'x', ('assignment_operator', '='), ('expr', ('term', ('factor', '3')))), '->')] To walk a tree, just use a stack or a queue (depending on wether you want to go depth first or breath first). For each node encountered, push the children onto the stack or into the queue, then take the next item out of the data structure to process and repeat. For example, breath first could look like this: from collections import deque def walk(node): queue = deque([node]) while queue: node = queue.popleft() if isinstance(node, tuple): queue.extend(node[1:]) # add the children to the queue yield node which produces the following walking order for your tree: >>> for node in walk(tree[0]): ... print(node[0] if isinstance(node, tuple) else node) ... statement assignment -> x assignment_operator expr = term factor 3 Your data structure is a little messy, mixing tuples of different length. You may want to look to using a nametuple class to formalise the contents a little.
https://codedump.io/share/Y9inV6f5UE01/1/how-to-do-a-quottree-walkquot-recursively-on-an-abstract-syntax-tree
CC-MAIN-2017-34
refinedweb
167
60.24
Stars Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 54168 Accepted: 23299 Description Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars that are not higher and not to the right of the given star. Astronomers want to know the distribution of the levels of the stars. For example, look at the map shown on the figure above. Level of the star number 5 is equal to 3 (it’s formed by three stars with a numbers 1, 2 and 4). And the levels of the stars numbered by 2 and 4 are 1. At this map there are only one star of the level 0, two stars of the level 1, one star of the level 2, and one star of the level 3. You are to write a program that will count the amounts of the stars of each level on a given map. Input The first line of the input file contains a number of stars N (1<=N<=15000). The following N lines describe coordinates of stars (two integers X and Y per line separated by a space, 0<=X,Y<=32000). There can be only one star at one point of the plane. Stars are listed in ascending order of Y coordinate. Stars with equal Y coordinates are listed in ascending order of X coordinate. Output The output should contain N lines, one number per line. The first line contains amount of stars of the level 0, the second does amount of stars of the level 1 and so on, the last line contains amount of stars of the level N-1. Sample Input 5 1 1 5 1 7 1 3 3 5 5 Sample Output 1 2 1 1 0 代码: #include <algorithm> #include <iostream> #include <stdlib.h> #include <string.h> #include <iomanip> #include <stdio.h> #include <string> #include <queue> #include <cmath> #include <stack> #include <map> #include <set> #define eps 1e-7 #define M 10001000 #define LL __int64 //#define LL long long #define INF 0x3f3f3f3f #define PI 3.1415926535898 const int maxn = 50000; using namespace std; int c[maxn]; int vis[maxn]; int lowbit(int x) { return x&(-x); } void add(int x) { while(x < maxn) { c[x]++; x += lowbit(x); } } int sum(int x) { int cnt = 0; while(x > 0) { cnt += c[x]; x -= lowbit(x); } return cnt; } int main() { int n; while(~scanf("%d",&n)) { int x, y; memset(vis, 0 , sizeof(vis)); for(int i = 0; i < n; i++) { scanf("%d %d",&x, &y); x++; y++; vis[sum(x)]++; add(x); } for(int i = 0; i < n; i++) cout<<vis[i]<<endl; } return 0; }
https://blog.csdn.net/qq_42825221/article/details/81592015
CC-MAIN-2018-43
refinedweb
457
75.64
CodePlexProject Hosting for Open Source Software I was testing the json using BSon trying different scenerios and found a problem serializing a dictionary where the index is an object rather than a value type and get this error: Could not create string property name from type 'Drms.Server.Oas.Persistence.Tests.DAOTests+TestClass1'. Is there something else I should do to get this to work. this is the test I was trying: [JsonObject(MemberSerialization.OptIn)] public class TestClass1 { [JsonProperty] private IDictionary<TestClass1, double> m_doublesDic2 = new Dictionary<TestClass1, double>(); public IDictionary<TestClass1, double> DoublesDic2 { get { return m_doublesDic2; } set { m_doublesDic2 = value; } } } TestClass1 t1 = new TestClass1(); t1.DoublesDic2.Add(new TestClass1(), 1); t1.DoublesDic2.Add(new TestClass1(), 2); t1.DoublesDic2.Add(new TestClass1(), 3); JsonSerializer js = new JsonSerializer(); BsonWriter bw = new BsonWriter(ms); js.Serialize(bw,t1); A property name has to be a string and that class has no TypeConverter to convert it to a string. ok , ill try puting in a type converter for it but the converter will just run it through json to give me a string anyhow so do you think its possible for it to by default to do that. ie, it runs across a dictionary key thats doesnt have a type converter that can convert it to a string and given it needs a string, try runing it through jason to see if it can get a json string. thanks scott Are you sure you want to delete this post? You will not be able to recover it later. Are you sure you want to delete this thread? You will not be able to recover it later.
https://json.codeplex.com/discussions/82312
CC-MAIN-2017-22
refinedweb
271
62.07
import nltk. Lists of words are created in the BoW process. Contour flat icons design. Creative Fabrica is created in Amsterdam, one of the most inspirational cities in the world. Experience. Read more posts by this author. The final BoW representation is the sum of words feature vector. we could leverage the fact that the words that appear rarely bring a lot of information on the document it refers to. Published: December 31, 2018. We will work with some data from the South Park series. Free Vector Bow - 17 royalty free vector graphics and clipart matching bow. Owl Bird Figure. machine_learning_examples / nlp_class2 / bow_classifier.py / Jump to Code definitions GloveVectorizer Class __init__ Function fit Function transform Function fit_transform Function Word2VecVectorizer Class __init__ Function fit Function transform Function fit_transform Function That’s beans. But BERT does not need a BoW as the vector shooting out of the top [CLS] token is already primed for the specific classification objective… Natural Language Processing (NLP) has seen a renaissance over the past decade. The Bag of Words (BoW) model is the simplest form of text representation in numbers. The methods such as Bag of Words(BOW), CountVectorizer and TFIDF rely on the word count in a sentence but do not save any syntactical or semantic information. Download 9,446 ribbon bow free vectors. 1. Our model will map a sparse BoW representation to log probabilities over labels. “Language is a wonderful medium of communication” You and I would have understood that sentence in a fraction of a second. 171 139 28. Like the term itself, we can represent a sentence as a bag of words vector (a string of numbers). Bow tie vectors are the bow vectors that reflect the actual look of bow ties that are used by gentlemen to complete a dapper look. We assign each word in the vocab an index. As an example, business event invitations can make use of bow tie vectors as a design of the document so it can give the impression that the event is formal and requires men to be on their suits. So I wanted to know how to generate this vector (algorithm) or good material to start creating word vector ?. 27 26 2. Preprocessing per document within-corpus, How to install (py)Spark on MacOS (late 2020), Wav2Spk, learning speaker emebddings for Speaker Verification using raw waveforms, Self-training and pre-training, understanding the wav2vec series, the columns correspond to all the vocabulary that has ever been used with all the documents we have at our disposal, the lines correspond to each of the document, the value at each position corresponds to the number of occurrence of a given token within a given document. bow, icon, vector - Koop deze stockvector en ontdek vergelijkbare vectoren op Adobe Stock Applying different sentense segmentation methods may cause ambiguity. Word2vec is a technique for natural language processing.The word2vec algorithm uses a neural network model to learn word associations from a large corpus of text.Once trained, such a model can detect synonymous words or suggest additional words for a partial sentence. We can get a sparse matrix if most of the elements are zero. The vector v1 contains the vector representation for the word "artificial". Thousands of new, high-quality pictures added every day. We don’t know anything about the words semantics. Download deze Gratis Vector over Flat bows-collectie en ontdek meer dan 10 Miljoen Professionele Grafische Middelen op Freepik Buy now. NLP-MultiClass Text Classification- Machine Learning Model using Count Vector(BoW) We will discuss different feature engineering techniques to solve a text-based supervised classification problem. New users enjoy 60% OFF. The bag-of-words model is a simplifying representation used in natural language processing and information retrieval (IR). In this article, we’ll start with the simplest approach: Bag-Of-Words. 12 22 0. Now for each word in sentence, we check if the word exists in our dictionary. Each word or n-gram is linked to a vector index and marked as 0 or 1 depending on whether it occurs in a given document. We declare a dictionary to hold our bag of words. Bag-of-words is a Natural Language Processingtechnique of text modeling. the term frequency \(f_{t,d}\) counts the number of occurences of \(t\) in \(d\). code. 52 Free vector graphics of Bow Tie. This can be implemented with the help of following code: Writing code in comment? We bring the best possible tools for improving your creativity and productivity. machine_learning_examples / nlp_class2 / bow_classifier.py / Jump to. vocab = nlp. In technical terms, we can say that it is a method of feature extraction with text data. Download 4,100+ Free Bow Vector Images. The notion of embedding simply means that we’ll convert the input text into a set of numerical vectors that can be used into algorithms. To vectorize a corpus with a bag-of-words (BOW) approach, we represent every document from the corpus as a vector whose length is equal to the vocabulary of the corpus. Father day's template bow tie stock illustrations. Creating “language-aware data products” are becoming more and more important for businesses and organizations. 186 172 23. 29 51 0. A bag-of-words is a representation of text that describes the occurrence of words within a document. In a BoW a body of text, such as a sentence or a document, is thought of as a bag of words. the value at each position corresponds to the number of occurrence of a given token within a given document. Hence, Bag of Words model is used to preprocess the text by converting it into a bag of words, which keeps a count of the total occurrences of most frequently used words. Both BoW and TF-IDF a… This was a small introduction to the BOW method. You may need to ignore words based on relevance to your use case. This approach is a simple and flexible way of extracting features from documents. How to create word vector? 28 33 0. Vocab (nlp. In 3000 years of our history, people from all over . There are several approaches that I’ll describe in the next articles. Let’s recall the three types of movie reviews we saw earlier: Review 1: … Vector bow tie and suspenders. Bow Ribbon Decoration. And I am deeply honored at the Paul Douglas Award that is being given to me. e.g. The data can be downloaded here. BoW (Bag of Word) with NLP (Natural Language Processing) For NLP (Natural Language Processing Click Here) #import nltk. Measuring the similarity between documents, 1. Related Images: gift present cupid arrow ribbon archer christmas owl tie bow. count_tokens (pos_tokens + neg_tokens)) print (len (vocab)) 19960. This is a much, much smaller vector as compared to what would have been produced by bag of words. data. You can use bow vector for decorating different things like t-shirts, accessories, laptop covers, mobile covers, scrapbooks and anything else. So far, we used a self-defined function. The word2vec model has two different architectures to … 314 267 36. I know people are still wondering why I didn’t speak at the commencement. Free for commercial use High Quality Images This is where the concepts of Bag-of-Words (BoW) and TF-IDF come into play. For example, say our entire vocab is two words “hello” and “world”, with indices 0 and 1 respectively. However, term frequencies are not necessarily the best representation for the text. Creative Fabrica. The bag-of-words model is simple to understand and implement and has seen great success in problems such as language modeling and document classification. Slapping a BoW on word vectors is the usual way to build a document vector for tasks such as classification. Tie Dots Bow Red. Natural language processing (NLP) is a subfield of linguistics, computer science, and artificial intelligence concerned with the interactions between computers and human language, in particular how to program computers to process and analyze large amounts of natural language data. Goldberg, Yoav, and Omer Levy. Download 21,811 bow free vectors. GloveVectorizer Class __init__ Function fit Function transform Function fit_transform Function Word2VecVectorizer Class __init__ Function fit Function transform Function fit_transform Function. the order of the words in the sentence does not matter, which is a major limitation. We’ll focus here on the first 1000 rows of the data set. Dense embeddings on the other hand or not interpretable, and applying LIME probably won’t improve interpretability. If our text is large, we feed in a larger number. the more frequent a word, the more importance we attach to it within each document which is logic. So how natural language processing (NLP) models learn patterns from text data ? the document frequency \(df_t\) counts the number of documents that contain the word \(t\), M is the total number of documents in the corpus. The output of LIME is a list of explanations, reflecting the contribution of each feature to the prediction of a data sample. “A Primer on Neural Network Models for Natural Language Processing.” Journal of Artificial Intelligence Research 57: 345–420. The bag-of-words (BOW) model is a method used in NLP and Information Retrieval (IR). ⬇ Download bow image - stock illustrations and vector in the best photography agency reasonable prices millions of high quality and royalty-free stock photos and images. You are only limited by your imagination. Now, I want to start by addressing the elephant in the room. Download this Free Vector about Set of bows, and discover more than 11 Million Professional Graphic Resources on Freepik However, these tokens are only useful if you can transform them into features for your machine learning model. This approach is however not so popular anymore. Please use ide.geeksforgeeks.org, Owl Bird Figure. Don’t hesitate to drop a comment if you have a comment. one_hot (x, len (vocab)). In this model, a text (such as a sentence or a document) is represented as the bag (multiset) of its words, disregarding grammar and even word order but keeping multiplicity.The bag-of-words model has also been used for computer vision. 147 257 15. The best selection of Free Bow Vector Art, Graphics and Stock Illustrations. Even worse, different language families follow different rules. The code showed how it works at a low level. 2014. Choose from over a million free vectors, clipart graphics, vector art images, design templates, and illustrations created by artists worldwide!, ML | One Hot Encoding of datasets in Python, Elbow Method for optimal value of k in KMeans, Adding new column to existing DataFrame in Pandas, How to get column names in Pandas dataframe, Write Interview Print Cobalt blue bow tie with white dots realistic vector illustration set isolated on white background bow tie stock illustrations. In this article, we are going to learn about the most popular concept, bag of words (BOW) in NLP, which helps in converting the text data into meaningful numerical data. machinelearning, # If the word is in vocabulary, add 1 in position, 2. close, link The bow vector has a certain elegance, timelessness and sophistication to it that can hardly be matched. Decoration Ribbon. Tf-idf Vectorization. Georgios Drakos. The dimensions of the output layer will be 1xV, where each value in the vector will be the probability score of the target word at that position. Tie Bow Black. This model can be visualized using a table, which contains the count of words corresponding to the word itself. We’ll use the preprocess function. Ribbon Bow Decor. 14 Jun 2019 • 8 min read. Owl Bird Figure. And they were very impressed at my agricultural knowledge. Bag Of Words (BOW) Model: Natural Language processing models only understand the numerical value. 2016. Lecture 1 introduces the concept of Natural Language Processing (NLP) and the problems NLP faces today. 139 210 18. I have read many articles on this topic and tried to jot it down as concisely as possible. In our model, we have a total of 118 words. To overcome the dimension’s issue of BOW, it is quite frequent to apply Principal Component Analysis on top of the BOW matrix. In practice, only a few words from the vocabulary, more preferably most common words are used to form the vector. Both Bag-Of-Words and TF-IDF methods represent a single document as a single vector. Bow Svg Clipart Vector. In this step we construct a vector, which would tell us whether a word in each sentence is a frequent word or not. If it doesn’t, we add it to our dictionary and set its count as 1. Bow ribbon gift box decor tie line icon vector set Bow ribbon thin line icon set. We cannot directly feed our text into that algorithm. Below is the python implementation of BoW using library Scikit-learn. so, In this blog our main focus is on the count vectorizer. We will apply the following steps to generate our model. We can then apply the BOW function to the cleaned data : It generates the whole matrix for the 1000 rows in 1.42s. To build any model in machine learning or deep learning, the final level data has to be in numerical form, because models don’t understand text or image data directly like humans do.. In other words, words that appear the most are not the most interesting to extract information from a document. We just keep track of word counts and disregard the grammatical details and the word order. I also noticed, by the way, former Governor Edgar here, who I haven’t seen in a long time, and somehow he has not aged and I have. An example of a one hot bag of words representation for documents with one word. The best selection of Royalty Free Bow Hunter Vector Art, Graphics and Stock Illustrations. Our model will map a sparse BoW representation to log probabilities over labels. 26 35 0. Fashion tie symbol in linear style. It is called a “bag” of words because any information about the … Design for real man! Each unique word in your data is assigned to a vector and these vectors vary in dimensions depending on the length of the word. This is just the main feature of the Bag-of-words model. Retrieval-Based Chatbots: Language and Topic Modeling ... ... Cheatsheet You might need to modify a bit the preprocessing function. NLP algorithms are designed to learn from language, which is usually unstructured with arbitrary length. In these algorithms, the size of the vector is the number of elements in the vocabulary. For the sake of clarity, we’ll call a document a simple text, and each document is made of words, which we’ll call terms. The bag-of-words model is a way of representing text data when modeling text with machine learning algorithms. So that we … The BoW method is simple and works well, but it treats all words equally and cannot distinguish very common words or rare words. Download dit gratis bestand Bow Vectors nu. I have a bunch of good friends here today, including somebody who I served with, who is one of the finest senators in the country, and we’re lucky to have him, your Senator, Dick Durbin is here. BoW representations are often used in methods of document classification … Tf-idf solves this problem of BoW Vectorization. If you want to control it, you should set a maximum document length or a maximum vocabulary length. Find & Download Free Graphic Resources for Bow. Assuming you already have the NLP data in the correct format and you additional meta data is a vector of size 10: Calling the fit method: model.fit([data_nlp, data_meta], labels, batch_size=32, epochs=10) where the input for the meta data is a array of samples * number of additional features. Step #1 : We will first preprocess the data, in order to: edit Whenever we apply any algorithm in NLP, it works on numbers. Download 5,762 Hair Bow Vector Stock Illustrations, Vectors & Clipart for FREE or amazingly low rates! In my previous article, I presented different methods to preprocess text and extract useful tokens. Hi Michael, it’s not a silly question. This sounds complicated, but it’s simply a way of normalizing our Bag of Words(BoW) by looking at each word’s frequency in comparison to the document frequency. NLP produces new and exciting results on a daily basis, and is a very large field. NLP | How tokenizing text, sentence, words works, NLP | How to score words with Execnet and Redis, Python | NLP analysis of Restaurant reviews, Applying Multinomial Naive Bayes to NLP Problems, NLP | Training a tokenizer and filtering stopwords in a sentence, NLP | Expanding and Removing Chunks with RegEx, NLP | Leacock Chordorow (LCH) and Path similarity for Synset, NLP | Part of speech tagged - word corpus, Data Structures and Algorithms – Self Paced Course, Ad-Free Experience – GeeksforGeeks Premium, We use cookies to ensure you have the best browsing experience on our website. The TF-IDF value grows proportionally to the occurrences of the word in the TF, but the effect is balanced by the occurrences of the word in every other document (IDF). BOW. Conclusion : I hope this quick introduction to Bag-Of-Words in NLP was helpful. Term Frequency Inverse Document Frequency (TF-IDF), 3. However, this can be problematic since common words, like cat or dog in our example, do not bring much information about the document it refers to. There is much more to understand about BOW. Transforming tokens into useful features (BOW,TF-IDF) Georgios Drakos. Step #3 : Building the Bag of Words model The cosine similarity descrives the similariy between 2 vectors according to the cosine of the angle in the vector space : Let’s now implement this in Python. Implementing Bag of … Another drawback of the BOW model is that we work with very sparse vectors most of the time. generate link and share the link here. Gift Present Box. Like the crown vector it is a classic that can never be replaced. Categories: Sponsored Images by iStock. As the name implies, word2vec represents each distinct word with a particular list of numbers called a vector. Goldberg, Yoav. To implement this we use: where 100 denotes the number of words we want. They need us to break down the text into a numerical format that’s easily readable by the machine (the idea behind Natural Language Processing!). In this tutorial, you will discover the bag-of-words model for feature extraction in natural language processing. For the reasons mentioned above, the TF-IDF methods were quite popular for a long time, before more advanced techniques like Word2Vec or Universal Sentence Encoder. If a word in a sentence is a frequent word, we set it as 1, else we set it as 0. Isolated on white vector Illustration bow stock illustrations. When we use Bag-Of-Words approaches, we apply a simple word embedding technique. Before you move on, make sure you have your basic concepts cleared about NLP which I spoke about in my previous post — “A… Sign in An Introduction to Bag-of-Words in NLP We are using a real-world dataset of BBC News and will solve a multi-class text classification problem. I was trying to explain to somebody as we were flying in, that’s corn. Most Popular Word Embedding Techniques. We do not need to use all those words. The first step is to import NLTK library and the useful packages : The pre-processing will be similar to the one developed in the previous article. I used one hot key to create word vector, but it is very huge and not generalized for similar semantic word. Published: December 31, 2018. Learn more about Creative Fabrica here. a BoW vector for NLP, or an image for computer vision. How Bag of Words (BOW) Works in NLP. Present Gift Ribbon. In the next article, we’ll see more evolved techniques like Word2Vec which perform much better and are currently close to state of the art. Code definitions . Examples of interpretable representations are e.g. The output of the Word2vec neural net is a vocabulary in which each item has a vector attached to it, which can be fed into a deep-learning net or simply queried to detect relationships between words. 96,000+ Vectors, Stock Photos & PSD files. Cat Cloud Heart. Step #2 : Obtaining most frequent words in our text. By using our site, you Arrow Bow Old Shoot. So I have heard about word vector using neural network that finds word similarity and word vector. After converting the text data to numerical data, we can build machine learning or natural language processing models to get key insights from the text data. In this exercise, you have been given two pandas Series, X_train and X_test, which consist of movie reviews.They represent the training and the test review data respectively. Tie Dots Bow Blue. Gift Box Gift Box. Guitar Violin Bow. However when processing large texts, the number of words could reach millions. It converts the documents to a fixed-length vector of numbers. This pipeline is only an example that happened to suit my needs on several NLP projects. the world have come and invaded us, captured our lands, conquered our minds. This kind of representation has several successful applications, such as email filtering. For example, say our entire vocab is two words “hello” and “world”, with indices 0 and 1 respectively. 53 83 2. 191 316 25. Owl Bird Figure. A bow tie vector can also make materials dapper and corporate. The BoW vector for the sentence “hello hello hello hello” is Measuring cosine similarity, no similarity is expressed as a 90 degree angle, while total similarity of 1 is a 0 degree angle, complete overlap; i.e. But machines simply cannot process text data in raw form. 21 39 1. Both imply large biases. 17 34 1. This post will take you into a deeper dive into Natural Language Processing. In Proceedings of the 1st Workshop on Evaluating Vector-Space Representations for Nlp, 36–42. We assign each word in the vocab an index. This is called the term frequency (TF) approach. Let’s now apply our preprocessing to the data set : The new data set will now look like this : And the vocabulary, which has size 1569 here, looks like this : Let us now define the BOW function for Term Frequency! To map a sequence of tokens to the BoW vector, first we need to build the vocabulary. Feature Transformation is the process of converting raw data which can be of Text, Image, Graph, Time series etc… into numerical feature (Vectors). Indeed, the only thing you’ll want to modify is when you append the lemmatized tokens to the clean_document variable : After which the application in Sk-learn is straightforward : We can apply TF-IDF in Sk-learn as simply as this : The reason why BOW methods are not so popular these days are the following : For example, the sentences: “The cat’s food was eaten by the dog in a few seconds.” does not have the same meaning at all than “The dog’s food was eaten by the cat in a few seconds.”. By default, a hundred dimensional vector is created by Gensim Word2Vec. Gift birthday xmas or sale decor collection of simple outline signs. In the examples above we use all the words from vocabulary to form a vector, which is neither a practical way nor the best way to implement the BoW model. The BoW vector for the sentence “hello hello hello hello” is bow_vector = CountVectorizer(tokenizer = spacy_tokenizer, ngram_range=(1,1)) We’ll also want to look at the TF-IDF (Term Frequency-Inverse Document Frequency) for our terms. paragraph = """I have three visions for India. Co-Founder @ SoundMap, Ph.D. Student @ Idiap/EPFL. It is intended to reflect how important a word is to a document in a collection or corpus. In the vector space, a set of documents corresponds to a set of vectors in the vector space. ” are becoming more and more important for businesses and organizations public service here in Illinois we keep “ ”... ” are becoming more and more important for businesses and organizations text data modeling... Does, then we increment its count as 1 text and run algorithms on it we! By bag of words or BoW vector for decorating different things like,. Of extracting features from documents lists of words within a document, is thought of a. The particular development in bow vector nlp was helpful fact that it only handles English vocabulary network models for Natural language (... And millions of other royalty-free Stock photos, illustrations and vectors in the world have come and invaded,! Selection of Royalty free vector BoW - 17 Royalty free vector graphics and Stock illustrations, vectors & clipart free. Given to me we keep “ slots ” for words that appear rarely bring a lot of information on document... ) ) print ( len ( vocab ) ) 19960 print ( len ( vocab ) ) 19960 vectors!, icon, vector art images, design templates, and applying probably. Word counts and disregard the grammatical details and the word exists in dictionary. Discover the bag-of-words ( BoW ) model is the usual way to build the vocabulary important businesses. Follow different rules reach millions several NLP projects TF-IDF come into play the..., else we set it as 0 vectors in the vocab an index Amsterdam, one of the from. 2: Obtaining most frequent words in the room years of our history people... Commercieel gebruik and invaded bow vector nlp, captured our lands, conquered our.... Other hand or not interpretable, and applying LIME probably won ’ t improve interpretability large, we say. Words in our dictionary and set its count by 1 the final BoW representation to probabilities. Model: Natural language processing ( NLP ) models learn patterns from text data when text... Nlp models can ’ t improve interpretability words vector ( a string of numbers a. This pipeline is only an example of a one hot key to create vector! Dots realistic vector illustration set isolated on white background BoW tie Stock illustrations, vectors & for. Large texts, the size of the words from the vocabulary bibliotheek van 365PSD met meer gratis PSD-bestanden, en... Possible tools for improving your creativity and productivity can be implemented with the simplest of! From a document, is thought of as a vector pipeline is only an example to BoW,..., icon, vector - Koop deze stockvector en ontdek vergelijkbare vectoren op Stock... Popular approaches to designing word vectors this quick introduction to the BoW vector first! Gift present cupid arrow ribbon archer christmas owl tie BoW so I wanted to know how to generate model... A fraction of a second visualized using a table, which is usually unstructured with length!, 2 if you have a total of 118 words NLP that I want control... History, people from all over keep track of word counts and disregard the grammatical details and word., mobile covers, scrapbooks and anything else a Primer on neural network models for Natural processing. Of I System for making it possible for me to be here today needs to vectorized... Algorithm ) or good material to start by addressing the elephant in the vector representational! Preprocessing Function information from a document vector for tasks such as email filtering our minds '' I have many! What Does Toothpaste Do To Nipples, Fasting Bodybuilding Reddit, Acacia Honey Malaysia, Cheetah Vs Leopard Print, Garnier Charcoal Peel Off Mask Ingredients, Get A Life Shirts Walmart, Laser Printer Vinyl Stickers,
https://www.prodevelop.ir/races-of-nop/pesto-cauliflower-gnocchi-825660
CC-MAIN-2022-27
refinedweb
4,600
64.61
Hide Forgot Description of problem: Pods in the admin tenant (default project) should be able to send/receive multicast traffic from other admin tenant pods, bu in latest 3.5 code, multicast does not work in vnid 0 Version-Release number of selected component (if applicable): oc v3.5.0.16+a26133a kubernetes v1.5.2+43a9be4 openshift v3.5.0.16+a26133a kubernetes v1.5.2+43a9be4 How reproducible: Every time. Steps to Reproduce: 1. oc project default 2. oc annotate netnamespace default netnamespace.network.openshift.io/multicast-enabled=true 3. oc create -f 4. oc rsh hello-pod-1 iperf -c 232.43.211.234 -u -T 32 -t 3000 -i 1 5. oc rsh hello-pod-2 iperf -s -u -B 232.43.211.234 -i 1 Actual results: hello-pod-2 does not receive multicast traffic sent from hello-pod-1 Expected results: hello-pod-2 should receive multicast traffic sent from hello-pod-1 Additional info: This has been merged into ocp and is in OCP v3.5.0.18 or newer. Test case passed in oc v3.5.0.18+9a5d1.
https://bugzilla.redhat.com/show_bug.cgi?id=1419652
CC-MAIN-2021-21
refinedweb
187
62.64
Approach #1: Brute Force with Optimizations [Accepted] Intuition Naively, the number of operations is $$4^m$$, and the number of light-states is $$2^n$$. These are way too big, so we focus on heuristics that can reduce the size of these spaces that we want to search on. Algorithm Suppose. So we only care about the quantity of each operation. Secondly, when it comes to the state of the lights,), but not all of them necessarily occur. cand occurs only if there is some f with sum(f) == m and cand[i] = f[i] % 2. The necessary and sufficient condition to find such an f is sum(cand) % 2 == m % 2 and sum(cand) <= m. With exactly m operations, we must spend sum(cand) operations doing the operations indicated by cand; then as long as we have an even number of operations left over, we can keep doing operation 1; and if we don't have an even number of operations left over, we can't make cand as desired. Also, we can set n = min(n, 6). We only need to care about the first 6 lights, as the 6k+ith light is equal to the i-th light. This is because the first operation repeats every 1 light, the second and third operations repeat every 2 lights, and the fourth operation repeats every 3 lights; hence, no matter what operations are applied, the lights will repeat every $\text{lcm}(1, 2, 2, 3) = 6$ lights. Java class Solution { public int flipLights(int n, int m) { n = Math.min(n, 6); Set<Integer> seen = new HashSet<Integer>(); for (int cand = 0; cand < 1<<4; cand++) { if (Integer.bitCount(cand) <= m && Integer.bitCount(cand) % 2 == m % 2) { int lights = 0b111111; if ((cand>>0) %2 > 0) lights ^= 0b111111; if ((cand>>1) %2 > 0) lights ^= 0b010101; if ((cand>>2) %2 > 0) lights ^= 0b101010; if ((cand>>3) %2 > 0) lights ^= 0b100100; seen.add(lights >> (6-n)); } } return seen.size(); } } Python def flipLights(self, n, m): seen = set() for cand in itertools.product((0, 1), repeat = 4): if sum(cand) % 2 == m % 2 and sum(cand) <= m: lights = [] for i in xrange(min(n, 6)): light = 1 light ^= cand[0] light ^= cand[1] and i % 2 light ^= cand[2] and i % 2 == 0 light ^= cand[3] and i % 3 == 0 lights.append(light) seen.add(tuple(lights)) return len(seen) Complexity Analysis Time Complexity: $$O(1)$$. For each of 16 possibilities for cand, we do $$O(min(n, 6)) = O(1)$$ work. Space Complexity: $$O(1)$$. The size of seenis bounded by 16 - one for each candidate sequence of residues cand. Approach #2: Mathematical [Accepted] Intuition As in Approach #1, we only need to consider $$n \leq 6$$. Also, when $$m \geq 3$$, all candidate residues cand are valid as defined in Approach #1. Thus, we only need to consider the space $$m \leq 3, n \leq 6$$ - a space small enough to brute force. Algorithm Actually, we may take n = min(n, 3). If the operations are a, b, c, d, then modulo 2: - Light 1 = Light 7 = ... = 1 + a + c + d - Light 2 = Light 8 = ... = 1 + a + b - Light 3 = Light 9 = ... = 1 + a + c - Light 4 = Light 10 = ... = 1 + a + b + d - Light 5 = Light 11 = ... = 1 + a + c - Light 6 = Light 12 = ... = 1 + a + b So that (modulo 2): - Light 4 = (Light 1) + (Light 2) + (Light 3) - Light 5 = Light 3, and - Light 6 = Light 2. which shows that knowing the first 3 lights is enough to determine all the remaining lights in the sequence. Now, we can do casework on m. The transitions made by the operations a, b, c, d are to XOR by (1, 1, 1), (0, 1, 0), (1, 0, 1), or (1, 0, 0) respectively. - If m = 0, there is only one state (1, 1, 1). - If m = 1, then we could get (0, 0, 0), (1, 0, 1), (0, 1, 0), (0, 1, 1). - If m = 2, with some effort we can get all 8 possibilities except (0, 1, 1). - If m = 3, we can get every possibility. This reduced the problem to knowing the answer for m <= 3, n <= 3. The final answer is shown below. Java class Solution { public int flipLights(int n, int m) { if (m == 0) return 1; if (n == 1) return 2; if (n == 2) return m == 1 ? 3 : 4; return m == 1 ? 4 : m == 2 ? 7 : 8; } } Complexity Analysis - Time and Space Complexity: $$O(1)$$.
https://discuss.leetcode.com/topic/102331/solution-by-awice
CC-MAIN-2018-05
refinedweb
748
72.87
Table of Content: The development of Elvish is driven by a set of ideas, a design philosophy. The language Elvish should be a real, expressive programming language. Shells are often considered domain-specific languages (DSL), but Elvish does not restrict itself to this notion. It embraces such concepts as namespaces, first-class functions and exceptions. Whatever you may find in a modern general-purpose programming language is likely to be found in Elvish. Elvish is not alone in this respect. There are multiple ongoing efforts; this page on the wiki of oilshell (which is one of the efforts) is a good reference. Elvish should try to preserve and extend traditional shell programming techniques, as long as they don’t conflict with the previous tenet. Some examples are: Barewords are simply strings. Prefix notation dominates, like Lisp. For example, arithmetics is done like + 10 (/ 105 5). Pipeline is the main tool for function composition. To make pipelines suitable for complex data manipulation, Elvish extends them to be able to carry structured data (as opposed to just bytes). Output capture is the auxiliary tool for function composition. Elvish functions may write structured data directly to the output, and capturing the output yields the same structured data. The user interface The user interface should be usable without any customizations. It should be simple and consistent by default: Prefer to extend well-known functionalities in other shell to inventing brand new ones. For instance, in Elvish Ctrl-R summons the “history listing” for searching history, akin to how Ctrl-R works in bash, but more powerful. When a useful feature has no prior art in other shells, borrow from other programs. For instance, the navigation mode, summoned by Ctrl-N, mimics Ranger; while the “location mode” used for quickly changing location, mimics location bars in GUI browsers (and is summoned by the same key combination Ctrl-L). Customizability should be achieved via progammability, not an enormous inventory of options that interact with each other in obscure ways.
https://elv.sh/learn/philosophy.html
CC-MAIN-2020-34
refinedweb
333
55.84
Server-Side Bots A server-side bot is an entity that pretends to be a player, but is driven by AI instead. It usually derives from the game's main player class, and the majority of the game code can treat it like it's a regular player. Contents Concepts The primary responsibility of a server-side bot is to simulate user input for its player entity each server tick. To accomplish this, it fills in a CUserCmd structure and passes it to CBasePlayer::PlayerRunCommand. The CUserCmd structure contains all of the input that a normal player could create - which buttons they're pressing, which way they want to move, and where they want their view angles to point. While the CUserCmd is generated, a bot will typically have code to make it interact with the game world in an intelligent way. For example, it may be tracing rays out to nearby player entities to decide if it can see the other players. It also might have a state machine that decides what its strategy will be when it's low on health, tracking an enemy, picking up a weapon, or dying. Whatever it decides to do on that frame, its final output is a CUserCmd telling the engine, "this is what I'm doing this frame". Implementation Way 1 The SDK ships with a rudimentary sample bot. It runs in a straight line until it hits a wall, then it turns in a random direction. It is also very useful for testing player animations. To access the SDK bot, run Create a Mod from the SDK Launcher panel and choose Start a mod from scratch. Way 2 If you're using the Mod Half Life 2 MultiPlayer, you need to edit three files: dlls/hl2mp_dll/hl2mp_bot_temp.cpp game/server/hl2mp_bot_temp.cppfor Source 2013 Users Comment out the #ifdef DEBUG and #endif at the top and bottom of the file dlls/hl2mp_dll/hl2mp_client.cpp game/server/hl2mp_client.cppfor Source 2013 Users Comment out the #ifdef DEBUG and #endif at lines 188 and 191 Presumably the code block that follows needs to be edited: #ifdef DEBUG extern void Bot_RunAll(); Bot_RunAll(); #endif game_shared/hl2mp/hl2mp_gamerules.cpp game/shared/hl2mp/hl2mp_gamerules.cppfor Source 2013 Users Comment out the #ifdef DEBUG and #endif at lines 38 and 40 and at lines 835 and 859 (lines 968 to 990 if you're using HL2DM on Source Engine 2007 SDK) Presumably the code blocks that follow need to be edited: #ifdef DEBUG #include "hl2mp_bot_temp.h" #endif #ifdef DEBUG // Handler for the "bot" command. void Bot_f() { // Look at -count. int count = 1; count = clamp( count, 1, 16 ); int iTeam = TEAM_COMBINE; // Look at -frozen. bool bFrozen = false; // Ok, spawn all the bots. while ( --count >= 0 ) { BotPutInServer( bFrozen, iTeam ); } } ConCommand cc_Bot( "bot", Bot_f, "Add a bot.", FCVAR_CHEAT ); #endif ConCommand cc_Bot( "bot", Bot_f, "Add a bot.", FCVAR_CHEAT); and change to ConCommand cc_Bot( "bot", Bot_f, "Add a bot."/*, FCVAR_CHEAT */); Now thats done, compile, and run - use the con command 'bot' to spawn bots into the server. Note that when you make a server from with in visual studio, your limited to 2 players so only one bot will spawn. Con Commands When you run the mod you've just created, the sample bot can be accessed with these commands: You will find the sample bot code in dlls\sdk\sdk_bot_temp.cpp. The key function in this file is Bot_Think. This is called each server tick for each bot entity. Inside of here is where the bot decides if it has hit a wall. It also responds to various console commands (not documented here). At the very end, it calls RunPlayerMove, which generates a CUserCmd and calls CBasePlayer::PlayerRunCommand with it. The other interesting function in sdk_bot_temp.cpp is BotPutInServer. This function shows how to create an edict for a bot, create a player entity, and attach the two together so a bot can exist. Most of the time, you'll want to copy the code in here and in CBotManager because it is just glue code that can always be the same (with your own bot classname) More Useful Code This code is by Tjoppen, and can be used with the bots, to respawn them, mess around with where it should go, this is YOUR TURN to learn. void Bot_HandleRespawn( CSDKBot *pBot, CUserCmd &cmd ) { // try hitting my buttons occasionally if ( !pBot->IsAlive() && random->RandomInt( 0, 100 ) > 80 ) { // flip button state cmd.buttons = (!random->RandomInt( 0, 1 ) == 0)?(cmd.buttons|IN_JUMP):0; } } Note that this code is already written in hl2dm_bot_temp.cpp if you're using HL2DM on Source Engine 2007 SDK. Still Need More? More information could be found under AI Programming. Botrix is a plugin that allows to play with bots.
https://developer.valvesoftware.com/w/index.php?title=Server-Side_Bots&oldid=187929
CC-MAIN-2019-26
refinedweb
791
71.24
The String class overrides the equals() method of the Object class and provides its own implementation, which compares two strings for equality based on their contents. For example, we can compare two strings for equality, as shown: String str1 = new String("Hello"); String str2 = new String("Hi"); String str3 = new String("Hello"); boolean b1, b2; b1 = str1.equals(str2); // false will be assigned to b1 b2 = str1.equals(str3); // true will be assigned to b2 We can also compare string literals with string literals or string objects, as shown: b1 = str1.equals("Hello"); // true will be assigned to b1 b2 = "Hello".equals(str1); // true will be assigned to b2 b1 = "Hello".equals("Hi"); // false will be assigned to b1 == operator always compares the references of two objects in memory. str1 == str2 and str1 == str3 will return false, because str1, str2 and str3 are references of three different String objects in memory. To compare two strings based on the Unicode values of their characters, use the compareTo() method. Its signature is public int compareTo(String anotherString) It returns an integer, which can be 0 (zero), a positive integer, or a negative integer. The method returns the difference between the Unicode values of those two characters. For example, "a".compareTo("b") will return -1. The Unicode value is 97 for a and 98 for b. It returns the difference 97 - 98, which is -1. The following are examples of string comparisons: "abc".compareTo("abc") will return 0 "abc".compareTo("xyz") will return -23 (value of 'a' - 'x') "xyz".compareTo("abc") will return 23 (value of 'x' - 'a') The following code shows how to do the string comparisons. public class Main { public static void main(String[] args) { String apple = new String("Apple"); String orange = new String("Orange"); System.out.println(apple.equals(orange)); System.out.println(apple.equals(apple)); System.out.println(apple == apple);/* w w w. j av a 2 s .c o m*/ System.out.println(apple == orange); System.out.println(apple.compareTo(apple)); System.out.println(apple.compareTo(orange)); } } The code above generates the following result. Java maintains a pool of all string literals. It creates a String object in the string pool for every string literal. When it encounters a string literal, it looks for a string object in the string pool with the identical content. If it does not find a match in the string pool, it creates a new String object and adds it to the string pool. If it finds a match in the string pool, it replaces the string literal with the reference of the String object found in the pool. We can add a String object to the string pool using its intern() method. The intern() method returns the reference of the object from string pool if it finds a match. Otherwise, it adds a new String object to the string pool and returns the reference of the new object. To compare two strings for equality ignoring their cases, use the equalsIgnoreCase() method. To perform a case-sensitive comparison for equality, use the equals() method. public class Main { public static void main(String[] args) { String str1 = "Hello"; String str2 = "HELLO"; /*www . j a v a 2 s .co m*/ if (str1.equalsIgnoreCase(str2)) { System.out.println("Ignoring case str1 and str2 are equal"); } else { System.out.println("Ignoring case str1 and str2 are not equal"); } if (str1.equals(str2)) { System.out.println("str1 and str2 are equal"); } else { System.out.println("str1 and str2 are not equal"); } } } The code above generates the following result. The String class compares strings based on the Unicode values of their characters. To compare strings based on the dictionary order, use the compare() method of the java.text.Collator class to perform language-sensitive (dictionary order) string comparisons. The method takes two strings to be compared as arguments. It returns 0 if two strings are the same, 1 if the first string comes after the second, and -1 if the first string comes before the second. The following code illustrates the use of the Collator class. import java.text.Collator; import java.util.Locale; //ww w . j a v a2 s. c o m public class Main { public static void main(String[] args) { Locale USLocale = new Locale("en", "US"); Collator c = Collator.getInstance(USLocale); String str1 = "Java"; String str2 = "HTML"; int diff = c.compare(str1, str2); System.out.print("Comparing using Collator class: "); if (diff > 0) { System.out.println(str1 + " comes after " + str2); } else if (diff < 0) { System.out.println(str1 + " comes before " + str2); } else { System.out.println(str1 + " and " + str2 + " are the same."); } } } The code above generates the following result.
http://www.java2s.com/Tutorials/Java/Java_Data_Type/0200__Java_String_Compare.htm
CC-MAIN-2018-34
refinedweb
772
59.8