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
- ac: a profile in courage Thu, 2011-04-28, 02:07 The subject is a reference to my wondering whether scalac had the courage of its convictions with respect to the specification, as given here: > A special rule concerns parameterless methods. If a paramterless > method defined as def f: T = ...ordef f = > ...overrides a method of type ()T′ whichhasan empty parameter list, then f > is also assumed to have an empty parameter list. So here was my gut check for scalac: class A { def f1(): () => Int = () => 5 } class B extends A { override def f1 = () => 10 def f2 = () => 10 } object Test { def main(args: Array[String]): Unit = { val b = new B println(b.f1() + ", " + b.f2()) } } Well scalac? Are you all talk or do you REALLY assume f1 has an empty parameter list? % scala29 Test , 10 Oh. Nice job I guess scalac. Inciting commentary: Reason I copy to scala-debate: raise your hand if you've ever implemented a structural type and thought "I'm sure glad that "def foo" and "def foo()" are treated as distinct signatures, and that this structural type will be able to cover at most one of those." I'm just curious.
http://www.scala-lang.org/old/node/9331
CC-MAIN-2016-07
refinedweb
196
69.72
In today’s Programming Praxis exercise, our goal is to write three fucntions: FizzBuzz, a function to determine if a base 36 number is prime and one to split a list down the middle while going through the list only once. Let’s get started, shall we? Some imports: import Data.Foldable (toList) import Data.Numbers.Primes import Data.Sequence (ViewL(..), (|>), fromList, viewl, empty) First up we have the classic FizzBuzz interview question. There are plenty of ways to solve it, but I’m partial to this one. fizzbuzz :: Integral a => a -> IO () fizzbuzz n = mapM_ (putStrLn . f) [1..n] where f n = case (mod n 3, mod n 5) of (0, 0) -> "FizzBuzz" (0, _) -> "Fizz" (_, 0) -> "Buzz" _ -> show n To determine if a word is prime we convert it from base 36 to base 10 and then determine if it’s prime. isPrimeWord :: String -> Bool isPrimeWord = isPrime . sum . zipWith (*) (iterate (* 36) 1) . reverse . map (\c -> maybe 0 id . lookup c $ zip (['0'..'9'] ++ ['A'..'Z']) [0..]) For splitting the list, the tortoise and hare algorithm seems dubious to me given the requirement that the list is only scanned once, since both of them scan the list (albeit looking only at half of the elements each). I’ve gone with a different approach. We start with two empty lists, which are balanced. If the lists are balanced, the next element will be added to the right one, which unbalances the list. If they are not balanced, the left element of the right list is added to the end of the left list. splitList :: [a] -> ([a], [a]) splitList = f True (empty, empty) where f _ (l,r) [] = (toList l, toList r) f True (l,r) (x:xs) = f False (l, r |> x) xs f False (l,r) (x:xs) = f True ((\(h :< t) -> (l |> h, t |> x)) $ viewl r) xs Some tests to see if everything is working correctly: main :: IO () main = do fizzbuzz 20 print . not $ isPrimeWord "PRAXIS" print $ isPrimeWord "LISP" print $ splitList [] == ([],[] :: [Int]) print $ splitList [1..4] == ([1,2],[3,4]) print $ splitList [1..5] == ([1,2],[3,4,5]) Tags: bonsai, code, fizzbuzz, Haskell, kata, list, praxis, prime, programming, split, word
https://bonsaicode.wordpress.com/2011/04/26/programming-praxis-miscellanea/
CC-MAIN-2017-30
refinedweb
366
81.12
Important: Please read the Qt Code of Conduct - ListView and QML Object Hello everyone, so to put the context, I have this page QML of settings, then I have a page QML per settings in an other folder, for now they are just put into a Column layout like this : import QtQuick 2.13 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.13 import "Settings/" [ ... ] ColumnLayout { anchors.fill: parent LangueSettings { Layout.fillWidth: true Layout.preferredHeight: parent.height * 0.1 } KeyboardSettings { Layout.fillWidth: true Layout.preferredHeight: parent.height * 0.1 } [ ... ] } [ ... ] This is working of course but I would like to have them into a ListView a litle like this : ListView { anchors.fill: parent property var listObjectSettings: [ LangueSettings, KeyboardSettings, [ ... ] ] model:listObjectSettings delegate: new Component(model[currentIndex]) } this is not working I know it's one of the hundreds syntax i've tried but I couldn't find a way to make it work or any example of something near it, so if someone knows how to make it work or if there is an other way, I would be glad to hear everything about it I'm using Qt 5.13, with MingW73_64 on Windows 7 by the way ^^ Thank you very much by advance - IntruderExcluder last edited by Not sure what are LangueSettings and KeyboardSettings, but I will assume that ObjectModelis probably what you need: ListView { ... model: ObjectModel { LangueSettings {...} KeyboardSettings {...} } } Hello Intruder and thank you very much for this answer, to be honnest I already tried this but being stupid and all I forgot to put dimansion into LangueSettings and KeyboardSettings so they couldn't be displayed. So final item look like this Item { id: itemSettings ListView { anchors.fill: parent model: ObjectModel { LangueSettings { width: itemSettings.width height: itemSettings.height * 0.1 } KeyboardSettings { width: itemSettings.width height: itemSettings.height * 0.1 } } } } And it works perfectly, thank's again Intruder !!
https://forum.qt.io/topic/106119/listview-and-qml-object
CC-MAIN-2020-40
refinedweb
308
57.47
Detecting edges Edge detection is one of the most popular techniques in Computer Vision. It is used as a preprocessing step in many applications. Let's look at how to use different edge detectors to detect edges in the input image. How to do it… - Create a new Python file, and import the following packages: import sys import cv2 import numpy as np - Load the input image. We will use chair.jpg: # Load the input image -- 'chair.jpg' # Convert it to grayscale input_file = sys.argv[1] img = cv2.imread(input_file, cv2.IMREAD_GRAYSCALE) - Extract the height and width of the image: h, w = img.shape - Sobel filter is a type of edge detector that uses a 3x3 kernel to detect horizontal and vertical edges separately. You can learn more about it at ... Get Python: Real World Machine Learning now with O’Reilly online learning. O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.
https://www.oreilly.com/library/view/python-real-world/9781787123212/ch09s03.html
CC-MAIN-2021-39
refinedweb
159
59.9
In the spirit of sharing more of the tech behind the scenes, and reasons why some things are the way they are, this post contains an overview of Unity’s serialization system. Understanding this system very well can have a big impact on the effectiveness of your development, and the performance of the things you make. Here we go. Serialization of “things” is at the very core of Unity. Many of our features build ontop of the serialization system: - Storing data stored in your scripts. This one most people are probably somewhat familiar with. - Inspector window. The inspector window doesn’t talk to the C# api to figure out what the values of the properties of whatever it is inspecting is. It asks the object to serialize itself, and then displays the serialized data. - Prefabs. Internally, a prefab is the serialized data stream of one (or more) game objects and components. A prefab instance is a list of modifications that should be made on the serialized data for this instance. The concept prefab actually only exists at editor time. The prefab modifications get baked into a normal serialization stream when Unity makes a build, and when that gets instantiated, the instantiated gameobjects have no idea they were a prefab when they lived in the editor. - Instantiation. When you call Instantiate() on either a prefab, or a gameobject that lives in the scene, or on anything else for that matter (everything that derives from UnityEngine.Object can be serialized), we serialize the object, then create a new object, and then we “deserialize” the data onto the new object. (We then run the same serialization code again in a different variant, where we use it to report which other UnityEngine.Object’s are being referenced. We then check for all referenced UnityEngine.Object’s if they are part of the data being Instantiated(). If the reference is pointing to something “external” (like a texture) we keep that reference as it is, if it is pointing to something “internal” (like a child gameobject), we patch the reference to the corresponding copy). - Saving. If you open a .unity scene file with a text editor, and have set unity to “force text serialization”, we run the serializer with a yaml backend. - Loading. Might not seem surprising, but backwards compatible loading is a system that is built on top of serialization as well. In-editor yaml loading uses the serialization system, as well as the runtime loading of scenes and assets. Assetbundles also make use of the serialization system. - Hot reloading of editor code. When you change an editor script, we serialize all editor windows (they derive from UnityEngine.Object!), we then destroy all the windows, unload the old c# code, load the new c# code, recreate the windows, and finally deserialize the datastreams of the windows back onto the new windows. - Resource.GarbageCollectSharedAssets(). This is our native garbage collector and is different to the C# garbage collector. It is the thing that we run after you load a scene to figure out which things from the previous scene are no longer referenced, so we can unload them. The native garbage collector runs the serializer in a mode where we use it to have objects report all references to external UnityEngine.Objects. This is what makes textures that were used by scene1, get unloaded when you load scene2. The serialization system is written in C++, we use it for all our internal object types (Textures, AnimationClip, Camera, etc). Serialization happens at the UnityEngine.Object level, each UnityEngine.Object is always serialized as a whole. They can contain references to other UnityEngine.Objects and those references get serialized properly. Now you may say that none of this concerns you very much, you’re just happy that it works and want to get on with actually creating some content. However, this will concern you, as we use this same serializer to serialize MonoBehaviour components, which are backed by your scripts. Because of the very high performance requirements that the serializer has, it does not in all cases behave exactly like what a C# developer would expect from a serializer. Here we’ll describe how the serializer works and some best practices on how to make the best use of it. What does a field of my script need to be in order to be serialized? - Be public, or have [SerializeField] attribute - Not be static - Not be const - Not be readonly - The fieldtype needs to be of a type that we can serialize. Which fieldtypes can we serialize? - Custom non abstract classes with [Serializable] attribute. - Custom structs with [Serializable] attribute. (new in Unity4.5) - References to objects that derive from UntiyEngine.Object - Primitive data types (int,float,double,bool,string,etc) - Array of a fieldtype we can serialize - List<T> of a fieldtype we can serialize So far so good. So what are these situations where the serializer behaves differently from what I expect? Custom classes behave like structs If you populate the animals array with three references to a single Animal object, in the serializationstream you will find 3 objects. When it’s deserialized, there are now three different objects. If you need to serialize a complex object graph with references, you cannot rely on Unity’s serializer doing that all automagically for you, and have to do some work to get that object graph serialized yourself. See the example below on how to serialize things Unity doesn’t serialize by itself. Note that this is only true for custom classes, as they are serialized “inline” because their data becomes part of the complete serializationdata for the MonoBehaviour they are used in. When you have fields that have a reference to something that is a UnityEngine.Object derived class, like a “public Camera myCamera”, the data from that camera are not serialized inline, and an actual reference to the camera UnityEngine.Object is serialized. No support for null for custom classes Pop quiz. How many allocations are made when deserializing a MonoBehaviour that uses this script: It wouldn’t be strange to expect 1 allocation, that of the Test object. It also wouldn’t be strange to expect 2 allocations, one for the Test object and one for a Trouble object. The correct answer is 729. The serializer does not support null. If it serializes an object and a field is null, we just instantiate a new object of that type and serialize that. Obviously this could lead to infinite cycles, so we have a relatively magical depth limit of 7 levels. At that point we just stop serializing fields that have types of custom classes/structs and lists and arrays. [1] Since so many of our subsystems build on top of the serialization system, this unexpectedly big serializationstream for the Test monobehaviour will cause all these subsystems to perform more slowly than necessary. When we investigate performance problems in customer projects, we almost always find this problem and we added a warning for this situation in Unity 4.5. We actually messed up the warning implementation in such a way that it gives you so many warnings, you have no other option but to fix them right away. We’ll soon ship a fix for this in a patch release, the warning is not gone, but you will only get one per “entering playmode”, so you don’t get spammed crazy. You’d still want to fix your code, but you should be able to do it at a time where it suits you. No support for polymorphism If you have a and you put in an instance of a dog, a cat and a giraffe, after serialization, you will have three instances of Animal. One way to deal with this limitation is to realize that it only applies to “custom classes”, which get serialized inline. References to other UnityEngine.Object’s get serialized as actual references and for those, polymorphism does actually work. You’d make a ScriptableObject derived class or another MonoBehaviour derived class, and reference that. The downside of doing this, is that you need to store that monobehaviour or scriptable object somewhere and cannot serialize it inline nicely. The reason for these limitations is that one of the core foundations of the serialization system is that the layout of the datastream for an object is known ahead of time, and depends on the types of the fields of the class, instead of what happens to be stored inside the fields. I want to serialize something that Unity’s serializer doesn’t support. What do I do? In many cases the best approach is to use serialization callbacks. They allow you to be notified before the serializer reads data from your fields and after it is done writing to them. You can use this to have a different representation of your hard-to-serialize data at runtime than when you actually serialize. You’d use these to transform your data into something Unity understands right before Unity wants to serialize it, you also use it to transform the serialized form back into the form you’d like to have your data in at runtime, right after Unity has written the data to your fields. Let’s say you want to have a tree datastructure. If you let Unity directly serialize the data structure, the “no support for null” limitation would cause your datastream to become very big, leading to performance degradations in many systems: Instead, you tell Unity not to serialize the tree directly, and you make a seperate field to store the tree in a serialized format, suited for Unity’s serializer: Beware that the serializer, including these callbacks coming from the serializer, usually do not run on the main thread, so you are very limited in what you can do in terms of invoking Unity API. (Serialization happening as part of loading a scene happens on a loading thread. Serialization happening as part of you invoking Instantiate() from script happens on the main thread). You can however do the necessary data transformations do get your data from a non-unity-serializer-friendly format to a unity-serializer-friendly-format. You made it to the end! Thanks for reading this far, hope you can put some of this information to good use in your projects. Bye, Lucas. (@lucasmeijer) PS: We’ll add all this information to the documentation as well. [1] I lied, the correct answer isn’t actually 729. This is because in the very very old days before we had this 7 level depth limit, Unity would just endless loop, and then run out of memory if you created a script like the Trouble one I just wrote. Our very first fix for that 5 years ago was to just not serialize fieldtypes that were of the same type as the class itself. Obviously, this was not the most robust fix, as it’s easy to create a cycle using Trouble1->Trouble2->Trouble1->Trouble2 class. So shortly afterwards we actually implemented the 7 level depth limit to catch those cases too. For the point I’m trying to make however it doesn’t matter, what matters is that you realize that if there is a cycle you are in trouble. 관련 게시물 39 replies on “Serialization in Unity” Seems to be some fairly major bugs in OnAfterDeserialize too. But debugging is impossible, because Unity will crash on any attempt to debug that method (since Unity isn’t running on the main thread, you’re not allowed to read any data. If you can’t read, you certainly can’t debug!) After spending a couple of weeks trying to make this work, I’ve realised that this feature is – in practice – pretty much useless. Unity prevents you from having any “unique ID” per object. Without unique ID’s, it is not possible to do general serialization. Only toy examples will work with these callbacks :(. I say “prevents” because Unity seemingly goes out of its way to destroy all stable definitions of ID, and we only need this because the Serialization callbacks above have insufficient information without it. I’m sure this wasn’t intentional, but it’s an inevitable side-effect of three things: 1. Unity “re-defines” core C# object-construction (constructors aren’t treated as constructors – but the Unity workaround (Awake()) ONLY works at runtime, not in editor), which breaks e.g. Microsoft’s ObjectIdGenerator (try it: Unity serialization kills it) 2. Unity processes “create new” and “duplicate old” identically: you cannot tell the difference in code. This means you CANNOT generate and save an internal ID: when the object is duplicated, or prefab-instantiated, Unity will give you copies of the same ID, breaking everything) 3. These callbacks are PREVENTED from comparing GameObject instances. Without that, you cannot construct a workaround based on stable IDs that exist in MonoBehaviour (which – obviously – faced the same problems as above, but has Unity internal fixes to help it along) Between these, it’s not possible to write any object graph to be serialized. You can workaround any two of those three (the first two are hardest to workaround: they require you to write code that doesn’t do what you want to do, in order to generate the side-effect you needed). But with all 3 … it seems to be hopeless. I’ve tried every avenue I could think of, and always hit the same dead-ends: Unity’s workarounds to Unity’s Serialiazation bugs are incomplete. That makes these callbacks IMHO a waste of time. Yes, you can implement some simple, localized data-structures with them. But you can’t have object referneces, which cuts out the vast majority of C# coding :(. Very disappointing. Olla buddy, This is really useful! Thank you a lot! is the inability to serialize generic types the reason why we can’t have generic monobehaviors on gameobjects? or is there something more to it? Generic monobehaviors would make things a lot easier, rather than having dictionaries of and stub monobehaviors that are just empty implementations of the generic monobehavior. @Ashkan: The scenario you mean is when you call Instantiate() on something. Let’s take this example. There are three objects. O1: GameObject components=O2, O3 O2: RigidBody O3: BoxCollider when you invoke Instatiate(gameObject1), we duplicate all three objects. O4: GameObject components=O2, O3 O5: RigidBody O6: BoxCollider Notice how the cloned object O4, actually points to O2 and O3 in its component list. this is obviously not what you intended. In the second phase of Instantiate, we fix this up, by running the serializer in a special mode on O1,O2&O3. we ask it “please report your object references”, and then we check if any of the objects referenced were included in the list of objects that were cloned. For each reference that referenced an object that was cloned (both entries in the componentlist in our case), we update that reference to the cloned version instead of the original. after the fix it looks like this: O4: GameObject components=O5, O6 O5: RigidBody O6: BoxCollider Hope that clears things up, L @Lucas Many thanks for writing all of these, It was really helpful but one piece of information was missing. At runtime Unity executes serialization callbacks multiple times, Can you describe the way that it works? It should be something like this — serialize/deserialize (one time) if we don’t have any object references exit try fixing references to UnityEngine.Object and children (once more) //Is there any difference between the times which a fix happens or not? — Do you serialize structs in the second phase (fixing phase) to avoid reallocating memory for them since they are value types? Hello This whole serialization sounds great, but… When I have a scene with 10’000 objects, all refering to the same prefab and without customized values, then why are they all fully saved? My scene save data is always huge, but when I compress this data, it’s only a fraction of the previous size. Please add some compression to the saves of scenes, that would be great as people want to share projects with dropbox and stuff. @Jacob: there are no technical impossibilities to improving the serializer. some improvements are not that hard (generic types), some are a lot of hard work (polymorphism, null). I wrote this post to explain how the serializer currently works, and give some background on some of the reasons why. Your serializationcallback is being called all the time because of item#2 in the bulletpoint list of this blogpost: the inspectorwindow serializes the object it is inspecting, and then displays the serialized data. @vexe: I don’t see a good usecase for serializing abstract types. I think the only thing it would add is confusion for users who would then (not surprsingly) think that polymorphism will work. @vexe: serializing generic types I hope to implement soonish. It turns out it’s a little bit hard because on Metro/WinPhone8 we actually have a completely seperate serialization codepath which is based on codegeneration instead of “setting values in managed memory from c++”. due to the way the serialization code is generated, generic types don’t work quite well with that yet. It will require me changing the way we emit the serialization code for wp8/metro. Internally, we can’t wait until we can throw away the duplicate serialization codepath for WP8/Metro, this is something that will happen when we manage to get wp8/metro shipping on il2cpp @VEXE Brilliant solution to the merge issue, thanks! Next thing to solve is how to modify the JSON reference-preserving functionality to use localized ids, so that the reference id’s are only invalidated within the branch that contains graph cycles. *Sigh* “But, if i ‘just’ remove the word abstract, the Animal reference persists” – Sorry I take that back. I was testing on a small scale of types. Got confused with something else. Another thing on abstract classes: So this is not serialized: public class MB : MonoBehaviour { public Animal animal; } public abstract class Animal { } [Serializable] public class Cat : Animal { } [Serializable] public class Dog : Animal { } Assume “animal” is assigned in-editor somehow to a Cat or Dog, via a custom editor or whatever… Of course after I enter playmode the reference is gone. But, if i ‘just’ remove the word abstract, the Animal reference persists. What ‘practical’ difference is there between the ‘abstract’ Animal and the non-abstract one in this case? – I don’t see any! – There’s still an Animal base referencing child objects. I don’t see why can’t you just serialize abstracts if you could serialize them with the absence of the word ‘abstract’ “Some things that are relatively long hanging fruit that I want to get to are serialization of generic types” I’d love to see that happen. @Lucas Meijer: Can you please explain why is it hard to serialize generic types? I mean, you did serialize a generic list, so what’s stopping you from serializing any serializable generic type? I’ve seen lots of custom solutions (like Full Inspector for ex) where they use 3rd party serializers like proto-buf to serialize pretty much everything with total ease. If it’s hard to serialize generic types, why can’t you just go for these custom solution/serializers as well? @Jacob L “…My problem with the as-is callbacks is that my giant JSON string (homegrown polymorphic type support) is printed horrifically in the text-mode assets, making merging a nightmare.” We ran into a similar problem with our home-made serialization. Just split the (pre-beautified) string on \n and serialize a string[] instead of one string field. Finally, escape ‘ and it looks awesome in the yaml. (I usually do yaml-editing now to do smaller property changes. Much faster.) @Rene Thanks for the post! Unfortunately this whole serialization ordeal is one of my remaining biggest frustrations with Unity. I buy some of the rationales you’ve laid out here, but I strongly suspect that the real reasons have to do with backwards compatibility, not any actual technical impossibility. Take polymorphic serialization. The claim of the blog post is that the format of the stream must be known ahead of time. That is, the *format* not the length. Or else you would never be able to serialize a string or a list. Paradigmatically, all you need to support polymorphism is to write a type indicator if the stored type is not the base type. Just the CLR module specification will do, those are unique, yes? In a binary data stream, you of course need a sentinel bit/byte on every class object to indicate whether to check for the type, but you can always make it opt-in on the field level. I needn’t be the one telling you this though, there are freely available serialization libraries that already do this, but Unity’s isn’t one of them. The new serialization callbacks would be fully complete if it gave access to the raw serialization stream, as well as text-mode formatting options. Then the users can make as many performance blunders as they wish, and it’s all on their shoulders. My problem with the as-is callbacks is that my giant JSON string (homegrown polymorphic type support) is printed horrifically in the text-mode assets, making merging a nightmare. Also, any ideas why OnBeforeSerialize is called constantly on my ScriptableObject when it is open in the inspector? “…no longer tear down the entire domain, but to extend mono to re-jit only the methods that have changed when you changed a script” +1 I’d like to see that in the future. It makes me happy to see that there are programmers in Unity team that are actively working on improving lives of Unity programmers. These little things, like adding serialization hooks make our lives so much easier and make so many things possible. As a programmer, I would love to see Unity reach a level where I can employ good programming principles and not do workarounds and compromises all the time because some basic things such as polymorphism and generics don’t work well in Unity. I am working with a wonderful language that is C# but can’t use it’s full beauty because of complications. :( @Lucas Meijer “…no longer tear down the entire domain, but to extend mono to re-jit only the methods that have changed when you changed a script” Awesome. IMHO that is the way to go. There are some enterprise-level appdomain serializers out there and for some they were developed as long as C# is around and still don’t get every corner case correctly.. What about the suggested global hooks in e.g. EditorApplication? I recon, that would be very cheap to realize and support a wide range of applications. You could even pass a parameter whether you do just a hot-fix to the runtime or you are going for a full assembly reload. @Prankard: Types like GameObject, Components, MonoBehaviours (Anything inheriting from UnityEngine.Object) are simply referenced, no duplication etc is going on. Other types like structs and classes with [system.serializable] not inheriting from UnityEngine.Object are “embedded” into the serialization stream and are thus duplicated. Hmm, does that mean if I did this: // Assigned in scene public GameObject prefab; void Start() { GameObject instance = (GameObject)GameObject.Instantiate(prefab); } The scene is loading in my serialised object into a new GameObject on scene load. And then on Instantiate it is serialising that new GameObject and then deserialise and making a new one? Is there not a way for us to Instantiate a prefab as a new GameObject directly from the serialised prefab instance? As this would be faster if my Instantiate was in a large for loop. This was an interesting blog post. It makes me understand a little bit more on the core code of Unity3D. Thanks for sharing :) I had a game that I made (back in Unity version 3) that had a particular ‘levelblock’ prefab. This prefab was a reskinable 3d block that we used to build a lot of custom levels out of. One of the things we realised (pretty quickly), was that if you wanted to Instantiate() about 200-300 prefabs it makes mobile run pretty slowly for a few seconds. After reading your post it seems clear why, (creating from a serialised prefab and then doing all those reference checks after. Makes me think that in those rare scenarios you may not want to use a unity prefab and perhaps try and create that one game object with all new keywords and reference the dependencies yourself. The serialiser you’ve written seems interesting. Is there and api at runtime that we could call it to serialise anything that extends Unity.Object and then deserialise it ourselves? It would be a good alternative to c#’s serialiser. (Or does it already use the system.serializer as its core?) @Hatless: I agree that the practicle usecases for having a running game survive a serialize-domainreload-deserialize phase are tiny. I think that if we would also serialize static variables it would go from tiny to a little more than tiny. What we’ve been thinking about internally is to completely change the way around that we do script reloads, and to no longer tear down the entire domain, but to extend mono to re-jit only the methods that have changed when you changed a script. (and do a traditional domain reload in case you moved/added/changed field layout). speeding up entering playmode is defenitely something that has been discussed a lot around the dev team lately. Regarding communication of this feature on the website: I just spent five minutes looking to see if anywhere we advertise that you can change scripts while keeping the game running. I was not able to find it. If you can point me to a piece of text on the website that you feel is advertising this feature as if it does more than it does in reality, please point me to it, and I’ll change the website. @richard: if you have a monobehaviour with 3 int fields. create some of them in the scene, and populate the scene with data. if you later change your script, and add another int field in the middle of the other fields, the typetree is the thing that will automatically “upgrade your data” to the new format, without you even having to think about it. we use typetrees for this for monobehaviours, but even for our internal types like texture2d or camera, it’s very easy for us to add another member variable that needs to be serialized. the typetree will automatically make sure we can properly load old data. you could totally design a serialization system to work differenly, have different tradeoffs. ours is currently designed like this. I’d like to improve the serializer over time, (as we did with unity4.5), but we have to weigh each potential improvement against all other unity improvements that we could be doing. Some things that are relatively long hanging fruit that I want to get to are serialization of generic types, a built in dictionary (like the one you and I started hacking on a bit back, but then built on serializationcallbacks). @richard: about cycles in private members, I think the answer to that is yes. but I didn’t check. if the answer indeed is yes though, you can easily break it by adding a [NotSerialized] attribute Also, regarding private members: Doesn’t them being serialised for hot-reload mean we can’t have type cycles even in private members? So I get the typetree vs instance distinction, but I don’t really get *why* it’s that way. Given that you can have a collection of variable length in an instance of a type, you can’t use the type tree to predict the size of an instance, or even the offsets of particular fields within an instance. So I’m confused, what’s the typetree actually *for*? I second Hatless. “This core feature of Unity — this feature you advertise very prominently on the website — has not, so far as I know, ever worked.” Every Unity programmer I ever talked to confirmed me, that he never saw a Unity project bigger than a toy-solution or tutorial, that actually could survive an assembly reload during play mode. For our project, we wrote a small editor script that immediately stops play mode when it detects an recompile. This is much faster than to wait for the assembly reload to occur just to throw tons of exceptions. Also, we mark all and every private variable as NonSerializable to speed up assembly reload – even if its just a bit. I know that it is possible to write code that survive assembly reloads, but it restricts so much of sound C# design principles, that it is laughable to even try. Please do not assume that private member serialization during runtime is anything usefull in its current state. Some kind of hot-swapping of dlls during runtime without unloading the appdomain would be awesome. (Like MS.NET and Visual Studio does it for some code changes) An global callback in EditorApplication just before and after assembly reload occurs would help much more (which is guaranteed to be in the main thread, so it actually can do usefull things with Unity). This way we could fire up some professional C# appdomain serializer (or redirect to any ingame savegame/loading system.. nice integration test for these as well ^^). Will Unity ever stop losing static values when it recompiles scripts at runtime? This (invisibly, silently) breaks any project over a certain level of complexity. This core feature of Unity — this feature you advertise very prominently on the website — has not, so far as I know, ever worked. @all: what rene said. it’s not technically impossible to ever support null. it’s a lot of non trivial work though. We’ have to somehow serialized “inline objects” with a bool wether or not this one is null. it affects how you interact with such objects with the SerializerProperty class, as well as the prefab system. (if the “isnull” bit is marked, but a prefab sets a value anyway, what do you do). none of these are theoretically unsolvable. you would however still run into the depth limit problem, because of the way we do backwards compatible loading. When we do backwards compatible loading, we at runtime, generate a typetree for a certain object. this concept of a typetree is actually a pretty core one in unity, and already should give a good feeling on how many of our systems are built around assumptions on how datalayout is static. we indeed have the concept of a collection, but other than that that’s it. so when we generate a typetree, we actually create an object, then we serialize it in a special typetree creation mode. if you have class cycles, the typetree would still grow very big. (we cap it to 7 levels too). so yeah, a ton of work. up until now we have prioritized other things, and I don’t see that changing in the near future. (I actually spent a week or two going down this rabbit hole for both null and polymorphism when I did the serialization improvements for 4.5, thinking I’d be able to get something in, but I ended up with the conclusion that it would take a lot more time than that, and that my time was better spent providing things like serialization callbacks, and other things in Unity that I feel could really use some loving). Thanks for the post Lucas! Regarding this: “No support for null for custom classes” This has its pros and cons, but at least it’s a very clear contract… except when the script just got created, where custom class fields (and arrays, BTW) are null until the first reload or inspector change. I reported this, case # 613469, just in case it didn’t make its way to you ;) ! This makes it painful for custom editor and ExecuteInEditMode scripts, this forces us to place nullchecks for just this corner case. This is sort-of related (at least in my mind) to another bug (case # 608574): OnValidate is not called when the script is first created. It’s like “just created” objects don’t go through the same codepath that “properly serialized and loaded”. @Richard This has to do with the separation between “this is how you serialize class Node” vs. “serializing an instance of class Node”. Basically, looking at any arbitrary class C, the system has to be able to figure out what the data for the class looks like on disk and that has to be true for any given instance of class C. So, let’s say the system is looking at the Node class that has the recursion. It finds the List field. So the system switches to the List serialization code which says “I’m inserting a count and an arbitrary number of Node objects at the current position”. That in turn makes the system switch back to the serialization code for Node which says “I’m inserting a Node at the current position”. And round it goes. The serialized data that you outline, however, depends on how things actually look at runtime, i.e. on the actual values found in properties, whereas the serialization system operates entirely from static type data. And you’re correct about private fields being serialized when we do script reloads in the editor. The rationale here is that if we don’t, we lose significant internal state (both for the editor as well as when your game is running) and when resuming execution things will likely go very wrong. However, this serialization is completely transient, i.e. it only ever writes state to memory and never to disk. @Daniel It’s because the system as is has no concept of “pointer/reference to something that is not a UnityEngine.Object”. The reason for that is that in the object persistence model (which is based on C++ objects, not .NET objects), these objects that aren’t UnityEngine.Objects have no identity. A UnityEngine.Object always has an identity established with the engine (which you can see by calling Object.GetInstanceID) and every such object can be made persistent in which case it receives another identity that is tied to a blob of data on disk. So, for correctly handling null correctly on arbitrary user classes, the persistence system would have to have a concept of “pointer to a shared piece of data in a serialized data stream which, however, is not an engine object”. With that, it would be possible to serialize reference as you’d expect rather than treating custom user classes as value types. However, there’s other ways to hack in support for a “null” representation without adding full support for a new type of pointer/reference. We’ll have to see what’s the best path here in the future. @RICHARD FINE I’m curious about the zero-length lists too. Will it still run into the problem if a list down the line is empty before the depth limit is reached? Thank you for finally writing this post. Now I finally understand why I had so much trouble with serialization in the past. You should add articles like these to the documentation. They are very valuable! Serialization callbacks, finally! Woooohooo!!! Oh how long I’ve waited for those! And this time it is not a magical callback but interface implementation!! And to anyone who wonders if this works with custom non MonoBehaviour classes – it does! (But not structs) You have no idea just how happy you just made me! Is there something special about ScriptableObjects, as they seem to serialize its private fields by default? I’m also curious about the behaviour that Richard Fine posted. But in addition, why don’t you support polymoorphism? Wouldn’t it be easy to just get the type (object.getType()) and store this type together with the data? I don’t think that this would cause a large overhead, but at the end the serialization process would work like the developer would think it does. And finaly, why don’t you support properties that are writable and readable? It should be easy with reflection… Greetings Chillersanim I’m curious about the same thing Richard Fine posted, I read your example of that problem in a Unity thread and had some confusion as to why that would be a problem. Thanks for posting this writeup, though. The serialization callbacks are an exciting advancement for editor scripting – I can’t wait to upgrade to 4.5. I wonder if other engines also put such strong emphasis on the concept of serialization or it “just works” as the developer would expect (e.g: UE4) While you don’t support nulls, you do support serialising zero-length lists of objects. So how come [Serializable] class Node { public List ns; } causes problems, given that ns can be zero-length? I mean, how come it can’t generate a small set of properties like ns.arraySize = 3 ns.data[0].ns.arraySize = 0 ns.data[1].ns.arraySize = 1 ns.data[1].ns.data[0].arraySize = 0 ns.data[2].ns.arraySize = 0 and stop there? Also, you said that a field has to be public (or [SerializeField]) to be serialised, but Levi said in the forum that private fields get serialised during hot-reload in the editor…? desi Why don’t you just support nulls? I have my own serialization system and don’t use scenes and I didn’t encounter any issues for this for my use-cases; what I serialize is a little more verbose though. Is this for performance reasons, I’d like to know in-case it’s something that hasn’t yet occurred to me. Nice, I’ve actually gone in and edited yaml in a text editor when opening unity would incur an import time longer than the time need for the change. I’ve also done it to batch edit settings on AudioClips.
https://blogs.unity3d.com/kr/2014/06/24/serialization-in-unity/
CC-MAIN-2020-34
refinedweb
6,413
61.77
11 August 2011 19:41 [Source: ICIS news] (adds Canadian and Mexican shipment data) ?xml:namespace> Canadian chemical railcar loadings for the week totalled 9,861, up from 9,598 in the same week a year earlier, the Association of American Railroads (AAR) said. The previous week ended 30 July saw a year-on-year increase of 17.4%. The weekly chemical railcar loadings data are seen as an important real-time measure of chemical industry activity and demand. Year to date to 6 August, Canadian chemical railcar shipments were up by 12.0% to 351,375. The AAR said chemical railcar traffic in Year to date to 6 August, Mexican chemical railcar shipments were up 2.8% to 36,208 carloads. Chemical shipments on US railroads rose 0.7% year on year in the week ended on 6 August, to 28,967 chemical railcar loadings from 28,767 loadings in the same week in 2010. In the previous week ended on 30 July, Meanwhile, overall US weekly railcar shipments for the 19 high-volume freight commodity groups tracked by the For all.
http://www.icis.com/Articles/2011/08/11/9484614/canadian+weekly+chemical+railcar+traffic+rises+2.7.html
CC-MAIN-2013-20
refinedweb
183
56.05
I was working recently on a GoogleVR Cardboard project where they printed their own custom Cardboard headsets and bulk mailed them out to invited guests. As you may or may not know, each Google cardboard physcial headset could be manufactured with different specifications but still obtain the “”Works with Google Cardboard” compatibility via a custom profile (with specs embedded into a URL and QR Code) using the Viewer Profile Generator. This profile can be scanned in by the user in the Cardboard app to set the correct viewer settings. If the user has not paired a hardware Cardboard Viewer with your app (using the settings QR Code scanner) then you can set the default to be a different viewer – and that default will stay in effect unless the user decides to scan in a different one. Note: GoogleVR Cardboard stores the viewer linked to the provisioning profile of your app, so if you re-install the app the pairing will still be valid. If you want to specifically lose that pairing you will need to change your provisioning profile (a bundle id change is not enough). To set the default profile you will need to install the GoogleVR Cardboard SDK for Unity. You have to do this because the generic VR settings in Unity do not have a concept of profiles. When you use the GoogleVR Cardboard SDK it will communicate directly to the cardboard native library that Unity has embedded in it. For full details, watch my tutorial video: In SDK we want: GvrCardboardHelpers.SetViewerProfile(profileURI) Broken on GVR Unity SDK v1.60 Important Note: This method is currently broken in GVR Unity SDK v1.60.0 (Jun 7, 2017). Please follow this work-around to fix it: Pull Request #622: GvrSettings and GvrCardboardHelpers on ios should use [DllImport(“__Internal”)] SetViewerProfile SDK method Lets create a c# script to set the default profile URI. SetupCardboard.cs: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.VR; public class SetupCardboard : MonoBehaviour { public string CardboardProfileUri; void Awake () { if (VRSettings.loadedDeviceName == "cardboard") { GvrCardboardHelpers.SetViewerProfile (CardboardProfileUri); } } } Add that script to a game object in the scene and build your app. On that component, enter a URI for CardboardProfileUri property. eg: URI for 2015 Cardboard Viewer V2 If the user has not already paired a viewer with your app then the app will now be pre-configured for the viewer you setup. If you have your own viewer profile called “My Viewer” then it will appear like this: that is getting the pointer on. So if your current VR module is set to “None” or some other one, then the call will attempt to use an invalid pointer and your app will crash or do something unexpected. Checking if the default was applied The method SetViewerProfile() returns void, but internally the SDK function returns a boolean, which will be True if it changed the device to the one you requested, otherwise False (if the user already was paired to a device). I verified this works, by changing the void return type to bool and making sure the call in the DLLImport returns the result. This is useful if you do want to know if they user has paired or not. Getting the profile (aka cfg url) So above I fed in a URI into CardboardProfileUri(). Just how did I get that URI? You probably just have a fancy QR Code. To get your config URI, here are the steps I used: 1. Download a copy of your QR Code 2. Decode it by upload it to 3. You’ll get a parsed result, such as: 4. We want to go to that URL *BUT* not in a web browser (which redirects to a fancy user page), instead, use a command line tool such as curl. So open up terminal and enter: $ curl 5 Examine the response and it will contain the cfg URI eg: <HTML> <HEAD> <TITLE>Moved Permanently</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1>Moved Permanently</H1> The document has moved <A HREF="">here</A>. </BODY> </HTML> 6. Copy the URL from that and use it in your profile setup!
http://talesfromtherift.com/googlevr-cardboard-set-default-viewer-profile/
CC-MAIN-2018-17
refinedweb
691
70.63
Flash Player 10 and later, Adobe AIR 1.5 and later Using a shader as a blend mode is like using other blend modes. The shader defines the appearance resulting from two display objects being blended together visually. To use a shader as a blend mode, assign your Shader object to the blendShader property of the foreground display object. Assigning a value other than null to the blendShader property automatically sets the display object’s blendMode property to BlendMode.SHADER. The following listing demonstrates using a shader as a blend mode. Note that this example assumes that there is a display object named foreground contained in the same parent on the display list as other display content, with foreground overlapping the other content: foreground.blendShader = myShader; When you use a shader as a blend mode, the shader must be defined with at least two inputs. As the example shows, you do not set the input values in your code. Instead, the two blended images are automatically used as shader inputs. The foreground image is set as the second image. (This is the display object to which the blend mode is applied.) A background image is created by taking the composite of all the pixels behind the foreground image’s bounding box. This background image is set as the first input image. If you use a shader that expects more than two inputs, you provide a value for any input beyond the first two. The following example demonstrates using a shader as a blend mode. This example uses a lighten blend mode based on luminosity. The result of the blend is that the lightest pixel value from either of the blended objects becomes the pixel that’s displayed. draws three objects. The first, backdrop, is a dark gray background behind the blended objects. The second, backgroundShape, is a green gradient ellipse. The third object, foregroundShape, is an orange gradient ellipse. The foregroundShape ellipse is the foreground object of the blend. The background image of the blend is formed by the part of backdrop and the part of backgroundShape that are overlapped by the foregroundShape object’s bounding box. The foregroundShape object is the front-most object in the display list. It partially overlaps backgroundShape and completely overlaps backdrop. Because of this overlap, without a blend mode applied, the orange ellipse (foregroundShape) shows completely and part of the green ellipse (backgroundShape) is hidden by it: However, with the blend mode applied, the brighter part of the green ellipse “shows through” because it is lighter than the portion of foregroundShape that overlaps it: The following is the ActionScript code for this example. Use this class as the main application class for an ActionScript-only project in Flash Builder, or as the document class for the FLA file in Flash Professional: package { import flash.display.BlendMode; import flash.display.GradientType; import flash.display.Graphics; import flash.display.Shader; import flash.display.Shape; import flash.display.Sprite; import flash.events.Event; import flash.geom.Matrix; import flash.net.URLLoader; import flash.net.URLLoaderDataFormat; import flash.net.URLRequest; public class LumaLighten extends Sprite { private var shader:Shader; private var loader:URLLoader; public function LumaLighten() { init(); } private function init():void { loader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.BINARY; loader.addEventListener(Event.COMPLETE, onLoadComplete); loader.load(new URLRequest("LumaLighten.pbj")); } private function onLoadComplete(event:Event):void { shader = new Shader(loader.data); var backdrop:Shape = new Shape(); var g0:Graphics = backdrop.graphics; g0.beginFill(0x303030); g0.drawRect(0, 0, 400, 200); g0.endFill(); addChild(backdrop); var backgroundShape:Shape = new Shape(); var g1:Graphics = backgroundShape(); addChild(backgroundShape); var foregroundShape:Shape = new Shape(); var g2:Graphics = foregroundShape.graphics; var c2:Array = [0xff8000, 0x663300]; var a2:Array = [255, 255]; var r2:Array = [100, 255]; var m2:Matrix = new Matrix(); m2.createGradientBox(300, 200); g2.beginGradientFill(GradientType.LINEAR, c2, a2, r2, m2); g2.drawEllipse(100, 0, 300, 200); g2.endFill(); addChild(foregroundShape); foregroundShape.blendShader = shader; foregroundShape.blendMode = BlendMode.SHADER; } } } The following is the source code for the LumaLighten shader kernel, used to create the “LumaLighten.pbj” Pixel Bender bytecode file: <languageVersion : 1.0;> kernel LumaLighten < namespace : "com.quasimondo.blendModes"; vendor : "Quasimondo.com"; version : 1; description : "Luminance based lighten blend mode"; > { input image4 background; input image4 foreground; output pixel4 dst; const float3 LUMA = float3(0.212671, 0.715160, 0.072169); void evaluatePixel() { float4 a = sampleNearest(foreground, outCoord()); float4 b = sampleNearest(background, outCoord()); float luma_a = a.r * LUMA.r + a.g * LUMA.g + a.b * LUMA.b; float luma_b = b.r * LUMA.r + b.g * LUMA.g + b.b * LUMA.b; dst = luma_a > luma_b ? a : b; } } For more information on using blend modes, see Applying blending modes. Twitter™ and Facebook posts are not covered under the terms of Creative Commons.
http://help.adobe.com/en_US/as3/dev/WSB19E965E-CCD2-4174-8077-8E5D0141A4A8.html
CC-MAIN-2013-48
refinedweb
784
51.44
curl_mime_free - free a mime handle NAME curl_mime_free - free a previously built mime structure SYNOPSIS #include <curl/curl.h> void curl_mime_free(curl_mime *mime); DESCRIPTION curl_mime_free is used to clean up data previously built/appended with curl_mime_addpart and other mime-handling functions. This must be called when the data has been used, which typically means after curl_easy_perform has been called. The handle to free is the one you passed to the CURLOPT_MIMEPOST option: attached subparts mime structures must not be explicitly freed as they are by the top structure freeing. mime is the handle as returned from a previous call to curl_mime_init and may be NULL. Passing in a NULL pointer in mime will make this function return immediately with no action. AVAILABILITY As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0. RETURN VALUE SEE ALSO This HTML page was made with roffit.
https://curl.se/libcurl/c/curl_mime_free.html
CC-MAIN-2020-50
refinedweb
150
72.26
Find the item you want, right-mouse click on it, and select "Generate Management Class" to have Visual Studio generate a management class for you. For instance, right-mouse clicking on My Computer in Server Explorer generates a class called ComputerSystem (in the namespace ROOT.CIMV2) with all sorts of read/write properties for changing settings on your application's host computer. It also includes many read-only properties for checking the computer's state. Several enumerations are included to allow you to write readable code. There's another way to get Visual Studio to create a class for managing computer resources for you. If you work with Message Queues (or any of the other things listed in Server Explorer), Visual Studio is more than willing to generate a control that you can use from your code to manage that resource. Just click on the item in Server Explorer and drag it onto a form (or any other design surface). Dragging a Message Queue from Server Explorer gives you a control dedicated to that queue with Receive and Send methods (and a ton of other methods and properties). You can do this with anything listed under the Services node or any of the categories listed under Event Logs. You can use this feature in a class library, even though classes don't normally have a design surface. In Solution Explorer, right-mouse click on your project and select Add Component, instead of your normal Add Class. That will give you a "class with a design surface" that you can drag Server Explorer resources onto. Don't go nuts! You can drag some but not all from Server Explorer -- see for a list of what you can and can not drag. Do you have a Visual Studio tip, you'd like to share? Send it to me at phvogel@1105media.com. Posted by Peter Vogel on 04/12/2011 at 1:16 PM Printable Format I agree to this site's Privacy Policy. > More Webcasts
https://visualstudiomagazine.com/blogs/tool-tracker/2011/04/wbtip_new-classes-from-server-explorer.aspx
CC-MAIN-2019-13
refinedweb
334
62.07
How to: Create an XML Schema Set by Using the XML to Schema Wizard (Visual Basic) You can use the XML to Schema Wizard to create an XML Schema set and include the set in your project. When you include an XML Schema set in a Visual Basic project, you enable XML IntelliSense for XML properties. That is, when you write code that uses XML properties, IntelliSense is provided to enable you to select XML element and attribute names from the included XML Schema set. For more information, see XML IntelliSense in Visual Basic. To infer an XML Schema set In your project, click Add New Item on the Project menu. Select the Xml to Schema item template from either the Data or Common Items template categories. Provide a file name for the Extensible Schema Definition Windows Explorer, click Add from File. To add an XML document from an HTTP address, click Add from Web. To copy or type the contents of an XML document into the wizard, click Type or paste XML. When you have specified all the XML document sources that you want to infer the XML Schema set from, click OK to infer the XML Schema set. The schema set is saved in your project folder in one or more XSD files. (For each XML namespace in the schema, a file is created.)
https://msdn.microsoft.com/en-us/library/cc442691(v=vs.100).aspx
CC-MAIN-2016-44
refinedweb
226
77.77
On Jun 26, 2006, at 5:24 AM, paul.newport@targetgroup.net wrote: > > Why don't you dynamically programmatically create something like an > > org.apache.commons.dbcp.BasicDataSource > > > and then just cache the instance of that in a Map for use whenever > you need it. That way your code is app server indpendent. That would be app server independent, but it would also preclude any container managed transaction features such as use of UserTransaction or CMT ejbs. If you don't need any features like these this might well be your simplest solution. There is no way to bind any such datasource into the java:comp jndi namespace and as the contents of this namespace are specified by the j2ee spec this is not likely to change. Can you specify a bit more fully when the configuration info in the database is available, when it changes related to when the app is deployed/started/stopped, and how you want your program to get the reference to the datasources? thanks david jencks > > If you use Spring for wiring up the datasources to whatever beans > that need them that will make life much easier as >
http://mail-archives.apache.org/mod_mbox/geronimo-user/200606.mbox/%3CA8E46720-B0EC-45AC-803D-D5D4892A975B@yahoo.com%3E
CC-MAIN-2016-44
refinedweb
193
59.64
Adding the tank model For tank battles, we will be using a 3D model available for download from the App Hub website () in the Simple Animation CODE SAMPLE available at. Our first step will be to add the model to our content project in order to bring it into the game. Time for action – adding the tank model We can add the tank model to our project by following these steps: - Download the 7089_06_GRAPHICSPACK.ZIP file from the book's website and extract the contents to a temporary folder. - Select the .fbx file and the two .tga files from the archive and copy them to the Windows clipboard. - Switch to Visual Studio and expand the Tank BattlesContent (Content) project. - Right-click on the Models folder and select Paste to copy the files on the clipboard into the folder. - Right-click on engine_diff_tex.tga inside the Models folder and select Exclude From Project. - Right click on turret_alt_diff_tex.tga inside the Models folder and select Exclude From Project. What just happened? Adding a model to our game is like adding any other type of content, though there are a couple of pitfalls to watch out for. Our model includes two image files (the .tga files&emdash;an image format commonly associated with 3D graphics files because the format is not encumbered by patents) that will provide texture maps for the tank's surfaces. Unlike the other textures we have used, we do not want to include them as part of our content project. Why not? The content processor for models will parse the .fbx file (an Autodesk file format used by several 3D modeling packages) at compile time and look for the textures it references in the directory the model is in. It will automatically process these into .xnb files that are placed in the output folder &endash; Models, for our game. If we were to also include these textures in our content project, the standard texture processor would convert the image just like it does with the textures we normally use. When the model processor comes along and tries to convert the texture, an .xnb file with the same name will already exist in the Models folder, causing compile time errors. Incidentally, even though the images associated with our model are not included in our content project directly, they still get built by the content pipeline and stored in the output directory as .xnb files. They can be loaded just like any other Texture2D object with the Content.Load() method. Free 3D modeling software There are a number of freely available 3D modeling packages downloadable on the Web that you can use to create your own 3D content. Some of these include: - Blender: A free, open source 3D modeling and animation package. Feature rich, and very powerful. Blender can be found at. - Wings 3D: Free, open source 3D modeling package. Does not support animation, but includes many useful modeling features. Wings 3D can be found at. - Softimage Mod Tool: A modeling and animation package from Autodesk. The Softimage Mod Tool is available freely for non-commercial use. A version with a commercial-friendly license is also available to XNA Creator's Club members at. Building tanks Now that the model is part of our project, we need to create a class that will manage everything about a tank. While we could simply load the model in our TankBattlesGame class, we need more than one tank, and duplicating all of the items necessary to handle both tanks does not make sense. Time for action – building the Tank class We can build the Tank class using the following steps: - Add a new class file called Tank.cs to the Tank Battles project. - Add the following using directives to the top of the Tank.cs class file: using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; - Add the following fields to the Tank class: #region Fields private Model model; private GraphicsDevice device; private Vector3 position; private float tankRotation; private float turretRotation; private float gunElevation; private Matrix baseTurretTransform; private Matrix baseGunTransform; private Matrix[] boneTransforms; #endregion - Add the following properties to the Tank class: #region Properties public Vector3 Position { get { return position; } set { position = value; } } public float TankRotation { get { return tankRotation; } set { tankRotation = MathHelper.WrapAngle(value); } } public float TurretRotation { get { return turretRotation; } set { turretRotation = MathHelper.WrapAngle(value); } } public float GunElevation { get { return gunElevation; } set { gunElevation = MathHelper.Clamp( value, MathHelper.ToRadians(-90), MathHelper.ToRadians(0)); } } #endregion - Add the Draw() method to the Tank class, as follows: #region Draw public void Draw(ArcBallCamera camera) { model.Root.Transform = Matrix.Identity * Matrix.CreateScale(0.005f) * Matrix.CreateRotationY(TankRotation) * Matrix.CreateTranslation(Position); model.CopyAbsoluteBoneTransformsTo(boneTransforms); foreach (ModelMesh mesh in model.Meshes) { foreach (BasicEffect basicEffect in mesh.Effects) { basicEffect.World = boneTransforms[mesh.ParentBone. Index]; basicEffect.View = camera.View; basicEffect.Projection = camera.Projection; basicEffect.EnableDefaultLighting(); } mesh.Draw(); } } #endregion - In the declarations area of the TankBattlesGame class, add a new List object to hold a list of Tank objects, as follows: List tanks = new List (); - Create a temporary tank so we can see it in action by adding the following to the end of the LoadContent() method of the TankBattlesGame class: tanks.Add( new Tank( GraphicsDevice, Content.Load (@"Models\tank"), new Vector3(61, 40, 61))); - In the Draw() method of the TankBattlesGame class, add a loop to draw all of the Tank objects in the tank's list after the terrain has been drawn, as follows: foreach (Tank tank in tanks) { tank.Draw(camera); } - Execute the game. Use your mouse to rotate and zoom in on the tank floating above the top of the central mountain in the scene, as shown in the following screenshot: What just happened? The Tank class stores the model that will be used to draw the tank in the model field. Just as with our terrain, we need a reference to the game's GraphicsDevice in order to draw our model when necessary. In addition to this information, we have fields (and corresponding properties) to represent the position of the tank, and the rotation angle of three components of the model. The first, TankRotation, determines the angle at which the entire tank is rotated. As the turret of the tank can rotate independently of the direction in which the tank itself is facing, we store the rotation angle of the turret in TurretRotation. Both TankRotation and TurretRotation contain code in their property setters to wrap their angles around if we go past a full circle in either direction. The last angle we want to track is the elevation angle of the gun attached to the turret. This angle can range from 0 degrees (pointing straight out from the side of the turret) to -90 degrees (pointing straight up). This angle is stored in the GunElevation property. The last field added in step 3 is called boneTransforms, and is an array of matrices. We further define this array while defining the Tank class' constructor by creating an empty array with a number of elements equal to the number of bones in the model. But what exactly are bones? When a 3D artist creates a model, they can define joints that determine how the various pieces of the model are connected. This process is referred to as "rigging" the model, and a model that has been set up this way is sometimes referred to as "rigged for animation". The bones in the model are defined with relationships to each other, so that when a bone higher up in the hierarchy moves, all of the lower bones are moved in relation to it. Think for a moment of one of your fingers. It is composed of three distinct bones separated by joints. If you move the bone nearest to your palm, the other two bones move as well – they have to if your finger bones are going to stay connected! The same is true of the components in our tank. When the tank rotates, all of its pieces rotate as well. Rotating the turret moves the cannon, but has no effect on the body or the wheels. Moving the cannon has no effect on any other parts of the model, but it is hinged at its base, so that rotating the cannon joint makes the cannon appear to elevate up and down around one end instead of spinning around its center. We will come back to these bones in just a moment, but let's first look at the current Draw() method before we expand it to account for bone-based animation. Model.Root refers to the highest level bone in the model's hierarchy. Transforming this bone will transform the entire model, so our basic scaling, rotation, and positioning happen here. Notice that we are drastically scaling down the model of the tank, to a scale of 0.005f. The tank model is quite large in raw units, so we need to scale it to a size that is in line with the scale we used for our terrain. Next, we use the boneTransforms array we created earlier by calling the model's CopyAbsoluteBoneTransformsTo() method. This method calculates the resultant transforms for each of the bones in the model, taking into account all of the parent bones above it, and copies these values into the specified array. We then loop through each mesh in the model. A mesh is an independent piece of the model, representing a movable part. Each of these meshes can have multiple effects tied to it, so we loop through those as well, using an instance of BasicEffect created on the spot to render the meshes. In order to render each mesh, we establish the mesh's world location by looking up the mesh's parent bone transformation and storing it in the World matrix. We apply our View and Projection matrices just like before, and enable default lighting on the effect. Finally, we draw the mesh, which sends the triangles making up this portion of the model out to the graphics card. The tank model The tank model we are using is from the Simple Animation sample for XNA 4.0, available on Microsoft's MSDN website at. Bringing things down to earth You might have noticed that our tank is not actually sitting on the ground. In fact, we have set our terrain scaling so that the highest point in the terrain is at 30 units, while the tank is positioned at 40 units above the X-Z plane. Given a (X,Z) coordinate pair, we need to come up with a way to determine what height we should place our tank at, based on the terrain. Time for action – terrain heights To place our tank appropriately on the terrain, we first need to calculate, then place our tank there. This is done in the following steps: - Add a helper method to the Terrain class to calculate the height based on a given coordinate as follows: #region Helper Methods public float GetHeight(float x, float z) { int xmin = (int)Math.Floor(x); int xmax = xmin + 1; int zmin = (int)Math.Floor(z); int zmax = zmin + 1; if ( (xmin < 0) || (zmin < 0) || (xmax > heights.GetUpperBound(0)) || (zmax > heights.GetUpperBound(1))) { return 0; } Vector3 p1 = new Vector3(xmin, heights[xmin, zmax], zmax); Vector3 p2 = new Vector3(xmax, heights[xmax, zmin], zmin); Vector3 p3; if ((x - xmin) + (z - zmin) <= 1) { p3 = new Vector3(xmin, heights[xmin, zmin], zmin); } else { p3 = new Vector3(xmax, heights[xmax, zmax], zmax); } Plane plane = new Plane(p1, p2, p3); Ray ray = new Ray(new Vector3(x, 0, z), Vector3.Up); float? height = ray.Intersects(plane); return height.HasValue ? height.Value : 0f; } #endregion - In the LoadContent() method of the TankBattlesGame class, modify the statement that adds a tank to the battlefield to utilize the GetHeight() method as follows: tanks.Add( new Tank( GraphicsDevice, Content.Load (@"Models\tank"), new Vector3(61, terrain.GetHeight(61,61), 61))); - Execute the game and view the tank, now placed on the terrain as shown in the following screenshot: What just happened? You might be tempted to simply grab the nearest (X, Z) coordinate from the heights[] array in the Terrain class and use that as the height for the tank. In fact, in many cases that might work. You could also average the four surrounding points and use that height, which would account for very steep slopes. The drawbacks with those approaches will not be entirely evident in Tank Battles, as our tanks are stationary. If the tanks were mobile, you would see the elevation of the tank jump between heights jarringly as the tank moved across the terrain because each virtual square of terrain that the tank entered would have only one height. In the GetHeight() method that we just saw, we take a different approach. Recall that the way our terrain is laid out, it grows along the positive X and Z axes. If we imagine looking down from a positive Y height onto our terrain with an orientation where the X axis grows to the right and the Z axis grows downward, we would have something like the following: As we discussed when we created our index buffer, our terrain is divided up into squares whose corners are exactly 1 unit apart. Unfortunately, these squares do not help us in determining the exact height of any given point, because each of the four points of the square can theoretically have any height from 0 to 30 in the case of our terrain scale. Remember though, that each square is divided into two triangles. The triangle is the basic unit of drawing for our 3D graphics. Each triangle is composed of three points, and we know that three points can be used to define a plane. We can use XNA's Plane class to represent the plane defined by an individual triangle on our terrain mesh. To do so, we just need to know which triangle we want to use to create the plane. In order to determine this, we first get the (X, Z) coordinates (relative to the view in the preceding figure) of the upper-left corner of the square our point is located in. We determine this point by dropping any fractional part of the x and z coordinates and storing the values in xmin and zmin for later use. We check to make sure that the values we will be looking up in the heights[] array are valid (greater than zero and less than or equal to the highest element in each direction in the array). This could happen if we ask for the height of a position that is outside the bounds of our map's height. Instead of crashing the game, we will simply return a zero. It should not happen in our code, but it is better to account for the possibility than be surprised later. We define three points, represented as Vector3 values p1, p2, and p3. We can see right away that no matter which of the two triangles we pick, the (xmax, zmin) and (xmin, zmax) points will be included in our plane, so their values are set right away. To decide which of the final two points to use, we need to determine which side of the central dividing line the point we are looking for lies in. This actually turns out to be fairly simple to do for the squares we are using. In the case of our triangle, if we eliminate the integer portion of our X and Z coordinates (leaving only the fractional part that tells us how far into the square we are), the sum of both of these values will be less than or equal to the size of one grid square (1 in our case) if we are in the upper left triangle. Otherwise our point is in the right triangle. The code if ((x - xmin) + (z - zmin) <= 1) performs this check, and sets the value of p3 to either (xmin, zmin) or (xmax, zmax) depending on the result. Once we have our three points, we ask XNA to construct a Plane using them, and then we construct another new type of object we have not yet used – an object of the Ray class. A Ray has a base point, represented by a Vector3, and a direction – also represented by a Vector3. Think of a Ray as an infinitely long arrow that starts somewhere in our world and heads off in a given direction forever. In the case of the Ray we are using, the starting point is at the zero point on the Y axis, and the coordinates we passed into the method for X and Z. We specify Vector3.Up as the direction the Ray is pointing in. Remember from the FPS camera that Vector3.Up has an actual value of (0, 1, 0), or pointing up along the positive Y axis. The Ray class has an Intersects() method that returns the distance from the origin point along the Ray where the Ray intersects a given Plane. We must assign the return value of this method to a float? instead of a normal float. You may not be familiar with this notation, but the question mark at the end of the type specifies that the value is nullable—that is, it might contain a value, but it could also just contain a null value. In the case of the Ray.Intersects() method, the method will return null if the object of Ray class does not intersect the object of the Plane class at any point. This should never happen with our terrain height code, but we need to account for the possibility. When using a nullable float, we need to check to make sure that the variable actually has a value before trying to use it. In this case, we use the HasValue property of the variable. If it does have one, we return it. Otherwise we return a default value of zero. Animating the tank Now that we have a tank in our game, let's look at how we can animate the bones defined in the model in order to aim the turret and the cannon. We will be adding some temporary code to our TankBattlesGame class in order to see our animations in action. Time for action – tank animation In order to animate our tank, we perform the following steps: - In the constructor of the Tank class, add the following two lines to the end of the method: baseTurretTransform = model.Bones["turret_geo"].Transform; baseGunTransform = model.Bones["canon_geo"].Transform; - In the Draw() method of the Tank class, add the following before the call to model.CopyAbsoluteBoneTransformsTo(): model.Bones["turret_geo"].Transform = Matrix.CreateRotationY(TurretRotation) * baseTurretTransform; model.Bones["canon_geo"].Transform = Matrix.CreateRotationX(gunElevation) * baseGunTransform; - In the Update() method of the TankBattlesGame class, add some temporary code to allow us to animate the tank with the keyboard. Place this code after the existing camera movement code, inside the if block that checks for (this.IsActive ) – directly after the current mouse position is stored in previousMouse : // Begin temporary code KeyboardState ks = Keyboard.GetState(); if (ks.IsKeyDown(Keys.A)) { tanks[0].TankRotation += 0.05f; } if (ks.IsKeyDown(Keys.Z)) { tanks[0].TankRotation -= 0.05f; } if (ks.IsKeyDown(Keys.S)) { tanks[0].TurretRotation += 0.05f; } if (ks.IsKeyDown(Keys.X)) { tanks[0].TurretRotation -= 0.05f; } if (ks.IsKeyDown(Keys.D)) { tanks[0].GunElevation += 0.05f; } if (ks.IsKeyDown(Keys.C)) { tanks[0].GunElevation -= 0.05f; } //End temporary code - Launch the game, use the mouse to zoom in on the tank, and then use the keyboard to rotate the tank with keys A and Z , the turret with keys S and X, and the cannon with keys D and C. Our tank would look like the one in the following screenshot: What just happened? Each of the bones within the tank model we are using has a name assigned to it. In this case, the turret bone is named turret_geo, while the bone for the gun is named canon_geo. In step 1, we store the base transformations for these bones so that we have their baseline positions, which we will use to apply our modifications to later. When drawing the model, recall that we can produce a matrix that includes all of the transforms we wish to apply by multiplying the component matrices together. This is done in step 2. Finally, we modify the Update() method of the TankBattlesGame class to allow us to use the keyboard to modify the various rotation values associated with the parts of our tank. We will pull this code back out of our project later, so it is marked with start and end comments to make it easy to recognize. The combatants Now that we can render and animate tanks, we will add a second tank to our game and position the two tanks randomly within the game world. Time for action – positioning tanks To position tanks within our game, perform the following steps: - Add the following fields to the declarations area of the TankBattlesGame class: ContentManager p2Content; Random rand = new Random(); - In the Initialze() method of the TankBattlesGame class, add the following lines right before the call to base.Initialize(): p2Content = new ContentManager(this.Services); p2Content.RootDirectory = "Content"; - Add the StartNewRound() method to the TankBattlesGame class as follows: public void StartNewRound() { tanks.Clear(); Vector3 p1Position = new Vector3(rand.Next(8, 56), 0, rand.Next(8, 56)); Vector3 p2Position = new Vector3(rand.Next(8, 56), 0, rand.Next(8, 56)); int p1Quadrant = rand.Next(0, 4); switch (p1Quadrant) { case 0: p2Position += new Vector3(64, 0, 64); break; case 1: p1Position += new Vector3(64, 0, 0); p2Position += new Vector3(0, 0, 64); break; case 2: p1Position += new Vector3(0, 0, 64); p2Position += new Vector3(64, 0, 0); break; case 3: p1Position += new Vector3(64, 0, 64); break; } p1Position.Y = terrain.GetHeight(p1Position.X, p1Position.Z); p2Position.Y = terrain.GetHeight(p2Position.X, p2Position.Z); tanks.Add( new Tank( GraphicsDevice, Content.Load (@"Models\tank"), p1Position)); tanks.Add( new Tank( GraphicsDevice, p2Content.Load (@"Models\tank"), p2Position)); } - In the LoadContent() method of the TankBattlesGame class, remove the current code that adds a tank to the Tanks list, and replace it with the following: StartNewRound(); - Execute the game. Verify that two tanks have been added to the battlefield in opposite quadrants of the map as shown in the following screenshot: What just happened? We logically divide our battlefield into four quadrants, numbered 0, 1, 2, and 3. As our battlefield is 128 units on a side, each quadrant is 64 by 64 units. Using this information we generate two positions within quadrant 0 (the upper left quadrant). We pad these positions a bit to keep the tanks from being too close to the outside edges of the map, or to the dividing lines between the quadrants. Once we have two positions, we randomly select a quadrant for the first tank to occupy. In order to position it in the correct quadrant, we add 64 to the X, Z, both, or neither components of the position depending on the quadrant we selected. We similarly add offsets to the second tank based on the quadrant the first tank is located in, so that the two tanks are in diagonally opposite quadrants. We calculate the height of each of the final points for the tanks and then generate and add both of them to the tanks list. You might be wondering though, why we went through the trouble of creating a second instance of the ContentManager class to load the model for the second player's tank. This is because when we load a model (or any other resource) with ContentManager, it checks to see if it has already loaded that content. If it has, you simply get a pointer to the existing content object in memory. In most cases this is not a problem. If we are using the same texture in multiple classes in our game, there really is no need to have multiple copies of the same data in memory. With our models, though, the transforms that make up the animations will be changing over time. This means that we have to have some way to separate the different instances of our tank models from each other. There are, of course, multiple ways to do this. You could write your own code to draw the model's meshes, taking each set of bone transforms into account and applying them separately. The approach we have taken here is far simpler. By creating a second instance of ContentManager, it does not know that the first instance has already loaded, so it happily loads a new copy of it from the disk and supplies it for the second tank. Now both tanks can operate independently. Summary We have a pair of tanks on our battlefield now, and they are ready to fight! In this article, we covered the addition of 3D model content to our project along with the textures to support them, loading and displaying a 3D model, and animating a 3D model by applying bone transforms. We have also seen how to precisely determine the elevation of a given point on our terrain using Ray/Plane intersection and how to lay the groundwork for our game flow by randomly positioning enemy tanks on the battlefield.
https://www.packtpub.com/books/content/xna-4-3dgetting-battle-tanks-game-world
CC-MAIN-2016-07
refinedweb
4,221
60.95
# All hail bug reports: how we reduced the analysis time of the user's project from 80 to 4 hours ![0885_SupportAndAnalyzerOptimizations/image1.png](https://habrastorage.org/r/w1560/getpro/habr/post_images/0b3/f51/674/0b3f51674d77106439b511de713d2c8f.png) People often see work in support as something negative. Today we'll look at it from a different perspective. This article is about a real communication of 100+ messages, exceptions, the analysis that didn't complete in three days... Actually, bug reports are great If a bug report is adequately handled from both sides, it means that both the user and the software developer are interested in solving the problem. If both sides achieve the desired result, it's a win-win situation. Before we proceed to the story, here's a little introduction. We are the [PVS-Studio](https://pvs-studio.com/en/pvs-studio/) team. We develop the analyzer that searches for errors and potential vulnerabilities in C, C++, C#, and Java code. Yours truly is the team lead of the C# analyzer development team, the author of articles and posts. How it all started ------------------ The story starts like this. My teammate comes to me and says: "There's a user with a C# project. His analysis doesn't complete after 80 hours". 80 hours, it's madness! ![0885_SupportAndAnalyzerOptimizations/image2.png](https://habrastorage.org/r/w1560/getpro/habr/post_images/5d0/f9b/642/5d0f9b642458c7bb4dc0197194da879d.png) This screenshot shows one interesting detail — the last file. This file remained not analyzed. This means we're dealing with freezing — there is something with this file that the analyzer could not process it in an adequate time. Let's go further. I go through the message history and clarify a couple of moments. It becomes clear that: * the project preparation stage takes 2-3 hours. It's ***too*** long; * a lot of files exceed the analysis timeout (if it's set); * there's freezing and the analysis stays incomplete after 80 hours; * even without freezing the analysis takes too long – the check of 17,000 files out of 20,000 took 36 hours; * there are exceptions with stack traces. ![0885_SupportAndAnalyzerOptimizations/image3.png](https://habrastorage.org/r/w1560/getpro/habr/post_images/ee7/7ce/acf/ee77ceacf3e1d044f418b72fa74443bd.png) The user: > Obviously, your analyzer wasn't designed for testing such solutions. I look at the project code and I think I'll limit myself to the analyzer's warnings. If, of course, the analysis completes. That's it. Doing something else in this nightmare is suicide. On the one hand, this is an epic fail. It is impossible to collect any more problems. Moreover, we'll have to fix all these problems… It's worth noting that we regularly test our analyzer on various open source projects. We have never met such problems before. On the other hand, it's a precious find! We were doing other things — [supported OWASP and implemented taint analysis](https://pvs-studio.com/en/blog/posts/csharp/0831/), for example — and couldn't think that some projects had such problems! How many people have faced similar problems, but have never contacted our support? This was a chance to enhance the PVS-Studio analyzer for C#, and we could not miss it. And here you may ask a question... Do you even test your analyzer? ------------------------------- Of course we do! We regularly run our analyzer on a number of open source projects. Thus, we know the total time of the analysis on all projects. Also, we have information about: * the issued warnings; * the amount of memory consumed; * the analysis time. We can track that the analyzer issues the right warnings. It doesn't slow down, doesn't start consuming more memory. If any of these things happen, then we either fix it or accept it as it is. Roslyn is the 'heaviest' project from our list. It has approximately 11k files for the analysis. The analysis time takes about 1h 45m. The project preparation time takes a couple of minutes. The project size (at least the number of files) can be compared to the user's one. We cannot say the same about the analysis time and preparation time. It's worth noting that we knew about some performance issues but didn't fix it. Why? Priorities. These issues looked unpleasant. Still, everything worked… And we had other things to do. However, to clear my conscience, I'm going to mention some issues we knew about but put them on the shelf. Performance issues that we know about ------------------------------------- **Inefficient work of the V3083 diagnostic** The [V3083](https://pvs-studio.com/en/docs/warnings/v3083/) diagnostic searches for unsafe event invocations. These invocations may cause *NullReferenceException* in multithreaded code. The dangerous code looks like this: ``` public event EventHandler MyEvent; void OnMyEvent(EventArgs e) { if (MyEvent != null) MyEvent(this, e); } ``` If between the check for *null* and direct event invocation the event is left without handlers, then an exception of the *NullReferenceException* type is thrown. You can read more about it in the [documentation](https://pvs-studio.com/en/docs/warnings/v3083/). The diagnostic first searched the event declaration and after that — all places of its use. This was a bit weird — it was more logical to start with the unsafe invocation. But we had what we had. To find the places of event invocation, we used the method from Roslyn — *SymbolFinder.FindReferencesAsync.* We knew that: * we should have rewritten the logic as I described above; * The *SymbolFinder.FindReferencesAsync* didn't work in an optimal way. If we change the logic, we no longer need it. However, everything worked, and this task remained in the to-do list. **Inefficient CPU usage** We noticed this problem on several projects, especially on Roslyn. On Roslyn, at some point, the CPU usage dropped to about 15% and stayed like this for a while. After that it increased again. We noticed this when we first globally optimized the analyzer (you can read about it [here](https://pvs-studio.com/en/blog/posts/csharp/0836/)). But at that moment we didn't have time to investigate the problem. Editing time ------------ Thanks to the user messages, we had a lot of things to do. After breaking the task into subtasks, we gradually began to fix the problems. **Exceptions with stack traces** Nothing tricky here — we just fix it. The problems were on the tree-semantics bundle. **Diagnostics** We identified problems in two diagnostics: [V3083](https://pvs-studio.com/en/docs/warnings/v3083/) and [V3110](https://pvs-studio.com/en/docs/warnings/v3110/) Oh, this V3083 again… Our cup of patience was overflowing. In the end we just rewrote it. [Here](https://pvs-studio.com/en/blog/posts/csharp/0823/) you can read about the result and what performance enhancements we achieved. Without going into details, we can say that in the V3110 diagnostic the problem related to multiple processing of the same elements. Elimination of their re-processing (all hail associative containers!) solved the problem. However, at the time of writing this article, we found another code fragment on which V3110 worked too long. We'll get back to it soon. **Other optimizations** The title is a bit generalized. But it's true — we made a lot of various optimizations. Our main goal was to reduce the pressure on the GC, which we noticed after we profiled the analyzer. ![0885_SupportAndAnalyzerOptimizations/image5.png](https://habrastorage.org/r/w1560/webt/of/3n/6f/of3n6fzhosfereepioxkvmct3uq.png) [Full-size image is here](https://import.viva64.com/docx/blog/0852_NETAppsPerf_MinChangesMajorRes/image3.png). Some fixes were internal: we added cashes here, learned faster evaluations there (like comparing some tree nodes), etc. There's no point in describing them. If to speak about more general corrections related to C# / .NET — we found a lot of interesting things. For example, I discovered that calling *GetHashCode* for enumeration elements (enum) leads to their boxing. Only in .NET Framework, though. Everything is fine with .NET — no boxing. You can read about the nuances with the boxing in a [separate article](https://pvs-studio.com/en/blog/posts/csharp/0844/). After the profiling, we identified and locally fixed the problematic places that we didn't even think about. LINQ, for example. There are a lot of places with LINQ in the analyzer. However, in some places it's better to refrain from using it. I described various optimizations in [this article](https://pvs-studio.com/en/blog/posts/csharp/0852/). I want to highlight the simplest (in terms of corrections) fix that significantly increased the analyzer performance. We changed the GC's working mode. We somehow didn't think about it. One of the users gave us this idea in the commentaries to an article about [optimizations](https://pvs-studio.com/en/blog/posts/csharp/0836/). As a result, we *significantly* reduced the analysis time of our test base's large projects. ![0885_SupportAndAnalyzerOptimizations/image6.png](https://habrastorage.org/r/w1560/getpro/habr/post_images/4fd/c4d/e38/4fdc4de3802f397335170781b24e0a7e.png) For example, the analysis time for Roslyn has decreased by more than 2 times! At the same time, we solved both problems mentioned above. We rewrote V3083, and the analyzer used CPU resources properly. The communication continues --------------------------- It's high time to give the user our beta! In fact, we gave two — one with edits and one with GC's new mode. The analysis progress with the first beta looked like this: ![0885_SupportAndAnalyzerOptimizations/image7.png](https://habrastorage.org/r/w1560/getpro/habr/post_images/b7c/b0f/80a/b7cb0f80a9d373e46d9623b10c2734c5.png) The result speaks for itself! 14.5 hours versus 36. 16.4k analyzed files versus 17k files. This is awesome. But still not enough. We wanted it to be faster. The second beta included both optimizations and new GC mode. You can see the results below: ![0885_SupportAndAnalyzerOptimizations/image8.png](https://habrastorage.org/r/w1560/getpro/habr/post_images/c71/844/387/c7184438753f1c21173914d89f833050.png) The user: > Wow! .config did a miracle. Awesome! It turns out everything was done for a reason. However, there was one more problem — the project preparation stage lasted several hours. The optimizations described above related to the project analysis. They did not affect the project preparation stage at all. We hoped that the new GC mode would solve the problem. Alas, it was in vain. So, we had another round of enhancements ahead — we had to optimize the project preparation stage. Let's optimize the project preparation stage -------------------------------------------- The user: > Project preparation stage completed. It went from 10:13 to 13:08, 2:55. The user's project preparation time varied somewhere between 2 and 3 hours. 2:55 was rather an exception, in general it was 2 hours. Anyway, 2 hours of preparation with 5.5 hours of analysis is unacceptable. Forget the analysis time, what kind of preparation lasts for several hours?! By the way, what is the project preparation stage? At this stage, the analyzer evaluates projects, restores dependencies (if necessary) and much more. Moreover, the analyzer performs many of these actions with Roslyn and MSBuild. And this was the reason of my concerns. Since the MSBuild and Roslyn code is external (we use NuGet packages), we cannot edit it. You may guess that if the freezing occurs in those libraries, this is bad. However, we easily figured out who caused the problem. We were the ones who messed up. It turned out that the analyzer could sometimes assume that the project has tens of thousands of dependencies. We easily reproduced this problem on a synthetic example. ![0885_SupportAndAnalyzerOptimizations/image9.png](https://habrastorage.org/r/w1560/getpro/habr/post_images/d19/edb/454/d19edb4541af83db36497ae285fea502.png) 500k dependencies — impressive, right? The problem was in the way the analyzer processed project's transitive dependencies. The analyzer did not take into account the uniqueness of the dependencies. The same projects could be processed over and over again. I described this in a [separate article](https://pvs-studio.com/en/blog/posts/csharp/0864/). What we needed to do was not to re-process the same dependencies. We fixed it, sent the beta to the user, and... The user: > 15:50 solution scan launched > > 15:51 project check started > > 15:54 the check compleWHAT?! What kind of magic is this? 4 minutes instead of two hours? The fix hit the target, and we were pleased. :) The graph below clearly demonstrates the project preparation time difference before the fix and after. ![0885_SupportAndAnalyzerOptimizations/image10.png](https://habrastorage.org/r/w1560/getpro/habr/post_images/ccf/b4d/c9e/ccfb4dc9e5ace64ae8bfe72084df9e3a.png) By the way, it was a funny situation. The problematic code has been in the analyzer since ancient times. And no one complained about the time of the project preparation stage. However, when I started inspecting the problem, several people wrote to me. They had a similar situation with long preparation. I repeat: we didn't cause it with our optimizations. But it was a funny coincidence. Several people decided to try the analyzer for C#, encountered this problem, and contacted our support almost simultaneously. Someone, for example, decided to check C# projects in addition to the C++ ones. Another user decided to check their project with our analyzer and got this problem. I know that the fix above helped about 4 users. Results ------- We started with: * exceptions with stack traces; * project preparation time: we don't know the exact time, but certainly more than 2 hours; * freezing; * the analysis: doesn't complete in 80 hours due to freezing; regardless of freezing — doesn't complete in 77+; We ended with: * project preparation time: 4 minutes; * project analysis time: 4.5 hours. ![0885_SupportAndAnalyzerOptimizations/image11.png](https://habrastorage.org/r/w1560/getpro/habr/post_images/224/644/525/2246445255bbe62ee507e0b63aa4dcfa.png) Bonuses: * these optimizations are general. They are not made for a specific project. Thus, the analyzer's performance increased on all large projects; * we solved the problem with the long preparation and helped at least 4 users (including two our clients); * we wrote a number of interesting notes/articles. Conclusion ---------- We can look at the situation in different ways. On the one hand, we can say that everything is terrible, nothing works, and life is pain. Exceptions are thrown, we have freezes, the analyzer is slow. On the other hand, we see this situation as an opportunity to make our product better. We helped this user and many other. Who knows how many people have encountered this but never contacted support? I like the second option more. I think we should see more opportunities around us. See more good things in life and especially in the things we do at work. Isn't it cool to do what brings you pleasure? Sometimes we need to see things from a different perspective. By the way, if you still don't use the static analysis — this is a sign for you to [start](https://pvs-studio.com/en/pvs-studio/try-free/). Don't forget to subscribe to [my Twitter](https://twitter.com/_SergVasiliev_) so as not to miss anything interesting. ;) Special thanks -------------- I want to say a big thank you to the user. Thanks to him, we made the described optimizations. And thanks to him I wrote this article. Communication in 100+ emails is a big thing. You must have a huge patience to wait 80 hours for the analysis to complete. Thank you to the contribution in the analyzer's development! Additional links ---------------- Here are the links mentioned in the article. They describe in detail the C# / .NET peculiarities that we had to face. They also describe the problems that were fixed and the process of fixing. * [.NET application optimization: simple edits speeded up PVS-Studio and reduced memory consumption by 70%](https://pvs-studio.com/en/blog/posts/csharp/0836/) * [Roslyn API: why PVS-Studio was analyzing the project so long](https://pvs-studio.com/en/blog/posts/csharp/0823/) * [Enums in C#: hidden pitfalls](https://pvs-studio.com/en/blog/posts/csharp/0844/) * [Optimization of .NET applications: a big result of small edits](https://pvs-studio.com/en/blog/posts/csharp/0852/) * [PVS-Studio C#: what to do if project preparation takes too long or freezes?](https://pvs-studio.com/en/blog/posts/csharp/0864/) * [OWASP, vulnerabilities, and taint analysis in PVS-Studio for C#. Stir, but don't shake](https://pvs-studio.com/en/blog/posts/csharp/0831/)
https://habr.com/ru/post/588831/
null
null
2,712
51.75
. Major works are often divided up into sections or movements and on recordings, these sections usually will have their own tracks. The actual title of the movements are usually pretty non-descriptive such as “Allegro Moderato”, “Freilich” or something like that. Anyway, you can see, record companies encode all this information, but do so in a way that makes each track title really long and unwieldy. This is where Apple really upped their game. In the latest version of iTunes, Apple introduced the concept of storing the ‘work name’ instead of just the song title. You could use this for pop music, but really it seems geared towards classical music and it was a major improvement in cataloging classical music. You can see in the image below that when things are cataloged using Apple’s new system, it makes organizing classical music a breeze. So what’s wrong with that? Why I also hate Apple… Apple finally figured out how to catalog classical music. Awesome. What they didn’t do, was put some parser into iTunes to extract all these fields from the CD metadata and populate the appropriate fields correctly. So if I want all my music to look like the results on the left (and I do) I have to go through and adjust the titles manually. I see that Apple attempted to automate this process, but they didn’t get it right. In the example below, the full track title is Beethoven: Symphony #7 In A, Op. 92 – 1. Poco Sostenuto, Vivace. When you switch iTunes into the “classical music mode” you’ll note that the composer is listed as the work name (wrong), the movement number is blank and the name of the movement contains the catalog or opus number, then the movement number and finally the movement title–all wrong. Here’s how the fields should be populated: My disappointment in Apple comes from the fact that the iTunes team clearly put a lot of thought and effort into how to accurately catalog and store classical music and laid the foundation to do it better than any other music program I’ve seen. Despite this, they failed at a key point, which was automatically ingesting the data into this format and as a result, I would bet that many iTunes users who listen to classical music don’t even know this feature exists. How to fix this: In looking at this, I noticed that record labels do seem to be fairly consistent in how they encode the metadata for classical albums and as such, I wrote the following code snippet to extract all the relevant fields from the data. import re import pandas as pd pattern = r'(.+?):\s(.+?)\s-\s(.*)?' testData = """ Dvořák: Symphony #6 In D, Op. 60 - 2. Adagio Shostakovich: Symphony #5 In D Minor, Op. 47 - Moderato, Allegro Non Troppo, Etc. Shostakovich: Symphony #7 In C, Op. 60, "Leningrad" - Allegretto Shostakovich: The Bolt Suite #5 - 3. The Dance Of The Drayman Shostakovich: The Bolt Suite #5 - 1. Overture Shostakovich: Symphony #5 In D Minor, Op. 47 - Largo Ravel: L'Enfant Et Les Sortilèges - Oh! Ma Belle Tasse Chinoise! Schubert: Symphony #9 In C, D 944, "Great" - 1. Andante, Allegro Ma Non Troppo Prokofiev: Symphony #1 In D, Op. 25, "Classical" - 4. Finale: Vivace Shostakovich: Lady Macbeth Of Mtsensk - Act 1/Sc. 1: Proshcháy, Katerina Bach: Toccata, Adagio & Fugue In C, BWV 564 - 3. Fugue Copland: Rodeo - 1. Buckaroo Holiday Handel: Suite In D For Trumpet & Orchestra - 1. Overture Rimsky-Korsakov: Capriccio Espagnol, Op. 34 - 2. Variazioni """ data = testData.split("\n") movementPattern = r'(\d+)\.?(.+)' tracks = [] for line in data: record = {} patternMatch = re.match( pattern, line ) if patternMatch: record['composer'] = patternMatch.group(1) record['workTitle'] = patternMatch.group(2) record['section'] = patternMatch.group(3) movementObj = re.match( movementPattern, patternMatch.group(3)) if movementObj: record['movementNumber'] = movementObj.group(1) record['section'] = movementObj.group(2) tracks.append( record ) df = pd.DataFrame(tracks) The code above works reasonably well at extracting the correct fields from the metadata as you can see in the table below. The challenge: So Apple, I’ve thrown down the gauntlet. I’ve put up code for how to fix this. I realize iTunes isn’t implemented in Python, but I don’t think it would be too hard to map this to c++ or whatever language it was written in. If I can do this in 20 min, I’m pretty sure that you can do this as well. All of the classical music listeners who use iTunes will be grateful! Make it so! Be First to Comment
https://thedataist.com/off-topic-why-i-simultaneously-love-and-hate-apple/
CC-MAIN-2020-24
refinedweb
764
66.64
The Gogo Shell Command sample demonstrates adding a custom command to Liferay DXP’s Gogo shell environment. All Liferay DXP installations have a Gogo shell environment, which lets system administrators interact with Liferay DXP’s module framework on a local server machine. This example adds a new custom Gogo shell command called usercount under the blade scope. It prints out the number of registered users on your Liferay DXP installation. To test this sample, follow the instructions below: Start a Liferay DXP installation. Using a command line tool, connect to your local Gogo shell. For example, you can do this by executing telnet localhost 11311. Run helpto view all the available commands. The sample Gogo shell command is listed. Figure 1: The sample Gogo shell command is listed with all the available commands. Execute usercountto execute the new custom command. The number of users on your running Liferay Portal installation is printed. Figure 2: The outcome of executing the `usercount` command. What API(s) and/or code components does this sample highlight? This sample demonstrates creating a new Gogo shell command by leveraging osgi.command.* properties in a Java class. How does this sample leverage the API(s) and/or code component? To add this new Gogo shell command, you must implement the logic in a Java class with the following two properties: osgi.command.function: the command’s name, which must match the method name in the registered service implementation. osgi.command.scope: the general scope or namespace for the command. These properties are set in your class’s @Component annotation like this: @Component( property = {"osgi.command.function=usercount", "osgi.command.scope=blade"}, service = Object.class ) The logic for the usercount command is specified in the method with the same name: public void usercount() { System.out.println( "# of users: " + getUserLocalService().getUsersCount()); } This method uses Declarative Services to get a reference for the UserLocalService to invoke the getUsersCount method. This lets you find the number of users currently in the system. For more information on using the Gogo shell, see the Using the Felix Gogo Shell tutorial. Where Is This Sample? There are three different versions of this sample, each built with a different build tool:
https://help.liferay.com/hc/ja/articles/360017891852-Gogo-Shell-Command-
CC-MAIN-2022-40
refinedweb
366
51.04
Notes on Managed Debugging, ICorDebug, and random .NET stuff C# doesn’t support inline IL. As an experiment, I wrote a post-compiler tool that allows primitive IL inlining for C# / VB.Net (or any .net language). (My main goal here was I actually wanted to try out fxcop and needed some pet project to do it with - but that’s another story). Examples Here are some examples of inputs that it can compile. It also handles the pdbs properly, so you can even debug the IL snippets alongside the rest of the source code. 1) A trivial example of inline IL in C#. using System; class Program { static void Main() { int x = 3; int y = 4; int z = 5; // Here's some inline IL; “x=x+y+z” #if IL ldloc x ldloc y add ldloc z stloc x #endif Console.WriteLine(x); } } 2) A similarly trivial example of inline IL in VB.Net ' VB demo with inline IL module m1 sub Main() Console.WriteLine("Hi!") Dim x As Integer x = 3 #If IL Then // Here's some inline IL dup #End If Console.WriteLine(x) End Sub end module 3) An example of using inline IL to inject a filter in C#. This is more interesting because C# doesn’t support filters, so we’re actually adding new functionality here. class Foo static void ThrowMe() throw new ArgumentException(); string x; object ex = null; // declare a new local. .locals init (int32 ghi) .try { x = "a"; ThrowMe(); leave.s IL_ExitTryCatch } // end try block filter // Exception object is on the stack. stloc ex Console.WriteLine("Inside Filter. Object=" + ex); x += "b"; ldc.i4.1 // true - execute handler endfilter } // end filter { // begin handler Console.WriteLine("Yow! In handler now!"); x += "c"; } // end handler IL_ExitTryCatch: nop Console.WriteLine("Back in C#"); } // end Main } // end Class Foo How does it work? This IL inliner is really just a parlor trick. It’s just a post-compile tool which round trips the source through ilasm / ildasm, and injects the new IL in the middle. Specifically 1) It invokes another process (such as C# / VB.Net) to compile the original source using the high level compiler. E.g.: csc %input_file% /debug+ /out:%temp_output% You’ll notice the IL snippets are conveniently under an #ifdef such that the compiler doesn’t get confused by it. This also introduces a key limitation which I’ll discuss below. 2) ILDasm the output. E.g.: ildasm %temp_output% /linenum /out=%temp_il_output% 3) Find the inline IL snippets in the original source. It turns out that ilasm is sufficiently intelligent that this is mainly just text processing. You could do it with a perl script. 4) Inject these snippets back into the ildasm output from step #2. Be sure to add .line directives to map the pdbs 5) run ilasm on the newly merged file. ilasm %temp_il_output% /output=%output_file% /optimize /debug Here’s a quick demo. For the first C# example, the main() function from the IL file before injecting the snippet (%temp_il_output%) is: .method private hidebysig static void Main() cil managed { .entrypoint // Code size 14 (0xe) .maxstack 1 .locals init ([0] int32 x, [1] int32 y, [2] int32 z) }' .line 6,6 : 9,19 'c:\\temp\\y2.cs' IL_0000: ldc.i4.3 IL_0001: stloc.0 .line 7,7 : 9,19 '' IL_0002: ldc.i4.4 IL_0003: stloc.1 .line 8,8 : 9,19 '' IL_0004: ldc.i4.5 IL_0005: stloc.2 .line 19,19 : 9,30 '' ß snippet goes before this line IL_0006: ldloc.0 IL_0007: call void [mscorlib]System.Console::WriteLine(int32) IL_000c: nop .line 20,20 : 5,6 '' IL_000d: ret } // end of method Program::Main After injecting the IL snippet, that function looks like: // removed .maxstack declaration .line 12,12 : 1,16 'c:\\temp\\y2.cs' .line 13,13 : 1,16 'c:\\temp\\y2.cs' .line 14,14 : 1,12 'c:\\temp\\y2.cs' .line 15,15 : 1,16 'c:\\temp\\y2.cs' .line 16,16 : 1,12 'c:\\temp\\y2.cs' .line 17,17 : 1,16 'c:\\temp\\y2.cs' .line 19,19 : 9,30 '' What sort of limitations are there? On the bright side, this inliner is pretty cheap. It’s under 1000 lines of C#. It operates on the IL level and so can work cross-language without a compiler change. That said, it works well enough on the samples above but it does have some key limitations, including: 1) The compiler (e.g. csc.exe) is completely ignorant to the IL snippets. This greatly simplifies the model but also introduces some issues: a. The compiler doesn’t know about any locals declared in the IL snippets. b. The compiler can’t do any analysis on the IL snippets. This can be critical in dead-code detection. If the only reference to C# code is via the IL snippet, CSC will think it’s dead code and remove it, and then the code will be unavailable for the inliner. This is why the C# filter example above puts the throw in its own function. 2) There are limitations to stitching the high-level source code and the IL together. For example, you can’t share labels across the boundary. Also, the compiler doesn’t know about declarations from the IL snippets. 3) The inliner only supports IL statements. It doesn’t support IL expressions, members, or types. Supporting expressions would require real integration with the compiler, and also provide little value since they can trivially be converted into statements. Supporting members would also require real integration with the compiler so that the rest of the compiler could see the newly declared member. Supporting types don’t make sense since the type could just be in its own IL file. Overall, I think this is a cute academic exercise, but not fit for commercial purposes. Random issues with ILAsm There are a few ilasm/ildasm issues to be aware of when doing this: 1) ILasm/ildasm and the symbol store. At first, I thought I’d need to use the managed symbol store to do things like - determine where in the IL code to inject the IL snippet. This would be mapping the source-line of the snippet back to a function and IL offset, and then injecting the snippet there. - resolve variable names to IL variable indices. This would mean transforming ‘ldloc x’ into ‘ldloc 0’ if x was IL var 0. It turns out that you can view ILasm as an alternative (text-based) symbol store interface. ILdasm will automatically load the pdbs and resolve variable names to indices. Thus you can blindly inject “ldloc x” into the IL stream and it will resolve the variable ‘x’ for you. ILdasm will also inject ‘.line’ directives for the managed sequence points if you pass the /linenum switch. This lets you preserve sequence points when round-tripping. You can also determine where to inject the IL snippets by parsing the IL text for ‘.line’ directives instead of actually cracking the symbol store. 2) Mapping IL snippets back to source. Just as we single-step through the high-level source, we want to be able to debug the inline IL. There are two things we need to do here. First, need to map the lines of the IL snippet back to the source via injecting our own ‘.line’ directives. If we don’t do this, our IL snippets will map back to either a random ‘.line’ directive occurring earlier in the file, or the temporary %temp_il_output% file that we created. ILasm can only place ‘.line’ directives before statements, so we need to do a little hacky parsing to determine that. Make sure the filenames in the ‘.line’ directives have consistent casing or that may confuse debuggers. Second, we need to ilasm with the /debug flag (instead of /debug=impl), which tells the jitter to explicitly use the sequence points we specified as opposed to inferring sequence points based off various heuristics (such as stack-empty points). The downside is that there’s a perf hit to using explicit sequence points. 3) Removing the ‘.maxstack’ directive. When we did the ildasm, it emiited ‘.maxstack’ directives describing the stack space needed based off just the high-level source code. That will change when we add the new IL. If we just strip these directives from %temp_il_output%, ilasm will recompute the maxstack when it reassembles. I think it would also be cool if there was an IL codedom that allowed you to easily load, manipulate, and save assemblies at the il level, without having to resort to parsing ildasm text output. Now what? This was mostly an experiment. I didn’t find a good use for inlining IL in C#. Inlined IL also is very fragile and seems to be more pain then it’s worth. Just look at the C# filter example. I have the demo files from above at:. [Update:] This also includes the source for the tool. Another takeaway is that I think there are interesting opportunities for extremely cheap tools that take advantage of IL roundtripping. For example, Serge Lidin (the author of ilasm) wrote a short (under 1000 lines) utility, ILlink, which merges managed assemblies by basically running ildasm on the assemblies, concatenating the outputs, and then ilasm that. Like my IL inliner, he had to do some basic touchups (such as removing multiple assembly declarations). I could imagine another such tool that does code-coverage: ILdasm an assembly, blindly inject code coverage probes before each ‘.line’ statement, and then ilasm it back up. Note that the officially correct way to do code-coverage is with the CLR profiling APIs, which is the most scalable and would let you reinstrument the code on the fly (thus avoiding a separate code-coverage build), but ildasm roundtripping would certainly be simpler to implement. Il round-tripping , nell'accezione .NET del termine, è una tecnica in base alla quale viene modificato Last update: June 13 , 2007 Document version 0.6 Preface If you have something to add, or want to take Common INFO: · const is "baked" into the assembly. If you have to change the const value in This section describes the common .NET tips which don't relates to the specific category. INFO:
http://blogs.msdn.com/jmstall/archive/2005/02/21/377806.aspx
crawl-002
refinedweb
1,703
67.45
/* * _DTRACE_PTSS_H_ #define _DTRACE_PTSS_H_ #ifdef __cplusplus extern "C" { #endif /* * The pid provider needs a small per thread scratch space, * in the address space of the user task. This code is used to * manage that space. * * High level design: * * To avoid serialization, this is a (mostly) lockless allocator. If * a new page has to be allocated, the process's sprlock will be acquired. * * NOTE: The dtrace copyin/copyout code is still the shared code that * can handle unmapped pages, so the scratch space isn't wired for now. * * Each page in user space is wired. It cannot be paged out, because * * dtrace's copyin/copyout is only guaranteed to handle pages already * * in memory. * * Each page in user space is represented by a dt_ptss_page. Page entries * are chained. Once allocated, a page is not freed until dtrace "cleans up" * that process. * * Clean up works like this: * * At process exit, free all kernel allocated memory, but ignore user pages. * At process exec, free all kernel allocated memory, but ignore user pages. * At process fork, free user pages copied from parent, and do not allocate kernel memory. * * This is making the assumption that it is faster to let the bulk vm_map * operations in exec/exit do their work, instead of explicit page free(s) * via mach_vm_deallocate. * * As each page is allocated, its entries are chained and added to the * free_list. To claim an entry, cas it off the list. When a thread exits, * cas its entry onto the list. We could potentially optimize this by * keeping a head/tail, and cas'ing the frees to the tail instead of the * head. Without evidence to support such a need, it seems better to keep * things simple for now. */ #define DTRACE_PTSS_SCRATCH_SPACE_PER_THREAD 64 #define DTRACE_PTSS_ENTRIES_PER_PAGE (PAGE_SIZE / DTRACE_PTSS_SCRATCH_SPACE_PER_THREAD) struct dtrace_ptss_page_entry { struct dtrace_ptss_page_entry* next; user_addr_t addr; }; struct dtrace_ptss_page { struct dtrace_ptss_page* next; struct dtrace_ptss_page_entry entries[DTRACE_PTSS_ENTRIES_PER_PAGE]; }; struct dtrace_ptss_page_entry* dtrace_ptss_claim_entry(struct proc* p); /* sprlock not held */ struct dtrace_ptss_page_entry* dtrace_ptss_claim_entry_locked(struct proc* p); /* sprlock held */ void dtrace_ptss_release_entry(struct proc* p, struct dtrace_ptss_page_entry* e); struct dtrace_ptss_page* dtrace_ptss_allocate_page(struct proc* p); void dtrace_ptss_free_page(struct proc* p, struct dtrace_ptss_page* ptss_page); void dtrace_ptss_enable(struct proc* p); void dtrace_ptss_exec_exit(struct proc* p); void dtrace_ptss_fork(struct proc* parent, struct proc* child); #ifdef __cplusplus } #endif #endif /* _DTRACE_PTSS_H_ */
https://opensource.apple.com/source/xnu/xnu-2050.9.2/bsd/sys/dtrace_ptss.h.auto.html
CC-MAIN-2021-43
refinedweb
368
62.17
3 covers Views and ViewModels. So far we’ve just been returning strings from controller actions. That’s a nice way to get an idea of how controllers work, but it’s not how you’d want to build a real web application. We are going to want a better way to generate HTML back to browsers visiting our site – one where we can use template files to more easily customize the HTML content send back. That’s exactly what Views do. Adding a View template To use a view-template, we’ll change the HomeController Index method to return an ActionResult, and have it return View(), like below: public class HomeController : Controller { // // GET: /Home/ public ActionResult Index() { return View(); } } The above change indicates that instead of returned a string, we instead want to use a “View” to generate a result back. We’ll now add an appropriate View template to our project. To do this we’ll position the text cursor within the Index action method, then right-click and select “Add View”. This will bring up the Add View dialog: The “Add View” dialog allows us to quickly and easily generate View template files. By default the “Add View” dialog pre-populates the name of the View template to create so that it matches the action method that will use it. Because we used the “Add View” context menu within the Index() action method of our HomeController, the “Add View” dialog above has “Index” as the view name pre-populated by default. We don’t need to change any of the options on this dialog, so click the Add button. When we click the Add button, Visual Web Developer will create a new Index.cshtml view template for us in the \Views\Home directory, creating the folder if doesn’t already exist. The name and folder location of the “Index.cshtml” file is important, and follows the default ASP.NET MVC naming conventions. The directory name, \Views\Home, matches the controller - which is named HomeController. The view template name, Index, matches the controller action method which will be displaying the view. ASP.NET MVC allows us to avoid having to explicitly specify the name or location of a view template when we use this naming convention to return a view. It will by default render the \Views\Home\Index.cshtml view template when we write code like below within our HomeController: public class HomeController : Controller { // // GET: /Home/ public ActionResult Index() { return View(); } } Visual Web Developer created and opened the “Index.cshtml” view template after we clicked the “Add” button within the “Add View” dialog. The contents of Index.cshtml are shown below. @{ ViewBag.Title = "Index"; } <h2>Index</h2> This view is using the Razor syntax, which is more concise than the Web Forms view engine used in ASP.NET Web Forms and previous versions of ASP.NET MVC. The Web Forms view engine is still available in ASP.NET MVC 3, but many developers find that the Razor view engine fits ASP.NET MVC development really well. The first three lines set the page title using ViewBag.Title. We’ll look at how this works in more detail soon, but first let’s update the text heading text and view the page. Update the <h2> tag to say “This is the Home Page” as shown below. @{ ViewBag.Title = "Index"; } <h2>This is the Home Page</h2> Running the application shows that our new text is visible on the home page. Using a Layout for common site elements Most websites have content which is shared between many pages: navigation, footers, logo images, stylesheet references, etc. The Razor view engine makes this easy to manage using a page called _Layout.cshtml which has automatically been created for us inside the /Views/Shared folder. Double-click on this folder to view the contents, which> @RenderBody() </body> </html> The content from our individual views will be displayed by the @RenderBody() command, and any common content that we want to appear outside of that can be added to the _Layout.cshtml markup. We’ll want our MVC Music Store to have a common header with links to our Home page and Store area on all pages in the site, so we’ll add that to the template directly above that @RenderBody() statement. <!DOCTYPE html> <html> <head> <title>@ViewBag.Title</title> <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script> </head> <body> <div id="header"> <h1> ASP.NET MVC MUSIC STORE</h1> <ul id="navlist"> <li class="first"><a href="/" id="current">Home</a></li> <li><a href="/Store/">Store</a></li> </ul> </div> @RenderBody() </body> </html> Updating the StyleSheet The empty project template includes a very streamlined CSS file which just includes styles used to display validation messages. Our designer has provided some additional CSS and images to define the look and feel for our site, so we’ll add those in now. The updated CSS file and Images are included in the Content directory of MvcMusicStore-Assets.zip which is available at. We’ll select both of them in Windows Explorer and drop them into our Solution’s Content folder in Visual Web Developer, as shown below: You’ll be asked to confirm if you want to overwrite the existing Site.css file. Click Yes. The Content folder of your application will now appear as follows: Now let's run the application and see how our changes look on the Home page. - Let’s review what’s changed: The HomeController’s Index action method found and displayed the \Views\Home\Index.cshtmlView template, even though our code called “return View()”, because our View template followed the standard naming convention. - The Home Page is displaying a simple welcome message that is defined within the \Views\Home\Index.cshtml view template. - The Home Page is using our _Layout.cshtml template, and so the welcome message is contained within the standard site HTML layout. Using a Model to pass information to our View A View template that just displays hardcoded HTML isn’t going to make a very interesting web site. To create a dynamic web site, we’ll instead want to pass information from our controller actions to our view templates. In the Model-View-Controller pattern, the term Model refers to objects which represent the data in the application. Often, model objects correspond to tables in your database, but they don’t have to. Controller action methods which return an ActionResult can pass a model object to the view. This allows a Controller to cleanly package up all the information needed to generate a response, and then pass this information off to a View template to use to generate the appropriate HTML response. This is easiest to understand by seeing it in action, so let’s get started. First we’ll create some Model classes to represent Genres and Albums within our store. Let’s start by creating a Genre class. Right-click the “Models” folder within your project, choose the “Add Class” option, and name the file “Genre.cs”. Then add a public string Name property to the class that was created: public class Genre { public string Name { get; set; } } Note: In case you're wondering, the { get; set; } notation is making use of C#'s auto-implemented properties feature. This gives us the benefits of a property without requiring us to declare a backing field. Next, follow the same steps to create an Album class (named Album.cs) that has a Title and a Genre property: public class Album { public string Title { get; set; } public Genre Genre { get; set; } } Now we can modify the StoreController to use Views which display dynamic information from our Model. If - for demonstration purposes right now - we named our Albums based on the request ID, we could display that information as in the view below. We’ll start by changing the Store Details action so it shows the information for a single album. Add a “using” statement to the top of the StoreControllers class to include the MvcMusicStore.Models namespace, so we don’t need to type MvcMusicStore.Models.Album every time we want to use the album class. The “usings” section of that class should now appear as below. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using MvcMusicStore.Models; Next, we’ll update the Details controller action so that it returns an ActionResult rather than a string, as we did with the HomeController’s Index method. public ActionResult Details(int id) Now we can modify the logic to return an Album object to the view. Later in this tutorial we will be retrieving the data from a database – but for right now we will use "dummy data" to get started. public ActionResult Details(int id) { var album = new Album { Title = "Album " + id }; return View(album); } Note: If you’re unfamiliar with C#, you may assume that using var means that our album variable is late-bound. That’s not correct – the C# compiler is using type-inference based on what we’re assigning to the variable to determine that album is of type Album and compiling the local album variable as an Album type, so we get compile-time checking and Visual Studio code-editor support. Let’s now create a View template that uses our Album to generate an HTML response. Before we do that we need to build the project so that the Add View dialog knows about our newly created Album class. You can build the project by selecting the Debug⇨Build MvcMusicStore menu item (for extra credit, you can use the Ctrl-Shift-B shortcut to build the project). Now that we've set up our supporting classes, we're ready to build our View template. Right-click within the Details method and select “Add View…” from the context menu. We are going to create a new View template like we did before with the HomeController. Because we are creating it from the StoreController it will by default be generated in a \Views\Store\Index.cshtml file. Unlike before, we are going to check the “Create a strongly-typed” view checkbox. We are then going to select our “Album” class within the “View data-class” drop-downlist. This will cause the “Add View” dialog to create a View template that expects that an Album object will be passed to it to use. When we click the “Add” button our \Views\Store\Details.cshtml View template will be created, containing the following code. @model MvcMusicStore.Models.Album @{ ViewBag.Title = "Details"; } <h2>Details</h2> Notice the first line, which indicates that this view is strongly-typed to our Album class. The Razor view engine understands that it has been passed an Album object, so we can easily access model properties and even have the benefit of IntelliSense in the Visual Web Developer editor. Update the <h2> tag so it displays the Album’s Title property by modifying that line to appear as follows. <h2>Album: @Model.Title</h2> Notice that IntelliSense is triggered when you enter the period after the @Model keyword, showing the properties and methods that the Album class supports. Let's now re-run our project and visit the /Store/Details/5 URL. We'll see details of an Album like below. Now we’ll make a similar update for the Store Browse action method. Update the method so it returns an ActionResult, and modify the method logic so it creates a new Genre object and returns it to the View. public ActionResult Browse(string genre) { var genreModel = new Genre { Name = genre }; return View(genreModel); } Right-click in the Browse method and select “Add View…” from the context menu, then add a View that is strongly-typed add a strongly typed to the Genre class. Update the <h2> element in the view code (in /Views/Store/Browse.cshtml) to display the Genre information. @model MvcMusicStore.Models.Genre @{ ViewBag.Title = "Browse"; } <h2>Browsing Genre: @Model.Name</h2> Now let’s re-run our project and browse to the /Store/Browse?Genre=Disco URL. We’ll see the Browse page displayed like below. Finally, let’s make a slightly more complex update to the Store Index action method and view to display a list of all the Genres in our store. We’ll do that by using a List of Genres as our model object, rather than just a single Genre. public ActionResult Index() { var genres = new List<Genre> { new Genre { Name = "Disco"}, new Genre { Name = "Jazz"}, new Genre { Name = "Rock"} }; return View(genres); } Right-click in the Store Index action method and select Add View as before, select Genre as the Model class, and press the Add button. First we’ll change the @model declaration to indicate that the view will be expecting several Genre objects rather than just one. Change the first line of /Store/Index.cshtml to read as follows: @model IEnumerable<MvcMusicStore.Models.Genre> This tells the Razor view engine that it will be working with a model object that can hold several Genre objects. We’re using an IEnumerable<Genre> rather than a List<Genre> since it’s more generic, allowing us to change our model type later to any object type that supports the IEnumerable interface. Next, we’ll loop through the Genre objects in the model as shown in the completed view code below. @model IEnumerable<MvcMusicStore.Models.Genre> @{ ViewBag.Title = "Store"; } <h3>Browse Genres</h3> <p> Select from @Model.Count() genres:</p> <ul> @foreach (var genre in Model) { <li>@genre.Name</li> } </ul> Notice that we have full IntelliSense support as we enter this code, so that when we type “@Model.” we see all methods and properties supported by an IEnumerable of type Genre. Within our “foreach” loop, Visual Web Developer knows that each item is of type Genre, so we see IntelliSence for each the Genre type. Next, the scaffolding feature examined the Genre object and determined that each will have a Name property, so it loops through and writes them out. It also generates Edit, Details, and Delete links to each individual item. We’ll take advantage of that later in our store manager, but for now we’d like to have a simple list instead. When we run the application and browse to /Store, we see that both the count and list of Genres is displayed. Adding Links between pages Our /Store URL that lists Genres currently lists the Genre names simply as plain text. Let’s change this so that instead of plain text we instead have the Genre names link to the appropriate /Store/Browse URL, so that clicking on a music genre like “Disco” will navigate to the /Store/Browse?genre=Disco URL. We could update our \Views\Store\Index.cshtml View template to output these links using code like below (don’t type this in - we’re going to improve on it): <ul> @foreach (var genre in Model) { <li><a href="/Store/Browse?genre=@genre.Name">@genre.Name</a></li> } </ul> That works, but it could lead to trouble later since it relies on a hardcoded string. For instance, if we wanted to rename the Controller, we’d need to search through our code looking for links that need to be updated. An alternative approach we can use is to take advantage of an HTML Helper method. ASP.NET MVC includes HTML Helper methods which are available from our View template code to perform a variety of common tasks just like this. The Html.ActionLink() helper method is a particularly useful one, and makes it easy to build HTML <a> links and takes care of annoying details like making sure URL paths are properly URL encoded. Html.ActionLink() has several different overloads to allow specifying as much information as you need for your links. In the simplest case, you’ll supply just the link text and the Action method to go to when the hyperlink is clicked on the client. For example, we can link to “/Store/” Index() method on the Store Details page with the link text “Go to the Store Index” using the following call: @Html.ActionLink("Go to the Store Index", "Index") Note: In this case, we didn’t need to specify the controller name because we’re just linking to another action within the same controller that’s rendering the current view. Our links to the Browse page will need to pass a parameter, though, so we’ll use another overload of the Html.ActionLink method that takes three parameters: - 1. Link text, which will display the Genre name - 2. Controller action name (Browse) - 3. Route parameter values, specifying both the name (Genre) and the value (Genre name) Putting that all together, here’s how we’ll write those links to the Store Index view: <ul> @foreach (var genre in Model) { <li>@Html.ActionLink(genre.Name, "Browse", new { genre = genre.Name })</li> } </ul> Now when we run our project again and access the /Store/ URL we will see a list of genres. Each genre is a hyperlink – when clicked it will take us to our /Store/Browse?genre=[genre] URL. The HTML for the genre list looks like this: <ul> <li><a href="/Store/Browse?genre=Disco">Disco</a> </li> <li><a href="/Store/Browse?genre=Jazz">Jazz</a> </li> <li><a href="/Store/Browse?genre=Rock">Rock</a> </li> </ul> Please use the Discussions at for any questions or comments. This article was originally created on April 21, 2011
http://www.asp.net/mvc/overview/older-versions/mvc-music-store/mvc-music-store-part-3
CC-MAIN-2015-48
refinedweb
2,944
62.48
I'm installing packages with "easy_install --user" but I can't import them from my WSGI app. Any ideas? I'm installing packages with "easy_install --user" but I can't import them from my WSGI app. Any ideas? That's a bug -- we have a fix almost ready to go, but it's tied up with some large infrastructural changes so won't go live until the New Year (we don't want to risk having everything broken over Christmas!) The problem is that we don't set up the path properly for your WSGI app. So for now, a good workaround is to add the specific packages you've installed to your sys.path in the WSGI script manually, like this: import sys my_package = '/home/drewvid/.local/lib/python2.6/site-packages/pisa-3.0.33-py2.6.egg/' if my_package not in sys.path: sys.path.append(my_package) That should be enough to get things working until our bugfix is in. That's great I'll give it a try. Enjoy your Holiday Yes, your suggestion worked. Thanks once again. Excellent, glad to hear it! Have a good holiday.
https://www.pythonanywhere.com/forums/topic/20/
CC-MAIN-2018-26
refinedweb
191
75.91
Greetings, I just have to ask about something I have always wanted to learn how to do myself, when it comes to scripting. I am not very experianced on writing scripts myself, but I have been working for along time whit plugin development, such as "Bukkit, for Minecraft"! Which brings me to my question.. When I scripted to make plugins, whit the use of the "Bukkits API", there was some methods I cant seem to understand how to make, nor can I seem to find help to learn how to make these, since I have no clue what they are called.. Let me give you an example code I would be able to use; something.getLocation(); // this would return an Vector3 something.getLocation().getWorld(); // this would return the string for the world name! What is this called, and how can I make them in my game? I dont even know how to make something return anything else then true or false! (bool)! It just dont make sense to be, I see why the first example can return Vector3 (even though I dont know how), but the second line? How can it suddenly return this string? I hope someone can help me, so that I in my game can make something like this; players.getExperiance().getCurrentExperiance(); // this then returns the current exp of the players! Thanks, Winsjansen EDIT; also, in the API, I could do this; if(something.getLocation().getWorld == "somewhere"){. // returns true if the world have that name! Answer by Michael Covert · Sep 19, 2012 at 10:50 PM The key to this is public methods. A method that is public is accessible outside the class you write it in, and a many development environments will be able to populate the auto-complete suggestion field with these methods. Avoid making things public when you don't need to, however! It might not be a good idea to let your modders tamper with all your functions - expose only what you need to. Planning ahead makes most projects easier, but in the case of an open source system or even just a moddable API, you'll really really want to plan things out. If you don't, you'll end up with a bit of a mess, which will make exposing it to modders both difficult for you and confusing for them. If you've structured it such that something.getLocation() returns a class you've written, and that class has a getWorld() call in it, the intellisense handles the rest. Here's some sample files that you can use to see the suggestion box in action: In a file called SampleLocation: using UnityEngine; using System.Collections; public class SampleLocation : MonoBehaviour { SampleWorld myWorld; //other stuff related to a location - maybe some textures, or enemy spawning code; who knows! public SampleWorld getWorld() { return myWorld; } } in a SampleWorld file: using UnityEngine; using System.Collections; public class SampleWorld : MonoBehaviour { //some stuff that worlds do string worldType; public string getType() { return worldType; } } A SampleWorld object can now have the .getWorld() method called; the result of that call (a sampleWorld) will be able to have the .getType() method called on it. This means we can now write something like, mySampleLocation.getWorld().getType(), and it'll function. Note that the sample code above doesn't handle assigning the variables it's using, so you'll get some null references if you try it. You can fix this by making the variables public and assigning them through the inspector, or by providing additional logic (probably in a startup method?) to fill these variables out prior to these calls. You could also ditch the variables entirely, and have the return values be calculated when you call the method - you have a lot of versatility there, which is why I didn't write that portion out - it'll most likely change from place to place in your code. Does that help? Thanks for the reply, and YES, it looks like you understand what I am looking for to do! I find it abit hard to understand though, why it works! I see that I know can do "something.getLocation().getWorld().getType(); but can any of these alone return something? I should be able to use "something.getLocation();" and that would alone return Vector3, but if I simple added "getWorld();" after it, no Vector3 will be returned, just the string for the world name! and, if I again add "getType();" it would not return the string for the world name, only the string for the type! I know that I could just make one method for each, and just document the API for the developers to call different methods for everything, but I see this as so much better way to do it, so I can just document everything that has whit location to do, under getLocation();! I will try look closer to your reply and see what I can get out of it! Thanks, we are atleast on the same page! @winsjansen: Yes and no. Your getLocation function does return something. It always returns the same thing, a reference to a SampleWorld-class (at least in michael's example). It's not possible (in almost all compiled language, Java included) to return different types with the same function. Even in a dynamic languages the function can't determine what you would expect as return value. However, it is possible in C# to create an implicit casting operator which can "convert" your custom class into another type. For example when you implement an operator like this in your SampleWorld class you can use the class "like a string": public static implicit operator string(SampleWorld w) { return w.getType(); } Such operators might cause confusion because you can't see what happens behind the scenes. It's always better to use destict functions or properties. Btw, every class in C# / .NET has a built-in function called "ToString" (same in Java, there it's called "toString") which will return "the string representation" of this type. For number types it's usually just the number formatted as string. Classes usually just return their classname by default. In custom classes you can override this function to return something else. For example the Vector3 struct in Unity will return a string that looks like "(x,y,z)". The compiler will automatically call ToString when you concat your class with a string. int i = 5; string s1 = "i equals" + i; string s2 = "i equals" + i.ToString(); The s1 and s2 example is exactly the same. In the first case the compiler detects automatically that you want to concat an integer with a string and it calls ToString implicitly. Another way are extension methods which do not exist in Java(Note: I just mention Java because you said you developed a Bukkit plugin. Java has nothing to do with Javascript or UnityScript). Extension methods allows you to kind of "inject" your own method into another existing class. When you try to call a function on a class that doesn't exist in the class itself or anywhere up the inheritance chain, the compiler will look for an extension method. Extension method can be declared in any static class and have to take the extending class as first parameter with the additional "this" keyword. @michael-covert: You have to be careful, GetType() is already a built-in function (note the capital "G"). Each of those methods does return something, yeah. You can call any of them individually, and do whatever you want with the result. In fact, when you call the chain like that, your code isn't actually running them all at once - the compiled version of your code will really be calling them individually, storing the results, then calling the next function on the result of the previous call. You're also right - it's a lot better to stick everything related to locations in the location class, everything related to worlds in the world class, etc. It'll make things a lot easier for you later on, and I wasn't trying to suggest otherwise; rather, encourage it! Btw, i never developed a bukkit plugin, but getLocation() doesn't return a Vector3, it returns a Location class. This can probably be implicitly casted into a Vector3, but it isn't a Vector3. "getWorld" is probably a function of the Location class and i'm pretty sure it will return a "World" class. The World class has probably it's toString function overridden so it returns the name of the world. I just did a quick search and found the header of the World interface ;) The world has lots of methods and one is called "getName()". This is probably what is used. This is btw the Location class I'm aware GetType() is a function; I'd normally name it differently, but I was simply following his naming - and since getType() doesn't bother it, I figured it wasn't too important to the discussion at hand. Answer by DaveA · Sep 19, 2012 at 01:35 AM This depends on the language. UnityScript is easier. You just return whatever type you want: function getVector() { return new Vector3(1,2,3); // for example. returns a Vector3 } Vector3 is a 'class' which itself has many methods (functions) that come for free. One of them is ToString() which will return a string, like so: function ToString() { return new String (v.x+","+v.y+","+v.z); // for example } == is also a function which returns a boolean. I forget exact syntax for defining those, but you can find that at MSDN.com Thanks, for the reply! This helps me alot, I didnt know it was that easy to return something else then just true or false through bool methods!:) But, do you know how I can do something like what I said above? getLocation().getWorld(); I understand now how to make two different methods, whit the location in Vector3, and the world name in string! but, how can I call them out like that? getLocation() must return an object, and one its methods must be ToString() which is called implicitly when printing to the console. Another method on that object must be getWorld() which returns the name as a string (it's basically like ToString()) By the way, you can set this up in the debugger, set a break point, then examine the variables to see what methods and properties they have, it's a good way to get familiar with things. It looks like you're after a class array (locations[thisLocation].locationName). class Locations { var locationName : String; var somethingElse : int; } var locations : Locations[] = new Locations[amount]; Otherwise a separated function for looking up a name for a location would do the trick which returns the string for that contained area. Answer by rcober · Sep 19, 2012 at 02:09 PM The first call getLocation() returns an object. This object is used to call it's getWorld() method. I think it is really good that you are teaching yourself scripting. To learn more you could try googling for a javascript tutorial. Heres one but I am not sure how good it is, especially in the context of unity. No, getLocation() do not return an object! Let me show you two different outputs in the console from the two different methods; something.getLocation(); console says: 10.0 10.0 10.0! <-- Vector3! something.getLocation().getWorld().getName(); console says: "awsome world"! <-- String, whit world name! Answer by rcober · Sep 19, 2012 at 03:51 PM Not sure about what you are seeing - I believe you - just not sure about Unity implementation. In general, the technique is called method chaining. You often see it in other languages like Ruby. Perhaps getLocation() is returning an object, and the console is calling it's description method to show you the text. It was for java, so since I use C# I understand its abit different, but it should be possible? Since I dont know how I am atm just making one method for everything, which ofc works perfectly, but it would be so much better to be able to just do it like I explained.. But, anyways thanks for trying to help! If you, or anyone else figure out more about it, please let me know more! :) The methods btw, can be more then just 2, like; "something.getLocation().getWorld().getType()"! Basically, OptimisticMonkey's been telling you what's going on. The getLocation returns a vector3 - this vector3 sticks around for a little bit in temporary memory. Then, we use that vector3 to call getWorld(), and it uses the vector3's data to determine what world it's in. Once that call finishes, we store that result in another temporary variable, then call getType() using that temporary variable. The key to these chains is to return something useful to call methods on; if your function returns, say, a bool, there might not be a useful function to call. If instead it returns some custom object, say, a class holding data about your player, or the world, any methods in that custom class can be called on the result. Your chain is nearly the same thing as doing: Vector3 tempVector = something.getLocation(); String tempName = tempVector.getWorld(); Type type = tempName.getType(); You're just saving yourself the work of these immediate steps. Thanks for the reply, I think I can understand alittle bit of what you are trying to teach me, but do you mind giving me an example for one method that could return different things like that?:) Would have been nice, thanks! Dave A.'s answer above provides an example of 2 methods that return various things in UnityScript. I'm unfamiliar with it, however from what I've heard/read, simply returning an object of that type defines the return type. In C#, you declare this in your function declaration. When you write something like, public void MyFunction() { //function stuff in here } that 'void' word is where you determine what the function returns. If, for example, you changed it to this: public Vector3 MyFunction() { Vector3 someVector3; //stuff in here return someVector3; } we'll return a vector3. Void indicates no return type. You can return literally any class or struct you've written, and a few you haven't written (these are provided to you by the language and the Unity framework). If you called this function, then the result would be a Vector3. This means that you can either store that vector3 yourself, or you can chain with any method that you could normally call on a Vector3. This makes a call like MyFunction().SomeFunction() legal syntax, as long as the Vector3 object supports a SomeFunction() call. Does that help? If you want more detail, it'd be good to know what language you're trying to use. Thanks for the reply! :) I use C#, and I am currently using methods like you explained whit the return of Vector3, or int/string and what not! It works fine, and for my own development of the game, I dont really need to make it more complicated. But, I want my game to be open source so people can create plugins and such to the game! Thats why I want to be able to do this, just like "Bukkit for Minecraft"! So, when you type "something.getLocation()" it will show up in the suggestion field stuff like "getWorld()" or, "get 14 People are following this question. [C#] Getting a return from SendMessage? 1 Answer Corutine not behaving like it should? 1 Answer Flight Simulator - Return To Original Height 0 Answers Help returning a true varaible 4 Answers Return a value for a class? 1 Answer
http://answers.unity3d.com/questions/319774/return-how-to-do-it.html
CC-MAIN-2016-30
refinedweb
2,617
71.75
Copying Files into Explorer WEBINAR: On-Demand Building the Right Environment to Support AI, Machine Learning and Deep Learning Following my previous article on copying filenames from explorer, I received many requests on how to copy the files into the explorer. I have/had the same request for a long time. After a lot of debugging and breaking my head, I finally solved the problem (hopefully). The clue I got was that, there is a DROPFILES structure in shlobj.h. However, there is no documentation on how to use it. Actually, it is the structure, whose pointer is the one we are receiving as HDROP handle. That is the mystery. One important issue is that, the DROPFILES's last parameter specifies whether the appended string is a Multi/Single Byte character string. Windows NT uses Multi byte Character set. To suit to this requirement, we will also use Multi Byte character format for the appended file names. So, do the following steps to get the job done. 1. First, prepare a string of null separated file names and pad with an extra null. The extra null is the requirement to indicate the end of file names. 2. Next, prepare a HGLOBAL of size equal to the sum of length of string of the file names and the size of the DROPFILES. Account for NULLs in between and at the end. The HGLOBAL should be created with these flags: GMEM_ZEROINIT|GMEM_MOVEABLE|GMEM_DDESHARE 3. Lock the HGLOBAL to get a memory pointer. Fill up the first 20 bytes memory with the DROPFILES structure values. 4. Copy the file names to the rest of the memory. Once copying is done, unlock the HGLOBAL. 5. Open the clipboard, empty it and do SetClipboardData with CF_HDROP format and your HGLOBAL. 6. Close the clipboard, but don't free the HGLOBAL. 7. That's it. Your job is done. Note: Please note that I have done this in hurry. There will be better methods to prepare a multibyte character string from a single byte character string. What I have done is one of the simple ways to take care of NULLs etc. 8. Now go to Explorer. Open one directory, do right-click. Paste will be enabled. Select paste. Your files will be copied to that directory. #include "shlobj.h" void CMyWnd::OnSetFilesToClipboard() { char sFiles[] = "C:\\Temp\\file1.txt\0" "C:\\Temp\\file2.txt"; DROPFILES dobj = { 20, { 0, 0 }, 0, 1 }; int nLen = sizeof(sFiles); int nGblLen = sizeof(dobj) + nLen*2 + 5;//lots of nulls and multibyte_char HGLOBAL hGbl = GlobalAlloc(GMEM_ZEROINIT|GMEM_MOVEABLE|GMEM_DDESHARE, nGblLen); char* sData = (char*)::GlobalLock(hGbl); memcpy( sData, &dobj, 20 ); char* sWStr = sData+20; for( int i = 0; i < nLen*2; i += 2 ) { sWStr[i] = sFiles[i/2]; } ::GlobalUnlock(hGbl); if( OpenClipboard() ) { EmptyClipboard(); SetClipboardData( CF_HDROP, hGbl ); CloseClipboard(); } } Date Last Updated: April 5, 1999 WonderfulPosted by H smith on 01/29/2014 05:36am Very helpful mate, works a treatReply Great articlePosted by Matteo on 04/05/2012 05:12am Great article sir thank you !Reply
https://www.codeguru.com/cpp/w-p/clipboard/article.php/c2997/Copying-Files-into-Explorer.htm
CC-MAIN-2018-39
refinedweb
502
65.32
Feature #8563closed Instance variable arguments Added by sawa (Tsuyoshi Sawada) over 8 years ago. Updated about 4 years ago. Description. Related issues Updated by nobu (Nobuyoshi Nakada) over 8 years ago - Category set to syntax - Status changed from Open to Assigned - Assignee set to matz (Yukihiro Matsumoto) - Target version set to 3.0 Updated by phluid61 (Matthew Kerwin) over 8 years ago Updated by matz (Yukihiro Matsumoto) over 8 years ago From my POV: def initialize(@foo, @bar) end does not express intention of instance variable initialization. I'd rather add a method like define_attr_initialize(:foo, :bar) to define a method of def initialize(foo, bar) @foo = foo @bar = bar end Matz. Updated by sawa (Tsuyoshi Sawada) over 8 years ago It could also be used besides initialize: def update_something foo do_update_something(@foo = foo) ... end would become def update_something @foo do_update_something(@foo) ... end Updated by nobu (Nobuyoshi Nakada) over 8 years ago phluid61 (Matthew Kerwin) wrote: Question: would this be valid? def foo(@foo=@foo) end In generic, foo = foo is valid always. Updated by headius (Charles Nutter) over 8 Updated by Anonymous over 8 years ago matz (Yukihiro Matsumoto): (Tsuyoshi Sawada) Updated by phluid61 (Matthew Kerwin) over 8. Updated by Anonymous over 8 years ago Updated by nobu (Nobuyoshi Nakada) almost 6 years ago Updated by nobu (Nobuyoshi Nakada) over 5 years ago - Has duplicate Feature #12578: Instance Variables Assigned In parameters ( ala Crystal? ) added Updated by Eregon (Benoit Daloze) over 5 years ago Anonymous wrote: matz (Yukihiro Matsumoto): If define_attr_initializeis an option, then there is a question of named / ordered qualifier, either as: define_attr_initialize :foo, :bar, as: :named define_attr_initialize :baz, :quux, as: :ordered You could have simply: define_attr_initialize :baz, :quux, foo: nil, bar: nil But this starts to look much like a macro to me. One problem with the proposed define_attr_initialize is once some extra behavior needs to be added to initialize, there is no choice but to desugar everything (write ivar assignments manually). The original proposition does not have this issue. IMHO many constructors usually need some custom behavior after some time, and so paying the "cost" upfront of doing manual assignments is worth it in many cases. Updated by rosenfeld (Rodrigo Rosenfeld Rosas) over 5 years ago Even if define_attr_initialize would accept a block to enhance the initializer besides initializing instance variables it doesn't support default arguments. I'd certainly prefer the original proposal which I find more useful. It's not obvious what array.each(&:to_i) does either but people get used to it because it's handy. I think it's the same about this proposal although it's quite familiar for people using this feature in other languages like CoffeeScript and Crystal among others. Updated by rosenfeld (Rodrigo Rosenfeld Rosas) over 5 years ago Also it doesn't handle variable arguments, extra options that shouldn't be assigned to instance variables or &block. Updated by nobu (Nobuyoshi Nakada) over 5 years ago - Has duplicate Feature #12820: Shorter syntax for assigning a method argument to an instance variable added Updated by marcandre (Marc-Andre Lafortune) about 4 years ago matz (Yukihiro Matsumoto) wrote: Arguments are giving names to passed values, which is different from attribute (instance variables) initialization. I think they should be separated clearly. This may be a valid theoretical distinction, but what does this change in practice? I feel there would be about no additional cognitive load if this was accepted. It is most probably the most requested feature This is not surprising, since a majority of initialize with arguments is doing that! And for most of the cases, only initializeneeds this kind of initialization. Indeed. This doesn't change the case that a majority of initialize methods needs this kind of initialization. Here's an example Rails app (which I didn't write): A gem I'm using a lot these days: Since keyword arguments, I feel that's even more true, since Struct is no longer as useful. My idea is With all due respect, this is not a good idea and it can't solve the issue. As was pointed out, there are many more cases that it doesn't handle: - keyword arguments (that's absolutely major!) - defaults - dealing with other arguments - doing extra code I'd also mention the additional cognitive load involved. Note that it has always been trivial to implement define_attr_initialize in pure Ruby. I've never seen such code though. Take the top 100 gems, a few web apps, make an inventory of the initialize with parameters. I'm betting that the vast majority of these methods would be simplified by allowing instance variable arguments. I doubt that define_attr_initialize would help any but a small minority. Updated by ko1 (Koichi Sasada) about 4 years ago Not so serious idea. class Binding def set_attributes(attrs = self.local_variables) attrs.each{|attr| self.receiver.instance_variable_set(:"@#{attr}", self.local_variable_get(attr)) } end end class C def initialize a, b binding.set_attributes end end p C.new(1, 2) #=> #<C:0x000001f30a8b95d0 @a=1, @b=2> Updated by matz (Yukihiro Matsumoto) about 4 years ago - Status changed from Assigned to Rejected My opinion has not been changed from I am strongly against code like def initialize(@foo, @bar) end I don't care about define_attr_initialize not being "the solution". Matz. Updated by ko1 (Koichi Sasada) about 4 years ago Oops. class Binding def set_attributes(attrs = self.eval('method(__method__).parameters.map{|t, v| v}')) attrs.each{|attr| self.receiver.instance_variable_set(:"@#{attr}", self.local_variable_get(attr)) } end end class C def initialize a, b x = y = nil binding.set_attributes end end p C.new(1, 2) #=> #<C:0x000001f30a8b95d0 @a=1, @b=2> Also available in: Atom PDF
https://bugs.ruby-lang.org/issues/8563?tab=properties
CC-MAIN-2022-05
refinedweb
944
52.9
Yo, back on Wednesday, September 08, 2010 Carl Eugen Hoyos was all like: > Reuben Martin <reuben.m <at> gmail.com> writes: > > > Comments, suggestions, code, flames all welcome. > > I am sure work on this is very welcome, I can't really comment on the details, > but here are a few cosmetic hints: > > Please split the short patch again: I suspect the two hunks are unrelated (could > you confirm that you can produce valid H264 gxf files only with this short > change? If not, it should be part of one patch that adds H264 support.) Forgot in my previous reply: This chunk of code is for decoding only. I can confirm that I can get it to play back, but the playback is not correct. The color-space conversion is not correct (the AVCi samples I have access to use yuvj420p color space) and it complains about too many reference frames: [h264 @ 0x30c9f00] number of reference frames exceeds max (probably corrupt input), discarding one If you want to look at the samples yourself, they can be found here: (any files with "AVCI50" in the file name) -Reuben > > > - //{ CODEC_ID_NONE, , 18 }, /* Non compressed 24 bit audio */ > > + //{ CODEC_ID_NONE , 18 }, /* Non compressed 24 bit audio */ > > > - gxf->flags |= 0x00000040; > > gxf->time_base = (AVRational){ 1, 50 }; > > + gxf->flags |= 0x00000040; > > Such changes are very unwelcome, please remove them before submitting (they make > reviewing harder). > > > - sc->media_type += 2; > > - sc->track_type = 6; > > - gxf->flags |= 0x00002000; > > - media_info = 'E'; > ... > > + sc->media_type += 2; > > + gxf->flags |= 0x00002000; > > + media_info = 'E'; > > + sc->track_type = 6; > > Please do not re-indent in this case to make the patch smaller. (Re-indentation > goes into a separate commit.) > > > +#if 0 > > + case CODEC_ID_H264: > > + sc->media_type = 26; > > + gxf->flags |= 0x02000000; > > + media_info = 'I'; > > + sc->track_type = 11; > > + break; > > +#endif > > If this does not work, please remove it (including the hunk in the other file), > dead code often just rots. > > > >
http://ffmpeg.org/pipermail/ffmpeg-devel/2010-September/100871.html
CC-MAIN-2016-36
refinedweb
303
64.24
. Preview Activation for Older Repos The current preview toolbar is enabled by default on all new Prismic repos. However, if you're on an older repo, you might be on older version of the toolbar. If your preview script src URL (described in Step 2, below). The next step is to make sure that the preview ref is used when you make your queries.. The following example checks to see if there is a preview cookie. If there is, then it will set the ref variable to the preview ref. If not, it will use the experiment ref (if there is one) and otherwise the normal master ref (default published content). def api @api = Prismic.api('') end def ref @ref ||= preview_ref || experiment_ref || api.master_ref.ref end def preview_ref if request.cookies.has_key?(Prismic::PREVIEW_COOKIE) request.cookies[Prismic::PREVIEW_COOKIE] else nil end end def experiment_ref if request.cookies.has_key?(Prismic::EXPERIMENTS_COOKIE) api.experiments.ref_from_cookie(request.cookies[Prismic::EXPERIMENTS_COOKIE]) else nil end end Then you just need to add the "ref" query option as shown below to ensure that the preview ref is used. Here is an example query: document = api.getByUID("page", "about-us", { "ref" => ref }) That is all you need to do to gain the basic functionality of the Preview feature! With the basic functionality of the Preview feature, when you click on the preview button, you will be taken to the homepage of your preview domain. From here you can navigate to the page you are trying to preview. Next we will show you how to add a Link Resolver endpoint so that you will be taken directly to the page you are trying to preview. In order to be taken directly to the page you are previewing instead of the homepage, you need to add a Link Resolver endpoint. A typical example of this would be: http://{yoursite}/preview In your preview settings add an endpoint to the optional Link Resolver field as explained in step 1. Using the official Prismic starter project? If you are using the official Prismic Ruby on Rails starter project,_session method as shown below Here is an example preview route: # Preview def preview api = Prismic.api('') preview_token = params[:token] redirect_url = api.preview_session(preview_token, link_resolver(), '/') redirect_to redirect_url end The example above uses a Link Resolver, link_resolver() , to determine the end url to redirect to. To learn more about how to set this up, check out our Link Resolving page. Once all of these pieces are in place, your previews should be up and running! Mistakes happen. So sometimes you might to do a little troubleshooting to figure out where exactly the problem is from, luckily we've created an article for just that. Deprecated: In-Website Edit Button Please note that the In-Website Edit Button has been deprecated in favor of the Preview Toolbar, which has an edit button built in. Was this article helpful? Can't find what you're looking for? Get in touch with us on our Community Forum.
https://prismic.io/docs/technologies/previews-and-the-prismic-toolbar-ruby
CC-MAIN-2021-31
refinedweb
500
55.74
EIG:File Transfer Contents WORK IN PROGRESS File Transfer Provider This provider is able to transfer files through a variety of protocols. We have a simple client on GitHub that shows all that the provide can do. Here is where you describe what the provider can do, what problem it solves and how it does that. It needs enough information to aid the reader of the manual in the decision of this provider can be useful for him. Example Bundles The Example provider needs the following bundles. You can type some text about the start levels or something else. Example Container Instantiation Example container ID : ecf.example.manager Sample code: IContainerFactory factory = getContainerManager().getContainerFactory(); IContainer containerManager = factory.createContainer( "ecf.example.manager", "example:///why/curt?why!" ); use screenshots in the EIG namespace Example Use Describe how to use the provider in a normal program. Explain it very well. After all, this is a manual. Additional topics needed your text here
http://wiki.eclipse.org/EIG:File_Transfer
CC-MAIN-2016-26
refinedweb
159
51.34
. Defining the chapters, you will find how to: - Setup a Demo Project for our Tests - Run the Tests for CI Pipeline [is the first way to run automated tests in a project, and a first barrier of your QA defence which contain Unit Testing coverage]. - Run any Tests for CD Pipeline [if the second way, which contains UI or/and API Testing coverage]. - Run your Tests from Test Plans on Demand [is the third, and a final way, which gives possibility to run any test you want whenever you: - Open your console or terminal Create a folder for your solution: mkdir TechFabricSln Create folders for Main and Test Projects mkdir src mkdir test Create a Project in the ‘src’ folder & build the Project cd src dotnet new webapp -n TechFabricSln cd TechFabricSln dotnet build Create a Test Project in the ‘test’ folder & build the Project cd.. cd.. cd test dotnet new nunit -n TechFabricSln.Test cd TechFabr* dotnet build Create solution for your projects: dotnet new sln --name TechFabricSln Add your Projects to solution: dotnet sln TechFabricSln.sln add src/TechFabricSln/TechFabricSln.csproj test/TechFabricSln.Test/TechFabricSln.Test.csproj Add a reference for Test Project: dotnet add test/TechFabricSln.Test/TechFabricSln.Test.csproj reference src/TechFabricSln/TechFabricSln.csproj: Add an additional class for the Main ‘TechFabricSln’ Project, in our example we will add ‘Bought’ class: Write some functions which you want to test. The following code defines a new bool variable which verifies who bought something in our shop.: - Login in Azure DevOps - Go to Pipelines-> Builds - Press on New pipeline: - Connect to your source control tool: - Select your Project’s repository: - Select ASP.NET Core Template: Add the following command to run the Tests from Test Project into the yml file: - task: [email protected] inputs: command: test projects: '**/*Test/*.csproj' arguments: '--configuration $(buildConfiguration)' In fact Azure DevOps will read configuration file, and execute the steps as described. Save and Runbutton, with commit directly to the master branch. After the build procedure is done, we can see the builds results in Logs. Especially, we are interested in our DotNetCoreCLIcommand,: - Create UI Test using Selenium Test Framework. - Create a Release Pipeline using your CI from the Chapter II. - Run created UI Tests on Azure DevOps CD. - Publish and monitor Test Results. ADD SELENIUM TO THE TEST PROJECT Till this moment, we already have continuous integration (CI) build pipeline with running Unit Tests, so all we need is to add Selenium References, Driver and Test for existing Project. To do this: - Open the Solution in IDE; - Go to the .Test Project -> Manage NuGet Packages; Add additional Packages to your .Test Project: - Selenium.WebDriver.ChromeDriver; - Selenium.Support; - Selenium.WebDriver; - Microsoft.TestPlatform.TestHost; The list of installed packages at this moment is: Add new Class for Selenium Tests ‘SeleniumTest.cs’ to the Project Add Selenium Test in SeleniumTest.csclass. As an example, we will add the Test which finds the Microsoft Page, and verifies which page contains the ‘Windows’ menu. The code is: using NUnit.Framework; using OpenQA.Selenium; using OpenQA.Selenium.Chrome; using System.Threading; namespace TechFabricSln.Test { class SeleniumTest { [Test] [Category("UITests")] public void VisitMicrosoft_CheckWindowsMenu() { IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("“); Thread.Sleep(10000); string Windows_text = driver.FindElement(By.Id("shellmenu_1")).Text; Assert.AreEqual("Windows", Windows_text); driver.Quit(); } } } Add Publish chromedriver for your Test Project into .csproj file: <PropertyGroup> ... ... <PublishChromeDriver>true</PublishChromeDriver> </PropertyGroup> We need this option to get chromedriver into the artefacts after the project is published.: trigger: - master pool: vmImage: 'windows-2019' variables: buildConfiguration: 'Release' steps: - task: [email protected] inputs: packageType: 'sdk' version: '3.0.x' includePreviewVersions: true - task: [email protected] inputs: versionSpec: '5.1.0' checkLatest: true - task: [email protected] inputs: command: 'restore' restoreSolution: '**/*Test/*.csproj' feedsToUse: 'select' noCache: true - task: [email protected] inputs: command: test projects: '**/*Test/*.csproj' arguments: '--configuration $(buildConfiguration) --filter TestCategory=UnitTest' - script: dotnet build --configuration $(buildConfiguration) displayName: 'dotnet build $(buildConfiguration)' - task: [email protected] displayName: 'dotnet build test' inputs: projects: '**/*Test/*.csproj' arguments: '--runtime win-x64' continueOnError: true - task: [email protected] displayName: 'dotnet publish --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)' inputs: command: publish publishWebProjects: false projects: 'src/TechFabricSln/TechFabricSln.csproj' arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)/TechFabricSln/' zipAfterPublish: false - task: [email protected] displayName: 'dotnet publish test --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)' inputs: command: publish publishWebProjects: false projects: 'test/TechFabricSln.Test/TechFabricSln.Test.csproj' arguments: '-p:PublishChromeDriver=true --runtime win-x64 --output $(Build.ArtifactStagingDirectory)/TechFabricSln.Test/' zipAfterPublish: false - task: [email protected] displayName: 'publish artifacts' CREATE RELEASE PIPELINE WITH INCLUDED TESTS As soon as the preparation is done, and the build is ended successfully, check the chromedriver.exelocated in artefacts of your build. It’s an important thing because without the driver, you won’t be able to complete written UI tests successfully. Then make changes into your Release Pipeline or create a new one: - Open the Releases page in the Azure Pipelines section - Click on New pipelinebutton in Releases block: - In opened Templates block click to start with Empty job: - Name the stage and click on the Job/Task link: Add the Dotnet Core Task: Complete the added task with the following parameters: - Task Version: 2; - Display Name: Choose any name you want, the field is just responsible for the name of procedure; - Command: There are several command we can find, but the one we need is custom, we’ll specify the command father in Custom command section; - Path to project(s): Specify the path to your Test Project’s dll, in our case it’s: **/TechFabricSln.Test/TechFabricSln.Test/TechFabricSln.Test.dll Add the arguments you want to use. To set logs you can use: --logger:trx;logfilename=TEST.xml To run only UI tests on this Release, add: /TestCaseFilter:"TestCategory=UITests” Also, it’s important to say, that in case one or more tests fail, the procedure will be stopped, to prevent this, we recommend to use continue on erroroption. Add the Publish Test ResultsTask Complete the added task with the following parameters: - Task Version: 2; - Display Name: Choose any name you want, the field is just responsible for the name of the procedure; - Test result format: Format of test result files generated by your choice of test runner. In our case we need VSTest option; - Search Folder: Specify the folder path where to search for the test result files.: - Visit the Test Logs - > Tests block; - Visit the Test Plan - > Runs. CHAPTER IV – Run your Tests from Test Plans on Demand The idea of this chapter is to show how to use Azure Test Plan to create linkages between manual and automated tests. Rather than using scheduled tests, running the tests on demand can be useful if you: - Don’t want to run all tests on build or release stages (e.g. if you want to save the time and run only some important tests on Release, and afterwards run whatever you want on demand); - The changes in your environment are made not by release (e.g. changes in DB); - To rerun some individual tests (e.g. the tests can fail on build/release stage because of some infrastructure issues, and you just want to rerun them); - To run the tests on a new build without it’s releasing. You already have almost everything we need, so in this chapter we proceed with: - Create a Test Plan with a Manual TC to linkage with our Automated TC; - Create separate Release Pipeline for Test Project for running the Tests on Demand; Create linkage between Manual and Automated TCses - Go to the Test Plans and push on ‘New Test Plan’ button; - Create a Test Plan with any Name and Area; - Go to Test Plan – ‘Define’ block and push on ‘New Test Case’ button: - Write some TC Check, no matter which step is it. - Open your Project in IDE; - Connect into the Team Services/Azure; - Add linkage with right click on the test -> Associate: - VSTest Platform Installer: You need the Visual Studio Test Platform to be installed on the agent computer, and if it’s not - you must add the Visual Studio Test Platform Installer task to the pipeline definition; - VSTest Task: This command allows us to use vstest run command with specifying settings and parameters for our Test Run; - Publish Test Results: This task allows us to collect the data from test runs to make some statistical analysis and verify the ‘weakest’ areas of the App. Add all 3 described tasks with the following settings: - VSTest Platform Installer task settings: -: - Go to Test Plans; - Select ‘Execute’ block; - Select a TC you want to run; - Choose ‘Run with options’ in the menu ‘Run for web applications’: - Choose the build and Stage where you want to run your UI Selenium tests. Use the latest build, and choose ‘Dev Tests’ Stage which we just created. - - Setup a WEB Project with Unit Tests; - Create a CI in Azure DevOps; - Add Selenium Tests on existing Projects; - Run all the tests locally, in your own IDE. - Run the Tests in 3 Ways on Azure DevOps: - On each Build (for Unit Tests); - On each Release (for UI or API tests); - Create linkages between your manual and automated tests and run them whenever you want. - Check for Test run results.. Discussion (0)
https://azurefirst.com/preetham/3-ways-to-run-automated-tests-on-azure-devops-31h2
CC-MAIN-2022-40
refinedweb
1,527
50.87
1 /*2 * @(#)Exchanger.java 1.6 06/09/203 *4 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.6 */7 8 package java.util.concurrent;9 import java.util.concurrent.atomic.*;10 import java.util.concurrent.locks.LockSupport ;11 12 /**13 * A synchronization point at which two threads can exchange objects.14 * Each thread presents some object on entry to the {@link #exchange15 * exchange} method, and receives the object presented by the other16 * thread on return.17 *18 * <p><b>Sample Usage:</b>19 * Here are the highlights of a class that uses an <tt>Exchanger</tt> to20 * swap buffers between threads so that the thread filling the21 * buffer gets a freshly22 * emptied one when it needs it, handing off the filled one to23 * the thread emptying the buffer.24 * <pre>25 * class FillAndEmpty {26 * Exchanger<DataBuffer> exchanger = new Exchanger();27 * DataBuffer initialEmptyBuffer = ... a made-up type28 * DataBuffer initialFullBuffer = ...29 *30 * class FillingLoop implements Runnable {31 * public void run() {32 * DataBuffer currentBuffer = initialEmptyBuffer;33 * try {34 * while (currentBuffer != null) {35 * addToBuffer(currentBuffer);36 * if (currentBuffer.full())37 * currentBuffer = exchanger.exchange(currentBuffer);38 * }39 * } catch (InterruptedException ex) { ... handle ... }40 * }41 * }42 *43 * class EmptyingLoop implements Runnable {44 * public void run() {45 * DataBuffer currentBuffer = initialFullBuffer;46 * try {47 * while (currentBuffer != null) {48 * takeFromBuffer(currentBuffer);49 * if (currentBuffer.empty())50 * currentBuffer = exchanger.exchange(currentBuffer);51 * }52 * } catch (InterruptedException ex) { ... handle ...}53 * }54 * }55 *56 * void start() {57 * new Thread(new FillingLoop()).start();58 * new Thread(new EmptyingLoop()).start();59 * }60 * }61 * </pre>62 *63 * @since 1.564 * @author Doug Lea65 * @param <V> The type of objects that may be exchanged66 */67 public class Exchanger<V> {68 /*69 * Algorithm Description:70 *71 * The basic idea is to maintain a "slot", which is a reference to72 * a Node containing both an Item to offer and a "hole" waiting to73 * get filled in. If an incoming "occupying" thread sees that the74 * slot is null, it CAS'es (compareAndSets) a Node there and waits75 * for another to invoke exchange. That second "fulfilling" thread76 * sees that the slot is non-null, and so CASes it back to null,77 * also exchanging items by CASing the hole, plus waking up the78 * occupying thread if it is blocked. In each case CAS'es may79 * fail because a slot at first appears non-null but is null upon80 * CAS, or vice-versa. So threads may need to retry these81 * actions.82 *83 * This simple approach works great when there are only a few84 * threads using an Exchanger, but performance rapidly85 * deteriorates due to CAS contention on the single slot when86 * there are lots of threads using an exchanger. So instead we use87 * an "arena"; basically a kind of hash table with a dynamically88 * varying number of slots, any one of which can be used by89 * threads performing an exchange. Incoming threads pick slots90 * based on a hash of their Thread ids. If an incoming thread91 * fails to CAS in its chosen slot, it picks an alternative slot92 * instead. And similarly from there. If a thread successfully93 * CASes into a slot but no other thread arrives, it tries94 * another, heading toward the zero slot, which always exists even95 * if the table shrinks. The particular mechanics controlling this96 * are as follows:97 *98 * Waiting: Slot zero is special in that it is the only slot that99 * exists when there is no contention. A thread occupying slot100 * zero will block if no thread fulfills it after a short spin.101 * In other cases, occupying threads eventually give up and try102 * another slot. Waiting threads spin for a while (a period that103 * should be a little less than a typical context-switch time)104 * before either blocking (if slot zero) or giving up (if other105 * slots) and restarting. There is no reason for threads to block106 * unless there are unlikely to be any other threads present.107 * Occupants are mainly avoiding memory contention so sit there108 * quietly polling for a shorter period than it would take to109 * block and then unblock them. Non-slot-zero waits that elapse110 * because of lack of other threads waste around one extra111 * context-switch time per try, which is still on average much112 * faster than alternative approaches.113 *114 * Sizing: Usually, using only a few slots suffices to reduce115 * contention. Especially with small numbers of threads, using116 * too many slots can lead to just as poor performance as using117 * too few of them, and there's not much room for error. The118 * variable "max" maintains the number of slots actually in119 * use. It is increased when a thread sees too many CAS120 * failures. (This is analogous to resizing a regular hash table121 * based on a target load factor, except here, growth steps are122 * just one-by-one rather than proportional.) Growth requires123 * contention failures in each of three tried slots. Requiring124 * multiple failures for expansion copes with the fact that some125 * failed CASes are not due to contention but instead to simple126 * races between two threads or thread pre-emptions occurring127 * between reading and CASing. Also, very transient peak128 * contention can be much higher than the average sustainable129 * levels. The max limit is decreased on average 50% of the times130 * that a non-slot-zero wait elapses without being fulfilled.131 * Threads experiencing elapsed waits move closer to zero, so132 * eventually find existing (or future) threads even if the table133 * has been shrunk due to inactivity. The chosen mechanics and134 * thresholds for growing and shrinking are intrinsically135 * entangled with indexing and hashing inside the exchange code,136 * and can't be nicely abstracted out.137 *138 * Hashing: Each thread picks its initial slot to use in accord139 * with a simple hashcode. The sequence is the same on each140 * encounter by any given thread, but effectively random across141 * threads. Using arenas encounters the classic cost vs quality142 * tradeoffs of all hash tables. Here, we use a one-step FNV-1a143 * hash code based on the current thread's Thread.getId(), along144 * with a cheap approximation to a mod operation to select an145 * index. The downside of optimizing index selection in this way146 * is that the code is hardwired to use a maximum table size of147 * 32. But this value more than suffices for known platforms and148 * applications.149 *150 * Probing: On sensed contention of a selected slot, we probe151 * sequentially through the table, analogously to linear probing152 * after collision in a hash table. (We move circularly, in153 * reverse order, to mesh best with table growth and shrinkage154 * rules.) Except that to minimize the effects of false-alarms155 * and cache thrashing, we try the first selected slot twice156 * before moving.157 *158 * Padding: Even with contention management, slots are heavily159 * contended, so use cache-padding to avoid poor memory160 * performance. Because of this, slots are lazily constructed161 * only when used, to avoid wasting this space unnecessarily.162 * While isolation of locations is not much of an issue at first163 * in an application, as time goes on and garbage-collectors164 * perform compaction, slots are very likely to be moved adjacent165 * to each other, which can cause much thrashing of cache lines on166 * MPs unless padding is employed.167 *168 * This is an improvement of the algorithm described in the paper169 * "A Scalable Elimination-based Exchange Channel" by William170 * Scherer, Doug Lea, and Michael Scott in Proceedings of SCOOL05171 * workshop. Available at: */173 174 /** The number of CPUs, for sizing and spin control */175 private static final int NCPU = Runtime.getRuntime().availableProcessors();176 177 /**178 * The capacity of the arena. Set to a value that provides more179 * than enough space to handle contention. On small machines180 * most slots won't be used, but it is still not wasted because181 * the extra space provides some machine-level address padding182 * to minimize interference with heavily CAS'ed Slot locations.183 * And on very large machines, performance eventually becomes184 * bounded by memory bandwidth, not numbers of threads/CPUs.185 * This constant cannot be changed without also modifying186 * indexing and hashing algorithms.187 */188 private static final int CAPACITY = 32;189 190 /**191 * The value of "max" that will hold all threads without192 * contention. When this value is less than CAPACITY, some193 * otherwise wasted expansion can be avoided.194 */195 private static final int FULL =196 Math.max(0, Math.min(CAPACITY, NCPU / 2) - 1);197 198 /**199 * The number of times to spin (doing nothing except polling a200 * memory location) before blocking or giving up while waiting to201 * be fulfilled. Should be zero on uniprocessors. On202 * multiprocessors, this value should be large enough so that two203 * threads exchanging items as fast as possible block only when204 * one of them is stalled (due to GC or preemption), but not much205 * longer, to avoid wasting CPU resources. Seen differently, this206 * value is a little over half the number of cycles of an average207 * context switch time on most systems. The value here is208 * approximately the average of those across a range of tested209 * systems.210 */211 private static final int SPINS = (NCPU == 1) ? 0 : 2000;212 213 /**214 * The number of times to spin before blocking in timed waits.215 * Timed waits spin more slowly because checking the time takes216 * time. The best value relies mainly on the relative rate of217 * System.nanoTime vs memory accesses. The value is empirically218 * derived to work well across a variety of systems.219 */220 private static final int TIMED_SPINS = SPINS / 20;221 222 /**223 * Sentinel item representing cancellation of a wait due to224 * interruption, timeout, or elapsed spin-waits. This value is225 * placed in holes on cancellation, and used as a return value226 * from waiting methods to indicate failure to set or get hole.227 */228 private static final Object CANCEL = new Object ();229 230 /**231 * Value representing null arguments/returns from public232 * methods. This disambiguates from internal requirement that233 * holes start out as null to mean they are not yet set.234 */235 private static final Object NULL_ITEM = new Object ();236 237 /**238 * Nodes hold partially exchanged data. This class239 * opportunistically subclasses AtomicReference to represent the240 * hole. So get() returns hole, and compareAndSet CAS'es value241 * into hole. This class cannot be parameterized as "V" because242 * of the use of non-V CANCEL sentinels.243 */244 private static final class Node extends AtomicReference<Object > {245 /** The element offered by the Thread creating this node. */246 public final Object item;247 248 /** The Thread waiting to be signalled; null until waiting. */249 public volatile Thread waiter;250 251 /**252 * Creates node with given item and empty hole.253 * @param item the item254 */255 public Node(Object item) {256 this.item = item;257 }258 }259 260 /**261 * A Slot is an AtomicReference with heuristic padding to lessen262 * cache effects of this heavily CAS'ed location. While the263 * padding adds noticeable space, all slots are created only on264 * demand, and there will be more than one of them only when it265 * would improve throughput more than enough to outweigh using266 * extra space.267 */268 private static final class Slot extends AtomicReference<Object > {269 // Improve likelihood of isolation on <= 64 byte cache lines270 long q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, qa, qb, qc, qd, qe;271 }272 273 /**274 * Slot array. Elements are lazily initialized when needed.275 * Declared volatile to enable double-checked lazy construction.276 */277 private volatile Slot[] arena = new Slot[CAPACITY];278 279 /**280 * The maximum slot index being used. The value sometimes281 * increases when a thread experiences too many CAS contentions,282 * and sometimes decreases when a spin-wait elapses. Changes283 * are performed only via compareAndSet, to avoid stale values284 * when a thread happens to stall right before setting.285 */286 private final AtomicInteger max = new AtomicInteger();287 288 /**289 * Main exchange function, handling the different policy variants.290 * Uses Object, not "V" as argument and return value to simplify291 * handling of sentinel values. Callers from public methods decode292 * and cast accordingly.293 *294 * @param item the (non-null) item to exchange295 * @param timed true if the wait is timed296 * @param nanos if timed, the maximum wait time297 * @return the other thread's item, or CANCEL if interrupted or timed out298 */299 private Object doExchange(Object item, boolean timed, long nanos) {300 Node me = new Node(item); // Create in case occupying301 int index = hashIndex(); // Index of current slot302 int fails = 0; // Number of CAS failures303 304 for (;;) {305 Object y; // Contents of current slot306 Slot slot = arena[index];307 if (slot == null) // Lazily initialize slots308 createSlot(index); // Continue loop to reread309 else if ((y = slot.get()) != null && // Try to fulfill310 slot.compareAndSet(y, null)) {311 Node you = (Node)y; // Transfer item312 if (you.compareAndSet(null, item)) {313 LockSupport.unpark(you.waiter);314 return you.item;315 } // Else cancelled; continue316 }317 else if (y == null && // Try to occupy318 slot.compareAndSet(null, me)) {319 if (index == 0) // Blocking wait for slot 0320 return timed? awaitNanos(me, slot, nanos): await(me, slot);321 Object v = spinWait(me, slot); // Spin wait for non-0322 if (v != CANCEL)323 return v;324 me = new Node(item); // Throw away cancelled node325 int m = max.get();326 if (m > (index >>>= 1)) // Decrease index327 max.compareAndSet(m, m - 1); // Maybe shrink table328 }329 else if (++fails > 1) { // Allow 2 fails on 1st slot330 int m = max.get();331 if (fails > 3 && m < FULL && max.compareAndSet(m, m + 1))332 index = m + 1; // Grow on 3rd failed slot333 else if (--index < 0)334 index = m; // Circularly traverse335 }336 }337 }338 339 /**340 * Returns a hash index for the current thread. Uses a one-step341 * FNV-1a hash code ()342 * based on the current thread's Thread.getId(). These hash codes343 * have more uniform distribution properties with respect to small344 * moduli (here 1-31) than do other simple hashing functions.345 *346 * <p>To return an index between 0 and max, we use a cheap347 * approximation to a mod operation, that also corrects for bias348 * due to non-power-of-2 remaindering (see {@link349 * java.util.Random#nextInt}). Bits of the hashcode are masked350 * with "nbits", the ceiling power of two of table size (looked up351 * in a table packed into three ints). If too large, this is352 * retried after rotating the hash by nbits bits, while forcing new353 * top bit to 0, which guarantees eventual termination (although354 * with a non-random-bias). This requires an average of less than355 * 2 tries for all table sizes, and has a maximum 2% difference356 * from perfectly uniform slot probabilities when applied to all357 * possible hash codes for sizes less than 32.358 *359 * @return a per-thread-random index, 0 <= index < max360 */361 private final int hashIndex() {362 long id = Thread.currentThread().getId();363 int hash = (((int)(id ^ (id >>> 32))) ^ 0x811c9dc5) * 0x01000193;364 365 int m = max.get();366 int nbits = (((0xfffffc00 >> m) & 4) | // Compute ceil(log2(m+1))367 ((0x000001f8 >>> m) & 2) | // The constants hold368 ((0xffff00f2 >>> m) & 1)); // a lookup table369 int index;370 while ((index = hash & ((1 << nbits) - 1)) > m) // May retry on371 hash = (hash >>> nbits) | (hash << (33 - nbits)); // non-power-2 m372 return index;373 }374 375 /**376 * Creates a new slot at given index. Called only when the slot377 * appears to be null. Relies on double-check using builtin378 * locks, since they rarely contend. This in turn relies on the379 * arena array being declared volatile.380 *381 * @param index the index to add slot at382 */383 private void createSlot(int index) {384 // Create slot outside of lock to narrow sync region385 Slot newSlot = new Slot();386 Slot[] a = arena;387 synchronized (a) {388 if (a[index] == null)389 a[index] = newSlot;390 }391 }392 393 /**394 * Tries to cancel a wait for the given node waiting in the given395 * slot, if so, helping clear the node from its slot to avoid396 * garbage retention.397 *398 * @param node the waiting node399 * @param the slot it is waiting in400 * @return true if successfully cancelled401 */402 private static boolean tryCancel(Node node, Slot slot) {403 if (!node.compareAndSet(null, CANCEL))404 return false;405 if (slot.get() == node) // pre-check to minimize contention406 slot.compareAndSet(node, null);407 return true;408 }409 410 // Three forms of waiting. Each just different enough not to merge411 // code with others.412 413 /**414 * Spin-waits for hole for a non-0 slot. Fails if spin elapses415 * before hole filled. Does not check interrupt, relying on check416 * in public exchange method to abort if interrupted on entry.417 *418 * @param node the waiting node419 * @return on success, the hole; on failure, CANCEL420 */421 private static Object spinWait(Node node, Slot slot) {422 int spins = SPINS;423 for (;;) {424 Object v = node.get();425 if (v != null)426 return v;427 else if (spins > 0)428 --spins;429 else430 tryCancel(node, slot);431 }432 }433 434 /**435 * Waits for (by spinning and/or blocking) and gets the hole436 * filled in by another thread. Fails if interrupted before437 * hole filled.438 *439 * When a node/thread is about to block, it sets its waiter field440 * and then rechecks state at least one more time before actually441 * parking, thus covering race vs fulfiller noticing that waiter442 * is non-null so should be woken.443 *444 * Thread interruption status is checked only surrounding calls to445 * park. The caller is assumed to have checked interrupt status446 * on entry.447 *448 * @param node the waiting node449 * @return on success, the hole; on failure, CANCEL450 */451 private static Object await(Node node, Slot slot) {452 Thread w = Thread.currentThread();453 int spins = SPINS;454 for (;;) {455 Object v = node.get();456 if (v != null)457 return v;458 else if (spins > 0) // Spin-wait phase459 --spins;460 else if (node.waiter == null) // Set up to block next461 node.waiter = w;462 else if (w.isInterrupted()) // Abort on interrupt463 tryCancel(node, slot);464 else // Block465 LockSupport.park();466 }467 }468 469 /**470 * Waits for (at index 0) and gets the hole filled in by another471 * thread. Fails if timed out or interrupted before hole filled.472 * Same basic logic as untimed version, but a bit messier.473 *474 * @param node the waiting node475 * @param nanos the wait time476 * @return on success, the hole; on failure, CANCEL477 */478 private Object awaitNanos(Node node, Slot slot, long nanos) {479 int spins = TIMED_SPINS;480 long lastTime = 0;481 Thread w = null;482 for (;;) {483 Object v = node.get();484 if (v != null)485 return v;486 long now = System.nanoTime();487 if (w == null)488 w = Thread.currentThread();489 else490 nanos -= now - lastTime;491 lastTime = now;492 if (nanos > 0) {493 if (spins > 0)494 --spins;495 else if (node.waiter == null)496 node.waiter = w;497 else if (w.isInterrupted())498 tryCancel(node, slot);499 else500 LockSupport.parkNanos(nanos);501 }502 else if (tryCancel(node, slot) && !w.isInterrupted())503 return scanOnTimeout(node);504 }505 }506 507 /**508 * Sweeps through arena checking for any waiting threads. Called509 * only upon return from timeout while waiting in slot 0. When a510 * thread gives up on a timed wait, it is possible that a511 * previously-entered thread is still waiting in some other512 * slot. So we scan to check for any. This is almost always513 * overkill, but decreases the likelihood of timeouts when there514 * are other threads present to far less than that in lock-based515 * exchangers in which earlier-arriving threads may still be516 * waiting on entry locks.517 *518 * @param node the waiting node519 * @return another thread's item, or CANCEL520 */521 private Object scanOnTimeout(Node node) {522 Object y;523 for (int j = arena.length - 1; j >= 0; --j) {524 Slot slot = arena[j];525 if (slot != null) {526 while ((y = slot.get()) != null) {527 if (slot.compareAndSet(y, null)) {528 Node you = (Node)y;529 if (you.compareAndSet(null, node.item)) {530 LockSupport.unpark(you.waiter);531 return you.item;532 }533 }534 }535 }536 }537 return CANCEL;538 }539 540 /**541 * Create a new Exchanger.542 **/543 public Exchanger() {544 }545 546 /**547 * Waits for another thread to arrive at this exchange point (unless548 * it is {@link Thread#interrupt interrupted}),549 * and then transfers the given object to it, receiving its object550 * in return.551 * <p>If another thread is already waiting at the exchange point then552 * it is resumed for thread scheduling purposes and receives the object553 * passed in by the current thread. The current thread returns immediately,554 * receiving the object passed to the exchange by that other thread.555 * <p>If no other thread is already waiting at the exchange then the 556 * current thread is disabled for thread scheduling purposes and lies557 * dormant until one of two things happens:558 * <ul>559 * <li>Some other thread enters the exchange; or560 * <li>Some other thread {@link Thread#interrupt interrupts} the current561 * thread.562 * </ul>563 * <p>If the current thread:564 * <ul>565 * <li>has its interrupted status set on entry to this method; or 566 * <li>is {@link Thread#interrupt interrupted} while waiting567 * for the exchange, 568 * </ul>569 * then {@link InterruptedException} is thrown and the current thread's 570 * interrupted status is cleared. 571 *572 * @param x the object to exchange573 * @return the object provided by the other thread.574 * @throws InterruptedException if current thread was interrupted 575 * while waiting576 **/577 public V exchange(V x) throws InterruptedException {578 if (!Thread.interrupted()) {579 Object v = doExchange(x == null? NULL_ITEM : x, false, 0);580 if (v == NULL_ITEM)581 return null;582 if (v != CANCEL)583 return (V)v;584 Thread.interrupted(); // Clear interrupt status on IE throw585 }586 throw new InterruptedException ();587 }588 589 /**590 * Waits for another thread to arrive at this exchange point (unless591 * it is {@link Thread#interrupt interrupted}, or the specified waiting592 * time elapses),593 * and then transfers the given object to it, receiving its object594 * in return.595 *596 * <p>If another thread is already waiting at the exchange point then597 * it is resumed for thread scheduling purposes and receives the object598 * passed in by the current thread. The current thread returns immediately,599 * receiving the object passed to the exchange by that other thread.600 *601 * <p>If no other thread is already waiting at the exchange then the 602 * current thread is disabled for thread scheduling purposes and lies603 * dormant until one of three things happens:604 * <ul>605 * <li>Some other thread enters the exchange; or606 * <li>Some other thread {@link Thread#interrupt interrupts} the current607 * thread; or608 * <li>The specified waiting time elapses.609 * </ul>610 * <p>If the current thread:611 * <ul>612 * <li>has its interrupted status set on entry to this method; or 613 * <li>is {@link Thread#interrupt interrupted} while waiting614 * for the exchange, 615 * </ul>616 * then {@link InterruptedException} is thrown and the current thread's 617 * interrupted status is cleared. 618 *619 * <p>If the specified waiting time elapses then {@link TimeoutException}620 * is thrown.621 * If the time is 622 * less than or equal to zero, the method will not wait at all.623 *624 * @param x the object to exchange625 * @param timeout the maximum time to wait626 * @param unit the time unit of the <tt>timeout</tt> argument.627 * @return the object provided by the other thread.628 * @throws InterruptedException if current thread was interrupted629 * while waiting630 * @throws TimeoutException if the specified waiting time elapses before631 * another thread enters the exchange.632 **/633 public V exchange(V x, long timeout, TimeUnit unit)634 throws InterruptedException , TimeoutException {635 if (!Thread.interrupted()) {636 Object v = doExchange(x == null? NULL_ITEM : x,637 true, unit.toNanos(timeout));638 if (v == NULL_ITEM)639 return null;640 if (v != CANCEL)641 return (V)v;642 if (!Thread.interrupted())643 throw new TimeoutException ();644 }645 throw new InterruptedException ();646 }647 }648 Java API By Example, From Geeks To Geeks. | Our Blog | Conditions of Use | About Us_ |
http://kickjava.com/src/java/util/concurrent/Exchanger.java.htm
CC-MAIN-2022-27
refinedweb
3,961
62.78
Getting Started with Vuex: a Beginner’s Guide JavaScript In single-page applications, the concept of state relates to any piece of data that can change. An example of state could be the details of a logged-in user, or data fetched from an API. Handling state in single-page apps can be a tricky process. As an application gets larger and more complex, you start to encounter situations where a given piece of state needs to be used in multiple components, or you find yourself passing state through components that don’t need it, just to get it to where it needs to be. This is also known as “prop drilling”, and can lead to some unwieldy code. Vuex is the official state management solution for Vue. It works by having a central store for shared state, and providing methods to allow any component in your application to access that state. In essence, Vuex ensures your views remain consistent with your application data, regardless of which function triggers a change to your application data. In this article, I’ll offer you a high-level overview of Vuex and demonstrate how to implement it into a simple app. Want to learn Vue.js from the ground up? Get an entire collection of Vue books covering fundamentals, projects, tips and tools & more with SitePoint Premium. Join now for just $9/month. A Shopping Cart Example Let’s consider a real-world example to demonstrate the problem that Vuex solves. When you go to a shopping site, you’ll usually have a list of products. Each product has an Add to Cart button and sometimes an Items Remaining label indicating the current stock or the maximum number of items you can order for the specified product. Each time a product is purchased, the current stock of that product is reduced. When this happens, the Items Remaining label should update with the correct figure. When the product’s stock level reaches 0, the label should read Out of Stock. In addition, the Add to Cart button should be disabled or hidden to ensure customers can’t order products that are currently not in inventory. Now ask yourself how you’d implement this logic. It may be trickier than you think. And let me throw in a curve ball. You’ll need another function for updating stock records when new stock comes in. When the depleted product’s stock is updated, both the Items Remaining label and the Add to Cart button should be updated instantly to reflect the new state of the stock. Depending on your programming prowess, your solution may start to look a bit like spaghetti. Now, let’s imagine your boss tells you to develop an API that allows third-party sites to sell the products directly from the warehouse. The API needs to ensure that the main shopping website remains in sync with the products’ stock levels. At this point you feel like pulling your hair out and demanding why you weren’t told to implement this earlier. You feel like all your hard work has gone to waste, as you’ll need to completely rework your code to cope with this new requirement. This is where a state management pattern library can save you from such headaches. It will help you organize the code that handles your front-end data in a way that makes adding new requirements a breeze. Prerequisites Before we start, I’ll assume that you: You’ll also need to have a recent version of Node.js that’s not older than version 6.0. At the time of writing, Node.js v10.13.0 (LTS) and npm version 6.4.1 are the most recent. If you don’t have a suitable version of Node installed on your system already, I recommend using a version manager. Finally, you should have the most recent version of the Vue CLI installed: npm install -g @vue/cli Build a Counter Using Local State In this section, we’re going to build a simple counter that keeps track of its state locally. Once we’re done, I’ll go over the fundamental concepts of Vuex, before looking at how to rewrite the counter app to use Vue’s official state management solution. Getting Set Up Let’s generate a new project using the CLI: vue create vuex-counter A wizard will open up to guide you through the project creation. Select Manually select features and ensure that you choose to install Vuex. Next, change into the new directory and in the src/components folder, rename HelloWorld.vue to Counter.vue: cd vuex-counter mv src/components/HelloWorld.vue src/components/Counter.vue Finally, open up src/App.vue and replace the existing code with the following: <template> <div id="app"> <h1>Vuex Counter</h1> <Counter/> </div> </template> <script> import Counter from './components/Counter.vue' export default { name: 'app', components: { Counter } } </script> You can leave the styles as they are. Creating the Counter Let’s start off by initializing a count and outputting it to the page. We’ll also inform the user whether the count is currently even or odd. Open up src/components/Counter.vue and replace the code with the following: <template> <div> <p>Clicked {{ count }} times! Count is {{ parity }}.</p> </div> </template> <script> export default { name: 'Counter', data: function() { return { count: 0 }; }, computed: { parity: function() { return this.count % 2 === 0 ? 'even' : 'odd'; } } } </script> As you can see, we have one state variable called count and a computed function called parity which returns the string even or odd depending on the whether count is an odd or even number. To see what we’ve got so far, start the app from within the root folder by running npm run serve and navigate to. Feel free to change the value of the counter to show that the correct output for both counter and parity is displayed. When you’re satisfied, make sure to reset it back to 0 before we proceed to the next step. Incrementing and Decrementing Right after the computed property in the <script> section of Counter.vue, add this code: methods: { increment: function () { this.count++; }, decrement: function () { this.count--; }, incrementIfOdd: function () { if (this.parity === 'odd') { this.increment(); } }, incrementAsync: function () { setTimeout(() => { this.increment() }, 1000) } } The first two functions, increment and decrement, are hopefully self-explanatory. The incrementIfOdd function only executes if the value of count is an odd number, whereas incrementAsync is an asynchronous function that performs an increment after one second. In order to access these new methods from the template, we’ll need to define some buttons. Insert the following after the template code which outputs the count and parity: <button @Increment</button> <button @Decrement</button> <button @Increment if Odd</button> <button @Increment Async</button> After you’ve saved, the browser should refresh automatically. Click all of the buttons to ensure everything is working as expected. This is what you should have ended up with: See the Pen Vue Counter Using Local State by SitePoint (@SitePoint) on CodePen. The counter example is now complete. Let’s move and examine the fundamentals of Vuex, before looking at how we would rewrite the counter to implement them. How Vuex Works Before we go over the practical implementation, it’s best that we acquire a basic grasp of how Vuex code is organized. If you’re familiar with similar frameworks such as Redux, you shouldn’t find anything too surprising here. If you haven’t dealt with any Flux-based state management frameworks before, please pay close attention. The Vuex Store The store provides a centralized repository for shared state in Vue apps. This is what it looks like in its most basic form: // src/store/index.js import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) export default new Vuex.Store({ state: { // put variables and collections here }, mutations: { // put sychronous functions for changing state e.g. add, edit, delete }, actions: { // put asynchronous functions that can call one or more mutation functions } }) After defining your store, you need to inject it into your Vue.js application like this: // src/main.js import store from './store' new Vue({ store, render: h => h(App) }).$mount('#app') This will make the injected store instance available to every component in our application as this.$store. Working with State Also referred to as the single state tree, this is simply an object that contains all front-end application data. Vuex, just like Redux, operates using a single store. Application data is organized in a tree-like structure. Its construction is quite simple. Here’s an example: state: { products: [], count: 5, loggedInUser: { name: 'John', role: 'Admin' } } Here we have products that we’ve initialized with an empty array, and count, which is initialized with the value 5. We also have loggedInUser, which is a JavaScript object literal containing multiple fields. State properties can contain any valid datatype from Booleans, to arrays, to other objects. There are multiple ways to display state in our views. We can reference the store directly in our templates using $store: <template> <p>{{ $store.state.count }}</p> </template> Or we can return some store state from within a computed property: <template> <p>{{ count }}</p> </template> <script> export default { computed: { count() { return this.$store.state.count; } } } </script> Since Vuex stores are reactive, whenever the value of $store.state.count changes, the view will change as well. All this happens behind the scenes, making your code look simple and cleaner. The mapState Helper Now, suppose you have multiple states you want to display in your views. Declaring a long list of computed properties can get verbose, so Vuex provides a mapState helper. This can be used to generate multiple computed properties easily. Here’s an example: <template> <div> <p>Welcome, {{ loggedInUser.name }}.</p> <p>Count is {{ count }}.</p> </div> </template> <script> import { mapState } from 'vuex'; export default { computed: mapState({ count: state => state.count, loggedInUser: state => state.loggedInUser }) } </script> Here’s an even simpler alternative where we can pass an array of strings to the mapState helper function: export default { computed: mapState([ 'count', 'loggedInUser' ]) } This version of the code and the one above it do exactly the same thing. You should note that mapState returns an object. If you want to use it with other computed properties, you can use the spread operator. Here’s how: computed: { ...mapState([ 'count', 'loggedInUser' ]), parity: function() { return this.count % 2 === 0 ? 'even' : 'odd' } } Getters In a Vuex store, getters are the equivalent to Vue’s computed properties. They allow you to create derived state that can be shared between different components. Here’s a quick example: getters: { depletedProducts: state => { return state.products.filter(product => product.stock <= 0) } } Results of getter handlers (when accessed as properties) are cached and can be called as many times as you wish. They’re also reactive to state changes. In other words, if the state it depends upon changes, the getter function is automatically executed and the new result is cached. Any component that has accessed a getter handler will get updated instantly. This is how you can access a getter handler from a component: computed: { depletedProducts() { return this.$store.getters.depletedProducts; } } The mapGetters Helper You can simplify the getters code by using the mapGetters helper: import { mapGetters } from 'vuex' export default { //.. computed: { ...mapGetters([ 'depletedProducts', 'anotherGetter' ]) } } There’s an option for passing arguments to a getter handler by returning a function. This is useful if you want to perform a query within the getter: getters: { getProductById: state => id => { return state.products.find(product => product.id === id); } } store.getters.getProductById(5) Do note that each time a getter handler is accessed via a method, it will always run and the result won’t be cached. Compare: // property notation, result cached store.getters.depletedProducts // method notation, result not cached store.getters.getProductById(5) Changing State with Mutations An important aspect of the Vuex architecture is that components never alter the state directly. Doing so can lead to odd bugs and inconsistencies in the app’s state. Instead, the way to change state in a Vuex store is by committing a mutation. For those of you familiar with Redux, these are similar to reducers. Here is an example of a mutation that increases a count variable stored in state: export default new Vuex.Store({ state:{ count: 1 }, mutations: { increment(state) { state.count++ } } }) You can’t call a mutation handler directly. Instead, you trigger one by “committing a mutation” like this: methods: { updateCount() { this.$store.commit('increment'); } } You can also pass parameters to a mutation: // store.js mutations: { incrementBy(state, n) { state.count += n; } } // component updateCount() { this.$store.commit('incrementBy', 25); } In the above example, we’re passing the mutation an integer by which it should increase the count. You can also pass an object as a parameter. This way, you can include multiple fields easily without overloading your mutation handler: // store.js mutations: { incrementBy(state, payload) { state.count += payload.amount; } } // component updateCount() { this.$store.commit('incrementBy', { amount: 25 }); } You can also perform an object-style commit that looks like this: store.commit({ type: 'incrementBy', amount: 25 }) The mutation handler will remain the same. The mapMutations Helper Similar to mapState and mapGetters, you can also use the mapMutations helper to reduce the boilerplate for your mutation handlers: import { mapMutations } from 'vuex' export default{ methods: { ...mapMutations([ 'increment', // maps to this.increment() 'incrementBy' // maps to this.incrementBy(amount) ]) } } On a final note, mutation handlers must be synchronous. You can attempt to write an asynchronous mutation function, but you’ll come to find out later down the road that it causes unnecessary complications. Let’s move on to actions. Actions Actions are functions that don’t change the state themselves. Instead, they commit mutations after performing some logic (which is often asynchronous). Here’s a simple example of an action: //.. actions: { increment(context) { context.commit('increment'); } } Action handlers receive a context object as their first argument, which gives us access to store properties and methods. For example: context.commit: commit a mutation context.state: access state context.getters: access getters You can also use argument destructing to extract the store attributes you need for your code. For example: actions: { increment({ commit }) { commit('increment'); } } As mentioned above, actions can be asynchronous. Here’s an example: actions: { incrementAsync: async({ commit }) => { return await setTimeout(() => { commit('increment') }, 1000); } } In this example, the mutation is committed after 1,000 milliseconds. Like mutations, action handlers aren’t called directly, but rather via a dedicated dispatch method on the store, like so: store.dispatch('incrementAsync') // dispatch with payload store.dispatch('incrementBy', { amount: 25}) // dispatch with object store.dispatch({ type: 'incrementBy', amount: 25 }) You can dispatch an action in a component like this: this.$store.dispatch('increment') The mapActions Helper Alternatively, you can use the mapActions helper to assign action handlers to local methods: import { mapActions } from 'vuex' export default { //.. methods: { ...mapActions([ 'incrementBy', // maps this.increment(amount) to this.$store.dispatch(increment) 'incrementAsync', // maps this.incrementAsync() to this.$store.dispatch(incrementAsync) add: 'increment' // maps this.add() to this.$store.dispatch(increment) ]) } } Re-build Counter App Using Vuex Now that we’ve had a look at the core concepts of Vuex, it’s time to implement what we’ve learned and rewrite our counter to make use of Vue’s official state management solution. If you fancy a challenge, you might like to have a go at doing this yourself before reading on … When we generated our project using Vue CLI, we selected Vuex as one of the features. A couple of things happened: Vuexwas installed as a package dependency. Check your package.jsonto confirm this. - A store.jsfile was created and injected into your Vue.js application via main.js. To convert our “local state” counter app to a Vuex application, open src/store.js and update the code as follows: import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) export default new Vuex.Store({ state: { count: 0 }, getters: { parity: state => state.count % 2 === 0 ? 'even' : 'odd' }, mutations: { increment(state) { state.count++; }, decrement(state) { state.count--; } }, actions: { increment: ({ commit }) => commit('increment'), decrement: ({ commit }) => commit('decrement'), incrementIfOdd: ({ commit, getters }) => getters.parity === 'odd' ? commit('increment') : false, incrementAsync: ({ commit }) => { setTimeout(() => { commit('increment') }, 1000); } } }); Here we can see how a complete Vuex store is structured in practice. Please go back over the theory part of this article if anything here is unclear to you. Next, update the src/components/Counter.vue component by replacing the existing code within the <script> block. We’ll switch the local state and functions to the newly created ones in the Vuex store: import { mapState mapGetters, mapActions } from 'vuex' export default { name: 'Counter', computed: { ...mapState([ 'count' ]), ...mapGetters([ 'parity' ]) }, methods: mapActions([ 'increment', 'decrement', 'incrementIfOdd', 'incrementAsync' ]) } The template code should remain the same, as we’re sticking to the previous variable and function names. See how much cleaner the code now is. If you don’t want to use the state and getter map helpers, you can access the store data directly from your template like this: <p> Clicked {{ $store.state.count }} times! Count is {{ $store.getters.parity }}. </p> After you’ve saved your changes, make sure to test your application. From an end-user perspective, the counter application should function exactly the same as before. The only difference is that the counter is now operating from a Vuex store. See the Pen Vue Counter Using Vuex by SitePoint (@SitePoint) on CodePen. Conclusion In this article, we’ve looked at what Vuex is, what problem it solves, how to install it, as well as its core concepts. We then applied these concepts to refactor our counter app to work with Vuex. Hopefully this introduction will serve you well in implementing Vuex in your own projects. It should also be noted that using Vuex in such a simple app is total overkill. However, in another article—Build a Shopping List App with Vue, Vuex and Bootstrap Vue—I’ll build a more complicated app to demonstrate a more real-world scenario, as well as some of Vuex’s more advanced features. I write clean, readable and modular code. I love learning new technologies that bring efficiencies and increased productivity to my workflow. New books out now! 🤓 Ok. When did a code editor from Microsoft become kinda cool!? Popular Books Visual Studio Code: End-to-End Editing and Debugging Tools for Web Developers Form Design Patterns Jump Start Git, 2nd Edition
https://www.sitepoint.com/vuex-beginner-guide/
CC-MAIN-2020-24
refinedweb
3,068
57.87
Politics: Harry, The Disastrous & The Unpalatable 281 nd writes: "Harry Browne has agreed to a roundtable discussion with everyone in a Kuro5hin Feature. He'll be responding to messages himself under his own account." It's been going on for a few days now, and is an amazing look at the future of political coverage. Reflecting a sentiment I hope is accurate, Jim Madison writes: "Despite the apathy, I think slashdot's members are actually quite well-informed, politically speaking. Our friends, however, are not. According to this article, 25% of citizens 18-24 cannot name both major party presidential candidates and 70% cannot name their running mates. Wow. This discussion at Quorum.org (disclaimer: a site I co-founded) questions whether online forums (like this one) can help make politics more accessible or whether it's going to take structural change in Washington before it gets any better. What's the point of the $200 mm spent on advertising if they can't even get unaided brand recall?" For whose pathologically opposed to the letter "W," CaptainZ asserts that "This guy [Jamin Raskin] over at MSN has a pretty good article about how Nader and Gore can both 'win.'" Finally, wallstrum writes with word of yet another worthy candidate (still, I'm more of a Quimby man). Why assume that pro-Nader means pro-Gore? (Score:3) I live in a swing state (Michigan) and I intend to vote for Nader. I would love to read the headlines: "Bush wins, Nader blamed". That would make my day. If Gore really wanted my vote, then he'd answer concerns about corporate welfare and corruption, as well as the other unheard issues that Nader wants to solve. Instead, Gore has done his best to dodge those issues, re-invent his record, and ignore Nader. Gore has demonstrated that he will continue to represent the very worst that I hate about elections: scumming votes from the most impressionable voters through TV ads funded by massive soft money contributions. Gore's actions and his record have failed to convince me that he will be significantly better than Bush. How long must I vote for the second-worst candidate in exchange for nothing? Four years? Eight? Twelve? How many more times will I be betrayed by the Democrats? It's time to send a "tough love" message to the Democrats who are so busy scraping votes from potential Republicans that they forgot that there's a job to do and work to be done. Cthuluh for president (Score:3) Why vote for the lesser of evils, when you can vote for the greatest evil Cthuluh. No more years! No more years! 25% did not know the major candidates (Score:3) Candidates Deserve Apathy -- And We Deserve Them (Score:3) As one of my friends put it: Why do politicians pander and spin? Because we (as a nation) are easily pandered to and spun about. Why do the preach fuzzy partizan ideologies? Because that's the level of dialogue we're at. The solution: either DON'T VOTE (if you're not informed) or but in the effort necessary to get informed. Let's define "informed" minimaly: as having spent more than 3-6 hours ACTIVELY seeking out information about a candidates history, funding, and positions. From sources other than their campaign (or their opponent's campaign, thank you). And REALLY informed would be if you'd actually spent some time studying aspects of policy, so that you could intelligently evaluate statements like "A free market always gives the best results," or "We need more funding for education" or "By floating this bond over a longer time period, we can afford this". But most of us don't. We make our votes on vague feelings and sometimes, passion for an ideology. The politicians know this. That's why they started doing things the way they're done. That's why apathy has increased.... Break the cycle? My friends are already vote swapping (Score:3) Well, everyone except Dubya. We hope. Re:My friends are already vote swapping (Score:2) Seen it in action (Score:2) Such ignorance unfortunately is common. Most of them could do quite well at a quiz of who are the qb's for all the NFL teams. But ask them who their senators and representative in congress are... Don't waste your vote. Choice freedom on Nov. 7 Re:Why assume that pro-Nader means pro-Gore? (Score:2) It talks mainly about how people in swing states voting for Nader could 'trade' their vote with people in Republican won states (by means of the honour system) that want to vote for Gore. That way, Gore might win the swing states, screwing Bush, and Nader will still get the 5% he needs to get official party status for the Greens. It is significant in that it could be done with relative ease over the internet. I for one am particularly impressed by this idea, and although I would vote for Nadar (I'm a dual citizen, living outside the country), I would happily trade my vote so that Gore could make it in instead of Bush. All this would do is shift the votes to the swing states where they are really needed. It's voting strategy at it's best - now if only people could get organized enough to implement it. Re:Why assume. (it's anti-Bush more than pro-Gore) (Score:4) After seeing what Bush has done to the TNRCC (the Tex. state enviro agency, where I used to intern) over the course of his reign, I dread to see what the state of the EPA (and, more importantly, our nation's environment) would be by the end of a Shrub presidency. Bush Sr. was bad enough, but at least a Dem House counterbalanced him & managed to get things like the Clean Air Act passed (which Dubya has consistently ignored in Texas). It's already too hard to breathe in Houston as it is.... Gore really is the lesser of two evils, at least as far as energy & environmental policy is concerned. Do you really think Dubya will do squat about extinctions, pollution & global warming (at least until it's far too late)? #include "disclaim.h" "All the best people in life seem to like LINUX." - Steve Wozniak Green Party in Oregon (Score:3) You may be able to help the Greens this way in other states too; check your local Green party and/or your local election laws. fearbush.com [fearbush.com] Darth Vader ineligible (Score:2) Poor guy. I'd vote for him otherwise. -Chris Gore, Bush, does it really matter? (Score:3) If you look at their stands on most issues, Bush and Gore are mostly in agreement. On the really devisive issues where they differ, it doesn't matter what either one promises, it'll be the congress that decides what is done and how. The president can veto that which he doesn't like, but that leaves him with nothing. The president's choice is either compromise with congress (go back on campaign promises) or fight them, in which case he is either overridden by congress or he leaves office accomplishing nothing and not getting re-elected. The congress after this election will be so closely split between the two parties that consensus will be hard to reach. There aren't going to be enough swing votes in congress to allow either party to accomplish much. Net result: 4 more years of business as usual in Washington. (Money talks, the people can walk) Anyone who thinks that either Bush or Gore are going to make sweeping changes needs to up their dosage of reality. 'Cause it ain't gonna happen. Re:Why assume. (it's anti-Bush more than pro-Gore) (Score:5) Do those extinct animals make anyone a profit? Then maybe they deserve to die -- they're just Looters, living off our hard work! What has the environment done for us lately? If it was worth saving it would work harder, like all good americans do! Why should we give welfare to the "environment" when it doesn't pay taxes, all it does is take, take, take? Don't you see, protecting the environment is for communists -- we live in a free country, and the government should stay out of it. If you want to fix the ozone layer, then do it on your own dime. Don't tell me to stop dumping toxic chemicals into your drinking water just because you're not profitable enough to afford a filter. Damn looters!... --------------------------------------------- What is up with the /. hatred of GWB? (Score:3) He wasn't the basis for the male character in love Story. He didn't room with Tommy Lee Jones in college. Maybe he did drink too much 20 years ago. He does have something that Gore does not. Integrity. Though I can see where someone could disagree with his politics. I don't agree with him on everything, but why the vitriol? Some of you people are hostile and down right nasty. Why? LK Re:Libertarian Ideology (Score:2) I really want to go with the Libertarians, but I'm sorry, the general population is just not smart enough to govern themselves. It's good to know that someone out there is willing to take over responsibility for my personal decisions. Sadly, I'm just not smart enough to know what's in my own best interest. -- Damn! (Score:2) This is exactly what *I* think--so do I vote for Browne? Unfortunately, I have to still say no. I want Browne to win, but I think a vote for Nader is the only way to get there. Voting for Nader gets across the message I want to get across: Campaign Finance Reform, God Dammit! After that happens, Browne has my vote. BTW, it isn't really Harry himself answering the questions, at least he didn't answer MY question despite the fact that his nick was "Harry Browne". PS: If the Republicans get a lock on Congress AND the Presidency, maybe the Democrats will push finance reform in 2004 hard enough that it gets in. -- An abstained vote is a vote for Bush and Gore. The Nader Factor (Score:4) In 1996, Clinton very shrewdly looked at his consituency and decided to alienate the voters that were sure to vote for him in favor of winning the center vote. He did this by signing the Defense of Marriage Act, a direct slap in the face of the homosexual community, and signing the Welfare Reform Act. Both the poor and the homosexual vote where basically foregone conclusions for the democrats. The strategy worked. Immediately after the election both Clinton and Gore began complaining about the bills that Clinton signed into law only a weeks before. Nader has become Gore's truth detector. Now the left wing of the party recognizes that Gore, although he is advocating huge increases in the size of government, wants to appeal to the center and they're abandoning him in favor of a candidate who presents a consistent view and actually has some credibility that he means what he says. Gore doesn't. I say vote Nader. At least you can trust the man. You certainly can't trust Gore. Re:Gore has to lose... (Score:3) I respectfully disagree. This election isn't just about who's going to sit in the White House for the next four years; it's about who's going to sit on the Supreme Court for the next twenty. Bush has stated that his favorite Justices on the Supreme Court are Scalia and Thomas. At present, at least two and maybe four Supreme Court justices are approaching the point where they will need to retire from the bench. These justices are all moderates or liberals and their replacements could decide on issues of privacy, reproductive freedom, and civil rights, in the very near future. A Bush election could mean the end of Roe v. Wade. A lot of people on the left would perceive this as a major loss, and it's not just Bush that they're going to blame. I humbly submit to the reader, that a Bush win means four white-knuckle years for the Left, a Democratic party that's going to shift further to the right under the direction of the Democratic Leadership Council, and a Green Party that will lose its legitimacy with the Left. A Gore win gives the Left more wiggle room, and a chance to 'guilt' Gore into following up on his proposed policies in his book Earth in the Ballance [amazon.com]. That's my two cents, although it's probably worth less than that. fearbush.com [fearbush.com] Re:25% did not know the major candidates (Score:2) Well, maybe it's because 100% of the major candidates don't have jack for policy that is of interest to anyone under 40. I mean, come on, prescription drugs in Medicare? Eliminating the marriage penalty? More crackdowns on kids surfing for porn or safe sex advice? None of this is of any value to anyone who isn't old, or married, or getting married, or with kids old enough to have their own personalities, which pretty much excludes the old 18-29 demographic. I'm 29, and I'm voting for Gore, [slashdot.org] for various reasons, but I'm also a political junkie. Non junkies not in the "swing demographic" can be forgiven for feeling ignored. When they're ignored, well, of course they don't vote. Look at Nader, for fuck's sake. The guy's policies would be a disaster in my view - but you've gotta hand it to him, he sure knows how to make younger voters feel like they're not just ATMs to be tapped to pay for the Pentagon and corporate welfare. Friends of mine who work for Nader have been brought to tears by his concern for us. Ask the Young Republicans for Dubya if they feel that way -- if you can find any. [/rant] Respect, and the slide in political participation (Score:3) This may be slightly off topic, but here goes. I firmly believe that one of the main problems with voter apathy and the political process is the lack of respect and loss of etiquette and civility in recent times (since WWII, probably). Look at the headline of this story for just one example: Politics: Harry, The Disastrous & The Unpalatable Harry? When referring to a candidate for office in the story (I realize asking all posters to do so would be too much :-), he should be referred to by the proper rules of etiquette, based on his rank or position (to which I must plead ignorance, unfortunately). At the very least, Mr. Browne would be appropriate, while Harry is not, even if he asks you to call him that. Same with the other candidates: Governor Bush and Mr. Vice President. And the current president is to be referred to as Mr. President, not Mr. Clinton, (even a womanizing, purjurious pervert occupying the Office deserves to be shown the proper deference due his position) etc. etc. etc. And former presidents should be referred to properly as well, Governor Reagan, Ambassador Bush, etc. etc. etc., not Pres. Reagan, Mr. Reagan, Ronald Reagan, etc. etc. etc. I realise this is idealistic, perhaps even silly, and is really only a symptom of a much larger loss of civility in society. But, some diseases really ARE best cured by addressing the symptoms, and this would be one good place to start. Perhaps the /. editorial staff could be persuaded to attempt adherence to established protocol as a strike for journalistic integrity and societal civility? :-) Re:Harry Browne (well, his webmaster) says... (Score:5) Looks a lot like "Information wants to be free" to me.. Yes, but then he goes on to say [kuro5hin.org] As far as IP being worthy of being safeguarded, it matters little to me whether or not a week's worth of my labor was spent fashioning a dining room table or writing code -- both consumed part of my life and are fruits of my labor, and I want both to be guarded from those who would take them without my giving me something in exchange. The (unspoken) implication is that copyright, patents, and other forms of IP are OK, although strictly speaking he did not state that explicitly. I think he (and a lot of people, both here and elsewhere) need to be educated and made to realize (or at least confront and argue against) the notion that a government mandated and enforced monopoly isn't necessary for IP creators to be fairly compensated and, furthermore, has a stifling impact [danny.oz.au] on the field of endeavor so affected, not to mention the society [ram.org], culture [reason.com], and the economy [around.com] as a whole. Nevertheless, while Libertarians are split on the question of IP (and he perhaps falls on the wrong side of that debate), he is quite correct in saying that "our first step on the road to freedom is to return to the Constitution as the rule of law for our nation." We can (and must) fix the debacle that is IP, but he argues (perhaps correctly) that getting bogged down in that is putting the cart before the horse. Although I disagree with his (implied) stance on patents and copyrights, I have been persuaded to vote for Harry Browne over Ralph Nader nevertheless. There is no candidate I agree with on every issue, but I agree with Harry Browne's agenda on far more points than I do with any other candidate. (And yes, as someone who was going to vote for Ralph Nader based on his stance WRT corporate and special interests influencing government, I have had my mind changed. This happens from time to time, if one's mind is truly open.) Re:Why assume that pro-Nader means pro-Gore? (Score:2) I agree that that isn't the way to go, but if you switch with someone else who intended to vote Gore then wouldn't you still make your contribution to the Green party while at the same time providing an effort to keep Bush out? I guess it comes down to whether or not you want to just look for the long term gains of voting 3rd party or to also try to minimize the short term damage of having a Rep. president - I agree that there isn't much difference between the 2 major parties but IMO the democrats are still more favorable than the republicans. Vaderfor2000.org? (Score:2) -- Re:What is up with the /. hatred of GWB? (Score:2) I'm not a fan of Al Gore (I'll be voting for Nader) but I don't trust Bush any further than I could throw him. The guy's a politician, no better than Gore, but with 5% of the brains. 25%?! (Score:3) This is the Unspoken Side of "Go vote" campaigns (Score:5) People who can't name vice-presidential candidates or who don't know the issues shouldn't be voting. They should be learning. I'll tell you why I'm against bush: (Score:3) Re:What is up with the /. hatred of GWB? (Score:2) GWB? "Integrity"? This is George W. Bush you're referring to, right? No doubt Dubya's spinmeisters are happy to know how well they've succeeded. I don't have any "hatred of GWB", I'm just disgusted that he and Al are what the Republicrats and their corporate owners are offering us. Near as I can tell, Dubya and Al register about even on the ol' integrity-ometer -- for both of them the needle is pegged ... at the low end. Re:The Nader Factor (Score:2) Give me a break. Nader made millions on technology stocks. He profited from 50+ h workweeks many geeks put in yet he is the one calling for 32 h workweek without salary cut. One fucking credible fellow. More crap (Score:3) They (meaning "THE MAN", the 2-Party apologists, etc...) will have one of those arguments every 4 years if we don't START to put a stop to it RIGHT NOW. Sure, maybe Nader won't win this time, or next time, but as the articles says, he needs the votes to get on the Green Party Ballot next time. And who knows, maybe in 12 or 16 years we'll have some real alternatives to the 2-Party, pro-corporate-welfare JERKS who take bribes to sell out their constituents. Aren't you people tired of this crap? I know I sure as hell am. And don't forget, Souter turned out to be one of the cooler justices in the court and HE wasn't appointed be a (sellout) Democrat. Don't waste your vote by voting for jerks who sellout to corporate dollars. Vote for someone who ACTUALLY cares and will enact REAL change. Rich... Re:Seen it in action (Score:2) American the broken (Score:3) As far of the 18-24 years old not knowing who is who, I look at like this, they don't feel like there is anything that can be done. They get the same crap every four years. It's boring. Look at tv today, you see two guys on the media: Bush and Gore. Both are drug addicts, one is a lier the other is a whimp, they talk about boring unrelated issues to 18-24 year olds. So they say. What do 18-24 year old want? While most are busy having sex, having a social life, and working towards or for thier jobs. Not to mention it's nerdy to understand goverment and knowing the issue (of course nerds make more money and don't work as hard). So how do you fix this "problem"? Heck you fix like every other problem in life, education. And you do that by getting people involed. I can sit here and listen to talk radio until my ear bleed, or read stories until my ear balls hurt, but it won't make a lick of sense until the rest of American wakes up to the truth, see above. My vote goes to Harry Browne. Re:What is up with the /. hatred of GWB? (Score:5) First of all, he's not only really dim witted and stupid, he's woefully unqualified to hold the highest and most powerful office in the free world. Beyond that, there are his ties with the religious right, that threaten the freedom of everyone who is non-Christian, or 'unapproved' by Christians (such as gays). He's very anti-gay (fighting to keep the Texas Sodomy Law on the books, for example), which represents a direct threat to my personal civil liberties. He's fiscally irresponsible, given his promise to throw the surplus back at rich people who aren't hurting for the money, and not concentrating on paying down the debt, or more carefully 'targeting' the tax-cut so as not to over-stimulate the economy, etc., etc. He's inarticulate and really inexperienced in foreign affairs... do you really want this guy who can't even prounce words in his own Mother Tongue in sensitive negotations with other countries? He represents a switch back to the ways of the past... with the potential to roll back hard-won freedoms in the areas of gay civil rights, a woman's right to choose, freedom of (and from) religious expression in public life, etc... he'd rely almost exclusively on the same advisors his dad used (in a few cases that's not so bad, but in most it is)... and really, do you want to go back to the state this country was in in 1990/91? And as for integrety, Bush is every bit as vunerable on that as Gore is. He's lied (or mistated) just as much. What about his AWOL time in Alabama (where he never reported to duty), and he has no idea where he was for that time, and can't answer any questions about it? How about that Texas 'patients bill of rights' he takes credit for, when the reality is that he fought it tooth-and-nail the entire way? And then there's the whole environmental issue. And the way he coddles corporations. He wants to give them practically free liscense to do anything they want (even ignore Clean air/water acts if they so choose), and he wants to remove the ability of individual consumers to sue 'big companies' for damages in such cases. As far as I'm concerned, George W. Bush represents a direct and real theat to my own personal freedoms and even my existance. - Spryguy "Stategic voting" (Score:4) "Insanity is continuing to do the same thing over and over and expecting a different result." +1, Funny (Score:2) but I couldn't use it here posted already. Re:Why assume that pro-Nader means pro-Gore? (Score:2) Then there's also Ralph's point, made in a news conference today, that there must be a point where a candidate flunks your standard of vote-worthy. There are getting to be too many issues where I find Gore's position and record unacceptable, and I'm happy to accelerate progress toward being able to elect an acceptable candidate, even if it's not this year. If progressive voters do not send a message that they are willing to abandon the Democrats, they will always get candidates that are as close to Republicans as possible. Re:Rank them! (Score:2) I'm afraid that something like this might be a long time coming in our political system though. Seeing as this type of system would seriously damage the amount of power that the two major parties would have they would probably fight against it tooth and nail. I guess implementation would have to change as well - it would be hard to read everyones numbers on the ballots, but if the election booths were digital and run on an isolated system you could have everyone go to the booth once, just type in their numbers (the system could regulate it so that they adhered to the rules) and it would be calculated and done with in no time. Mind you that we would have to have an extremely secure and fail-proof system, but it would probably be safer than the archaic ballot counting system we're using now anyways! AMERICA NEEDS NIXON! (Score:2) Every election year my mom goes back to her closet and digs up that old button. Every once in a while someone gets the point. Re:I think I can come up with last initials... (Score:2) Actually, that's four, and it should be five. The complete list for the 20th century is: McKinley-Roosevelt, Harding-Coolidge, Roosevelt-Truman, Kennedy-Johnson, and Nixon-Ford. Also, if formal procedures for handling long-term Presidential incapacitation had been in place at the time, we probably would have added Wilson-Marshall. /. Re:What is up with the /. hatred of GWB? (Score:3) I'm a Republican because of two issues Gun Control and Abortion. Given the two men with any chance of winning, GWB is the man who gets my vote. Re:Damn! (Score:2) The Green party is gung-ho to get x amount of votes so they can qualify for federal matching funds next time around. Browne has qualified and turned down the money. I helped pay for the Libertarian convention - because I'm a member of the party and wrote a check to them specifically. Unfortunately, I also helped pay for the Republican and Democratic conventions, with money those parties extracted from me with the threat of force. Nader's "reform" would involve forcing me to pay for his party, as well as the Republicrats, by threat of force. I don't consider this much of an improvement. I think you misunderstand Libertarianism (Score:5) Forget Harry Browne... (Score:2) Nice troll.... (Score:2) Maybe it's because in Texas the governor has very little power due to a very weird constitution, and he hasn't had any real experience, but even the little bit he's had seems to be indicitive of a man who'll cut my taxes and make the rest of the country suffer. Maybe I don't like the idea of a Republican dominated Supreme Court. Maybe I forgot to buy into the character assassination of Gore. Maybe I'm just smarter than you. -- "Don't trolls get tired?" Re:What is up with the /. hatred of GWB? (Score:3) Can you show me a source for GW favoring making it illegal for a man to love another man? He's fiscally irresponsible, given his promise to throw the surplus back at rich people who aren't hurting for the money, and not concentrating on paying down the debt, or more carefully 'targeting' the tax-cut so as not to over-stimulate the economy, etc., etc. The truely poor get MORE back under GW's tax plan than they do under Gore's. While it's true that "rich" people get more money back, THEY PAY MORE IN THE FIRST PLACE. If I get 20% back and Bill Gates get's 2%, of course he gets more money back than I do because he paid a 1000x more to begin with. The budget surplus that Gore's looking to spend on the geezers relies upon a projected increase in the economy. In order to have the money in the first place, the economy has to GROW! He's inarticulate and really inexperienced in foreign affairs... do you really want this guy who can't even prounce words in his own Mother Tongue in sensitive negotations with other countries? I nearly forgot, to some people being able to tell a lie well is more important than the ability to tell the truth. He represents a switch back to the ways of the past... with the potential to roll back hard-won freedoms in the areas of gay civil rights I hate to be the one to tell you, but you don't have a right to sodomy. a woman's right to choose, To choose murder? That's why he gets my vote. freedom of (and from) religious expression in public life, etc...? do you want to go back to the state this country was in in 1990/91? Are you seriously asking ME that? Socially, absolutely. Back when it was not a federal crime to protest the wrong type of business. Back when the tree huggers and dirt kissers didn't have the ability affect public policy because the people in charge weren't in bed with them. Back when I didn't have to worry about flipping channels only find to hairy faces lip locked on MTV. Back when no mainstream politician had the audacity to suggest taking over 1/7 of the US economy or suggest that I pay for someone to murder her own child. I'd love it. Please give me the good old days. LK Re:What is up with the /. hatred of GWB? (Score:2) Nice troll....Yeah? You too. (Score:2) I think that I already know the answer to this one, but I'll ask first. Why do you not like that idea? Re: Gore, Bush, it does really matter (Score:2) On most economic issues, yes, they'll end up in roughly the same place. But there are also things a President can affect unilaterally: If you care about these issues, then there is a difference between them. Re:Libertarian Ideology (Score:3) I agree 100%. But who do you think makes up the government!?!? Those same idiots wandering around that can't even balance their checkbook. (And in their hands it's a trillion dollar checkbook!) This is the missing puzzle peice that completly proves anarchism is the only rational path for human beings; only TRUE ABSOLUTE freedom allows progression of the human race. Ideologically I don't believe in voting. (AKA relinquishing your right of free choice to another) But Browne gets me pretty damn close to where I want to be, so he's getting my support instead of me voting all 'None of the above' this year. As for your drivel about how we are a 'country', a team, I owe you for something.... It's called dualistic thought. A flaw in human nature, and you've got it bad. -- Voting for president is not like betting on a horse race. You gain nothing by choosing the winner. It is about supporting someone that doesn't have an interest in holding a gun to your head to make you do things you don't want to do. Harry Browne is the only one that qualifies. I like Bush. (Score:2) I've been a bit puzzled by this myself. I suspect the reason is that the consensus among commentators is that Bush is a dummy and Gore is brilliant. Slashdot people tend to appreciate raw brainpower more than the average, so they can respect Gore's command of the issues. This is the way the race has been spun in most places. At the same time, I don't think the slashdot consensus is accurate. Consider the following issues: The Issues Bush had the guts to put Social InSecurity on the table, which is a HUGE issue for any independent contractors who happen to be around here - if you want to be paying 12.5% tax for the rest of your life on a program that's not going to give you a dime when you retire, by all means vote for Gore. Granted, Bush doesn't go as far as I'd like, but at least I see a glimmer of hope in where he is headed. Gore will only cut taxes for people who behave his way; Bush's tax cuts are across the board. That's why they go mainly to the top 1% of the nation; the top 1% pays more, so they get more back. If you're single and without kids, Bush's cuts will help you a darn sight more than Gore's. And I would expect that many slashdot readers are in income brackets where tax cuts would be quite attractive. And if you're not in them now, consider what might happen in a few years. Does anyone here seriously think of government as anything but a rampaging beast out to get every dime they can? The only way to tame the beast is to cut its food supply so it won't grow and envelop us all. His statements in the debates on net censorship are appalling - sadly, Gore's record is equally bad, if not worse. Gore has a proven record of getting serious about cultural issues such as porn and XXX-rated music lyrics; I doubt Bush will push them with any degree of enthusiasm. I could be wrong, but I'd be extremely surprised if there was any advantage to free speech in voting for Gore. There's a definite advantage in terms of net taxes in voting for Bush; I think he'll be much more protective of the net economy than Gore. Personality By all accounts, Bush has been quite successful in administrating a major state and building a policy consensus. Of course you can nibble at his record at the margins, but no politician does a perfect job anywhere. Bush came to office saying he would focus on certain issues, including education. He focused, and those areas have improved significantly. I'd count this as the mark of a successful leader of men, not a dumbass. A successful leader doesn't have to be the smartest person on the block; instead, he has to be inspirational and know what principles to work on. I'm probably smarter than my boss, the person who runs the company I work for, but he has the skills needed to rouse the troops, and he adheres to the principles that make the company successful. You could say I'm like Gore and my boss is like Bush. Guess what? He does a darn sight better job than I would, because he has skills I lack. Same with Gore and Bush. Gore strikes me as a playground bully; Bush is a concilitator. Who's going to do better at negotiating with Congress? Inconsistency on the Issues Gore has perfected the chameleon-like poses of Clinton. He's swung violently from the left to the right on a wide range of issues. Take the environment. In Earth in the Balance, he wanted to ban the internal combustion engine. Now he doesn't, because it would cost him votes. He's taken enormous donations from tobacco interests, and served them well in the senate; now he's as against tobacco as anyone. Gore has put on a large number of masks in the campaign, from populist to conservative who won't change a thing from the Clinton years. He's particularly upsetting as a populist; the mask of "fighting for the american people" feels so phony you can almost see the rubber. I don't think we've seen the Real Gore yet. I do think we've seen the real Bush. He's been extremely consistent in his positions throughout the campaign. Governing Policies Bush is a lot like Reagan: Create a program consisting of four or five major points, and once in office push like crazy for those points. Keep focused. This is why Reagan, a supposedly dumb man, managed to get a heck of a lot more done than theoretically smarter Clinton, Carter and Bush Sr. The more you are inclined to get into details, like Gore does, the more bogged down you are doing the actual work of the Presidency. I'm going to make a prediction: Bush will be a much more effective President than Clinton or Gore if he wins. He has a disciplined, well-managed team behind him, and he's focused on the issues he cares about. I think that's an enormous plus. ---- I (respectfully) disagree. (Score:2) Never forget that. Re:Go vote? Not! (Score:2) I think this is backwards - most people realize that some form of government is a good thing. They may not agree on what or how much the government does, but they prefer some form of organization to mob rule. Your (well, Fred's) quote assumes that people don't want government but keep forgetting to get rid of it. It is more the case that when presented with the alternative, most people prefer to have some sort of government, and vote accordingly. But a government selected by the voters is legitimate, at least if we are considering legitimacy in terms applicable to democracy or a republic. I'm sure there are some people who don't consent to the legitimacy of a particular government (either because of election fraud or just from being sore losers), but those folks are welcome to leave for somewhere which has less government or a different one. Republican dominated Supreme Court (Score:2) Seeing as I have no idea who exactly might be picked on either side, it's a bit of a crap shoot on any given issue, but democratic beliefs tend to mirror my own a little more accurately than republican beliefs, though both are mirrors of the funhouse variety. -- "Don't trolls get tired?" Re:Republican dominated Supreme Court (Score:2) Though you listed it last, I'd be willing to bet that like most other democrats, that's one of your BIG issues. As long as you can fuck your brains out and not have to worry about the consequences, everything else is secondary. Right? LK Re:Libertarian Ideology (Score:2) If they are not smart enough to govern themselves, how are they smart enough to choose someone else to govern them? -- Re:What is up with the /. hatred of GWB? (Score:2) Ever heard of NAMBLA? Am I to assume that you're just as much in favor as their right to the pursuit of happiness? Ahhh, the "murder" card! Touche! Didn't see _that_ one coming! Take it up with Susan B. Anthony, she is the first person that I've seen who called it child murder. But you seem to have taken simplistic arguments to an artform. I'm illustrating your absurdity by being absurd. Federal Crime to protest a business? Huh? Be a little more vague and mysterious, please. FACE. It's illegal to protest an abortion clinic if someone inside "feels threatened" by you being there. It's a federal crime that could land you in federal prison and get you a 6 figure fine. I'm sorry you are scared to watch MTV. Maybe you should see a therapist about that... I'm not the one who has a problem. No, they'd rather they just take over other people's lives and tell them how they should live. That's the ticket! I'd sacrifice the "right" to sodomy and infanticide if it means preserving my right to free speech and self defense. LK Re:What is up with the /. hatred of GWB? (Score:2) Who's telling the truth? Gore and Bush both lie, just that Bush doesn't say it as well. I hate to be the one to tell you, but you don't have a right to sodomy. It's kind of funny to hear these people talking about the "moral decay" in this country promiting views that it's ok to hate, but not ok to love. And some people might want to think that the guarantee of "life, liberty, and the pursuit of happiness" might include being able to be with the person who makes you happy without requiring government approval. It's not their fault some people have decided it's more important to take moral advice from a book that talks about selling daugthers into slavery and having a bear maul kids to death over making fun of someone's bald head.? Freedom of religion includes freedom FROM religion. You're not really free to believe what you wish if you're still required to believe in one of them. But that doesn't mean being free from all religious symbolism anywhere, since you have to respect the freedom of others also, but it means not having religion forced on you by the government. Besides, Bush doesn't believe in freedom of religion. He's already decided to pick and choose for himself which belief systems are legitimate religions and which aren't, and he's stated publicly that he doesn't consider Wicca a religion - and stated he plans to sign an executive order to prevent Wiccans from practicing in the military. Never mind that pesky first amendment. --- yep you're right (Score:2) You're right, I do love to fuck my brains out without worry about the consequences. Now that I have one child, I know that if the consequence is another child, I'd be delighted, if surprised. -- "Don't trolls get tired?" Re:Why assume that pro-Nader means pro-Gore? (Score:2) Fuck Roe v. Wade.. We've got bigger fish to fry. Re:Rank them! (Score:2) "There he goes with the fuzzy numbers again." G.W. Bush Re:Why assume that pro-Nader means pro-Gore? (Score:2) If Gore loses to Bush by a few percentage points, the Democrats have two options: 1) Move left to capture a small ~5% pool of Green votes 2) Move further right to capture the huge center I don't know the numbers, but I believe there are more centrists than either Democrats or Repulicans. Democrats would have a more likely chance to capture a few more of these votes. Plus the centrist values would be less likely to upset "New Democrats" than greener values. The Democrats will also realize that many of those ~5% have never and will never vote Democrat, always seeking to push the spectrum further left. This leads to the conclusion that a Gose loss with push the Democrats further right to the "Repulicrat" party! Re:What is up with the /. hatred of GWB? (Score:2) To my knowledge in my state there are no prohibitions of any kind against sodomy. Sodomy includes oral sex (only in the Texas law, the wording specifically states that only sodomy between same sex partners is illegal... this is the reason it was invalidated, because it violates the equal protection clause... what is legal for me should be legal for you) So then you can have all of the sodomy you want as long as you can find a willing woman? That is the same deal that I get. The fact that you may not want a woman is immaterial. Some people want children, is that a violation of the equal protection clause? A typically overly simplistic spewing of dogma. Child murder is a term that I picked up from Susan B. Anthony. It's not mine, I will not take credit for it. What if it's in the first few weeks, when the "fetus" is little more than a microscopic group of cells? You're not going to get away with playing that word game with me. Fetus means baby. What you're doing is equivalent to saying that "It's not a baby, it's a baby!". Science is no real help here I beg to differ. Science is able to tell us that the baby is a separate and distinct person from the mother because they have different genetic codes. Science is able to tell us that the mother's body recognizes the baby as a foreign entity because of her immunological response to the presence of the baby. Why can't Bush's claim to "Trust the people to do the right thing" with their tax money be applied to 'trust the people to do the right thing' with regards to abortion? Why should people be trusted to do the right thing when it comes to any type of murder? Would fvor trusting people to do the right thing when it comes to deciding when Grandma has lived long enough and should be put out of her misery? After all it's a moral and value judgement as to whether an elderly person's life is still worth living. Why should the government be involved with legislating moral and religious issues? LK Re:pro-Nader eq pro-Bush? (Score:3) I am not terribly fond of the idea of 4 years of Shrub in office, but I'm beginning to wonder if there is any other way to get this message across. It's a lose/lose proposition. I'm voting for Nader precisely because I don't like either one of the major party candidates. Re:What is up with the /. hatred of GWB? (Score:2) FACE has been used to remove people who were passively sitting across the street from abortion clinics holding protest signs. So you're practicing "sodomy"? There's nothing in the worly quite like a good "Lewinski". Your love of bringing up extreme cases to bolster your own argument just illuminates the lack of depth to your own. Clarity is best achieved at the ends of the spectrum. Either a right is absolute or it isn't. LK Re:I like Bush. (Score:2) My parents are huge savers and don't need a dime from me or the government - and since they and I aren't particularly close, in all honesty I don't feel any obligation to them even if that wasn't the case. I was addressing self-employed people because Slashdot has a large proportion of them, including myself less than a year ago. Believe me, I felt the horrendous pain of that 12.5% every year. That's why this is such a personal issue for me. I have absolutely zero faith that what I collect from Social Security, if anything, will be enough to pay for a meal in a half-decent restaurant, let alone be capable of sustaining human life. Social Security is 100% ripoff. Simple as that. Nobody should be forced into an investment programme that takes more and gives less. Reagan cut taxes across the board, increased defense spending in a manner that was very effective in intimidating the soviets, and definitely helped destroy the Soviet empire. He also changed our perception of government substantially; now almost nobody talks about going to the bad old high-spending days of the 70s. I'd say that's enough for any President - it's certainly a lot more than Clinton can claim credit for. D ---- Re:25% did not know the major candidates (Score:2) How about Social Security reform? Right now, 15% of your salary is being taken to support this pyramid scheme, and if you're really lucky (i.e. you live long enough and payroll taxes aren't raised again) you might come out of it with a 1-2% return, vastly worse than even letting the money sit in a savings account. George W Bush realizes this is a problem and has proposed a first step toward a solution by letting you invest part of your SS taxes in personal retirement accounts. That way you own actual assets instead of a vague promise from the government that the Supreme Court has already ruled they are under no obligation to keep. Predictably, Al Gore is screaming that Bush's plan will result in seniors being thrown out of their homes and forced to eat dog food, which is of course a complete lie as it would have no effect on current benefits. This is a very serious issue for people our age, as it could literally mean a difference of hundereds of thousands of dollars when we retire. Compound interest is a wonderful thing... Re:How can geeks be for Gore? (Score:2) This is a complete oversimplification. While comparing government to the software industry may make some nice sound bites, the two operate so completely differently that it can't go very far beyond the surface. This may be your opinion, but it doesn't really explain why geeks shouldn't want a liberal President. Being technically adept does not necessarily mean you consider all liberals to be pansies. Greedy members of OPEC are completely innocent? The rush of overzealous and underinformed do-it-yourself investors had no long-term impacts? All that money that venture capitalists threw at ultimately unviable dot-coms wasn't wasted? That's a lot of blame to put on one guy, especially one guy whose job doesn't include drawing up the budget (that's Congress' job). The economy is far too complex to put the blame for its failings on any one person. No matter who that person is. --- Zardoz has spoken! Re:Damn! (Score:2) Re:Libertarian Ideology (Score:2) So since you're talking about using (or, as my libertarian cohorts say, stealing) the efforts of the non-redneck non-idiots who DO vote to support these people that you don't really have that much compassion for... what IS your driving reason to give the ugly hoi polloi a left up? -- Re:Gore [mod parent up] (Score:2) I can't believe anyone can say this with a straight face, after the Communications Decency Act, Clipper Chip, encryption export controls, and Digital Millenium Copyright Act. The Democrats are no better at protecting freedom on the Internet or anywhere else, and are worse in many ways. Regarding an issue where there is a real different, vote for Bush or Browne if you'd like a chance of recovering any of your Social Security payments. In Defense of Signing the"Defense of Marriage Act" (Score:2) That said, Clinton had no real choice. The bill garnered such high support in Congress that it was veto-proof; even if he had vetoed it, it would still become law. Why fall on your sword? Sticking to his principles (even if this is Clinton we are talking about, let's assume he has some) would be political harikari, except no one would care. Presidents cannot change the culture by signing bills or vetoing them. To think they can is foolish. Ralph Nader, President? QED. Re:I like Bush. (Score:2) You're right. The Bush proposals don't go far enough in my view. Personally, I would like to see Social Security destroyed. However, unfortunately, I recognize that I have to be a realist here. Anything politicians can do to help me save for a real retirement instead of a chimera is a big plus for me. (I now make too much money to qualify for the Gore plan, in case you were going to mention that). If you look at my original posting, you will see very clearly that I was addressing the self-employed - I was saying many Slashdot readers are self-employed, and they should recognize that at least Bush is attempting to start doing something about the SS mess. Either way, even the 6% of income wage earners are paying for SS is way too much in relation to the pathetic benefits they might receive, assuming SS survives in anything like its current form. We could continue citing leftist and rightist cant forever this evening, but I fear better debaters than you or I have done much better jobs with the remaining issues. D ---- Re:I (respectfully) disagree. (Score:2) The office is held in trust. It is a job. It does not convey automatic, obligatory respect and deference- there are limits. You might consider the statement, "The King ought not be beneath any man- but he is beneath the law, and God" (attribution? I remember this from a book I read about Watergate, but don't know the original context) Let's look at that for a moment. Our President is not a 'King', but he is in a similar position. It is reasonable to expect (indeed, insist) that he not lick the boots of, say, Bill Gates, or any industrial robber baron or special interest. He should not be _beneath_ such people, he should not be _beneath_ Joe Sixpack. However, he is not _above_ Joe either. There is a name for that- 'class'. America was _meant_ to be basically egalatarian- the President is neither a King nor a special upper caste held automatically superior to the common peasants. He's a guy doing a job- it's always been that way. He has enough authority to do that job but the office does not grant him mystical powers, or make him royalty. The office does not deserve respect- the office should EARN respect. If you are an American citizen it is your DUTY to question the Presidential office and the guy occupying it- if it seems to you that he's abusing the office and not living up to it. That is why we have impeachment laws: because that top office is a job, not divine appointment. How difficult can this be to understand? In an era where both major party candidates have alarming flaws (Bush isn't smart, and Gore isn't trustworthy) it is all the more important to remain aware that the Presidency is a job, not a position of royalty. Our political system allows for the man to be FIRED. In order to judge this, you cannot simply look at the office- you must look at the man, the job he's done, the actions he's taken. You must overlook the office- having the office does not put the guy above the law. Re:You're a man (Score:2) I'm a tax paying member of this society. I have as much of a say about the welfare of it's other members as anyone else. Re:Republican dominated Supreme Court (Score:2) Re:Rank them! (Score:2) -- Obfuscated e-mail addresses won't stop sadistic 12-year-old ACs. Re:What is up with the /. hatred of GWB? (Score:2) I'm not afraid of anyone, homosexual or not. It's a misnomer. Homophobia is a term that was invented to shame people into hiding their natural aversion to deviant sexuality. You don't understand homosexuality, so you want it banned. Some guys like guys, some girls like girls, some girls and guys like both girls and guys. It's a pretty simple concept to understand. I don't "want it banned". I don't care how or with whom you have sex. There is nothing more interesting to me than my own action, and nothing less interesting to me than yours. Tolerating and accepting are not the same thing. Someone you know and care about is gay... you just probably don't know it. In fact I know several people whom I care about that are either homosexual or bisexual. That doesn't change the fact that I feel that they don't have a right to sodomy. And last I heard, embryos and fetuses weren't infants. Only because you refuse to listen. Fetus is a latin term for(drumrolll please) baby. Are you going to tell me that babies aren't infants? There is none so blind as him who will not see. And would you REALLY give up ever getting a blowjob ever again, or ever going down on a woman ever again? In exchange for saving babies, absolutely. LK Re:What is up with the /. hatred of GWB? (Score:2) Rape? Allowed. Incest? Allowed. Life of the mother? Allowed. But the problem comes in when the laws are worded to read the "health of the mother". Because mental health can be used as a justification. A woman only need to claim that she's had a few bad dreams and that it will be too stressful for her to carry the baby to term and she gets a pass. Abortion is an agonizing decision for any woman. Ok, I'm glad you mentioned that. Why is it so agonizing? Because they know that it's a person that they're killing. And you can ban them all you want, but all that will do is lead to illegal back-alley abortions and lots of mutilated and dead young women. You really think that's better? I have no compassion or sympathy for someone who dies as a result of their attempt to murder a defenseless child. The "Safety" pro-abort argument is as idiotic as claiming that we should legalize bank robbery because illegal bank robbery has caused people to kill innocent bystanders or be killed by the police in the commission of their crime. Re:What is up with the /. hatred of GWB? (Score:2) I have no statistics on that, in fact I have no idea if any even exist. That's not my point. The law was written to be abused. It was written to silence the voices in opposition to abortion on demand. Thank God... a Clinton reference. Now the scorecard is complete. I like a good BJ as much as the next man, however I'm not so vain as to believe that just because I enjoy something and that I want it makes it something that I have a right to. I think the problem is that you don't believe in absolute rights, though. Just for the ones you believe in. Sure I do. The right to freedom of speach is absolute. The right to defend one's self from harm is absolute. I could go on, but I think that you get the point. LK Re:I like Bush. (Score:2) Sorry, that is not the case. If you expect Mr. Spacely to keep paying your salary of $50,000 and your "employer share" of $3125, then you need to keep producing work worth at least:(Answer: b) If the whole Ponzi scheme is abolished, that $3125 will end up(Answer: b) You will eventually collect Social Security so you will get something back. Most people my age understand enough basic economics to realize that they are more likely to see a flying saucer than a Social Security check. /. Re:What is up with the /. hatred of GWB? (Score:2) I feel that they don't have a right to sodomy. It's traditional to separate mutually exclusive statements by at least three full paragraphs (or more, if you suspect that someone might actually be paying attention). /. Re:This is the Unspoken Side of "Go vote" campaign (Score:2) Disillusionment, Environmentalism & Browne (Score:2) I'm from Australia, so I can't vote in the election. It is of interest to me, though, because the US goverment is probably as important to Australia as our own (Sad but true). I tend towards the left side of the centre politically, so there was no way I was really going to be a fan of Harry Browne's political views. After doing some reading in preperation for the K5 interview I was truely shocked at how naive the mans views are, though. I realise that he can afford not to have his idealistic Libertaian views tempered by reality because he isn't goint to win, but I did think he would/should care more about the specific issues rather than the politics. Take his stance on environmentalism [harrybrowne.org]. I'm sure it is nice from the Libertaian political point of view, but from the environmental point of view it sucks, badly. Rather that go into it, read my about it - I got fairly worked up. [kuro5hin.org] He clearly ;has no idea about intellecual property [kuro5hin.org]. Suggesting protecting it by saying use encryption make for a good sound-bite, but doesn't address specific issues like patent reform. I could go on but I won't. All I'll do is say he sounds just like a hundred other politicions. He just echos the same statements over & over. Read his website - you won't find anything new in the K5 interview, because he doesn't want to say anything. Nothing jumps out and makes me think "Now there is a leader". Re:Harry Browne (well, his webmaster) says... (Score:2) Government mandated and enforced monopoly? Do you have any idea what libertarians even are? Take a look at all of the intellectual property articles at Free Nation [freenation.org], especially this one [freenation.org]. You don't need an official government pronouncement to make something property. Do you think that if the trespass laws were repealed that fence builders would go out of business? Re:Harry Browne (well, his webmaster) says... (Score:2) Well, like, yeah! Of course. Real freedom is for everyone, not just the people you like. It is impossible for you to be free unless Bill Gates is free. This is what Nader doesn't understand, and why he offers a pseudo-freedom. If you want freedom, vote Browne. If you want a free beer, vote Nader. Re:Libertarian Ideology (Score:2) Libertarianism is a political philosophy, not a personal way of life. There is much, much more to libertarians than the Randroid Objectivists (who are a minority in the movement). Don't mistake self interest for selfishness. But libertarianism is about neither self interest nor altruism. It is about initiating violence against others. Simple. Defense but no offense. Nothing more. So, you think that people are not smart enough to govern themselves? Then who are Nader, Buchanan, Gore and Bush? People! If they can't govern themselves (and I know that Clinton is unable to), then what makes you think they would do any better governing you and I? Won't be voting straight ticket (Score:2) When someone's platform is "the war on drugs has failed", does it really matter whether they call themselves a libertarian? So I'll be voting for him, otherwise straight libertarian. Re:What is up with the /. hatred of GWB? (Score:2) If that's true, it's about the only sensible thing he's said ever. Wicca isn't a religion, it's a load of made-up mumbo-jumbo which a bunch of long-haired fruits have managed to convince themselves has any basis in history or myth. Of course, that doesn't mean it shouldn't be allowed for soldiers. In fact, Wicca should be given equal protection with any other religion -- none. The only point I'm making is that Wicca is considerably more fucking stupid than Christianity, because all of its practitioners are intelligent enough to realise it's a load of rubbish, but choose not to. here's a pop quiz for you (Score:2) Bush's plan is to invest contributions in the stock market instead. If we assume a 1% growth in GDP, the stock market will:Answer c). Most people my age understand enough basic economics to realize that they are more likely to see a flying saucer than a Social Security check. "Basic economics" can sometimes teach you the durndest things. Slightly more advanced economics often tells you that it ain't necessarily so. Re:More crap (Score:2) Well, one of the major party candidates is going to lose also. Which meant (means) in the final analysis, he had no chance either. So I guess all of those voters wasted their votes as well since their guy didn't (isn't going to) win. Rich... Re:This is the Unspoken Side of "Go vote" campaign (Score:2) It was so nice that they did that at the library. Now they do it at the driver's licence office, too. You get your license and they register you right there. This bothers me. Although I am a fan of democracy, I am also a fan of informed democracy; after all, would you rather have a government elected by people who know how to drive, or who know how to read? OTOH, Arandir [slashdot.org], there are an awful lot of people who live in deplorable conditions, and they take it for granted that since the rest of society ignores them, screws them, mistrusts them, and otherwise puts them down, they pretty much take for granted that they are not just figuratively disenfranchised. Some of them are amazingly dumb, true, but most of them are at least as smart as the middle class soccer moms who keep shoving their SUVs into my lane while driving home to watch Oprah. The main difference is that these disenfranchised citizens don't know what they can do and what rights they have, because nobody bothered to tell them. To explain it away with some glib statement that "the franchise should only be given to those who actually want it" assumes they even know that their franchise exists, let alone how to use it. The degree of isolation and segregation--both economic and social--that creates these circumstances is amazing. The schools given to these people offer them no hope, and no education: a third drop out, and a third of those who stick around are still functionally illiterate. The the gap between us and them is like an Antarctic crevasse. Over on our side, we have a sustainable economy, one that can exist with or without them. If we can ignore them, we will, because our lives are already too goddamned busy to worry whether somebody who will never play a role in our lives is being fucked so badly by their own government and society that they're going to starve. I'm not talking about random Ethiopian refugees; I'm talking about people who live within fifty miles of you, or ten. So before you go saying things like "if they don't know, they don't deserve to know", remember just how incredibly easy it is for you to find out just about anything with your thousand dollar computer and your $20/month 'Net access. Then remember there are millions of people, right there in your own "developed" nation, for whom twenty dollars not spent on food is two days they and their children don't eat. A lot of things you haven't been taught are non-obvious. It's not obvious to separate light and dark colors in laundry; it's not obvious it is that AB+AC=A(B+C). It's not obvious that you should wash your hands before you handle food or that you should vaccinate your babies. And when you've been told since birth that your sole purpose in life is eventually to die, it's not obvious you have the right to vote. -- How dare you! (Score:2) Let me get this straight... The above poster spends a good deal of time making many, many good points about the failings of the Libertarian Party platform. Failings that cause people who consider themselves libertarians (note the small "L") such as myself --people who want to actually go beyond sales-pitch catchphrases such as "Government doesn't work" and "My first question to nominess for the Supreme Court; 'can you read'?" and find out what a Libertarian presidency will actually try to accomplish should Browne be elected -- to question whether or not they plan to vote Libertarian this year. And your well-considered and measured response is a two-sentence cheap ad hominem attack? I really, really hope your reply is not the typical attitude of the Libertarian (note the big "L") voter or party member, because if it is the Libertarian Party will never, ever move beyond being a fringe party, and you'll have only yourselves to blame. What's the current membership of the party, anyways? 40,000 or so? Kinda fell short of the mark that the LP's Project Archimedes [lp.org], which boasted of trying to increase membership from 26,000 registered members to a goal of 200,000 "contributing supporters", was trying to reach. According to the LP's own news release [lp.org] in February, Archimedes was falling short of its mark and had only increased contributing supporters by 18,000 to around 39,000 (wait a minute, if you started at 26,000 and added 18,000, shouldn't that be 44,000? Where did 5,000 people go?). And that's counting "contributing supporters", which are distingished from registered party members in some unclear way -- I guess if you're giving the LP money, that's as good as actually supporting their principles. (The same press release, by the way, claims that the goal of Archimedes is to reach 60,000 members by the end of 2000. Where did the 200,000 number go, I wonder?) Maybe the LP had trouble generating support because people don't like being called "idiots" when they ask questions about the Party's actual plans for accomplishing its goals and expect more substance than regurgitations of LP press releases and position papers. As for why your candidate isn't on the ballot in all 50 states, why is it that the Arizona Libertarian Party has split into two separate parties, with the party faction sponsored by the national Libertarian Party suing the Arizona Libertarian Party for the right to be the "official" LP of Arizona? And unsuccessfully, at that; the ALP is still the official party, and is endorsing their own candidate, L. Neil Smith, as the Libertarian candidate for President. (There's a thought; maybe the LP should fracture even further, and have 50 LPs each offering their own presidential candidates? The [Ll]ibertarian voters can write in the candidate that they feel is best...) [arizonalibertarian.org] And doesn't say much about the LP's stance regarding "initiatory force" if they try to use the "meddlesome" court system to force the state of Arizona to recognize their faction as the "official" ALP, does it? Apparently the courts should keep their hands off of Microsoft, but heaven forbid that Arizona libertarians want someone other than Harry Browne as their presidential candidate! Jay (= Re:I think you misunderstand Libertarianism (Score:2) Your example of the media is an excellent one. The media are among the most heavily regulated industries in the nation. The government has effectively monopolized the cable market, and has given billions in free spectrum to broadcast journalists. Corporations are now pushing for limiting "pirate" radio stations. The other thing to keep in mind about the media is: what's the alternative? Having the government run the media would be even worse, and corporations are always going to conspire to use the power of government to their advantage. Ultimately, the only way to prevent corporations and/or government from using the media to their own advantage is for consumers to be alert to the biases they hold. If that doesn't happen, there's no way we can prevent the monied interests from using their power to disadvantage the rest of us. In terms of the broader issue of monopolies and market power, I think you'll find that in most cases monopolies are created by the government. This is true in the cases of public utilities, phone, cable, and to a lesser extent trucking, taxi service in many states, pharmaceutical companies, and many others. Regulatory agencies like th FDA, ICC, and EPA exist primarily to protect the interests of the big firms in the industries they regulate. If you look at purely free markets, history does not bear out your position. A good example is Standard Oil. They had about an 85% market share in 1890. At that point they had driven the price of oil down by an order of magnitude. They certainly tried to monopolize their industry after that, but in fact their market share *declined* from 85% to about 65% by the time of the breakup in 1910 or so. In other words, Standard Oil was certainly big and powerful, but without the help of government, they were unable to take or keep a monopoly on the industry, and in the process of trying, they drove down prices and benefited consumers immensely. Contrast this with AT & T, which in the 1920's was in the same position. Their telephone patent had expired, and they were losing market share to smaller competitors. They lobbied for more government regulation of their industry, and effectively achieved a government-imposed monopoly. Had the government left them alone, they might still have a large market share, but there would likely not be the regional monopolies in local service we see today. The pattern is the same in virtually any industry you pick-- those with the most government interference show the greatest concentrations of economic power. Nor should this be surprising. As leftists like to point out, our politicians are bought and paid for by special interests. Why, then, should we be surprised when government interference ends up helping rather than hurting those special interests? Re:Libertarian Ideology (Score:2) At the federal level, most of them would be. Harry Browne has a whole book on what he'd do, so it can't be summarized to easily, but the basics are: * Sell of unneeded government assets. There are trillions of dollars in mineral reserves, land, old military bases, etc that the government has no Constitutional business owning. Browne estimates this would bring at least 5 trillion in. * Use the proceeds to pay down the national debt and buy private retirement anuities for those currently dependent on social security. For younger workers, free them from the social security tax so they can afford to save for retirement. * Cut most government programs. Return the money saved to taxpayers by ending the income tax. The Constitutional functions of the government would be funded by excise and sales tax. * End corporate welfare. This fits in with the above, but it deserves some emphasis, as it's one of the biggest costs to the Federal government. * Repeal regulatory agencies whose primary effect is to protect large firms from competition by harrassing their competitors, such as the FDA, ICC, EPA, OSHA, etc. * End the drug war. Free federal prisoners convicted of non-violent drug crimes. * End US imperialism abroad. The Browne administration will oversee an orderly withdrawal of our troops from foreign nations. Stop bullying other countries, bombing their cities, propping up their dictators, and giving their rebels weapons. Cut the military to the size needed for a purely defensive military force. There's much more, obviously, but those are the high points. A Libertarian government would be about 10% of its present size, with most of its current functions handled by the states or the private sector. I think you'd see much more rapid growth, much more rapid progress for the poor and disadvantaged, much less corporate power over government, less threat of terrorism abroad, less drug-war-fueled crime, and many other benefits. Re:What is up with the /. hatred of GWB? (Score:2) Re:You're a man (Score:2) No more than it is ok for the mafia to carry out hits and gangland executions. They're all privately funded. My standing to speak about it and hold an opinion comes from the fact that I am a member of this society. Re:What is up with the /. hatred of GWB? (Score:2) I have no problem with a "morning after" pill. If a woman is raped, it can prevent her from becoming pregnant. My problem with RU486 is that it can be used for several weeks after the pregnancy has begun. And from your final statement, you'd aparently try to jail any woman who attempted to get an abortion I guess. Would this be grandfathered? All women who have ever gotten an abortion would be crowded into prisons if you were elected? Remember, be consistent here! Yes. Women who get abortions should be jailed when we recriminalize abortion. As for your second question, it's a red herring. Have you ever heard of ex post facto? It means that you can't be charged with doing something that is now illegal if it was legal when you did it. LK Re:This is the Unspoken Side of "Go vote" campaign (Score:2) If you were born a citizen in California and went to school there, you KNOW you have the right to vote. If you are a naturalized citizen, then you had to study for your citizenship test, and you KNOW you have the right to vote. It's time Georgia gets its act together. As for my $20 dollar net connection, this will be the first presidential election in which I am not classified under the poverty line. And I've voted in five previous presidential elections... Re:Libertarian Ideology (Score:2) There are different "factions" within the libertarian movement. The anarcho-capitalists favor eliminating all publicly funded programs immediately. The gradualist faction argues that it took up a century to get us into our present straight, and that it will take a century to get us out, and favor a gradual "growing down" of the government. Most libertarians are in the middle. They recognize that some functions of government are necessary. And those functions are already delineated in the consititution. We favor getting rid of all non-constitutional roles of the federal government as soon as possible. Re:Libertarian Ideology (Score:2)
https://slashdot.org/story/00/10/24/1545232/politics-harry-the-disastrous-the-unpalatable
CC-MAIN-2017-26
refinedweb
13,349
71.85
In this article, learn how to parse JSON data with Arduino for IoT, IIoT, and Home Automation projects. We’ll start by connecting our wifi-enabled chip (ESP8266) to the Internet and then pointing it to the URL where the JSON file is stored. Then, we’ll use the ArduinoJson library to parse the JSON file into readable variables. Lastly, we’ll make checks against the variables to control outputs on our ESP8266. JSON data is a lot easier to work with using Python, but if you’re creating an IoT device using Arduino, then this methodology comes in handy. Expect to spend an hour or so configuring this project. This project is more advanced, so I recommend brushing up on the following topics if you’re new to Arduino and IoT. - Four Steps to Writing an Arduino Program - Getting Started With NodeMCU (ESP8266) Using Arduino IDE - How to use Dweet.io with Wemos D1 Mini (Arduino Tutorial) The goal of this project is to create a secondary IoT device that receives data. If you’ve followed along with previous dweet.io tutorials, you’ll notice we spend a lot of time publishing data to a webpage. This tutorial expands on that project by creating a second device that fetches and interprets the published data. If you’re looking to create your custom automation systems, then this can be very powerful because you’re essentially connecting two separate devices using the Internet. Here’s a diagram of what the final solution looks like. Now, let’s walk through the steps to get this working. Materials for this Project If you plan on using one device to publish data and another device to receive data, then you’ll need two separate ESP8266 controllers. - ESP8266 Controller (NodeMCU or Wemos D1 Mini) - Jumper Wires and Breadboard - or an IoT kit (I recommend this one.) We’ll be demonstrating the project by sending data to the dweet.io website using a Wemos D1 Mini and then receiving data from that URL using a second device (NodeMCU). Lastly, we’ll parse the JSON file and use the data to control our LEDs. Step 1: Wire Both Devices Wire a potentiometer to the Wemos D1 Mini. Then, wire three LEDs to the NodeMCU. Here are some fritzing diagrams for your reference. Once your devices are wired, write and upload code to the Wemos D1 Mini to publish potentiometer data to dweet.io. We have an example of this in our Special Topics Robotics Course and this article. Then move on to the next step. Step 2: Configure ArduinoJson Library To parse JSON files using Arduino, you’ll need to install the ArduinoJson library. Open up the Arduino IDE and go to Sketch > Include Library > Manage Libraries. Then search for ArduinoJson by Benoit Blanchon. Click the Install button. Then, include the header file at the top of your Arduino sketch. #include <ArduinoJson.h> Then, set up the sketch as you would normally. Define any global variables. Initialize the Serial Monitor at 115200 baud, and define any pin modes in the method. You’ll also need to connect the controller to the Internet. Once you have the code written, it’s time to add some logic to fetch and parse JSON Data. Step 3: View raw JSON data at the URL (dweet.io) The first step is to view the raw JSON data hosted on dweet.io. Regardless of whether you publish this data from a device or use an existing device, it’s important to understand how the data is formatted so that we can receive it in a way that makes sense. Open up your browser and go to dweet.io/see. Then click on the device name to see the current readings. Find the raw JSON URL by going to dweet.io/get/latest/dweet/for/MYTHING. Replace “MYTHING” with the name of your thing. For this example, the thing name is “wemos,” so we’ll go to the URL Step 4: Fetch Data from dweet.io using Arduino Now, we’re ready to use ArduinoJson to fetch this data. Copy and paste the JSON information from dweet.io into the ArduinoJson V6 Assistant tool. This will give you the necessary notation to format and parse the JSON file correctly using the ArduinoJson library. For this example, we care most about the potentiometer position, so we can update the variable for the potentiometer value to something more meaningful than int with_0_content_position. I’ve renamed this to potPosition for clarity. You can choose to use the generated code from the assistant tool, or modify it to best suit your application. I chose to print out the potentiometer value to the serial monitor once I receive it from the dweet.io website. //add print-outs to Serial Monitor Serial.print("Potentiometer Position: "); Serial.println(potPosition); Step 5: Make Decisions based on Key-Value Pairs Once you have the data, you can do whatever you’d like with it. Essentially, you have a local variable that can be used to toggle LEDs or local outputs based on conditions. Let’s use the value of the potentiometer position to turn on the corresponding LED based on the following conditions. If the position is less than 500, turn on the red LED. If the position is less than 750 and greater than 500, turn on the yellow LED. If the position is greater than 850, turn on the green LED. I chose to use global variables to hold these thresholds. You can opt to just hardcode the values if you’d like. Here’s some example code that you can use to set up your device. // global variables int redLimit = 500; int yellowLimit = 850; // set LED state if(potPosition <= redLimit){ digitalWrite(red, HIGH); digitalWrite(yellow, LOW); digitalWrite(green, LOW); Serial.println("Red LED ON"); } else if(potPosition <= yellowLimit){ digitalWrite(yellow, HIGH); digitalWrite(green, LOW); digitalWrite(red, LOW); Serial.println("Yellow LED ON"); } else if(potPosition > yellowLimit){ digitalWrite(green, HIGH); digitalWrite(yellow, LOW); digitalWrite(red, LOW); Serial.println("Green LED ON"); } And that’s it! You can choose to update the local variable in real-time, store data into an array, create a CSV, or whatever else makes sense for your application. Once you have the data, the possibilities are endless! Next Steps for Further Learning In this tutorial, we learned how to parse a JSON file using Arduino. The data was stored on the dweet.io website, which we connected to and performed a GET HTTP request. Once we removed the headers and allocated the JSON file, we could use the ArduinoJson library to parse the key-value pairs and set a local variable. In turn, we were able to use this variable to check against a set of conditions and turn on a corresponding LED. You can use this methodology to configure a network of IoT devices. These devices can automatically connect to a webpage, push and pull data, and make decisions based on the current values. As a result, you can unlock powerful, real-time metrics for applications in Industrial and Home Automation. Have a question? Be sure to review Episode 8 of the Special Topics Robotics Course. And, lastly, if this tutorial helped you in any way, consider sending me a tip. If you enjoyed this tutorial, be sure to share it with a friend! 2 Responses Hi Liz, Do you have source code for both Node MCU’s for this project? Thanks, – Jack Hi Jack, yes the full source code is located in our Free Robotics Course. Or you can read through this tutorial and put the pieces together.
https://www.learnrobotics.org/blog/parse-json-data-arduino/
CC-MAIN-2022-27
refinedweb
1,273
65.42
mtl (or its underlying transformers) package provides two types of State monad; Control.Monad.State.Strict and Control.Monad.State.Lazy. Control.Monad.State re-exports Control.Monad.State.Lazy. The difference between these two state monads does not matter in most cases, but it may cause unexpected surprises when infinite lists are involved. In this post, I am going to explain the subtle difference between lazy and strict state monads. Let’s start the discussion with a simple example. The program shown below returns an infinite list of integers [1..] in a lazy state monad. Running the program prints [1,2,3,4,5] as expected. import Control.Monad.State.Lazy foo :: State () [Int] foo = traverse pure [1..] main = print $ take 5 (evalState foo ()) However, when we replace the import with Control.Monad.State.Strict, the program hangs up. import Control.Monad.State.Strict foo :: State () [Int] foo = traverse pure [1..] main = print $ take 5 (evalState foo ()) What happened here? The definition of traverse might give us a hint. instance Traversable [] where traverse f = List.foldr cons_f (pure []) where cons_f x ys = (:) <$> f x <*> ys From the definition of traverse, we can see that traverse return [1..] expands to (:) <$> (return 1) <*> ((:) <$> (return 2) <*> ((:) <$> (return 3) <*> (...))) (<$>) and (<*>) operators are used to combine values. (<$>) are (<*>) are defined in Functor and Applicative instances of State monad respectively. Let’s compare the definitions of these operators. - Control.Monad.Trans.State.Lazy'') - Control.Monad.Trans.State.Strict'') The two definitions are almost the same except for a small difference in pattern matching. Did you find it? Yes, the lazy version uses a tilde ~ in pattern matching on a pair. It is a lazy pattern matching. Here’s the secret. In the strict version, the pattern matches on the pair forces its evaluation. So traverse pure [1..] never returns until its evaluation is finished. The lazy version avoids this evaluation of the pair using an irrefutable pattern ~(a,w). Evaluation is forced later when the pair is actually needed. This is why we can manipulate infinite lists in a lazy state monad. But this observation does not imply that we should always prefer the lazy version of state monad because the lazy state monad often builds up large thunks and causes space leaks due to its laziness.
http://kseo.github.io/posts/2016-12-28-lazy-vs-strict-state-monad.html
CC-MAIN-2017-17
refinedweb
382
60.92
I hope this is the correct area to ask this, if not I apologize! I've been using the Raspberry Pi for a couple of weeks now and I'm getting the hang of it, however the bane of my existence has been my 74HC595 shift register. I understand the basics of how the Shift Register works, however I'm running into a problem actually writing the code to get the Shift Register to work. I've gotten it all wired up, and using some Python example code that was in the tutorial to test, it works. But now I want to do it on my own and actually understand it. Below is my code. Currently it just chooses a random LED and lights it up. What I need help understanding is: 1.) Why exactly does 0x01 correspond to output 1, 0x02 correspond with output 2, etc? 2.) The code below limits me to enabling output on only one pin, how can I enable output on more than one pin at a time? Thanks for the help! Code: Select all import RPi.GPIO as GPIO import time import random RCLK = 12 SER = 11 SRCLK = 13 SRCLR = 15 def input(dat): for bit in range(0, 8): GPIO.output(SER, 0x80 & (dat << bit)) GPIO.output(SRCLK, GPIO.HIGH) time.sleep(0.001) GPIO.output(SRCLK, GPIO.LOW) def latch(): GPIO.output(RCLK, GPIO.HIGH) time.sleep(0.001) GPIO.output(RCLK, GPIO.LOW) ledList = { 1: 0x01, 2: 0x02, 3: 0x04, 4: 0x08, 5: 0x10, 6: 0x20, 7: 0x40, 8: 0x80 } def setup(): GPIO.setmode(GPIO.BOARD) GPIO.setup(RCLK, GPIO.OUT) GPIO.setup(SRCLK, GPIO.OUT) GPIO.setup(SER, GPIO.OUT) GPIO.setup(SRCLR, GPIO.OUT) GPIO.output(SER, GPIO.LOW) GPIO.output(RCLK, GPIO.LOW) GPIO.output(SRCLK, GPIO.LOW) GPIO.output(SRCLR, GPIO.HIGH) def clear(): GPIO.output(SRCLR, GPIO.LOW) time.sleep(0.1) GPIO.output(SRCLR, GPIO.HIGH) latch() def runRandom(): clear() time.sleep(1) while 1: input(ledList[random.randint(1, 8)]) latch() time.sleep(.1) setup() runRandom() if __name__ == '__main__': setup() try: runRandom() except: GPIO.cleanup() print("exiting...")
https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=249969&p=1526156
CC-MAIN-2020-50
refinedweb
353
57.98
I'm trying to get my regular expression to work but can't figure out what I'm doing wrong. I am trying to find any file that is NOT in a specific format. For example all files are dates that are in this format MM-DD-YY.pdf (ex. 05-13-17.pdf). I want to be able to find any files that are not written in that format. I can create a regex to find those with: (\d\d-\d\d-\d\d\.pdf) (?!\d\d-\d\d-\d\d\.pdf) (?!\d\d-\d\d-\d\d\.pdf).* 05-17-17.pdf Test.pdf 05-48-2017.pdf 03-14-17.pdf You can try this: import re s = "Test.docx 04-05-2017.docx 04-04-17.pdf secondtest.pdf" new_data = re.findall("[a-zA-Z]+\.[a-zA-Z]+|\d{1,}-\d{1,}-\d{4}\.[a-zA-Z]+", s) Output: ['Test.docx', '04-05-2017.docx', 'secondtest.pdf']
https://codedump.io/share/FTaWaKNNxJT9/1/python---regex---match-anything-except
CC-MAIN-2019-09
refinedweb
161
76.32
Perl: Control Structures, Regular Expressions, Files, and OO Programming - This lecture is adapted from material originally written by Dr. Plank and later modified by various cs300 instructors For/if/while For, if and while clauses work like their C counterparts, except the body of the clause must be enclosed in curly braces. For example, here is a simple code fragment to print the even numbers between 0 and 9: for ($i = 0; $i < 10; $i++) { if (($i % 2) == 0) { printf("%d\n", $i); } }Perl also adds a couple of useful new types of loops. First it has a foreach construct that allows you to iterate through arrays or other list-like structures, such as the lines in a file. Here's a simple code fragment to sum the elements in an array: $sum = 0; foreach $num (@nums) { $sum += $num; } print "sum = $sum\n";If the array is empty to start with, then the block of statements is never executed. Here's a code fragment that treats stdin like an array by using a foreach construct to iterate through each of the lines in stdin and echo them to the screen: foreach $line (<>) { print $line; }The loop stops automatically when EOF is reached. Second Perl has an until loop that is the mirror opposite of a while loop--the until loop iterates until the loop exit condition becomes true. For example, here is binary search on an array using an until loop: @data = (10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140); $low = 0; $high = $#data; $key = $ARGV[0]; $middle = int(($low + $high) / 2); // int truncates the result--perl does floating pt division until ($high < $low or $key == $data[$middle]) { if ($key > $data[$middle]) { $low = $middle + 1; } else { $high = $middle - 1; } $middle = int(($low + $high) / 2); }I believe the until loop is a much more intuitive way to express loops than a while loop, since it allows you to directly state the loop exit condition, rather than having to indirectly state it through negation. Studies repeatedly show that humans are not comfortable with negation; hence the utility of the until loop. Notice that using a while loop I would need to write: while ($high >= $low and $key != $data[$middle])which in my opinion makes it much more difficult for a reader to figure out when the loop is really supposed to exit. Finally, the one difference in using if-then-else in Perl is that instead of using "else if" as in C, you should use "elsif". For example, here is a code fragment to convert a numeric grade to a letter grade: if ($grade > 90) { print("grade = A\n"); } elsif ($grade > 80) { print("grade = B\n"); } else { print("grade = C\n"); } String Manipulation Using Regular Expressions Recall that one of Larry Wall's principal objectives in designing Perl was to make it easy to extract data from files. To do so, he needed a mechanism that made it easy to manipulate strings. Regular expressions provide such a mechanism. A regular expression is a pattern that specifies a substring that you would like to find in a string. The simplest regular expressions are those formed from characters, such as "a" or "brad". To determine whether a pattern matches a substring within a string, you can use Perl's matching operator, =~ and enclose the regular expression in slashes: $name = "vander zanden, brad t."; if ($name =~ /brad/) { print "$name has the substring \"brad\"\n"; }=~ is a boolean operator that returns true if the regular expression matches a portion of the string pointed to by the left hand side variable and undef otherwise. In contrast, !~ can be used to test for non-matches: $sentence = "The quick brown fox"; $sentence !~ /white/; # true, because white does not appear in $sentenceRegular expressions can be made much more expressive than just a collection of characters. For example, suppose I wanted to match any person whose last name begins with "vander zanden,". I do not know which characters may be in the person's first or middle name, nor do I know how many characters will be in that person's name. To specify that I want to match any character but a newline (\n), I use a period (.). To specify that the name must have at least one character (i.e., one or more characters), I use a plus sign (+). if ($name =~ /vander zanden,.+/) { print "$name has a person with the last name of vander zanden"; }I probably want to know what the person's first and middle name is, i.e., I want to be able to extract the person's first and middle name from the string. If I put parentheses around the portion of the pattern that I want extracted, then Perl will store the matched substrings in variables named $0, $1, $2, ... $n. $0 contains the substring matched by the entire pattern within slashes (//), so you do not have to put parentheses around the whole pattern. In the above example I just want the first and middle name, so I put the parentheses around the .+ portion of the pattern. To make the code fragment more interesting, I will now read names from stdin and print the first and middle names of people whose last name is "vander zanden": foreach $name (<>) { if ($name =~ /vander zanden,(.+)/) { # $1 refers to the pattern matched by (.+) print "first name is $1\n"; } }If you execute this code, you will notice that the first name has leading spaces in front of it, which you probably do not want. For example, if the line is: vander zanden, bradthen the output will be: first name is bradTo eliminate leading spaces from the first name, we can precede the pattern that matches the first name with the pattern " *". The asterisk, *, indicates zero or more occurrences of the pattern, which in this case is a space. The " *" pattern will absorb any leading spaces: foreach $name (<>) { # " *" has been added to match leading whitespace, thus eliminating # it from the first name pattern if ($name =~ /vander zanden, *(.+)/) { print "first name is $1\n"; } }Finally, suppose I wish to capture the first and middle names as separate strings. I will make the assumption that the first and middle names are each single words, that the first and middle names are separated by one or more spaces, and that the middle name optionally ends with a period. Remember that a period is a special character that matches any character, so I must escape the period with a backslash if I want a character to match only a period. I can use the character '?' to denote an optional part of the pattern (technically, '?' means 0 or 1 occurrences of the pattern). Here is the pattern: |---the period is optional /vander zanden, *(.+) +(.+\.?)/ first name--^^ ^^ ^^^^^---middle name |-- one or more spaces separates the first and middle namesHere is what $1 and $2 contains when matched against the following strings: "vander zanden, brad t." # $1 = brad, $2 = t. "vander zanden, brad tanner" # $1 = brad, $2 = tannerTo recap, here is what you have seen in this section: - Regular expressions can consist of one or more characters - . matches any character, except the '\n' character (thus Perl will cease searching at the end of a line) - * means 0 or more occurrences of a pattern - + means 1 or more occurrences of a pattern - ? means an optional pattern (technically, 0 or 1 occurrences of a pattern) - () captures the substring that matches the pattern enclosed in parentheses. The captured strings are stored in the variables $1, $2, etc. Character Classes Regular expressions provide an excellent mechanism for type checking user-supplied input. When you do this type-checking, you will often want to match specific characters, such as alphabetic characters or numbers. Three handy symbols for specifying character classes are the [] grouping operator, the ^ negation operator, and the - range operator: - The [] operator says that any character occurring within the brackets may be matched. For example, [aeiou] represents any vowel. - The ^ operator, when placed as the first character in brackets ([]'s), means any character but the following set of characters. Hence [^aeiou] means any characters but the vowels, or equivalently, any consonant. - The - operator allows you to specify a sequential list of characters within the ascii character set. Hence [a-z] represents lower case letters, [A-Z] represents upper case letters, [a-zA-Z] represents all lower and upper case letters, and [0-9] represents any digit. [0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9] #social security numberThis pattern is rather hard to read, so Perl has introduced shorthand notations for certainly commonly occurring character classes: \w is often referred to as the word character. Unfortunately, Perl does not have a word class representing letters only. Here are some examples using character classes: Repetition and Alternation You have already seen a number of ways to specify repeating patterns in strings, but often you want to specify a fixed number of repetitions, or a range of repetitions. For example, social security numbers have groups of 3, then 2, and finally 4 numbers. You can use the following notation to allow patterns to repeat a specific number of times: Here are a few simple examples: Another thing that you will often want to do is specify alternative patterns. For example, a middle name may be either fully written out, or may be a single character followed by a period. The | alternation character allows you to specify alternative patterns. For example: Anchors When type checking a string that has been input by a user, you often do not want any extraneous garbage in the string. For example, if the user inputs a zip code, you do not want any extraneous characters before or after the zip code. In other words, you want your pattern to match only if the string input by the user has exactly five digits. You can specify these types of boundaries by using anchors. The following anchors are available: Here are some examples: The idiom /^...$/ is very useful for typechecking strings and ensuring that no extraneous garbage is included in the string. You should get used to using it. Option Modifiers There are a number of searching situations that can be expressed by a complicated regular expression, but which occur so commonly that it is better to write a simple regular expression and tell Perl to modify its normal searching strategy. Some of these common situations include: - Matching a name in which people may or may not capitalize letters - Trying to capture a pattern that spans multiple lines using the . character. Normally Perl stops searching at a newline character, because \n is the only character not matched by the . character. - Matching any line in a multi-line string (i.e., a string with \n characters) that starts or begins with a pattern (i.e., that uses ^ or $), as opposed to just the start of the string. - Iterating through a string and looking for every match. Normally Perl stops after the first match. - Formatting a string with spaces so that the pattern is easier to read. Normally putting spaces into a pattern causes Perl to think that the space is part of the pattern and that the substring must have a matching space. You can make the pattern somewhat easier to read by using parentheses to group subpatterns, but then you may not want Perl to record the substrings matched by these subpatterns. You can alter Perl's search strategy by putting one or more option modifiers at the end of the slashes (//'s) that delimit the regular expression. The available options are: Here are some examples using these option modifiers: Nongreedy Searching Perl normally tries to create the longest string that could possibly match a pattern. For example, suppose you have the following pattern and string: $text = "<b>brad</b> and <b>nels</b> went to the store"; while ($text =~ /<b>(.*)<\/b>/g) { print ("$1\n"); }Here is the desired and actual output: Desired Output Actual Output brad brad and <b>nels nelsPerl has made a greedy match with the first string. Since . can match anything, including the characters in the "</b>" tag, it greedily matches until it reaches the second "</b>". This problem is a common one with the . character. These greedy match problems occur only with the repetition characters, which are *, +, {n,m}, {n,}. You can tell Perl to match the shortest string possible by adding a ? after the repetition operator. This type of match is called a nongreedy match. We can correct the above problem by using the nongreedy match operator: while ($text =~ /<b>(.*?)<\/b>/g) { print ("boldfaced text: $1\n"); }Because a ? can also be used to specify an optional occurrence of something, its use can seem ambiguous. The rule for interpreting the ? character is as follows: - If it follows one of the repetition operators, *, +, {n,m}, {n,}, then it means make a non-greedy match. - If it follows any other character or grouping operator, such as ()'s or []'s, then it denotes an optional character or group. The Grouping Operator () You have already been introduced to the grouping operator, but there are some additional items you should know about the grouping operator: - Nested parentheses ()'s: When parentheses are nested, you figure out the number of the group by counting left parentheses. For example: # captures a date of the form mm-dd-yyyy $date = "06-14-2008"; $date =~ /(\d{2})-(\d{2})-(\d{2}(\d{2}))/; ------- ------- -------------- ------- group: 1 2 3 4 # $1 = "06", $2 = "14", $3 = "2008", $4 = "08" - Persistence of memory: If a match fails, then $0, $1, $2, etc. retain their values from the last successful match. - Naming groups using lists: You can assign the groups to named variables by putting a list of variables to the left of the =~ operator: ($month, $day, $year, $yr) = $date =~ /(\d{2})-(\d{2})-(\d{2}(\d{2}))/; - Noncapturing parentheses: Sometimes you use a grouping operator to make the pattern clearer or to avoid issues with the precedence of the pattern operators. In these cases you may not want to capture the content. You can tell Perl to not capture the content by starting the ()'s with the ?: operator. For example: # names 1 and 2 may be separated by an optional "and" or "or" ($name1, $name2) = $names =~ /([a-z]+) (?:and|or)? ([a-z]+)/;In this case, $name1 is assigned the contents of the first group, the second group is ignored, and $name2 is assigned the contents of the third group. - Named captures: Keeping track of the numbers of groups can be error-prone, especially if you are adding or removing groups as you debug a pattern. To eliminate these problems, Perl versions 5.10 and later permit named captures where you attach a name directly to a group. The syntax is (?<label>pattern) and the labels can be accessed in a hash table named %+. Hence if your label is name1, you can access it via the reference $+{name1}. For example, the above name pattern could be rewritten as: use 5.010; $names =~ /(?<name1>[a-z]+) (and|or)? (?<name2>[a-z]+)/; print "$+{name1}\n"; print "$+{name2}\n";The use statement tells the Perl interpreter that version 5.10 or later is required. If the interpreter has a lower version number, it will print an error message and terminate. - Repeated patterns: Sometimes you want a particular sub-pattern to repeat and you would like to capture the first instance of the sub-pattern and then repeat it later in the overall pattern. For example, suppose I want to capture all the content between header tags in html. While I could write 6 different patterns, one each for h1-h6, an easier way to do it is capture the header number using the regular expression <h([1-6])>) and then repeat that pattern. Perl makes the group content available via the operators \1, \2, \3, etc. Hence I can write the following code fragment to match any header from h1-h6: # capture content between any tags labeled h1-h6 while ($text =~ /<h([1-6])>(.*?)<\/h\1>/igs) { print "$2\n"; } Interpolating into Regular Expressions Sometimes you will want to create dynamic regular expressions. For example, suppose that you want to write a "super" grep that allows you to enter multiple search terms for searching a file. The search terms would be entered using a command line argument and you would need to insert these search terms into your regular expression. You can do that using the normal variable interpolation into strings. For example: # Read lines from stdin one by one and see if they match any of the # search terms provided by the user. If so, then print out the line number # and the matching string $line_num = 0; foreach $line (<>) { $line_num++; foreach $term (@ARGV) { if ($line =~ /($term)/) { print ($line_num: $1); } } } Regular Expression Substitution You can modify a string variable by applying a vi-like substitution. The operator is again "=~" , and the substitution is specified as s/search pattern/replace pattern/For example: $line = "brad went to the store and bought some ice cream"; # replace "ice cream" with "chocolate ice cream" $line =~ s/ice cream/chocolate ice cream/;Frequently, you want to replace all the substrings that match the search pattern with the replacement pattern. In this case you must use the g option modifier; otherwise Perl only replaces the first occurrence of the pattern. For example, to replace all occurrences of the tag "<b>" with the tag "<strong>" I could write: You can also re-arrange a string by using the () operator to capture content and then re-arrange that content in the replacement pattern. You use the operators \1, \2, \3, etc. to access the content. For example, to re-arrange a date of the form "mm-dd-yy" into a date of the form "dd-yy-20yy" I could write: $date =~ s/(\d{1,2})-(\d{1,2})-(\d{2})/\2-\1-20\3/;If you need to concatenate a number, such as 20, directly after one of the memory capture operators, then use the notation "${n}20", where n is the number of the operator. If you try to write "\120", Perl will think you want the 120th memory capture. Splitting Strings A very useful function in Perl is split, which splits up a string into fields and places the fields into an array. split expects a regular expression, which determines the separator to be used in splitting the fields. The syntax for split() is: split(/pattern/, string)For example: # split a string using a single blank character between fields $line = "brad vanderzanden m 2 3 64"; @employee = split(/ /, $line); # @employee = ("brad", "vanderzanden", "m", "2", "3", "64") # split a comma-delimited string into fields $line = "brad,vander zanden,m,2/3/64"; @employee = split(/,/, $line); # @employee = ("brad","vander zanden","m","2/3/64")split provides a very powerful way of splitting a string into its constituent fields, but you must be careful about the way you specify your patterns, since extra white space can create all sorts of problems. Here are some common problems and how to fix them: - problem:There may be more than one whitespace character between fields, or the user placed tabs rather than spaces between the fields. If you specify that there will only be one space between each field, your array will have funny results. For example: $line = "brad vander zanden"; @employee = split(/ /, $line); # @employee=('brad','','','','','vander','zanden')The four empty strings are caused by the fact that there are 5 spaces between "brad" and "vander". The first space marks the end of "brad". The second space marks the end of the second field, and since there are no characters between these two spaces, you get an empty string as your second field. The same thing happens with spaces 2-3, 3-4, and 4-5, thus yielding 4 empty fields. The solution is to use "\s+" to absorb excess whitespace: $line = "brad vander zanden"; @employee = split(/\s+/, $line); # @employee=('brad','vander','zanden') - problem: Forgetting about white space when another delimiter is used. Often times delimiters may be surrounded by white space. For example, a comma-delimited list might be entered as: $info = "Balajee, Patrick, Michael, Josh, Leaf"; @personal = split(/,/, $info); # @personal = ("Balajee", " Patrick", " Michael", " Josh", " Leaf")If you just use the delimiter, in this case a comma, as your split pattern, then the fields will absorb the extra space, as shown in the above example. The solution is to put "\s*" both in front of and after your delimiter, to ensure that excess white space gets absorbed (make sure you do not use "\s+", unless you know that whitespace will occur before or after the delimiter): $info = "Balajee, Patrick, Michael, Josh, Leaf"; @personal = split(/\s*,\s*/, $info); # @personal = ("Balajee", "Patrick", "Michael", "Josh", "Leaf") - problem: The string has leading or trailing white space. If the string has leading whitespace, even the pattern "\s+" will not be enough to absorb the leading whitespace. Perl will create one empty string at the beginning of your array, because it will treat the leading whitespace as a separator between an empty field and the first actual field in your string. Thus if your string is " Brad Vander Zanden"your result will be the list ('', 'Brad', 'Vander', 'Zanden'). Python has a trim function that removes the leading and trailing whitespace. Unfortunately, Perl does not, so the solution is to trim this whitespace using a substitution pattern: $line = " brad vander zanden "; # strip leading and trailing whitespace using the ^/$ operators and \s* $line =~ s/^\s*(.*?)\s*$/\1/; @personal = split(/\s+/, $line); # @personal = ("brad", "vander", "zanden") Joining Strings Less common but still handy is the ability to concatenate the elements of an array or list-like structure into a string, separated by a delimiter. For example, many spreadsheets expect comma separated values (CSV format). Perl's join function provides this functionality. For example, if you have an array whose elements you would like to write out as a comma delimited string, you could write: @info = ("brad", "vander zanden", "m", "2/3/64"); $line = join(",", @info); # $line = "brad,vander zanden,m,2/3/64"The join command also comes in handy when you want to read in a file and concatenate the lines, so that you can do multi-line searches or substitutions: Functions In Perl you can define functions using the sub keyword, which is short for "subroutine". Functions may be placed anywhere in your program but it's probably best to put them all in one place, either at the beginning of the file or at the end of the file. A function has the form: sub function_name { print "Well, Hullo there!!!\n Isn't it absolutely peachy today?\n"; }Pre-6 versions of Perl do not allow functions to have explicit parameter lists (although they can be passed a list of parameters). Perl 6 introduces formal parameter lists, but until Perl 6 interpreters become widely available, you should continue to specify your functions without parameter lists. Here are a number of sample function calls: print_header; # A function with no parameters &print_header; # Functions once had to be prefixed with an &, but no more print_body($name, $amt, $date); # A function call with parameters $max = max($a, $b, $c, $d); # A function with a return value ($min, $max) = minmax($a, $b, $c, $d) # A function that returns a list of values In older Perl code you may see subroutine calls prefixed with an & character in front of the function name. It is no longer necessary to specify the & character. Also note that you can use lists to return multiple values from a function. This often comes in handy, especially if you want to return both a result and an error flag. Parameters When a function is called, parameters are passed as a list in the special @_ array variable. The following function prints out the parameter list that it was called with. sub printargs { print "@_\n"; # the elements of interpolated arrays are separated with spaces } printargs("balajee", "kannan"); # Prints "balajee kannan" printargs("Balajee", "and", "Kannan"); # Prints "Balajee and Kannan"Just like any other array, the individual elements of @_ can be accessed with the square bracket: sub print_args { print "Your first argument was $_[0]\n"; print "and your second argument was $_[1] \n"; }The array variable @_ is different from the $_ scalar variable (if you have not seen the $_ variable before, don't worry--we will discuss it later). Also, the indexed scalars $_[0], $_[1], etc. have nothing to with the scalar $_, which can also be used without fear of a name clash. The lack of a formal parameter list makes it easy to handle variable length parameters, such as might be found in a print function, or a function that computes the maximum of a set of arguments. For example, a max function might be written as: sub max { if (scalar @_ == 0) { return undef; } $max = $_[0]; foreach $element (@_) { if ($max < $element) { $max = $element; } } return $max; } Returning values Typically you return a value from a function explicitly using the return statement. However, if you fail to use a return statement, the result of a function is always the last expression evaluated. For example: sub max { if ($_[0] > $_[1]) { $_[0]; # it would be clearer to write "return $_[0];" } else { $_[1]; # it would be clearer to write "return $_[1];" } } $biggest = max(37, 24); print "$biggest"; # prints 37The print_args function in the previous section also returns a value, in this case 1. This is because print was the last statement executed by print_args and the result of a successful print statement is always 1. Local variables By default, Perl assumes that any variable you use in a function is a global variable, even if it is the first time the variable has been defined anywhere in the program (the only exception is the @_ parameter array, which is considered to be a local variable). For example, suppose you write the following code: sub max { ($a, $b) = @_; return $a > $b ? $a : $b; } print max(10, 30), "\n"; # prints 30 print '$a = ', $a, "\n"; # prints "$a = 10" print '$b = ', $b, "\n"; # prints "$b = 30"Notice that $a and $b are defined after the max function has returned, even though your top-level program never defined $a or $b. The reason is that Perl assumes that variables used in a function are global variables, and if they are being defined for the first time, adds them to the global namespace. In many cases you would like to limit a variable's scope to the function, or in other words, declare it as a local variable. This can be done using the my keyword: sub max { my ($a, $b) = @_; return $a > $b ? $a : $b; } print max(10, 30), "\n"; # prints 30 print '$a = ', $a, "\n"; # prints "$a =" print '$b = ', $b, "\n"; # prints "$b ="Now $a and $b are declared as local variables to the function max and hence are undefined when the last two print statements are executed. Each of them returns the value undef when accessed, thus resulting in the printed strings "$a =" and "$b =". In older Perl code you may see the local keyword used to declare local variables instead of the my keyword. The local keyword also declares a variable as local, but it establishes dynamic, rather than static scoping for the variable. Dynamic scoping means that when a function refers to a non-local variable, the variable's value is determined by searching through the call stack and locating the first function that declares that variable. The value for that variable will then be returned. In contrast static scoping determines the variable's value by looking for the variable in an enclosing function, or the top-level if there is no enclosing function. All modern, compiled languages, including C and Java, using static scoping. Reference Parameters In Perl you cannot directly pass arrays or associative arrays to functions. If you try to do so, then Perl will concatenate the contents to produce a single array of arguments. For example: Files These notes have previously discussed how to access STDIN to obtain input from standard input. STDIN is actually a pre-defined filehandle, which is the data type perl uses for accessing files. Perl also provides the predefined file handles STDOUT and STDERR. You can open a file for input and then place its file handle in the <> operator in order to read from it, just like STDIN. Moreover, you can open a file for output and print to it. Filehandles do not have any special character preceding them, as do arrays and hashes. Therefore, it is recommended that you always use all caps for filehandles to prevent them from interfering with any future reserved words. By default the open function opens a file for input. The first parameter is the filehandle, which allows the programmer to refer to the file in the future. The second parameter is an expression denoting the filename. If the filename is given as a string, then the filename is taken literally without shell expansion. So the expression '~/notes/todolist' will not be interpreted correctly. If you want to force shell expansion then use angled brackets: that is, use <~/notes/todolist> instead. Here are several example open statements: open(INFO, $file); open(INFO, "employees"); # employees should be a file in the current directory # perform file expansion and open the file idaho in the directory # associated with the user ~bvz open(INFO, <~bvz/idaho>); The open statement can also open a file for output or for appending. To do this, either prefix the filename with a > for output and a >> for appending, or use the three argument form of open with the > or >> passed in as the second argument and the filename as the third argument: open(INFO, ">$file"); # Open for output open(INFO, ">>$file"); # Open for appending open(INFO, "<$file"); # Also open for input use 5.006; open(INFO, ">", $file); # Open for output open(INFO, ">>", $file); # Open for appending # Use shell expansion and open for output open(INFO, ">", <~bvz/idaho.bak>);The three argument version was added in Perl 5.6, so it does not work in earlier versions. The three argument version is safer because it avoids quirkly behavior if $file has an unusual string, such as ">foo" (with the two argument version, you would inadvertently open "foo" for appending, rather than ">foo" for output). The three argument version also allows you to output files using shell expansion. If the file name is provided as a command line argument, then the shell will already have performed shell expansion. Hence in this case you can treat the file name as a string argument and do not need to use angle braces. For example: To print something to a file that has already been opened, pass the file's file handle to the print statement as the first extra parameter. Do not put a comma between the file handle and the first string to be written to the file. For example: # Writes line to the file specified by filehandle INFO. print INFO "This line goes to the file.\n"; # Even when using more conventional fct call notation you do not put a # comma between the file handle and the first argument to be printed print (INFO "another line", "to the file.\n"); You can return an open file handle from a subroutine and store it in a scalar variable. For example: sub openHandle { ($filename) = $_[0]; open MYHANDLE, ">$filename"; return MYHANDLE } $handle = openHandle($ARGV[0]); print $handle "hi brad\n"; close $handle;The close function tells Perl to close the file and make the file handle available for reuse. However, after the close statement, the defined function will still return true when passed the file handle as an argument, so do not assume it becomes undef. die and warn You cannot assume that your program will always be able to successfully open a file. The open command returns either 1 or undef to indicate whether or not the open command succeeded. You can either attempt to recover from such an error, perhaps by prompting the user for another filename, or you can cause the program to exit using the die function. die takes a string argument, prints it, and then exits the program with a non-zero error code. You cannot control the error code. The typical way you will see die used in conjunction with an open statement is as follows: open($file) or die "Cannot open $file: $!";Here are a few important things to know about die: - After a system command fails, the variable $! contains the error message created by the system command. This is the same error message accessed by perror in C. Do not use $! if you are die'ing from a user-defined error, since then you will get a message that is left over from a previous system command. - If you do not terminate the string with a newline character (\n), then die will also print the program name and line at which the error occurred. For the above program, the error message might look like: Cannot open /Users/bvz/idaho: No such file or directory at temp.pl line 1. - Normally if you are terminating the program because a system command failed, you do not terminate the die string with a newline character. If you are terminating the program because of a user-defined error, you terminate the string with a newline character, because the user does not need to know where the error occurred. If you want to print a warning message rather than terminate the program, use warn instead of die. Sorting Sorting is such a common operation for manipulating data that most scripting languages provide a built-in sort function for sorting lists. Perl is no exception. Its sort function alphabetically orders the elements of a list in ascending order and returns a new list with the ordered elements (the original list is unchanged). For example, the following code sorts standard input by reading it into an array and printing the sorted array: @a = (); while ($l = <STDIN>) { push(@a, $l); } print sort(@a);Since files can be treated as arrays, the following code would perform the same sort more simply: print sort(<STDIN>);If you wanted to sort the array in descending order, you could write: reverse sort(<STDIN>);It might seem like it is inefficient to sort the array and then reverse it, but this idiom is so common that Perl interpreters use tricks to do an efficient descending sort. Suppose instead that you wanted to sort a list of numbers. The following Perl code would not produce the desired result: @a = (1000, 100, 200, 10); @a = sort @a; # @a = (10, 100, 1000, 200)The reason for the strange output is that Perl compares the elements as strings, and any string that begins with "1" will be alphabetically less than any string that begins with "2". You can tell Perl to perform numerical sorting using the so-called spaceship operator <=>: @a = (1000, 100, 200, 10); @a = sort {$a <=> $b} @a; #a = (10, 100, 200, 1000)The code in the curly braces ({}) is an inline, anonymous function. The variables $a and $b are pre-defined for this comparison function by Perl. The <=> operator compares the two values $a and $b numerically, returning 1 if $a > $b, -1 if $a < $b and 0 otherwise. The cmp operator does the same thing for alphabetical sorting. For example, suppose I have strings of the form "firstname lastname phone" and I want to sort by lastname, with ties being broken by sorting firstname. The following code would do the trick: @a = ("brad vanderzanden 269-8596", "joe camel 658-5869", "aaron camel 685-3969"); @a = sort { @one = split / /, $a; @two = split / /, $b; if ($one[1] eq $two[1]) { return $one[0] cmp $two[0]; } else { return $one[1] cmp $two[1]; } } @a; print join("\n", @a); print "\n"; The output is: aaron camel 685-3969 joe camel 658-5869 brad vanderzanden 269-8596Since the comparison function above is rather large to write as an in-line function, you can define it separately and then provide the name of the function to sort. For example, if you moved the above in-line code to a function named compare_recs, you could write the sort as follows: sub compare_recs { @one = split / /, $a; @two = split / /, $b; if ($one[1] eq $two[1]) { return $one[0] cmp $two[0]; } else { return $one[1] cmp $two[1]; } } sort compare_recs @a;Several things should be noted about this code: - I did not have to declare $a and $b as local variables, because Perl makes a special exception in this case and pre-defines the two arguments as $a and $b. - When I called sort, I did not use parentheses and I did not put a comma between the function name and the array name. The reason is that if I used parentheses or used a comma, then Perl would think that I wanted to create a list consisting of the string "compare_recs" and the elements of @a, and I would end up with a sorted list that includes the string "compare_recs". Here are two final examples. The first example is an alphabetical sort that ignores case: @names = ("brad", "Frank", "nels", "Yifan", "smiley", "aaron"); sort { "\L$a" cmp "\L$b" } @a; result @names = ("aaron", "brad", "Frank", "nels", "smiley", "Yifan")The "\L" character directs Perl to convert the rest of the string to lowercase characters (the original values remain unchanged because Perl passes copies of the values to the comparison function). Similarly "\U" directs Perl to convert the rest of the string to uppercase characters. There are other such directives for modifying the case of characters in a string, and you can look them up in any perl reference. The second example sorts employee records. Let's assume that we have employee records with the fields name and age and we wish to sort the records into alphabetical order. Recall that we use anonymous hash tables with references to represent such records, so name and age will be the two keys in each hash. If we assume that the references to these hashes are stored in an array named emp_records, then the follow code will sort the records by employee name: # The $$ de-references the hash and allows us to treat the hash reference # as a scalar @sorted_emp_records = sort { $$a{"name"} cmp $$b{"name"}} @emp_records; for $rec (@sorted_emp_records) { printf "%-10s %3d\n", $$rec{"name"}, $$rec{"age"}; } Object Oriented Programming in Perl The syntax for object oriented programming is somewhat different from conventional object-oriented languages, such as C++ and Java. For starters, there is no class keyword for creating a new class (Perl 6 introduces a class keyword to make it easier to create more conventional looking classes). Instead classes are defined as packages using the package keyword. Each class is normally stored in a separate file, hence there is one package per file. Hashes are the data structure usually chosen to represent objects in Perl. Perl uses a blessing mechanism to associate a hash reference with a package. Once the hash has been "blessed", it is possible to use special object syntax to call methods associated with the package. It is easiest to explain Perl's object mechanism using a concrete example. The following example creates a package called Student that contains a constructor named new, an accessor named getName, and an accessor named setName: { package Student; # constructor sub new { # the first parameter is a string generated by Perl that represents # the class name. The remaining parameters are arguments passed to the # constructor by the user. In this case there is one user-provided argument, # representing the student's name. The student's name is an # optional argument. Recall that if there are more variables in a list # then there are elements in an array, the excess variables will be # assigned the value undef my ($class, $name) = @_; my $self = {}; # reference to the hash table bless($self, $class); # associate the reference with the package # name is an optional argument so we check to see if it is undef, and if # so, initialize name to be the empty string $self->{name} = ($name || ""); return $self; } #accessor function for name sub getName { my $self = @_[0]; # the first argument is a reference to the object return $self->{name}; # make sure we de-reference the argument using -> # we could also write $$self{name} } sub setName { # the first argument is a reference to the object and the second argument # is the new name for the student my ($self,$name) = @_; $self->{name} = $name; # remember to de-reference the argument using -> } } # use the constructor name to create a new student. $student1 is a reference # to the object returned by the constructor. $student1 = new Student("brad"); # use -> syntax to access a method. Like in C, you can use the -> operator # to access the elements of an object print ($student1->getName(), "\n"); print ($student1->{name}) # frowned on, but shows that Perl has no access protection # here's an example where we do not provide the constructor with # a name for the student $student2 = new Student(); $student2->setName("nels"); print ($student2->getName(), "\n");There are a number of things to observe about Perl's object mechanism: - A constructor can be named anything you want, but by convention it is named new. The constructor should contain a bless command, and should return a reference to the newly created object. The first argument to a constructor is a string that represents the name of the class. This string is automatically created by Perl when you call the constructor. It is a good idea not to hard code the class name, in case the constructor is being called by a subclass. In this case, the class name should be the name of the subclass (an example of how a subclass could call the superclass's constructor is shown in the inheritance section). - The bless command associates a reference, which is usually a reference to a hash, with a class. The class name (really the package name) should be a string. - Once you have used the bless command, you can call methods using the -> operator. - Methods take as their first parameter a reference to the object. Perl automatically passes this reference to the method, so you access user-provided arguments starting at $_[1]. - To create a new object, you use the syntax: constructor_name package_nameIn the above example, the constructor was named new and the package name was Student, so the code to create a new student was: $student1 = new Student("brad");However, if the constructor was called makeStudent, then the code to create a new student would have been: $student1 = makeStudent Student("brad");You cannot overload a constructor name by declaring multiple functions with the same name, but you could create multiple constructors with different names. For example, I could have both a "new" and a "makeStudent" constructor. - Perl has no access protection. By default, all members are public. If you provide accessor and settor methods, you have to rely on the user to access instance variables through their methods. - For larger projects you would not store a class in the same file as the file that uses the class. If you put the class definition in a separate file, you should observe the following conventions: - The file must have a .pm suffix, rather than a .pl suffix. The reason why is explained in the section on modules. - You no longer have to put {}'s around the package, since you now want the package at the top-level. - You will need to terminate your file with the expression "1;". The reason why is explained in the section on modules. Inheritance Inheritance in Perl is obtained using the @ISA array. The @ISA array specifies one or more superclasses, thus permitting multiple inheritance. For example, to define a new class, called HonorsStudent, whose superclass is Student, we could write: { package HonorsStudent; require Student; @ISA = ("Student"); # You should try to use the same constructor name as the superclass. # First call the superclass constructor # and then add new fields. Note that we must assign the result # of the superclass constructor call to $self, or else the rest # of the code will not work properly sub new { my ($class, $name) = @_; # we can access a method by the same name in the superclass by # prefixing the pseudo-class SUPER and :: $self= $class->SUPER::new($name); $self->{awards} = []; # awards is a reference to an anonymous array return $self; } # push the award onto the awards array # It might seem like you should be able to write: # push (@$self->{awards}, $award) # since $self->{awards} returns a reference and the @ would cast the # reference to an array. This code causes Perl to complain however, and # hence the code first assigns the reference to a variable named $ref, # and then casts $ref to an array sub addAward { my ($self, $award) = @_; $ref = $self->{awards}; push(@$ref, $award); } sub getAwards { my ($self) = @_; return $self->{awards}; } } $student3 = new HonorsStudent("yifan"); $student3->addAward("phi kappa beta"); print $student3->getName(), "\n"; $awards = $student3->getAwards(); foreach $award (@$awards) { print "award = $award\n"; }There are a few things to note about Perl's inheritance mechanism: - The superclass should already have a constructor that blesses the object, so you should first call the superclass constructor before doing anything else. Now you can see why it is a bad idea to hard code the class name into the bless function. If you are creating an HonorsStudent object, you want the object reference linked to the HonorsStudent package, not the Student package. - If Perl cannot find a method name in the subclass package, it will search the package names in the @ISA array to locate the method name. It will exhaustively search the ISA hierarchy associated with the first superclass before moving onto the second superclass, and hence name conflicts are resolved by using the first method found. - It is okay to omit a constructor, since the superclass constructor will get called. - Usually you will need to import the superclass package as well as define/modify the @ISA array. You can use the base module to both import the superclass and define/modify the @ISA array: { package HonorsStudent; use base("Student"); ... } Perl Modules The previous section introduced you to packages. Sometimes you may want to create a collection of functions, such as a library of functions, without creating an object. Packages can also be used to perform this task. In general, packages provide a way to divide up your namespace so that you can write functions or variables with the same name and not have them conflict with one another. In Perl packages that are meant to be libraries of functions are typically called modules. When creating modules, here is a list of things to keep in mind: - The file should have the same name as a package. - By convention you should use an uppercase letter for the first character of the package name. - The file should have a .pm extension, which stands for "Perl Module", rather than a .pl extension. When Perl searches for modules, it searches for files with a .pm extension, so .pl files will be ignored. - The file must end with an expression that returns a true value. Typically you end the file with the expression "1;". - Typically you will inherit from the Exporter class, which provides a set of functions for handling the exporting of functions and variables. - Typically you will only export functions, not variables. - If you use the Exporter class, then you will export functions via the @EXPORT and @EXPORT_OK arrays. The @EXPORT array lists the names of the default functions to export, and the @EXPORT_OK array lists additional functions that can be exported if the importing module specifically lists them in a use directive. - If your module represents a class, then you do not have to use the Exporter class. Perl will do the right thing, as long as you use object oriented notation to refer to the module (e.g., you create objects by writing "new Student"). Here is an example package: package Brad; # no quotes # use the Exporter module to inherit functions required to export functions # and variables require(Exporter); @ISA = ("Exporter"); # The default list of functions to export. These functions will be imported # into any module that uses "brad" @EXPORT = ("arraySum"); # Additional functions that can be exported from "brad". These functions will # be imported only if they are explicitly named in a use statement @EXPORT_OK = ("arrayPrint"); # sum the parameter list sub arraySum { $sum = 0; foreach $element (@_) { $sum += $element; } return $sum; } # print the parameter list sub arrayPrint { foreach $element (@_) { print("element = $element\n"); } } 1; # modules must return a true valueYou can import the functions from a module into your namespace with the use directive. Here are several examples of the use directive: use Brad; # imports arraySum -- do not use quotes or the .pm extension use Brad qw(arrayPrint); # imports arrayPrint but not arraySum use Brad qw(:DEFAULT arrayPrint); # imports arraySum and arrayPrintHere are a few things to keep in mind when using the use directive: - If you do not provide a list of functions to the use directive, then the list of functions from the @EXPORT list will be imported into the namespace. - If you provide a list of functions to the use directive, then only those functions on the list are imported into the namespace. Functions on the @EXPORT list that are not in this list will not be imported. - If you use the keyword :DEFAULT in your function list, then all functions from the @EXPORT list will be imported into the namespace. Perl has many pre-defined modules that you can import into your program, such as the CGI module for assisting with CGI scripts. You can also download a wide variety of modules from the Comprehensive Perl Archive Network (CPAN) site. Editing Files from the Command Line Sometimes you want to write a quick-and-dirty Perl script to perform a substitution in one or more files. For example, you might want to change all instances of "brad" to "bvz". You could write a Perl program to do this, but Perl provides a simple way to do this from the command line. For example, the following line will change all instances of "brad" to "bvz" in files with .html extensions and it will save the original files in files with a ".bak" extension. UNIX> perl -p -i.bak -e 's/brad/bvz/g;' *.htmlHere is what each of the options does: - The -p option tells Perl to create a small program of the form: while (<>) { print; }When you do not specify a variable for the <> operator, it reads the line into a default variable called $_. Similarly, when you do not specify a string or variable to print, Perl prints the contents of $_. - The -i option tells Perl to create backup files with a ".bak" extension. If you omit the -i option, then Perl will write to stdout rather than modifying the file. If you want Perl to write to the file without saving a backup, specify the -i option without any extension. The -i flag sets a special variable called $^I to ".bak". The $^I variable is what tells Perl to store backup copies in files with a ".bak" extension. - The -e option tells Perl that the following string is a piece of executable code that should be inserted before the print statement. You can specify multiple executable statements in the string by separating them with semi-colons, or you can use multiple -e flags. Your program now looks like: $^I = ".bak"; while (<>) { s/brad/bvz/g; print; }The $_ variable gets modified in the substitution command since you did not explicitly provide the substitution command with a variable. If you need to do more extensive editing of files, you can set the $^I variable explicitly in a Perl program and do your editing using a similar while loop that reads from files using the <> operator and prints to them using the print statement. Reading perl programs Perl lets you do lots more than what I've detailed. If you start reading random perl programs, you'll notice the use of default variables, such as $_, in procedures, regular expressions, foreach clauses, etc. The best thing I can say is to read the manual before trying to read programs. I'm not a huge fan of many of these shortcuts, because I find it tends to destroy readability, but you make your own decisions. More, more, more There is much more that you can do with perl. We will cover some of that additional stuff, such as file system handling and web scriptiong. However, there is even more, such as support for networking, that we will not cover. The best way to learn is to explore. Enjoy.
http://web.eecs.utk.edu/~bvz/cs465/notes/perl/perl2.html
CC-MAIN-2017-51
refinedweb
8,834
56.89
Let's use a simple program that illustrates the problem (in a file named gdbtest.cpp): #include <cstdio> inline void f1( int *p) { (*p)++; // Line 5 } inline void f2( int * p) { std::printf("%p\n", p); // Line 10 f1(p); } int main() { int i; f2(&i); std::printf( "%d\n", i); // Line 19 f2(0); std::printf( "%d\n", i); f2(&i); std::printf( "%d\n", i); return 0; } Here it's obvious which line is going to cause the segmentation fault, but the program is useful to demonstrate the general technique. Build the executable with: g++ -g -finline -o gdbtest gdbtest.cpp The -finline flag tells g++ to inline the functions even in debug mode. Make sure that core files are enabled by typing: ulimit -c unlimited Now run the program: ./gdbtest The output I get from a run (I'm running 64-bit Linux): 0x7fff2cdee1fc 1 (nil) Segmentation fault (core dumped) Start up gdb with the corefile: gdb gdbtest core gdb displays it's header, etc. at the bottom appears: #0 0x00000000004005fb in main () at gdbtest.cpp:5 5 (*p)++; (gdb) The hex address will probably be different for you. If you type where (or info stack) to see the stack trace you get (user input is in italics): (gdb) where #0 0x00000000004005fb in main () at gdbtest.cpp:5 This is not very useful, there is only one stack frame shown, main's. This does not show us which line in the actual body of the main function is the source of the segmentation fault. Line 5 is the line in the inlined f1 function that is called multiple times. The key to determining the real location is the hex address listed. This is the address of the machine instruction that caused the fault. You can use the info line gdb command to show the source line that maps to a code address. Typing: info line *0x4005fb displays: Line 5 of "gdbtest.cpp" starts at address 0x4005f7 Again the actual address values will probably be different for you. Here gdb f2 which itself is inlined and used in three different places. The problem is to find which of these three places is causing the segmentation fault. The key is to look at the code around the faulting code to determine where we are in main. From the above, we see that line 5 starts at address 0x4005f7, so the previous instruction will end at address 0x4005f6, we can use info line to see what line that is: (gdb) info line *0x4005f6 Line 10 of "gdbtest.cpp" starts at address 0x4005dc This tells us that the line executed before the crashing line was line 10. This is just what we expected, but doesn't tell us which call to f2 caused the crash. If we continue moving backward, using address 0x4005db (the address right before 0x4005dc where line 10 starts): (gdb) info line *0x4005db Line 19 of "gdbtest.cpp" starts at address 0x4005c2 Line 19 is in the body of main and this tells us that it is second call to f2 (line 20) that caused the crash. It appears that gdb has added a new option to the disassemble command, /m that would display the assembly code with addresses mixed in with the source code. This would allow one to easily determine the location. However, this option is not in the most recent version of gdb I have access to (6.8)
http://drpaulcarter.blogspot.com/2009/03/finding-source-of-error-in-inlined.html
CC-MAIN-2017-22
refinedweb
574
77.16
The -use option appears to produce grossly incomplete information. For example, -use on the following produces a page for class JD that claims "No usage of jd.JD". In general there seems to be problems with finding uses in parameter types. package jd; public class JD { public static class Bar { public void foo(JD o) { } } } Name: rmT116609 Date: 02/22/2002 DESCRIPTION OF THE PROBLEM : The "Use" page for a class in the documentation generated by javadoc does not list places where that class is used as an array type. An example in the JDK1.4 API javadocs where I noticed this is for the class java.lang.StackTraceElement: If you click the Use link at the top of the page it will report that there are no uses of the class. This is not exactly true. If you go to the docs for java.lang.Throwable.getStackTrace: You will see that it is used in the API, it's just that it is used in the form of an array. As a user of the Javadocs, you would want the "Use" page to return uses as an array of that type as well. (Review ID: 143203) ====================================================================== Name: rmT116609 Date: 03/15/2002 DESCRIPTION OF THE PROBLEM : It appears that the class-use pages in the Javadoc- generated API documentation were not generated correctly. For example, the class-use page for java.net.URLStreamHandler.html, in the documentation bundle at: says: No usage of java.net.URLStreamHandler However, in class java.net.URLStreamHandlerFactory, method createURLStreamHandler(String) returns type URLStreamHandler. (Review ID: 144245) ======================================================================
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4496290
CC-MAIN-2018-05
refinedweb
262
65.62
I whole new world opens up when you start experimenting with the GPIO (General Purpose Input/Output) pins. By turning them on or off, and sending (or receiving) signals through them, you can interact with other devices and react to the surrounding environment. A Brave New World (GPIO and Sensors) One way to use the GPIO pins is with a piece of hardware called a HAT, which sits on top of the Pi and plugs directly into the pins, adding a new set of functionality. For example, the Sense HAT provides multiple sensors and a grid of RGB LEDs (they can be set to any color), and is even being used on the ISS by ESA astronaut Tim Peake as part the Astro Pi competition. A second option is to buy a kit with random peripherals that you can connect to, and signal through, the GPIO pins. Kits vary, but generally include a breadboard, LEDs and resistors at a minimum. Some offer switches, small motors and fans, sensors, and more. You can get a Raspberry Pi 2 ultimate starter kit by Vilros for $60 (highly rated), or a Raspberry Pi 3 ultimate starter kit runs $90. Go for the Pi 3 unless cost is an issue and you want to save some money. Once you have the Pi in your hands, you’ll also have everything you need to experiment with it. Since I didn’t buy the breadboard originally, I bought a separate kit from CanaKit that included everything below. The small bag has a variety of LEDs and resistors. The main difference is that the HAT provides an out-of-the-box set of features, whereas the kit takes longer to setup but allows you to customize the configuration. And you don’t have to choose one or the other, as the HAT leaves the GPIO pins accessible. The kit above cost me about $20. There are less expensive options like the CamJam EduKit that runs about $7, which is good for a tight budget, but the kit I got comes with more of everything, as well as a cobbler and ribbon cable. The Cobbler Sounds like the villain out of a Batman movie… The cobbler is the black T-shaped device above, sitting on the red padding material. They can come in different shapes and sizes, like this smaller one for the original Pi. The images below, from the CanaKit product page, show it in more detail. It plugs into the breadboard, bridging all 40 pins from your Pi to the breadboard. Cobbler and ribbon, connected to the Pi Without a cobbler, as with the EduKit set, you’ll have to connect individual wires from the GPIO pins on the Pi to your breadboard. That’s not difficult, and would allow for more flexibility depending on what you’re trying to do, but it could be tedious and an unnecessary step. The cobbler eliminates wires that might get tangled up, and the one I got is clearly labeled, so you can tell at a glance which GPIO pin is mapped where on the breadboard. Anyway, I got my kit quickly (thank you Amazon Prime!) and pulled it out this weekend to try the “Hello World” of Pi hardware… Blinking an LED (Hello World) Making an LED blink is simple once you know how, and it’s about the smallest project you can complete that makes your Pi do something in the outside world. If you don’t have one of those cobbler boards, then you can just follow along with the tutorial at The PiHut titled “Turning on an LED with your Raspberry Pi’s GPIO Pins“. It’s short, has good images demonstrating where everything goes, and even includes a nice explanation of what each line of the short Python program is doing at the end. Read through it once or twice and go for it! In my case, there was no need to make the connections from the Pi to the breadboard, seen as black and orange wires in the tutorial. The cobbler takes care of that. But I did stare at the diagram for a few minutes, trying to envision how to modify it without accidentally frying something. Breadboard Setup Unlike the tutorial, I used pin 21 for the longer (anode) side of the LED (again, read the tutorial first), then connected the shorter (cathode) side to an empty row. This allowed me to add a resistor to the same row as the cathode side, and then complete the circuit by connecting to one of the “ground” terminals. Hopefully that makes more sense once you take a look at the image below, showing my setup. Also, if you’re wondering why to even bother with the resistor, I was too. From what little I understand, once the LED lights up it offers no resistance at all, so you’ve basically got a short-circuit. Things may work for awhile, but you could drastically shorten the lives of both the LED and the Pi. From the aforementioned tutorial:. Ultimately, here’s how I laid it out. The resistor I used was only 220 Ω (the tutorial recommends 330 Ω), but it worked okay. Python Script After you create the circuit, you still need to signal the GPIO pin, in order to turn on the LED. I wrote a short program (modified from the tutorial), which loops 10 times. Each time, it signals pin 21 once to turn the LED on for a quarter-second, then again to turn it off for a quarter-second. The effect is a light that blinks twice a second for 5 seconds. import RPi.GPIO as GPIO import time pin = 21 # The pin connected to the LED iterations = 10 # The number of times to blink interval = .25 # The length of time to blink on or off GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(pin, GPIO.OUT) # The parameters to "range" are inclusive and exclusive, respectively, # so to go from 1 to 10 we have to use 1 and 11 (add 1 to the max) for x in range(1, iterations+1): print "Loop %d: LED on" % (x) GPIO.output(pin, GPIO.HIGH) time.sleep(interval) print "Loop %d: LED off" % (x) GPIO.output(pin, GPIO.LOW) time.sleep(interval) Console Output Here’s the output that prints to the console while the LED blinks. That last word, “scrot”, is the command for taking a full-screen capture with the Scrot app in Raspbian. It’s Aliiiiive! And finally, here’s the LED blinking on and off. Success! With a newfound sense of invulnerability, I plugged two LEDs in. I just wanted to see it operate both, and it did, albeit the green LED seemed a bit dimmer. When I tried to use blue with red or green, the blue didn’t light up. I assume that’s because it uses more power than the resistor was allowing through. If I’m wrong about that assumption, I’d be interested in hearing the real reason. I assumed all the LEDs were identical other than color, but the blue is brighter than the red or green. And there’s a white LED with four wires that I haven’t tried it yet, but I’d bet it’s brighter than blue. Where can I purchase the. Where can I go from here? Try out these easy projects, to get more familiar with the Raspberry Pi: - Building a Morse Code Transmitter on a Raspberry Pi - Generating Morse Code on the Raspberry Pi Using a Button on a Breadboard - How to Flash an LED on Your Raspberry Pi When You Get New Email What else did I learn this week? More (completely random) things I learned this week. Taking Screen Captures in Raspbian If you want to be able to take screen shots on the Pi, you need to install an app called “scrot”: sudo apt-get install scrot Then just run “scrot” from the command line and it’ll take a full-screen capture and place it in the current working directory, wherever you happen to be in the command window when you call the command. The GPIO Library (aka, don’t reinvent the wheel) There’s a Python library called Rpi.GPIO that makes it easier to access and manipulate the GPIO pins. Here’s a few useful commands: import Rpi.GPIO # You have to import the library to use the commands in it GPIO.setmode(GPIO.BOARD) # Recommended! "Board" numbering mode, consistent between models GPIO.setmode(GPIO.BCM) # "Broadcom" numbering mode, could change between models of Pi GPIO.setup(13, GPIO.OUT) # Set the pin direction. In this case, sending signals out. GPIO.output(13, True) # Turn the pin "on". Could use: True/False, 1/0, GPIO.HIGH/GPIO.LOW Courses, Demos and Random Notes - Demo of an LED blinking, as seen in The Raspberry Pi Platform and Python Programming for the Raspberry Pi course on Coursera. - Interfacing with the Raspberry Pi, another course on Coursera. Now that I’ve got the breadboard, I’ll be trying this out. - I’m also taking Programming for Everybody (Getting Started with Python) on Coursera. - Tkinter Library, a Python library for GUI development (no clue about this yet, just noting it) When programming in Python, there are online Python editors. Personally, I just installed the free PyCharm IDE from JetBrains. By using VNC (Virtual Network Computing) and following a tutorial on How to give your Raspberry Pi a Static IP Address, I’m now able to connect to the Pi from other machines. Maybe I’ll write something up on how I did that. It’s convenient to not have* *to plug it into the TV or use a spare mouse/keyboard with it unless I want to.
https://grantwinney.com/hello-world-for-the-raspberry-pi-making-an-led-blink/
CC-MAIN-2019-18
refinedweb
1,636
69.21
How to auto adjust images in imageJ?897927 Nov 3, 2011 3:04 PM Hello, I would like to know How can I adjust the contrast and brightness in imageJ using a Java application? imageJ has Best Regards, I would like to know How can I adjust the contrast and brightness in imageJ using a Java application? imageJ has and inside it anand inside it an ContrastAdjuster.java function which is not public, so I cannot call it? any one has experience with this?function which is not public, so I cannot call it? any one has experience with this? autoAdjust Best Regards, This content has been marked as final. Show 2 replies 1. Re: How to auto adjust images in imageJ?896874 Nov 4, 2011 3:27 AM (in response to 897927)Your calling class needs to be at that access modifier allowance , since your caller probably isn't, you can make a small class with that access level(no specifier - is between protected and private) to join it that you can reference with your caller package level, or probably better, a nested class of that access level in your caller class with global scope instantiation in your caller. *// not all syntax is here - This just to give you a guide of the type of access specifier shuffling and reprocessing to obtain the methods variables at the same level as obtaining the ability to call the method , it may be more practical to target the class in imageJ that instantiates the ContrastAdjuster class and simply obtain its reference to ContrastAdjuster* *//ContrastAdjuster adj - should be passed from wherever it is instantiated , presumably its in a higher level class frame in the application* public class IwasCalling{ CallAutoAdjuster callAUTContraster; public IwasCalling(ContrastAdjuster adj){ callAUTContraster = new CallAutoAdjuster(); } //start nested class class CallAutoAdjuster{ void callAutoAdjuster(){ autoAdjust(imp,ip); // ImagePlus imp , ImageProcessor ip }//end method }//end nested }//end iwascalling Edited by: 893871 on Nov 3, 2011 6:53 PM After taking a good look at the .java files --i find the doAutoAdjust variable requires to be set in the public class ContrastAdjuster and call notify()-- ..and i have no idea how i lost the plot there... it was the contrast slider value you wanted so a method would be from some class you create Edited by: 893871 on Nov 3, 2011 8:15 PM // contr is the reference to the ij plugin frame extended from JFrame that ContrastAdjuster.java extends from // public int adJustContrast(int slideVal){ // this listener method sets an int in ContrastAdjuster public synchronized void adjustmentValueChanged(AdjustmentEvent e) // with the line contrastValue = contrastSlider.getValue(); // int sliderRange = 256; this global int is divided by two appears to be the Max for contrast and the or a scrollbar appears to be a make-shift slider value changer contr.contrastValue = slideVal; // global accessible int in ContrastAdjuster return contr.contrastValue; } public boolean adjAuto(){ contr.doAutoAdjust = true; return contr.doAutoAdjust; } public void updateNotifyComm(){ // now update the app contr.notify(); } //............... so you would call from somewhere to do it by this after making those methods adJustContrast(contr.contrastSlider.getValue()); updateNotifyComm(); // or just running code of contr.notify(); // i have no idea how that became boolean doAutoAdjust in my mind // for auto adjust adjAuto(); updateNotifyComm(); Edited by: 893871 on Nov 3, 2011 8:17 PM Edited by: 893871 on Nov 3, 2011 8:23 PM 2. Re: How to auto adjust images in imageJ?897927 Nov 4, 2011 11:23 AM (in response to 896874)Thank you for your assistance, I was able to find a simpler way to do that, thanks to imageJ developer Wayne Rasband, Recording a macro will generate the java code which can be used in the java application: Best Regards, IJ.run(imPlus, "Enhance Contrast", "saturated=0.35");
https://community.oracle.com/thread/2308263?tstart=15
CC-MAIN-2017-09
refinedweb
623
50.26
All the objects that are stored in a computer are ultimately converted into binary numbers which are sequences of 0s and 1s. Each digit in a binary number is stored on one bit of the computer memory. A bit is defined as the smallest unit of memory in a computer. In fact, computer manipulates a number by manipulating the bits on which the number is stored. In control systems also we often need to use operators to manipulate bits. The C language provides six bitwise operators to manipulate the bit patterns of integral values (integers and characters). They include not, i.e., complement(~), and (&), or (|), exclusive or, i. e., xor (^), left shift (<<) and right shift (>> ). These operators work directly on the bit patterns of the operands, i. e., on sequences of bits (0 and 1) representing the operands. In addition, C language provides five compound assignment operators (&=,| =, ^=, <<= and >>=). The complement operator (~) is a unary prefix operator and is used, as in ~a, whereas all other operators are binary infix operators and are used as in a op b. First consider these bitwise operations on individual bits. The bitwise and operator evaluates as 1 if both operands are 1, and zero otherwise. The bitwise or operator evaluates as 1 if either or both operands is 1, and zero otherwise. The bitwise xor operator evaluates as 1 if either of the operands (but not both) is 1, and zero otherwise. Finally, the bitwise not operator complements the value of the operand, i. e., it returns 1 if the operand is zero and vice versa. These operations are summarized in Table. While working with integral numbers, the bitwise operations are performed on all bits. As we know, char values are represented using 1 byte (i. e., 8 bits), int values using either 2 or 4 bytes, short int using 2 bytes and long int using 4 bytes. These values may be signed or unsigned. However, the working of binary operators is illustrated here using 4-bit numbers a and b having decimal values 11 (binary 1011) and 7 (binary 0111), respectively. The bitwise and, or and xor operations are performed on corresponding bits of two integer operands by applying bit operations, as shown in Table. Thus, a & b (i. e., 1011 & 0111) evaluates as 0011, i.e., decimal 3 as shown in Fig. Also, a | b evaluates as 1111(decimal 15) and a ^ b evaluates as 1100 (decimal 12). The complement operation is performed on all the bits of a number. Thus, the expression ~a evaluates as 0100 (decimal 4). This complement operation is also called as l's complement. The left shift (<<)and right shift (>>) are binary infix operators used, as in val << n and val >>n. They shift the bits in the first operand (val) by a number of bit positions specified in the second operand (n). Note that when a value is shifted left, the empty bit positions on the right are filled with 0 bits. Also, the bits that move out of the number are lost. Thus, expression a << 1 left-shifts bits in variable a (binary 1011) by 1 bit position to obtain 0110.(decimal 6) and expression a << 2 left-shifts bits in variable a by 2 bit positions to obtain 1100 (decimal 12) as shown in Fig. The working of the right shift operator depends on whether the number being shifted is signed or unsigned. When an unsigned number is shifted to the right, the empty bit positions on left (i. e., MS bits) are filled with 0 bits. This shift is called logical right shift. Also, note that the bits that move out of a number are lost. For example, assuming that variable a (binary 1011) is an unsigned int variable, the expression a>> 1 evaluates as 0101 (decimal 5) and a>> 2 as 0010 (decimal 2). When a signed int is shifted to the right, the bits are shifted as usual, except that the MS bit is copied to itself. Thus, the empty MS bit positions all become equal to the sign bit. This shift is called the arithmetic right shift. For example, assuming a (binary 1011) and b (binary 0111) to be signed int variables, the expression a >> 2 evaluates as 1110 and expression b >> 2 evaluates as 0001. Observe that a right shift by 1 bit position is equivalent to integer division by 2. Also, a left shift by 1 bit position is equivalent to multiplication by 2, provided the most significant bit of the number being shifted is 0. The bitwise compound assignment operators are similar to other compound assignment operators. For example, the assignment expression a & = expr is equivalent to the expression a= a & (expr). The bitwise complement operator is a unary operator and has the precedence and associativity as other unary operators. Thus, its precedence is higher than the arithmetic operators and it has right-to-left associativity. All other bitwise operators have left-to-right associativity. The precedence of the bitwise shift operators is just below that of the arithmetic operators and higher than that of the relational operators. The bitwise and, xor and or operators have precedence (in that order) below that of the equality operators (== and ! =) and above that of the logical operators (&& and ||). Finally, the bitwise compound assignment operators ( &=, ^=, |=, <<= and >>=) have the precedence and associativity as other assignment operators. Thus, they have precedence below that of the conditional operator (? :) and above that of the comma operator (,) and right-to-left associativity. Let us now understand how we can set, reset or complement a specific bit at position pin a given number, without affecting other bits in it. For this, we need to perform a specific bitwise operation between the given number and another value called a mask. The mask should usually have the same size in bits as that of the number being operated on. One of two masks will be used depending on the operations to be performed - one mask having 1 bit at position p and 0 bit at all other positions and an other mask with 0 bit at position p and 1 bit at all other positions. For example, for operations on bit position 2, we require either 0000 0100 or 1111 1011 as the mask. These masks can be easily obtained using the bitwise left shift operation on number 1 which has a bit pattern of 0000 0001, i.e., 1 bit at bit position 0 and 0 bit at all other positions. Thus, to obtain a mask with 1 at bit position p and 0 at all other positions, we use the expression 1<< p. We can complement this mask to obtain a mask with 0 at bit position p and 1 at all other positions using the expression ~ (1<< p) . Now, to set a bit at position p in a given number num, without affecting other bits in it, we use the bitwise or value of a with a mask having bit 1 at position p and 0 at all other positions, as shown in Fig, using the following statement. num = num | (1 << p); Note that the parentheses in the above expression are redundant but they improve readability. Alternatively, we can use the compound assignment operator |= as shown below. num | = 1 << p; /* set bit at position p */ We can use the above mask and the bitwise xor operator to complement (toggle) a bit at Position p without affecting the other bits as num ^ = 1 << p; /* complement bit at position p */ To reset a bit at position p without affecting the other bits in a given number num, we need to perform a bitwise and operation between num and the mask having 0 bit at position p and 1 at all other positions using the following statement. num &=~(1 << p); /* reset bit at position p */ To test the value of a bit at position p in number num, we check the condition num & (1<< p). If this expression is non-zero, the bit at position p is set; otherwise it is 0. We can perform this test on all bits of a given number num using a loop as shown below. mask = 1; for(b = 0; b < 8 * sizeof(num); b++) { if ( (num & mask) > 0) { /* bit b is 0, perform desired operation */ } else { /* bit b is 1, perform desired operation */ } mask <<= 1; } Note that the parentheses in the test for the if statement are essential as the > operator has a higher precedence than the & operator. Alternatively, we can write this test simply as if (num & mask) If the mask has same size (in bits) as that of num, we can alternatively write the above for loop in a concise manner by eliminating loop variable bas shown below. for(mask = 1; mask> O; mask<<= 1) { if (num & mask) { /* bit b is 0, perform desired operation */ } else { /* bit b is 1, perform desired operation */ } } Sometimes we may wish to process the bits in a given number from left to right. For this, we need to take a mask with a 1 bit in the MS bit position and 0 at all other bit positions. This can be achieved by shifting number 1 left as shown below. mask= 1 << (8 * sizeof(mask) - 1) Note that to shift this bit right one bit position at a time, we have to use a logical right shift operation in which the empty MS bit positions created by the right shift are set to 0. Hence, mask should be declared as an unsigned variable. Example of test the bits in a number a) Count the number of zeros and ones in a binary representation of a number A program to count zeros and ones in a binary representation of a number is given below. #include <stdio.h> int main() { int num; int zeros, ones; int b, mask; printf("Enter an integer number: "); scanf ("%d",&num); ones = 0; mask = 1; for(b = 0; b < 8 * sizeof(num); b++) { if (num & mask) ones++; mask <<= 1; } zeros= 8 * sizeof(num) - ones; printf("Zeros: %d Ones: %d\n", zeros, ones); return 0; } We can also write a function count_lbits to count the number of ones in the binary representation of a number as shown below. int count lbits(int num) { int ones, mask; ones = 0; for(mask = l; mask > 0; mask<<= 1) { if (num & mask) ones++; } return
http://ecomputernotes.com/what-is-c/operator/c-bitwise-operators
CC-MAIN-2018-17
refinedweb
1,727
60.35
Help Framework HOWTO Introduction This document has been reviewed for maemo 3.x. Various services are available for software developed on the maemo platform. One of them is the Help Framework, a context based help system, which can be easily used in any application.. This document is a short guide for using the Help Framework. It focuses on the explanation of the various steps necessary to enable this feature in your application, by going through an example in which a small program is written to use the framework. Also the XML format in which the help content is actually written is explained. The current version of this document was updated specifically for maemo SDK version 3.x, and it is subject to changes, as new versions of the SDK become available. The examples discussed in this document can be downloaded from help-framework downloads. Creating the Help File The help file is an XML document, with various pre-defined tags, used to aid the creation of help topics. The example below shows the format this file must obey: <). Here we've created the osso_example_help context UID that will be used in our application. In addition to the tag, below is a list of available tags with a short description: - folder Contains help topics, one or more. - title Title text for the folder to be shown in the Help application's Contents list, usually the name of the application. - topic Single help content to be shown for the user. Every topic can be referred via its unique contextUID. - topictitle Title text for the topic to be shown under the main title in the folder list. - heading Can be used in long help pages to separate different subsections. Note that headings aren't needed for all topics because the topictitle is used as a topic's main heading. Headings are formatted with different color and bigger and bolder font. - display_text Used for presenting text that appears on the device display, like button labels etc. Display text is formatted with a different color in the Help application. - graphic Used to show in-line images among the text. You have to define either the absolute path . - tip Shows a "Tip:" prefix. - note Shows a "Note:" prefix. - important Shows an "Important:" prefix. - example Shows an "Example:" prefix. - warning Shows a "Warning:" prefix. - ref Used to create a cross-reference, 'refid' parameter defines referred topic's contextUID and 'refdoc' parameter is the name of the reference. - emphasis Used to emphasize the text. - ossohelpsource Main XML tag for the help files. - change_history Change history of the help content. Used only by help content authors (see change). - change Entry on change_history. - synonyms Synonyms are only used by Global search and aren't shown for the users. Synonyms are extra keywords for search. Also common HTML tags like <b> for bold text and <i> for italic can be used. The link to the example files is in the end of this document. Adding help context support into the application In this section we will demonstrate, how to create an application with an online help system. This application will use the XML file described in the previous section. To use the online help system on the maemo platform, it is necessary to include the following header files into your application: #include <libosso.h> #include <osso-helplib.h> The header file libosso.h provides the environment initialization for the user. Next, after including these files into your source code, we our application you need these two steps: - Initialize the GTK+ library by calling the function gtk_init(). - Initialize the application context using osso_initialize(). In the following example you can see in details how this initialization must be done:; } Now we are able to use the maemo help system. To show one of the topics from our help file, you just need to call the function ossohelp_show(), as per the example below. In case the topic is not available, the function ossohelp_show() will return into the main function to create a button to activate help: /* add a Help button */ help_button = gtk_button_new_with_label("Help"); g_signal_connect(G_OBJECT(help_button), "clicked", G_CALLBACK(help_activated), OSSO_HELP_TOPIC_EXAMPLE); The next step is to add a help button into a dialog box (symbol '?' at the upper right corner of dialog box). The process is quite simple: just enable the button in the dialog box with the function ossohelp_dialog_help_enable(). In the example below, we show how this can we only need to compile our example: gcc `pkg-config --cflags --libs hildon-libs libosso libossohelp` \ -o example_help_framework example_help_framework.c Since the SDK 2.0 it has been possible to test the help system in the scratchbox, too. You can download the example application and code snippets from here: Distributing the example application To quickly test your help content you can manually copy the XML file to a correct path (e.g. /usr/share/osso-help/en_GB/) where it can be found by the help library. You may have to create these directories manually if testing in scratchbox. Replace the en_GB path by the correct language definition if your help is written for some other language. When you start your newly created application (or Help application) you should be able to show your help content. The easiest way to distribute help file and application is to create an Application Manager package. Improve this page
http://maemo.org/development/documentation/manuals/3-x/howto_help_framework_bora/
crawl-003
refinedweb
888
57.37
>>. obligatory (Score:4, Funny) programming language fans [github.com] I never thought I'd see the day (Score:5, Funny) Re: (Score:2) But seriously, if you're using PHP and you start worrying about The Rules, you've thrown out your only reason for using PHP at all. Re: (Score:3) Re: (Score:2) if you are using PHP and want purity with the ease of scripting language, you seriously need to jump ship. Whoops, I think you meant to link to this site [slashdot.org] FAILjoke. (Score:2) welp, I messed that joke up. (also, am I the only one who hates that infernal "Slow down cowboy. Its been 1 minute since you last posted" nonsense :( ") Re: (Score:2) Re: (Score:2) if you are using PHP and want purity with the ease of scripting language, you seriously need to jump ship [codehaus.org]. If someone is using PHP and is open to jumping ship, they're going to jump to another server-side web programming language. But they're idiots, so odds are it will be another steaming pile, probably ASP.net and VB. And there's nothing "pure" about anything related to Java; only managers think all that enterprisey crap is "pure." Java is fundamentally object-oriented, and that means it has no foundation in mathematics. Groovy just takes Java's original terrible idea and doubles down on it. And let's not even t: (Score:2) absolutely. I think its partly due to the 'programmers' not being able to do a good job int he current tech they use, so they blame it and then start looking for the next one - which is also why a lot of people insist that a complete rewrite is the only way to go. .. every time. The flaw lies not in the "legacy" code, or the "outdated" technology but in the people involved. While I don't give a fig for those guys, new entrants to the IT workforce are picking up the meme that "you can only do good work in the l Re: everywhe Re: (Score:2) Really, if you claimed that you would be a better driver if only you had a proper car, every real driver would laugh at you. Instant poloroids are used by the pro's. Some serious art is produced with nothing but paper and charcoal. It's interesting that you bring up cars, because we're not talking about driving a car, but building one. When an automaker builds a car, they don't reinvent the wheel unless there's something wrong with the old one. Parts like steering columns, any kind of electrical part, garnishes like door handles and map lights, and even glove box doors might be borrowed from another vehicle. Automakers clearly comprehend the value of a framework. Indeed, a single chassis design might be sold under several different na PHP supports closures (as of 5.3) (Score:3) As a coder-purist snob myself, my opinion is that using PHP disqualifies you from being either of the three. Honestly, why would you build a framework in a cobbled-together templating language? So where's your closure support, Java? C++? Even ObjectiveC and *javascript* support closures, for crying out loud (something as cool as jQuery wouldn't exist without closure support). Functional programming is a serious win for code reuse and extensibility. Re: (Score:2) You get the same thing with class instances. What's with the buzzword? Re: (Score:2) Because you don't get the same thing. By your logic it would be valid to say of class instances, "You get the same thing with struct pointers. What's with the buzzword?" At best class instances offer a very limited subset of functionality that true closures provide. Worse still, even the attempt at replicating the basic functionality of a closure using class instances requires much more (and far less clear) code. In many languages the attempt implies spaghetti coding. Re: (Score:2) By your logic it would be valid to say of class instances, "You get the same thing with struct pointers. What's with the buzzword?" Not really, sure a struct is effectively just a class but a pointer is not the same - or even close to the same - as an instance. Re: (Score:2) To hell with ALL of you puppies! (Score:2) If you're not at LEAST using a punch card and tape system, you little spoiled weasels are doing it wrong! I remember when we hand-encoded the bits on the drive with magnets! AND WE WERE THANKFUL FOR THE MAGNETS! There was even a time when we had to create the interface on the screen, on the fly, by hand-aiming the gun in the back of the a CRT! In the snow! Up hill! BOTH WAYS! AND WE WERE THANKFUL FOR IT! This precompiled code stored in binaries and libraries thing sounds dodgy. It'll never last! Re: (Score:2) Re: (Score:2) And your audio playback lacks punch; remember to use the water smoothed igneous rocks instead of the sedimentary ones. Re: (Score:2) jQuery is first-and-foremost a query language that merges 3 or 4 haphazard web namespaces into a single easy to use query-syntax. It's basically xpath on steroids. This plus a wealth of library operations that allow DOM / style manipulation in a more concise manner than straight-javascript and, of course, in a cross-browser manner.. THIS is what makes jQuery cool. This drew the attention of developers which created a wealth of modules that Re: (Score:3) The C code is very different from the Javascript code, because the 9 is bound at compile time. What makes a certain function a closure is how you can have multiple instances of the same function with different variables bound to it. Furthermore, since they bind to variables, changing the value of the variable outside the closure is reflected inside it: Re: (Score:2) True, but I've always considered this a negative.. The exact opposite of compartmentalization and data-hiding. Introducing bugs because it can cause unwanted surprise. function foo(x) { var v = function() { return x + 9; }; for (; x > 0; x--) { } ; return v; } Obviously contrived because I"m lazy, But in a sufficiently large function this type of bug is not uncommon. I more prefer th Re: (Score:2) Re: (Score:2) Plenty of great software has been written in C++, a language I think even its inventors would admit is "cobbled together." Re: (Score:2) I've recently gone back to C++ programming after 12 years of perl/python/PHP/Java/bash/SQL. O.M.G. do I hate C++. All these other languages were created in response to C/C++'s common-coding pitfalls. String processing, memory management catch-22s, loose coding contracts, horrid cross-platform capability (Windows/Linux/Mac might as well Re: (Score:2) It's interesting you should mention the OS issue. At my day job, I develop FLOSS software in a language called Vala. It's a source compiler that compiles a Java/C#-like OOP language into C. So you get the optimization and compatibility of C code with the pleasantness of a modern language. Perfect? No, but I think it's a step in the right direction, and you *could* program an OS in Vala. Re: (Score:2) That being said, I'd hate to see an OS written in anything other than C Then you'll hate this :) Cosmos is an operating system project implemented completely in CIL compliant languages. The team is committed to using C#, however any .NET language can be used. It does compile AOT, though. Re: (Score:3) There has been several, though no mainstream ones really. C was the first truly portable language and gave us the first portable OS (Unix) until then all OS's were written in machine code for a specific platform. Since then though there were quite a few OS's written in other languages. Sometimes for purely academic research, sometimes just for fun, some as serious projects with real users (though granted not a great many of them). XEROC wrote their PILOT system in Mesa. PERQ was written in Object Pasca Re: (Score:2) As a coder-purist snob myself, my opinion is that using PHP disqualifies you from being either of the three. Honestly, why would you build a framework in a cobbled-together templating language? Because PHP runs _everywhere_. Modern PHP has very little in common with the cobbled together PHP+HTML messes we used to se back in the 90s. Sure, it has it's share of warts, but if you'd care to educate yourself you would find that you can do very professional work on PHP with very professional tools. I've yet to see something that rivals Zend Studio combined with Zend Debugger when it comes to tracking down a weird issue, even on a remote server. My favorite language is Python, but to dismiss PHP completely Re: (Score:2) Re: (Score:2) PHP runs everywhere on the web but it certainly doesn't run everywhere like Java or even Python. There is no such thing as a language that can do everything well but Python, for example, is a damn sight closer to that idea than PHP. PHP really is only good at making web pages and not much else. True, but judging from TFA the whole thing was about web frameworks, IMHO. :) So I guess I should clarify: PHP will run on almost any available web hosting out there. Big potential user base = Good Thing. Re: (Score:2) Re: (Score:3) Re: (Score:2) > If you can't handle allocating and managing memory, you don't deserve the right to call yourself a programmer. Part of the point of Java was that programmers didn't have to worry about allocating and managing memory. Unless you're a JVM developer you shouldn't have to worry about it. The machine should throw an exception if it reaches capacity and you should have your code designed to deal with it. Don't get me wrong--I prefer managing my own memory (unless I'm scripting) at a level around that of C or And they have great timing (Score:2) And the article hits Slashdot just as they take down the Drupal servers for a 12 hour migration to Git. That's some good timing. Re: (Score:2) : (Score:2) Re: (Score:2) On a more serious note: MrEricSir, how much do you charge? I need you to rewrite the content on my website. We all know buzzwords sell! I'm just not that savvy, I guess.. Re: (Score:2) We need to aggressively move forward in a proactive manner on this one, guys, so let's call a kickoff meeting to identify key stakeholders and brainstorm strategy. I have a three-hour slot open next Friday afternoon. Re: (Score:2) Re:"Framework" isn't just a buzzword... (Score:5, Funny) Bingo! Re: (Score:2) OK, I'm interested. How can this help me leverage the cloud? Re: (Score:2) Greatest use ever of the phrase "paradigm shift": NewTek Revolutions - Video Toaster Demo [youtube.com] That was the first time I ever heard it and I fell in love. Everything even remotely interesting that my friends and I did during the 90's would at some point be called (in deep sonorous tones) a "paradigm shift". I was ever so pleased when it became a weasel buzzword. framework (Score:3, Interesting) What. [apple.com] I know that's not what you were really asking... Re: (Score:2) "If you wish to converse with me," said Voltaire, "define your terms." For a lot of people (readers of the design patterns ideas) a framework is a set of whatever things that help/enforce a well proved design, so you don't have to invent a new design for a lot of well known requirements presented on most applications. That's a bit different (but not much!) from a library or toolbox that helps to implement whatever design. Of course, people may assign another definition or concept to the term... Re: (Score:2) Re: (Score:2) I wasn't aware that the first usage of a word fixed its meaning for all time. Add to that the fact that the word was used in relation to buildings long before the time you're referring to and the only reasonable conclusion is that you're full of shit. Re: (Score:2) So it's a half-finished app that you need to finish in order to get it to do anything useful?. Re: (Score:2) a Re: (Score:2) Go GROOVY/GRAILS [grails.org]!! (my plug) Re: (Score:2) Well, I do think of myself as moderately technical, and there are two reasons: So, thanks! I'll check it out. Might be very useful. What is a framework? (Score:2) Oh, and if our products have a similar feature, but you use different words to describe it than I do, yours is also disqualified. Video Direct Link (Score:2) Here is the video, in case you can't reach his smoldering server: [vimeo.com]. Re: (Score:2) Re: (Score:2) You know you're right. I know you're right. The problem is that there are so many horribly inexperienced, disorganized, and utterly belligerently incompetent web programmers out there that they give the few of us who actually know our asses from a hole in the ground a bad name. The perception amongst the broader small and medium sized business community (a.k.a. 90% of all available clients) is that if you're not using a framework you can't possibly know what you're doing. They think there's no possible Re: (Score:2) They think there's no possible way someone could be experienced enough to make a secure, efficient, and stable website simple enough that it might cost less to build it from scratch and maintain it than the "equivalent" product created via an infinite amount of Joomla or Drupal customization. What they're more concerned about is whether the next guy to come down the pipe will be experienced enough to quickly pick up your code-base & make the needed changes effectively. If you use a standard framework, you're quickly, cheaply & easily replaceable. Re: (Score:2) While that's true in theory, my rough estimate based from first-hand experience is that only around 15% of the deployments of these "standard frameworks" stay standard enough for that to be true. The rest of the time the client expects the full customization capability of a site written from scratch along with this supposed "easily replaceable" coder. The code base tends to end up getting chopped all to hell and by the time they're done (IF they get done) it no longer shares enough in common with the offi Re: (Score:2) Drupal's backend management was confusing for me to use let alone trying to teach most typical users. For large, complex sites, yeah, it's something to consider. But if I'm building a personal site or a small site I can get wordpress up and running well in under 15 minutes. Even less if the account has a control panel with auto installer. Everytime I've tried to use Drupal it seems like I spend just as much time figuring it out and performance tuning than I do actually creating content. Drupal is a jack of all trades (Score:3, Interesting) Re: (Score:2) My company creates web pages (read: web systems). We only save time not using Drupal as our framework, when we are creating some kind of static advertising page. Other than that, no time saved. This is especially true for sites which are going to "stay around for a while". So I agree with you. Simple web pages, no Drupal. To sum up what kind of web pages I would consider Drupal an overkill: A singel page with some text and/or images. If the page was to look like this, I would immediately reach out to Drupal: Any Re: (Score:3) Maybe you should take the time to actually learn how Drupal works. Yes, it's hard to work with, if you do not understand the concept of hooks. Almost impossible actually. I've taken enough time to learn how Drupal works to know I don't want to work with Drupal. Wordpress works better for basic content management that clients can easily use without calling me all the time. Plus, it's more easily theme-able than Drupal is out of the box. Add to that the ease with which my clients can change themes or add plugins and Wordpress far outshines Drupal in basic content management. (And it appears to run better, too.) For custom content management I either find an already in place pr So... (Score:2) Drupal developer is good at using the tool he helped build! News at 11! Actually... (Score:3, Interesting) (This post contains shameless self promotion) I think GUI elements are an essential part of a web development framework nowadays. I maintain a small open source CMS called Enano [enanocms.org]. It's very basic, but during the course of its development I've written a ton of GUI building-blocks, among other frameworkey things, and documented the APIs for them so that plugins can use the same features. Regarding the GUI elements, I think consistent interfaces are an important part of any web application. Thus, what better way is there than to use a good, solid framework that, among its other jobs, takes care of some of the GUI design ugliness for you? Stuff like a standard way to present and validate forms, show message boxes, log in users, provide visual feedback for a process, etc. In my opinion, a framework should do more than just provide a bunch of random pick-and-choose APIs that you can use. It should take care of the boring details you don't want to have to rewrite for a web app, like user account management, sessions, user data, database abstraction, that kind of thing. That's why people are writing applications using software like Drupal and Enano: they want to write a web app that does what it needs to do without having to reinvent the wheel. I'm currently using Enano as the foundation for an e-commerce site (contracted project). Yeah, eating my own dog food, but shows that it can be easy to take something like Enano/Drupal/Wordpress and use its existing, established core features to write a whole new application that uses those features. Yes, I've used a more traditional framework before (CodeIgniter). It's great, and I love its design for basic applications, but you still have to write your own user management and a lot of other prerequisites to create something like an e-commerce site. In contrast, I've developed the entire e-commerce plugin with about 50-60 hours of work, including a couple of very minor modifications to the core. Re: (Score:2) Totally agreed. If, in this day and age, you're making a website from scratch, you're doing it WRONG. Exception only for specialized web applications that try to do "thick client" stuff on the web (let say something like gmail). For normal public facing sites, or intranets, if you don't use a CMS, you'll have to replicate basic stuff for nothing. Sure, stuff like ASP.NET or PHP/Ruby/Python/Whatever frameworks will handle low level authentication, data access, navigation and whatsnot, but a CMS will give you a Re: (Score:2) First I saw: and then I saw this: Now, I've only used a couple PHP frameworks and only done anything with one particular CMS (don't even remember what it was). But when I think of a framework, I think of staying out of the way. Something like CodeIgnitor or Kohana (personal favorite right now). When I think of CMS I think biiiiiggggggg. That doesn't mean they don't have a place, but if you're goal is someth Re: (Score:2) My approach to every project is "use the right tool for the right job". For public facing websites, the right tool will almost always be a CMS. For the rest, it depends: for internal web app my personal favorite is usually a composite application framework. Unfortunately, unlike CMSs, there are very few of those, and the ones that do exist tend to be immature, so I had to write my own. Some internal web app projects are suitable for CMS too though. If when you think CMS you think "biiiiiiiiiiiiiiiiiiig", you h Re: (Score:2) Re: (Score:2) it doesn't execute 30 SQL queries for a simple "Hallo world" Sensationalist much? Either you did something to cause those 30 queries, or you're talking out your ass like a complete idiot. My vote is on you being an idiot. 30 minutes, right? (Score:2) Am I the only one to notice he went over 30 minutes? Microsoft? (Score:2) Definition by Experience (Score:2) Framework: A bunch of organized and easily referenced functions which make development easier. CMS (Drupal, Plone, Etc): Fun for users. Hell for developers. Re: (Score:2) i would merrily be one if there werent budget and deadline considerations in real world. we could just work on and on on drupal et al, on our weekends and be happy. I say not framework (Score:3) I thought it was pretty much agreed that you could not "run" a framework. Just "use" it to build something (a website, an app...) that then you run. Significatively, there's no "content" (understanding content as "the thing that the end users usually change and use"). Drupal can run by itself, with no modifications (granted, the default installation will not let you do much, but you still can) so to me, it might be a framework plus something else - but definitively not "only" a framework.). Re: (Score:2)). Just to be clear, Drupal is highly modularized. The only modules you can't turn off are the core-required set. For 6.0 that looks like this: Block Controls the boxes that are displayed around the main content. Filter Handles the filtering of content in preparation for display. Node Allows content to be submitted to the site and displayed on pages. System Handles general site configuration for administrators. User Manages the user registration and login system. Then there's a whole other set of opti Re: (Score:2) Thanks a lot for your reply. I specially appreciated the bit at the end about D7. I guess I'll wait. Most of the modules you describe, I've already used. I just don't know the code inside them. "Download, uncompress on sites/all/modules, activate, if it doesn't explode, configure" that's my general approach with modules. It rarely includes a "have a peek at the code". But thanks. I hope you didn't type all the descriptions of each module and just copy-pasted from somewhere else. Otherwise, what a lot or work! Re: (Score:2) Thanks a lot for your reply. I specially appreciated the bit at the end about D7. I guess I'll wait. I tried it, and I would wait :) Most of the modules you describe, I've already used. I just don't know the code inside them. Me neither, they're in core. I only look at their code when the docs suck and I need to understand what the code is expecting me to do. I'm not much of a PHP guy but it's one of a whole horde of languages with similar syntax so I can muddle through. In fact I'm not much of a programmer in general. I have contributed back patches to drupal modules which were accepted though, both features and fixes. Not sure if that's scary or if I'm smarter than I think. I hope you didn't type all the descriptions of each module and just copy-pasted from somewhere else. Otherwise, what a lot or work! Copypasted from admin/b Drupal hungry. Drupal cries. Drupal loves papa. (Score:2) What's in store for tomorrow ? "Drupal is excited for carnival" ? has slashdot became drupal's private publishing arm ? Re: (Score:2) Re: (Score:2) It basically makes this framework competition sound like the paralympics. "You're not allowed to compete if you're more capable than us". Re: (Score:2) Re: (Score:2) Re: (Score:2) Re: (Score:2) Did you bother reading the article? Ah, you must be new here. Re: (Score:2) implementing the entire thing from start took only 1-2 days after that, along with the client's pickiness. Re: (Score:2) [wikipedia.org] Re: (Score:2) Great, now I don't feel so bad for sucking at Symfony. Frameworks seem to embody everything I hate about modern programmers. Sadly, I gotta eat, so I have to play ball. Re: (Score:2) When you work as an architect in a corporate setting framework are great since they allow you to impose your will upon the code monkey Re: (Score:2) What exactly is so wrong with frameworks? If you consider the hardware's that all the code running on a machine is a single program, then an operating system fits the description. It implements IoC, since it's the OS which calls the user code when appropriate, it implements a default behavior, they're usually extensible and user code definitively can't change its code. Re: (Score:2) Re: (Score:3) Re: (Score:2) That is why there is, in fact, no such thing as Wikipedia. The WikiMedia system does not exist either. [wikipedia.org] In a similar fashion there is no VM ZEND engine. [wikipedia.org] And I hate to break it to you, but there is no Santa Clause. Re: (Score:2) Is there a get-out claus? Re: (Score:2) You're in the same league as graphic designers bitching about 99Designs. How about other now-commodity stuff like ODBC drivers? There used to be entire companies around that one piece of tech. Now it's something we expect to just work as a matter of fact. If that means the bar is lower for web development, then so be it. Yes, more morons will get into the game. But so will competent people who otherwise may
https://developers.slashdot.org/story/11/02/24/221231/drupal-competes-as-a-framework-unofficially
CC-MAIN-2016-40
refinedweb
4,452
72.26
# OOX 2.0: Out of order execution made easy As [Intel's Threading Building Blocks](https://www.threadingbuildingblocks.org/) (TBB) library is being refreshed using the new C++ standard, deprecating tbb::task interface, the need for a high-level tasking interface becomes more obvious. In this article, I’m proposing another way of defining how a high-level parallel task programming model can look like in modern C++. I created it in 2014 as my last contribution to TBB project as a core developer after 9 wonderful years of working there. However, this proposal has not been used in production yet, so a new discussion might help it to be finally adopted. ### Motivation According to customer feedback, the nested blocking programming model used in TBB can cause deadlocks if a program uses parallel algorithms with locks in user functions. It can be worked-around using tbb::task\_arena by preventing work mixing but it is not an efficient approach. And there is no good way to solve the latency problem: one outermost task can get stuck until another outermost task of a high-level algorithm completes. It can be approached in different ways, e.g. using stack-switching (co-routines), just replacing a blocked thread by a new one, or preventing the task stealing using tbb::this\_task\_arena::isolate(). This article explores a purely semantical way out of these issues.  It avoids the burden of additional restrictions, complexity, or resources in the scheduler since at low-level, it is all still possible via the deprecated tbb::task interface. ### Design forces #### Main idea A solution for the nested blocking issue requires interrupting the current execution scope either by switching to a new stack/thread (scheduler way) or by terminating and splitting the scope into parts running as a sequence of continuations (semantical way). The latter leads to additional complexity of dealing with variables which go out of scope, e.g. consider this example with blocking style: ``` int result = parallel_reduce(...); post_process(result); ``` If we want parallel\_reduce not to block, we need to split this into two tasks (by lines) with separate scopes. But how to deal with the `result` then? The concept of `future` seems to be the closest approach to this and C++11 provides std::async(), which returns std::future as a result of the user's functor: ``` future result = std::async(parallel\_reduce, ...); std::async(post\_process, result); ``` Now, how to connect the tasks into as a sequence? std::future is blocking. However, this example demonstrates that the most native way to express dependencies is to follow the function arguments: the second task waits for the result of the first one. We just need to extend ideas of std::future and std::async to cover our needs. Meanwhile, let's consider the weakness of C++11 async constructs using the following example: ``` std::future Fib(int n) { // error: no implicit conversion if(n < 2) return n; // error: no conversion from 'std::future >' to 'std::future’ std::future &&left = async(Fib, n-1); std::future &&right = async(Fib, n-2); return async([](std::future &&l, std::future &&r) -> int { return l.get() + r.get(); // it blocks }, std::move(left), std::move(right)); } ```  In order to support recursions like this for continuation-style tasking, we need to: - directly initialize a 'future' variable by a value (optionally) - collapse template recursion of a 'future' variables - build task dependencies based on 'future' arguments instead of blocking - unpack 'future' types into plain types before calling user functor The result can be as beautiful and concise as the following: ``` oox_var Fib(int n) { if(n < 2) return n; return oox\_run(std::plus(), oox\_run(Fib, n-1), oox\_run(Fib, n-2) ); } ``` Where: **oox\_var -** represents a new form of a future variable **oox\_var oox\_run(Func, Args...) -** spawns a task when arguments are ready and returns `oox\_var` as a promise to provide the result of Func in future. If there are `oox\_var` arguments which are not ready (i.e. “promises” themselves), it makes a continuation task, which depends on completion of pending `oox\_var` arguments. All these requires tasking with multi-continuations and dynamic dependencies just as in the initial OOX (Out of Order eXecution) proposal by Arch Robison. Thus the `oox\_` prefix and the second version. [Update 24-Sep-21] Now, OOX officially stands for Out-of-Order Executor. #### Static Dependencies OOX implementation enables automatic deduction for write-after-write ("output"), write-after-read ("anti"), and read-after-write ("flow") dependencies. This new interface approach provides a way to enumerate all the prerequisites in arguments and identify their properties such as: **read-write -** l-value reference & **final-write -** r-value reference && **read-only -** const reference &, value **copy-only -** value Thus, each oox\_run task knows which oox\_var can be modified, which has only to be read, and which can be just copied thus unlocking more potential parallelism with write-after-read dependent tasks. It allows building a complete task dependency graph without additional specifications beyond the oox\_run() arguments for the case of a fixed number of tasks since the number of arguments is a compile-time decision: ``` oox_var a, b, c; oox\_run( [](T&A) { A=f(); }, a); oox\_run( [](T&B) { B=g(); }, b); oox\_run( [](T&C) { C=h(); }, c); oox\_run( [](T&A, T B) { A+=B; }, a, b); oox\_run( [](T&B, T C) { B+=C; }, b, c); oox\_wait\_for\_all(b); // this thread joins computation ``` ![](https://habrastorage.org/r/w1560/getpro/habr/upload_files/568/a54/db2/568a54db2f7659b1291fd84bb354245a.png)To sum up, there are two big design ideas behind OOX 2.0: 1. Abstract user functor from task dependencies 2. Reuse functor argument types for task dependency types specification Users make their best effort to specify the minimally necessary access types and OOX extracts as much parallelism as possible in response. #### Function and arguments types match There are two options for passing arguments to oox\_run and receiving them in the user functor. 1. Match oox\_run arguments to functor arguments. It means if the functor receives by lv-reference, it will be stored as a reference and it will be the user's responsibility for the lifetime of the referred object. However, if the functor receives by const-reference, a choice must be made: to copy the argument or to keep as a reference. If passed to oox\_run as rv-reference, it must be a copy. 2. The standard uses a different way. You can choose to pass by reference and take responsibility for the object over its lifetime, but it has to be done explicitly via std::ref(), std::cref(), and std::reference\_wrapper<>. Otherwise everything is passed by a value. Since the semantics of oox\_run arises from similarity with std::async and std::thread, it looks natural to assume the same rules for argument passing in case they are not oox\_var, i.e. [cplusplus.com says](http://www.cplusplus.com/reference/future/async/) the following: > Their types shall be [*move-constructible*](http://www.cplusplus.com/is_move_constructible). If **Fn** is a [*member pointer*](http://www.cplusplus.com/is_member_pointer), the first argument shall be an object for which that member is defined (or a reference, or a pointer to it). The function uses [*decay copies*](http://www.cplusplus.com/decay)of these arguments. **Fn** and **Args...** are template parameters: if implicitly deduced, these are the proper *lvalue* or *rvalue* reference types of the arguments. Note though, that the function uses [*decay copies*](http://www.cplusplus.com/decay)of **fn** and **args...** (see [std::ref](http://www.cplusplus.com/reference/functional/ref/) for a wrapper class that makes references copyable). > > Now, what to do with oox\_var<> arguments? They differ from plain types because they guarantee lifetime and access synchronization. Following the same logic of unification and taking into account that access to oox\_var<> content is synchronized by the dependency graph build by oox\_run(), we can claim that arguments referred as oox\_var<> are always stored by reference. It does not make much sense to always store arguments by value, since it kills half of use cases where oox\_var<> is used as a synchronization point when a writer waits for readers. On the other hand, when a user functor takes an argument by value, it is not visible to the user whether a task stores it by value or by reference to the oox\_var storage. The former enables task graph optimization opportunity when the producer can copy the argument to the consumer task and proceed to the next write immediately, without depending upon finishing of the consumer task. See note //1 below. But when an oox\_var argument is stored and passed by lv-reference, a visible difference with a plain type can arise for oox\_var<> passed by r-value reference: `oox_run(f, move(my_var));`It can prevent the optimization for functors f(T) and f(T&&) which works fine for non-oox types. Thus, arguments passed as oox\_var&& have to be moved into the user functor instead of just passing as lv-reference as for other cases. See note //2 below. The following table summarizes the observations above and couples it with **dependency arcs types** formed for the task graph as explained below (please note that this complexity is for the implementation writer rather than the user): | | | | | | | | --- | --- | --- | --- | --- | --- | | **Stage** | **oox arg \ functor arg:** | **f(T)** | **f(T&)** | **f(const T&)** | **f(T&&)** | | pack | var&a | A s(\*a.p) //1 | A& r(\*a.p) | A& r(\*a.p) | A s(\*a.p) //2 | | arc | var&a | copy-only //1 | read-write | read-only | copy-only //2 | | use | var&a | f(move(s)) //1 | f(r) | f((constA&)r) | f(move(s)) //2 | | pack | const var&a | A s(\*a.p) //1 | #Error | A& r(\*a.p) | A s(\*a.p) //2 | | arc | const var&a | copy-only //1 | #Error | read-only | copy-only //2 | | use | const var&a | f(move(s)) //1 | #Error | f((constA&)r) | f(move(s)) //2 | | pack | var&&a | A& r(\*a.p) | #Error | A& r(\*a.p) | A& r(\*a.p) | | arc | var&&a | final-write | #Error | final-write | final-write | | use | var&&a | f(move(r)) //3 | #Error | f(move(r)) //3 | f(move(r)) //3 | 1. True for a copy-optimized implementation, in a read-only version, it is just the same as for const ref. 2. True for a copy-optimized implementation, in a read-only version, it is f(A(\*a.p)). 3. The lifetime of oox\_var is over and its stored value can be moved in order to repeat plain type behavior. **read-write -** the value is exclusively owned by a single producer task which can modify it. It unlocks all the pending shared consumers to be scheduled for execution. **final-write -** there are no consumers or next producers for this read-write task - useful for optimizations. **read-only -** the value can be simultaneously shared between concurrent tasks which start after the producer task finishes and which prevent the next producer from being executed until all consumers finish. **copy-only -** producer copies the value to this consumer and does not depend upon its completion. #### Consistency One of the basic design principles for oox\_var is that its usage should be implicit/transparent for the user functor perhaps following std::reference\_wrapper<> notation. It is also motivated by recursive algorithms where oox\_run for the same functor can take oox\_var to build a dependency graph or direct parameter on the leaf nodes. It is seamless for a functor taking by value (T) or by rv-reference (T&&): ``` // setup void f(int by_value, string && by_rv_reference); // for plain types int i = 0; const int &j = i; string s = "plain"; oox_run(f, 1, string("temporary")); oox_run(f, i, s); oox_run(f, j, move(s)); // for oox variables oox_var oi = 0; oox\_var os = string("managed"); oox\_run(f, oi, move(os)); ``` As for const-reference (`const T&` and lv-reference (`T&`), the `std::reference_wrapper<>`has to be used for plain types, and oox\_var<> looks like a similar concept. This similarity also asks for std::ref-like function, which makes oox\_var<> for the given variable. Unlike `std::ref`where a user assumes the lifetime responsibility, 'oox\_ref' has to either copy or move the content. The idea is to take a variable by its name (without a type) and detach it from current scope prolonging its lifetime. E.g.: ``` // setup void f(int & by_ref, const string & by_cref); int i = 0; const int &j = i; string s = "plain"; // for plain types auto ri = std::ref(i); auto crs = std::cref(s); oox_run(f, ri, crs); // for oox_vars auto oi = oox_make_copy(i); auto os = oox_make_move(s); oox_run(f, oi, os); ``` #### Stored types Following the same rules described above (oox tasks store plain types by value and oox\_var usage has to be indifferent from plain type), it is easy to come to the following type storage rule: 1.      oox\_run() return oox\_var<> for decay type of functor return type, copy- or move-initialized. 2.      oox\_var<> doesn't store references. Use reference\_wrapper or pointer types instead. 3.      Although, oox\_var could have special meaning of non-modifiable storage shared between tasks, it basically becomes a form of shared\_ptr and its design value is not clear. 4.      Don't compile `oox_var`if not `is_same::type>` ### Dynamic Dependencies The simplest approach to a dynamic number of tasks is to build a chain of small tasks, which are also dependent upon bigger parallel tasks: ``` oox_var disk\_usage(INode& node) { if (node.is\_file()) return node.size(); oox\_var sum = 0; for (auto &subnode : node) oox\_run([](size\_t &sm, // serialized on write operation size\_t sz) { sm += sz; }, sum, oox\_run(disk\_usage, std::ref(subnode))); // parallel recursive leaves return sum; } ``` It also enables linearization and deterministic reduction. If such a serialization is not an option, anti-dependence trick can be used: ``` oox_var disk\_usage(INode& node) { if (node.is\_file()) return node.size(); typedef tbb::concurrent\_vector cv\_t; typedef cv\_t \*cv\_ptr\_t; oox\_var resv = new cv\_t; for (auto &subnode : node) oox\_run([](const cv\_ptr\_t &v, // make it read-only (not copyable) and thus parallel size\_t s){ v->push\_back(s); }, resv, oox\_run(disk\_usage, std::ref(subnode))); return oox\_run([](cv\_ptr\_t &v) { // make it read-write to induce anti-dependence // from the above read-only tasks size\_t res = std::accumulate(v->begin(), v->end(), 0); delete v; v = nullptr; // release memory, reset the pointer return res; }, resv); } ``` This might be enough for a minimal set of OOX features. Though, additional extensions might be helpful to improve the usability of this case: **oox\_var\_ptr -** same as `oox_var`but disables copy-and-release optimization **oox\_node -** base of oox\_var or same as `oox_var` **oox\_node oox\_join(oox\_node... begin) oox\_node oox\_join(Iter begin, Iter end) -** joins a collection of oox\_vars into flow-dependent oox node **oox\_var<> oox\_run(oox\_node, Func, args...) -** same as simple `oox_run(Func, args...)`but additionally flow-dependent upon the oox\_node. ### Integration with parallel algorithms Now, when the problem of passing results between continuation tasks is solved, let's return to the nested blocking issue. This is how to avoid it: ``` tbb::parallel_for(0, N, [](int i)->auto { mutex.lock(); oox_node dep = parallel_for(0, M, Body); return oox_run(dep, []{ // runs possibly on mutex.unlock(); // different thread }); }); ``` And this is how to avoid the performance implication issues: ``` tbb::parallel_for(0, N, [](int i)->auto { oox_node dep = parallel_for(0, M, Body1); return oox_run(dep, []()->oox_node { return parallel_for(0, M, Body2); }); }); ``` This is enabled by the following rules and constructs: **sync\_var -** contains root\_task of an algorithm. Source-compatibility with TBB needs semantics opposite to oox\_var: - wait\_for\_all() in destructor :-( - operator T(): implicitly waits for the value private constructors: not user-manageable. **oox\_var(sync\_var&&) -** converts algorithms into OOX nodes **sync\_var parallel\_for() sync\_var parallel\_reduce() -** Every blocking algorithm can return sync\_var. If user functor returns oox\_var, embed it into task tree as a continuation. Note that it is impossible to implement `oox\_run(parallel\_for, 0, M, Body)` form because overload resolution cannot be used for functor type deduction. ### Storage Considerations Since oox\_var<> is passed between tasks and can go out of scope before a task finishes working with its value, it needs a separate storage. I.e. oox\_var<> is always a pointer. And there are two ways to implement it: **separate storage**It's straightforward but it requires additional allocation in oox\_run() returning an oox\_var. Besides, it becomes too close to notion of shared\_ptr and probably should be better integrated with it. **embed into writing task**Each writing task moves the var inside itself from the previous location before modification and keeps it while someone references it. This reduces the number of allocations for oox\_run() with a return value but requires a move or copy constructor for the user type and gives no guarantee of the same location for stored variable. **embed into initiating task**A task executing oox\_run functor contains a storage for its return value. But it keeps the whole task object, which has produced this value, allocated. There are more tricks and variations for how to optimize storage and execution of oox tasks, e.g. use NRVO+TLS [trick](https://rextester.com/SNZ14761) to pass hidden execution context, introduce async\_var for building more optimized graph of tasks thanks to deferred parallelism, etc.. but this article is long enough already, so, let's stop here. Instead of conclusion [update: 5 Oct 21] ---------------------------------------- If you like the idea and have some spare time, please join discussion and contribute to the GitHub repo: GitHub: <https://github.com/intel-ai/oox> Slides: <https://www.slideshare.net/secret/ifHWb6mqkpBOn2> Instead of P.S.: more examples ------------------------------ **MergeSort** ``` template oox\_node mergesort(RAIter begin\_it, RAIter end\_it) { size\_t const base\_case\_bound = 50; if (end\_it - begin\_it < 2) return; if (end\_it - begin\_it < base\_case\_bound) { for (RAIter it = begin\_it + 1; it < end\_it; ++it) for (RAIter mentor = it; mentor > begin\_it && \*mentor < \*(mentor - 1); --mentor) std::iter\_swap(mentor, mentor - 1); return oox\_node(); } RAIter middle\_it = begin\_it + (end\_it - begin\_it) / 2; auto left = oox\_run(mergesort, begin\_it, middle\_it); auto right= oox\_run(mergesort, middle\_it, end\_it); return oox\_run( oox\_join(left, right), [=] { std::inplace\_merge(begin\_it, middle\_it, end\_it) }); } ``` **Quicksort** ``` template oox\_node quicksort(RAIter begin\_it, RAIter end\_it) { size\_t const base\_case\_bound = 350; if (end\_it - begin\_it < base\_case\_bound) { for (RAIter it = begin\_it + 1; it < end\_it; ++it) for (RAIter mentor = it; mentor > begin\_it && \*mentor < \*(mentor - 1); --mentor) std::iter\_swap(mentor, mentor - 1); return oox\_node(); } typedef typename std::iterator\_traits::value\_type Value; std::iter\_swap(begin\_it, begin\_it + (end\_it - begin\_it) / 2); Value const &pivot = \*begin\_it; RAIter greater\_or\_equal\_begin = std::partition(begin\_it + 1, end\_it, [&pivot](Value const &value) { return value < pivot; }); RAIter less\_end = greater\_or\_equal\_begin - 1; std::iter\_swap(begin\_it, less\_end); return oox\_join( oox\_run(quicksort, begin\_it, less\_end), oox\_run(quicksort, greater\_or\_equal\_begin, end\_it) ); } ``` **NBody** ``` template class T> oox\_node nbody(Tconst ▵, std::vector&forces, divconq\_range2d const ⦥) { size\_t const base\_case\_bound = 180; if (range.rows().end() <= range.cols().begin()) { return; } if (range.rows().end() - range.rows().begin() < base\_case\_bound) { for (size\_t i = range.rows().begin(); i < range.rows().end(); ++i) for (size\_t j = range.cols().begin(); j < std::min(range.cols().end(), i); ++j) { A const &term = triangle.at(i - 1, j); forces[i] += term; forces[j] -= term; } return oox\_node(); } auto self = static\_cast const &, std::vector&, divconq\_range2d const &)>(&nbody); auto subtask = std::bind(self, std::ref(triangle), std::ref(forces), std::placeholders::\_1); auto d=oox\_join( oox\_run(subtask, range.a11()), oox\_run(subtask, range.a22()) ); return oox\_join( oox\_run(d, subtask, range.a12()), oox\_run(v, subtask, range.a21()) ); } ``` **Wavefront** ``` void Serial_LCS( const char* x, size_t xlen, const char* y, size_t ylen ) { int F[MAX_LEN+1][MAX_LEN+1]; for( size_t i=1; i<=xlen; ++i ) for( size_t j=1; j<=ylen; ++j ) F[i][j] = x[i-1]==y[j-1] ? F[i-1][j-1]+1 : max(F[i][j-1],F[i-1][j]); } void Straight_LCS( const char* x, size_t xlen, const char* y, size_t ylen ) { oox_var F[MAX\_LEN+1][MAX\_LEN+1]; auto f = [x,y,xlen,ylen](int F11, int F01, int F10) { return x[i-1]==y[j-1] ? F11+1 : max(F01, F10); }; for( size\_t i=1; i<=xlen; ++i ) for( size\_t j=1; j<=ylen; ++j ) F[i][j] = oox\_run(f, i+j==0?0:F[i-1][j-1], j==0?0:F[i][j-1], i==0?0:F[i-1][j]); int res = oox\_get\_and\_wait(F[MAX\_LEN][MAX\_LEN]); } void RecursiveLCS( const char\* x, size\_t xlen, const char\* y, size\_t ylen ) { struct RecursionBody { int (\*F)[MAX\_LEN+1]; const char \*X, \*Y; RecursionBody(int f[][MAX\_LEN+1], const char\* x, const char\* y) : F(f), X(x), Y(y) {} oox\_node operator()(Range2D r) { if( !r.is\_divisible4() ) { for( size\_t i=r.rows().begin(), ie=r.rows().end(); i ```
https://habr.com/ru/post/542908/
null
null
3,606
51.38
. If you have developed applications with LINQ to SQL, you know that one of the features of these objects are that they are aware of the DataContext they were created in. This can have issues in ASP.NET if you do not cache the DataContext it belonged to, because each LINQ to SQL business object knows which context it was created in, and if it isn't the current one, then an exception is thrown. It's possible to create new business objects without them being known by the DataContext; when you first create an object, until that object is passed along to the DataContext through InsertOnSubmit, the data object can be a temporary holder of data disconnected from the database. It's also possible to create relationships for the data that are also disconnected from the database, so you can build a whole tree of relationships of objects rather easily, all in disconnected form. If you like to use that approach, use caution. If you add one object as a reference to a disconnected object that is DataContext-aware, then all of the other disconnected objects related to that object will all be queued up for insertion, which is a HUGE pain. If you get a lot of duplicated data, this is the first place to look; is a DataContext-aware object reference being assigned anywhere? If so, remove it, and make a reference by key. That can pose problems because one of the nice features of LINQ to SQL is being able to drill-down an object model using the PK/FK properties, but in disconnected mode, all of the data has to be disconnected, and reference data won't work because you aren't usually creating it on the fly. Creating temporary matching records isn't typically a good idea as well, because if they aren't removed, data will be duplicated, plus removing the objects later may damage the reference for the real value potentially. So what are the options here? I'd recommend storing as little disconnected data as posslble, or make sure you tread lightly. So what is the purpose of the descriptor? The descriptor describes information about the component, such as properties, events, and methods. For properties, the descriptor states the name and type of the property, as well as whether the property is read-only or if null values are allowed. So what does that govern? I was changing a component and found out that it governs a lot because whenever I changed the definition of the property, an exception was thrown at runtime, stating that a readonly property had a setter definition. So the ASP.NET AJAX framework is aware about your structures through the descriptor, and does perform validation. I defined this event: [ [ ExtenderControlEvent, ClientPropertyName("mouseOver")]public string OnClientMouseOver{ get { return (string)(ViewState["OnClientMouseOver"] ?? string.Empty); } set { ViewState["OnClientMouseOver"] = value; }} in my AJAX component that uses the AJAX Control Toolkit way of developing controls and extenders. AJAX Control toolkit uses attributes to describe the client component. The above property is describing an event handler for the mouseOver event of the underlying HTML element; however, what is happening is that this definition was throwing me an error. Turns out it is because I use the bolded text above in my null coalesce (??) definition; string.Empty doesn't work well in this case. I switched to null, and it works fine. To a point, LINQ to SQL works well with unit testing. When the LINQ-to-SQL objects are in a detached state (either not submitted to the database, or detached through the detach command) and there isn't a chance of accidentally updating records or creating new records to the database, LINQ to SQL works really well with unit testing. Take a look at this example: Customer customer = new Customer();customer.Orders.Add(new Order { OrderKey = 1, TotalAmount = 20, OrderDate = DateTime.Now });customer.Orders.Add(new Order { OrderKey = 2, TotalAmount = 19.50, OrderDate = DateTime.Now }); customer.Reviews.Add(new Review { ReviewKey = 1, ReviewText = "OK" })customer.Reviews.Add(new Review { ReviewKey = 2, ReviewText = "Liked it" }); At this point, no object has been submitted to the database, or is attached to the data context, so this unit test is isolated. Although it can be a pain to setup all of the objects needed for a test, it can be done. You can start processing the test as follows: CustomerBAL.ProcessOrders(customer); foreach (Order order in customer.Orders) Assert.AreEqual(true, order.IsSubmitted); And so on. As long as the components interacting with the objects don't submit the data to the database, or do anything outlandish with the objects, this approach will work well in unit testing. Apparently the same workspace name for two different TFS servers is an issue. I downloaded a new project from the codeplex site, and gave it the same workspace name as a different TFS project. When I opened the project that has had no problems for years, I started getting "all files must be in the specified workspace. Workspace <name> contains <folder>." which was real strange. Of course it was there, I just created it at the time; I got this when I added a new file to the project. Quickly changing the workspace name to be unique solved the problem. In the second article, I wanted to talk about client object-models. In JavaScript currently, we do have the ability to do class development. However, the Microsoft framework provides extensions to this approach (that fit within the JavaScript development approach) to differentiate namespaces, enumerations, interfaces, events, properties, and some of the other constructs. All of these existing contructs allow for the server to pass values to the client, along with exposing an object model similar to .NET on the client side. This means that AJAX server controls can have a client model that other controls or JavaScript code in ASP.NET pages can interact with. Let's look at the client/server communcation capabilities as well. Because the client code can call a web service, its also possible to have the client code stream data and rerender its interface using that data, all without posting back. These capabilities already exist through the Sys.Services.AuthenticationService and Sys.Services.ProfileService. It's possible to login and log out a user, as well as extract their profile information, all on the client side. The possibilities are endless, especially when Silverlight is thrown into the mix. More client development means a richer user experience, and to do this in a managed way means less coding effort to do so. If you are wondering why you may want to consider using the AJAX client library (forgetting about the AJAX extensions library server portion), there are multiple reasons to choose Microsoft's implementation. Right now, on the internet, we are seeing a lot of different approaches to developing JavaScript. There are quite a bit of JavaScript libraries available on the internet outside of Microsoft's implementation (like JQuery or Yahoo YUI). Each of these implementations are designed to make JavaScript development easier and sometimes more managed. Microsoft's is the same; however, they have taken a neat approach to custom JavaScript development. When looking at developing custom controls or extenders in ASP.NET AJAX, the client library helps create a client-side API for the control or extender that ASP.NET pages can make use of. Picture creating a control that can respond to events, can have property definitions to alter underlying data, or define methods that can be called. This all can happen on the client side without requiring a postback. In addition, its really easy to provide custom event handlers to events raised by client components, so the page can respond to an action of an AJAX component on the client side. Furthermore, this can be taken a step further by having the client-side component re-render the interface whenever the data changes, especially when the data is streamed from a web service called through a proxy. This is one of the underlying goals with ASP.NET AJAX, and I plan to talk about this in more detail on my blog. Stay tuned. I just wanted to post a note that I was up for re-evaulation for the MVP award (as it is a yearly thing), and I was renewed for the July 2008-2009 time period. I am really excited to be renominated, as I think it's a prestigious award, and I'm thankful that I'm in it again for another year. I look forward to another year of working with Microsoft technology and blogging about it here. Link to us All material is copyrighted by its respective authors. Site design and layout is copyrighted by DotNetSlackers. Advertising Software by Ban Man Pro
http://dotnetslackers.com/Community/blogs/bmains/archive/2008/07.aspx
crawl-003
refinedweb
1,469
54.02
bigml 4.1.3 An open source binding to BigML.io, the public BigML APIBigML Python Bindings ===================== `BigML <https: bigml.`_ makes machine learning easy by taking care of the details required to add data-driven decisions and predictive power to your company. Unlike other machine learning services, BigML creates `beautiful predictive models <https: bigml.`_ that can be easily understood and interacted with. These BigML Python bindings allow you to interact with `BigML.io <https: bigml.`_, the API for BigML. You can use it to easily create, retrieve, list, update, and delete BigML resources (i.e., sources, datasets, models and, predictions). For additional information, see the `full documentation for the Python bindings on Read the Docs <http: bigml.readthedocs.`_. This module is licensed under the `Apache License, Version 2.0 <http:"" licenses="" license-2.0.`_. Support ------- Please report problems and bugs to our `BigML.io issue tracker <https: github.`_. Discussions about the different bindings take place in the general `BigML mailing list <http: groups.google.`_. Or join us in our `Campfire chatroom <https: bigmlinc.campfirenow.`_. Requirements ------------ Python 2.7 and Python 3 are currently supported by these bindings. The basic third-party dependencies are the `requests <https: github.`_, `poster <http: atlee.`_ and `unidecode <http: pypi.python.`_ libraries. These libraries are automatically installed during the. Additional `numpy <http:""/>`_ and `scipy <http:""/>`_ libraries are needed in case you want to use local predictions for regression models (including the error information) using proportional missing strategy. As these are quite heavy libraries and they are so seldom used, they are not included in the automatic installation dependencies. The test suite includes some tests that will need these libraries to be installed. Installation ------------ To install the latest stable release with `pip <http:""/>`_ .. code-block:: bash $ pip install bigml You can also install the development version of the bindings directly from the Git repository .. code-block:: bash $ pip install -e git://github.com/bigmlcom/python.git#egg=bigml_python Running the Tests ----------------- The test will be run using `nose <https: nose.readthedocs.`_ , that is installed on setup, and you'll need to set up your authentication via environment variables, as explained below. With that in place, you can run the test suite simply by issuing .. code-block:: bash $ python setup.py nosetests Some tests need the `numpy <http:""/>`_ and `scipy <http:""/>`_ libraries to be installed too. They are not automatically installed as a dependency, as they are quite heavy and very seldom used. Importing the module -------------------- To import the module: .. code-block:: python import bigml.api Alternatively you can just import the BigML class: .. code-block:: python from bigml.api import BigML Authentication -------------- All the requests to BigML.io must be authenticated using your username and `API key <https: bigml.`_: .. code-block:: bash export BIGML_USERNAME=myusername export BIGML_API_KEY=ae579e7e53fb9abd646a6ff8aa99d4afe83ac291 With that environment set up, connecting to BigML is a breeze: .. code-block:: python from bigml.api import BigML api = BigML() Otherwise, you can initialize directly when instantiating the BigML class as follows: .. code-block:: python api = BigML('myusername', 'ae579e7e53fb9abd646a6ff8aa99d4afe83ac291') Also, you can initialize the library to work in the Sandbox environment by passing the parameter ``dev_mode``: .. code-block:: python api = BigML(dev_mode=True) Quick Start ----------- Imagine that you want to use `this csv file <https: static.bigml.`_ containing the `Iris flower dataset <http: en.wikipedia.`_: .. code-block:: python: .. code-block:: python >>> api.pprint(prediction) species for {"sepal width": 2.5, "sepal length": 5} is Iris-virginica Additional Information ---------------------- We've just barely scratched the surface. For additional information, see the `full documentation for the Python bindings on Read the Docs <http: bigml.readthedocs.`_. Alternatively, the same documentation can be built from a local checkout of the source by installing `Sphinx <http: sphinx.pocoo.`_ (``$ pip install sphinx``) and then running .. code-block:: bash $ cd docs $ make html Then launch ``docs/_build/html/index.html`` in your browser. How to Contribute ----------------- Please follow the next steps: 1. Fork the project on github.com. 2. Create a new branch. 3. Commit changes to the new branch. 4. Send a `pull request <https: github.`_. For details on the underlying API, see the `BigML API documentation <https: bigml.`_. .. :changelog: History ------- 4.1.3 (2015-05-19) ~~~~~~~~~~~~~~~~~~ - Adapting code to handle uploading from String objects. - Adding models creation new origin resources: clusters and centroids 4.1.2 (2015-04-28) ~~~~~~~~~~~~~~~~~~ - Fixing bug in summarize method for local models. Ensuring unicode use and adding tests for generated outputs. 4.1.1 (2015-04-26) ~~~~~~~~~~~~~~~~~~ - Fixing bug in method to print the fields in the anomaly trees. - Fixing bug in the create_source method for Python3. Creation failed when the `tags` argument was used. 4.1.0 (2015-04-14) ~~~~~~~~~~~~~~~~~~ - Adding median based predictions to ensembles. 4.0.2 (2015-04-12) ~~~~~~~~~~~~~~~~~~ - Fixing bug: multimodels median predictions failed. 4.0.1 (2015-04-10) ~~~~~~~~~~~~~~~~~~ - Adding support for median-based predictions in MultiModels. 4.0.0 (2015-04-10) ~~~~~~~~~~~~~~~~~~ - Python 3 added to supported Python versions. - Test suite migrated to nose. 3.0.3 (2015-04-08) ~~~~~~~~~~~~~~~~~ - Changing setup to ensure compatible Python and requests versions. - Hiding warnings when SSL verification is disabled. 3.0.2 (2015-03-26) ~~~~~~~~~~~~~~~~~~ - Adding samples as Fields generator resources 3.0.1 (2015-03-17) ~~~~~~~~~~~~~~~~~~ - Changing the Ensemble object init method to use the max_models argument also when loading the ensemble fields to trigger garbage collection. 3.0.0 (2015-03-04) ~~~~~~~~~~~~~~~~~~ - Adding Google App Engine support for remote REST calls. - Adding cache_get argument to Ensemble constructor to allow getting local model objects from cache. 2.2.0 (2015-02-26) ~~~~~~~~~~~~~~~~~~ - Adding lists of local models as argument for the local ensemble constructor. 2.1.0 (2015-02-22) ~~~~~~~~~~~~~~~~~~ - Adding distribution and median to ensembles' predictions output. 2.0.0 (2015-02-12) ~~~~~~~~~~~~~~~~~~ - Adding REST API calls for samples. 1.10.8 (2015-02-10) ~~~~~~~~~~~~~~~~~~~ - Adding distribution units to the predict method output of the local model. 1.10.7 (2015-02-07) ~~~~~~~~~~~~~~~~~~~ - Extending the predict method in local models to get multiple predictions. - Changing the local model object to add the units used in the distribution and the add_median argument in the predict method. 1.10.6 (2015-02-06) ~~~~~~~~~~~~~~~~~~~ - Adding the median as prediction for the local model object. 1.10.5 (2014-01-29) ~~~~~~~~~~~~~~~~~~~ - Fixing bug: centroids failed when predicted from local clusters with summary fields. 1.10.4 (2014-01-17) ~~~~~~~~~~~~~~~~~~~ - Improvements in docs presentation and content. - Adding tree_CSV method to local model to output the nodes information in CSV format. 1.10.3 (2014-01-16) ~~~~~~~~~~~~~~~~~~~ - Fixing bug: local ensembles were not retrieved from the stored JSON file. - Adding the ability to construct local ensembles from any existing JSON file describing an ensemble structure. 1.10.2 (2014-01-15) ~~~~~~~~~~~~~~~~~~~ - Source creation from inline data. 1.10.1 (2014-12-29) ~~~~~~~~~~~~~~~~~~~ - Fixing bug: source upload failed in old Python versions. 1.10.0 (2014-12-29) ~~~~~~~~~~~~~~~~~~~ - Refactoring the BigML class before adding the new project resource. - Changing the ok and check_resource methods to download lighter resources. - Fixing bug: cluster summarize for 1-centroid clusters. - Fixing bug: adapting to new SSL verification in Python 2.7.9. 1.9.8 (2014-12-01) ~~~~~~~~~~~~~~~~~~ - Adding impurity to Model leaves, and a new method to select impure leaves. - Fixing bug: the Model, Cluster and Anomaly objects had no resource_id attribute when built from a local resource JSON structure. 1.9.7 (2014-11-24) ~~~~~~~~~~~~~~~~~~ - Adding method in Anomaly object to build the filter to exclude anomalies from the original dataset. - Basic code refactorization for initial resources structure. 1.9.6 (2014-11-09) ~~~~~~~~~~~~~~~~~~ - Adding BIGML_PROTOCOL, BIGML_SSL_VERIFY and BIGML_PREDICTION_SSL_VERIFY environment variables to change the default corresponding values in customized private environments. 1.9.5 (2014-11-03) ~~~~~~~~~~~~~~~~~~ - Fixing bug: summarize method breaks for clusters with text fields. 1.9.4 (2014-10-27) ~~~~~~~~~~~~~~~~~~ - Changing MultiModel class to return in-memory list of predictions. 1.9.3 (2014-10-23) ~~~~~~~~~~~~~~~~~~ - Improving Fields and including the new Cluster and Anomalies fields structures as fields resources. - Improving ModelFields to filter missing values from input data. - Forcing garbage collection in local ensemble to lower memory usage. 1.9.2 (2014-10-13) ~~~~~~~~~~~~~~~~~~ - Changing some Fields exceptions handling. - Refactoring api code to handle create, update and delete methods dynamically. - Adding connection info string for printing. - Improving tests information. 1.9.1 (2014-10-10) ~~~~~~~~~~~~~~~~~~ - Adding the summarize and statistics_CSV methods to local cluster object. 1.9.0 (2014-10-02) ~~~~~~~~~~~~~~~~~~ - Adding the batch anomaly score REST API calls. 1.8.0 (2014-09-09) ~~~~~~~~~~~~~~~~~~ - Adding the anomaly detector and anomaly score REST API calls. - Adding the local anomaly detector. 1.7.0 (2014-08-29) ~~~~~~~~~~~~~~~~~~ - Adding to local model predictions the ability to use the new missing-combined operators. 1.6.7 (2014-08-05) ~~~~~~~~~~~~~~~~~~ - Fixing bug in corner case of model predictions using proportional missing strategy. - Adding the unique path to the first missing split to the predictions using proportional missing strategy. 1.6.6 (2014-07-31) ~~~~~~~~~~~~~~~~~~ - Improving the locale handling to avoid problems when logging to console under Windows. 1.6.5 (2014-07-26) ~~~~~~~~~~~~~~~~~~ - Adding stats method to Fields to show fields statistics. - Adding api method to create a source from a batch prediction. 1.6.4 (2014-07-25) ~~~~~~~~~~~~~~~~~~ - Changing the create methods to check if origin resources are finished by downloading no fields information. 1.6.3 (2014-07-24) ~~~~~~~~~~~~~~~~~~ - Changing some variable names in the predict method (add_count, add_path) and the prediction structure to follow other bindigns naming. 1.6.2 (2014-07-19) ~~~~~~~~~~~~~~~~~~ - Building local model from a JSON model file. - Predictions output can contain confidence, distribution, instances and/or rules. 1.6.1 (2014-07-09) ~~~~~~~~~~~~~~~~~~ - Fixing bug: download_dataset method did not return content when no filename was provided. 1.6.0 (2014-07-03) ~~~~~~~~~~~~~~~~~~ - Fixing bug: check valid parameter in distribution merge function. - Adding downlod_dataset method to api to export datasets to CSV. 1.5.1 (2014-06-13) ~~~~~~~~~~~~~~~~~~ - Fixing bug: local clusters' centroid method crashes when text or categorical fields are not present in input data. 1.5.0 (2014-06-05) ~~~~~~~~~~~~~~~~~~ - Adding local cluster to produce centroid predictions locally. 1.4.4 (2014-05-23) ~~~~~~~~~~~~~~~~~~ - Adding shared urls to datasets. - Fixing bug: error renaming variables. 1.4.3 (2014-05-22) ~~~~~~~~~~~~~~~~~~ - Adding the ability to change the remote server domain in the API connection constructor (for VPCs). - Adding the ability to generate datasets from clusters. 1.4.2 (2014-05-20) ~~~~~~~~~~~~~~~~~~ - Fixing bug when using api.ok method for centroids and batch centroids. 1.4.1 (2014-05-19) ~~~~~~~~~~~~~~~~~~ - Docs and test updates. 1.4.0 (2014-05-14) ~~~~~~~~~~~~~~~~~~ - Adding REST methods to manage clusters, centroids and batch centroids. 1.3.1 (2014-05-06) ~~~~~~~~~~~~~~~~~~ - Adding the average_confidence method to local models. - Fixing bug in pprint for predictions with input data keyed by field names. 1.3.0 (2014-04-07) ~~~~~~~~~~~~~~~~~~ - Changing Fields object constructor to accept also source, dataset or model resources. 1.2.2 (2014-04-01) ~~~~~~~~~~~~~~~~~~ - Changing error message when create_source calls result in http errors to standarize them. - Simplifying create_prediction calls because now API accepts field names as input_data keys. - Adding missing_counts and error_counts to report the missing values and error counts per field in the dataset. 1.2.1 (2014-03-19) ~~~~~~~~~~~~~~~~~~ - Adding error to regression local predictions using proportional missing strategy. 1.2.0 (2014-03-07) ~~~~~~~~~~~~~~~~~~ - Adding proportional missing strategy to MultiModel and solving tie breaks in remote predictions. - Adding new output options to model's python, rules and tableau outputs: ability to extract the branch of the model leading to a certain node with or without the hanging subtree. - Adding HTTP_TOO_MANY_REQUESTS error handling in REST API calls... - Downloads (All Versions): - 920 downloads in the last day - 4067 downloads in the last week - 9868ml-4.1.3.xml
https://pypi.python.org/pypi/bigml
CC-MAIN-2015-22
refinedweb
1,975
60.21
From: David Abrahams (dave_at_[hidden]) Date: 2004-07-18 21:47:49 "Robert Ramey" <ramey_at_[hidden]> writes: > Dave Abrahams wrote: > >>Rene Rivera <grafik.list_at_[hidden]> writes: > >>> boost-root/boost/utf8_codecvt_facet.hpp is original. >>> boost-root/boost/program_options/utf8_codecvt_facet.hpp + *.cpp >>> is slightly modified copy. >>> Intention is that utf8_codecvt_facet will become standalone library >>> at some time and these files will be replaced. >> >> Then it should be moved to boost.detail, directory and namespace. > >>Right. We should never knowingly allow (near) duplicate code in the >>repository. > > I don't think anyone did it knowingly. I don't see how it could happen without explicit knowledge (?) > Something like this should really be subjected to a mini-review and > have its own separate test and documentation and reside outside any > of the systems that use it. That's what the detail namespace/directory is for. You only need to do a mini-review if you want to make it a public facility in the library that can be used by anyone who downloads it. This is a long-standing practice at Boost. > This has been mentioned before by various people. So? > I included Ron Garcia's version in the serialization project because > I needed it. I added a test and found that as one moves to other > compilers and standard libraries little things keep popping up. > E.G. gcc standard library defines wchar_t as 4 byte while others use > 2. So the status is "good enough for the serialization library" > > The serialization review specifically invited reviewers to critique > this and no objections were raised that I recall. There have been > proposals for an improved version. My response is that I'm glad to > use one that gets reviewed and accepted rather than the one we have > now. But so far nothing else has been submitted. Please just move it to detail as Rene suggested. We can do a mini-review if anyone feels motivated enough to make it into a public library. -- Dave Abrahams Boost Consulting Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk
https://lists.boost.org/Archives/boost/2004/07/68428.php
CC-MAIN-2019-39
refinedweb
354
59.9
Python data manipulation made braindead Project description Python data manipulation made braindead. Installation pip install manipulator Usage manipulator mainly exposes three functions, get, update, and set. get retrieves data, update transforms it based on its form, and set transforms it by simply resetting. Transformations can be applied in place or on a copy. The default is in place, because copying is expensive. If you want a copy of the data, set the keyword argument in_place to True. It uses a query “language” not unlike CSS, albeit much, much simpler. The only two entities in this “language” are IDs—denoted by #—and Classes—denoted by .. IDs are unique, whereas Classes are collections of all leaf values that conform. A few motivating examples (a more exhaustive list can be found in the test directory): import manipulator manipulator.get({"k": [1, [2], 3]}, "#k #1 #0") # => 2 (note how list indices are coerced into integers) manipulator.get([{"k": "v"}, {"k": "v2", "k2": "v3"}], ".k") # => ["v", "v2"] manipulator.get([{"k": "v"}, {"k": { "a": [{"k": 10}, {"k": 11}] } }], ".k #1 #a .k") # => [10, 11] manipulator.set({"k": [1, [2], 3]}, "#k #1 #0", 3) # => {"k": [1, [3], 3]} (in place) manipulator.set({"k": [1, [2], 3]}, "#k #1 #0", 3, in_place=False) # => {"k": [1, [3], 3]} (will create a copy of the data) manipulator.set([{"k": "v"}, { "k": { "a": [{"k": 10}, {"k": 11}] } }], ".k #1 #a .k", 100) # => [{"k": "v"}, {"k": {"a": [{"k": 100}, {"k": 100}]}}] manipulator.update({"k": [1, [2], 3]}, "#k #1 #0", lambda x: x-1) # => {"k": [1, [1], 3]} (in place, use in_place=False to copy) manipulator.update([{"k": "v"}, { "k": { "a": [{"k": 10}, {"k": 11}] } }], ".k #1 #a .k", lambda x: x+1) # => [{"k": "v"}, {"k": {"a": [{"k": 11}, {"k": 12}]}}] That is all. Have fun! Project details Release history Release notifications | RSS feed Download files Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
https://pypi.org/project/manipulator/
CC-MAIN-2020-50
refinedweb
325
68.57
Inspecting Data Makie provides a data inspection tool via DataInspector(x) where x can be a figure, axis or scene. With it you get a floating tooltip with relevant information for various plots by hovering over one of its elements. By default the inspector will be able to pick any plot other than text and volume based plots. If you wish to ignore a plot, you can set its attribute plot.inspectable[] = false. With that the next closest plot (in range) will be picked. Attributes of DataInspector The inspector = DataInspector(fig) contains the following attributes: range = 10: Controls the snapping range for selecting an element of a plot. enabled = true: Disables inspection of plots when set to false. Can also be adjusted with enable!(inspector)and disable!(inspector). text_padding = Vec4f(5, 5, 3, 3): Padding for the box drawn around the tooltip text. (left, right, bottom, top) text_align = (:left, :bottom): Alignment of text within the tooltip. This does not affect the alignment of the tooltip relative to the cursor. textcolor = :black: Tooltip text color. textsize = 20: Tooltip text size. font = "Dejavu Sans": Tooltip font. background_color = :white: Background color of the tooltip. outline_color = :grey: Outline color of the tooltip. outline_linestyle = nothing: Linestyle of the tooltip outline. outline_linewidth = 2: Linewidth of the tooltip outline. indicator_color = :red: Color of the selection indicator. indicator_linewidth = 2: Linewidth of the selection indicator. indicator_linestyle = nothing: Linestyle of the selection indicator tooltip_align = (:center, :top): Default position of the tooltip relative to the cursor or current selection. The real align may adjust to keep the tooltip in view. tooltip_offset = Vec2f(20): Offset from the indicator to the tooltip. depth = 9e3: Depth value of the tooltip. This should be high so that the tooltip is always in front. priority = 100: The priority of creating a tooltip on a mouse movement or scrolling event. Extending the DataInspector The inspector implements tooltips for primitive plots and a few non-primitive (i.e. a recipe) plots. All other plots will fall back to tooltips of their hovered child. While this means that most plots have a tooltip it also means many may not have a fitting one. If you wish to implement a more fitting tooltip for non-primitive plot you may do so by creating a method function show_data(inspector::DataInspector, my_plot::MyPlot, idx, primitive_child::SomePrimitive) ... end Here my_plot is the plot you want to create a custom tooltip for, primitive_child is one of the primitives your plot is made from and idx is the index into that primitive plot. The latter two are the result from pick_sorted at the mouseposition. In general you will need to adjust idx to be useful for MyPlot. Let's take a look at the BarPlot overload, which also powers hist. It contains two primitive plots - Mesh and Lines. The idx from picking a Mesh is based on vertices, which there are four per rectangle. From Lines we get an index based on the end point of the line. To draw the outline of a rectangle we need 5 points and a seperator, totaling 6. We thus implement import Makie: show_data function show_data(inspector::DataInspector, plot::BarPlot, idx, ::Lines) return show_barplot(inspector, plot, div(idx-1, 6)+1) end function show_data(inspector::DataInspector, plot::BarPlot, idx, ::Mesh) return show_barplot(inspector, plot, div(idx-1, 4)+1) end to map the primitive idx to one relevant for BarPlot. With this we can now get the position of the hovered bar with plot[1][][idx]. To align the tooltip to the selection we need to compute the relevant position in screen space and update the tooltip position. using Makie: parent_scene, shift_project, update_tooltip_alignment!, position2string function show_barplot(inspector::DataInspector, plot::BarPlot, idx) # All the attributes of DataInspector are here a = inspector.plot.attributes # Get the scene BarPlot lives in scene = parent_scene(plot) # Get the hovered world-space position pos = plot[1][][idx] # project to screen space and shift it to be correct on the root scene proj_pos = shift_project(scene, to_ndim(Point3f, pos, 0)) # anchor the tooltip at the projected position update_tooltip_alignment!(inspector, proj_pos) # Update the final text of the tooltip # position2string is just an `@sprintf` a._display_text[] = position2string(pos) # Show the tooltip a._visible[] = true # return true to indicate that we have updated the tooltip return true end Next we need to mark the rectangle we are hovering. In this case we can use the rectangles which BarPlot passes to Poly, i.e. plot.plots[1][1][][idx]. The DataInspector contains some functionality for keeping track of temporary plots, so we can plot the indicator to the same scene that BarPlot uses. Doing so results in using Makie: parent_scene, shift_project, update_tooltip_alignment!, position2string, clear_temporary_plots! function show_barplot(inspector::DataInspector, plot::BarPlot, idx) a = inspector.plot.attributes scene = parent_scene(plot) pos = plot[1][][idx] proj_pos = shift_project(scene, to_ndim(Point3f, pos, 0)) update_tooltip_alignment!(inspector, proj_pos) # Get the rectangle BarPlot generated for Poly # `_bbox2D` is a node meant for saving a `Rect2` indicator. There is also # a `_bbox3D`. Here we keep `_bbox2D` updated and use it as a source for # our custom indicator. a._bbox2D[] = plot.plots[1][1][][idx] a._model[] = plot.model[] # Only plot the indicator once. It'll be updated via `_bbox2D`. if inspector.selection != plot # Clear any old temporary plots (i.e. other indicators like this) # this also updates inspector.selection. clear_temporary_plots!(inspector, plot) # create the indicator using a bunch of the DataInspector attributes. # Note that temporary plots only cleared when a new one is created. To # control whether indicator is visible or not `a._bbox_visible` is set # instead, so it should be in any custom indicator like this. p = wireframe!( scene, a._bbox2D, model = a._model, color = a.indicator_color, strokewidth = a.indicator_linewidth, linestyle = a.indicator_linestyle, visible = a._bbox_visible, show_axis = false, inspectable = false ) # Make sure this draws on top translate!(p, Vec3f(0, 0, a.depth[])) # register this indicator for later cleanup. push!(inspector.temp_plots, p) end a._display_text[] = position2string(pos) a._visible[] = true # Show our custom indicator a._bbox_visible[] = true # Don't show the default screen space indicator a._px_bbox_visible[] = false return true end which finishes the implementation of a custom tooltip for BarPlot. These docs were autogenerated using Makie: v0.15.2, GLMakie: v0.4.6, CairoMakie: v0.6.5, WGLMakie: v0.4.6
https://makie.juliaplots.org/stable/documentation/inspector/
CC-MAIN-2021-43
refinedweb
1,035
59.8
Most Outline Software/Tools used - MCUXpresso IDE 10.2.1 - MXUXpresso SDK for i.MX RT1050-EVKB 2.4.0 - LittlevGL v5.1.0 - NXP i.MX RT1050-EVKB with LCD 💡 You can find the example project used in this tutorial in the Links section at the end of his article. LittlevGL LittlevGL is an open source GUI library, developed and maintained by Gábor Kiss-Vámosi. I have found it very powerful, good-looking and extremely easy to use. It comes with many basic objects and they can be easily modified, enhanced or I can add my custom objects: Project Create a project for your board and LCD if you don’t have already one. Best if you start with a very basic working LCD project. For the i.MX RT1050-EVKB I used the driver_examples\elcdif\elcdif_rgb one: LittlevGL Sources Download the library from or clone it from GitHub (). Place the sources into your project (best inside the ‘source’ folder). Add the path to the compiler include settings: Configuration File Copy the template configuration file one directory level up: Enable the content in the header file: Change the horizontal and vertical resolution matching the LCD (LV_HOR_RES and LV_VER_RES): Check the number of bits per pixel matching the LCD: Memory Management By default, LittlevGL uses the standard library dynamic memory with and a custom heap management. I recommend to use FreeRTOS and to configure it to use the FreeRTOS heap management to have it thread save: LittlevGL Tick You have to call the LittlevGL periodically to give a time base, usually every 1 millisecond. Call the function lv_tick_inc() from a periodic timer interrupt or better use FreeRTOS and call it from the FreeRTOS Tick interrupt: /* ** =================================================================== ** Event : McuRTOS_vApplicationTickHook (module Events) ** ** Component : McuRTOS [FreeRTOS] ** Description : ** If enabled, this hook will be called by the RTOS for every ** tick increment. ** Parameters : None ** Returns : Nothing ** =================================================================== */ void McuRTOS_vApplicationTickHook(void) { /* Called for every RTOS tick. RTOS is configured for 1 kHz tick frequency */ lv_tick_inc(1); /* inform LittlevGL that another 1 ms time elapsed */ } LittlevGL Period Task Function The GUI library needs to be called periodically to get it updated. Unlike lv_tick_inc(), the timing is not critical, it can be done say every 1..10 ms. I have implemented the wrapper below which I can call from an endless loop or from a FreeRTOS task: void LV_Task(void) { /* Periodically call this function. * The timing is not critical but should be between 1..10 ms */ lv_task_handler(); } Updating the Display LittlevGL offers different methods to write to the display: double buffering, direct writes, buffered writes or even DMA or GPU usage. The simplest way is to provide a function which can write a single pixel as below which is what I’m using for the display on the i.MX RT1050-EVKB: void LCD_WritePixel(int x, int y, int color) { s_frameBuffer[0][y][x] = color; } And then use it in the ex_disp_flush() function: /* Flush the content of the internal buffer the specific area on the display * You can use DMA or any hardware acceleration to do this operation in the background but * 'lv_flush_ready()' has to be called when finished * This function is required only when LV_VDB_SIZE != 0 in lv_conf.h*/ static void ex_disp_flush++; } } /* IMPORTANT!!! * Inform the graphics library that you are ready with the flushing*/ lv_flush_ready(); } 💡 The above way is the most simple, but slow. However, it GUI is surprisingly fast, so I really had no need to optimize this (yet?). The function ex_disp_flush() is used in buffered mode. In a similar way I can provide functions for unbuffered mode: /* Write a pixel array (called 'map') to the a specific area on the display * This function is required only when LV_VDB_SIZE == 0 in lv_conf.h*/ static void ex_disp_map++; } } } /* Write a pixel array (called 'map') to the a specific area on the display * This function is required only when LV_VDB_SIZE == 0 in lv_conf.h*/ static void ex_disp_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color) { /.full); } } } Touchpad The GUI can use a touch input, keyboard or push buttons. Below is my touchpad callback function which returns the pressed or released state with the coordinates: /* Read the touchpad and store it in 'data' * Return false if no more data read; true for ready again */ static bool ex_tp_read(lv_indev_data_t * data) { /* Read the touchpad */ int x=0, y=0, res; bool pressed; res = TOUCH_Poll(&pressed, &x, &y); if (res==1 && pressed) { data->state = LV_INDEV_STATE_PR; } else { data->state = LV_INDEV_STATE_REL; } data->point.x = x; data->point.y = y; return false; /*false: no more data to read because we are no buffering*/ } Initializing the GUI library The last piece is to put everything together and initialize the library: void LV_Init(void) { lv_disp_drv_t disp_drv; lv_init(); /*Set up the functions to access to your display*/ disp_drv.disp_flush = ex_disp_flush; /*Used in buffered mode (LV_VDB_SIZE != 0 in lv_conf.h)*/ disp_drv.disp_fill = ex_disp_fill; /*Used in unbuffered mode (LV_VDB_SIZE == 0 in lv_conf.h)*/ disp_drv.disp_map = ex_disp_map; /*Used in unbuffered mode (LV_VDB_SIZE == 0 in lv_conf.h)*/ #if USE_LV_GPU /*Optionally add functions to access the GPU. (Only in buffered mode, LV_VDB_SIZE != 0)*/ disp_drv.mem_blend = ex_mem_blend; /*Blend two color array using opacity*/ disp_drv.mem_fill = ex_mem_fill; /*Fill a memory array with a color*/ #endif /*Finally register the driver*/ lv_disp_drv_register(&disp_drv); /************************* * Input device interface *************************/ /*Add a touchpad in the example*/ /*touchpad_init();*/ /*Initialize your touchpad*/ lv_indev_drv_t indev_drv; /*Descriptor of an input device driver*/ lv_indev_drv_init(&indev_drv); /*Basic initialization*/ indev_drv.type = LV_INDEV_TYPE_POINTER; /*The touchpad is pointer type device*/ indev_drv.read = ex_tp_read; /*Library ready your touchpad via this function*/ lv_indev_drv_register(&indev_drv); /*Finally register the driver*/ } Using the Library Below a very simple 'hello world': static void hello_world(void) { /*Create a Label on the currently active screen*/ lv_obj_t *label1 = lv_label_create(lv_scr_act(), NULL); /*Modify the Label's text*/ lv_label_set_text(label1, "Hello world!"); /* Align the Label to the center * NULL means align on parent (which is the screen now) * 0, 0 at the end means an x, y offset after alignment*/ lv_obj_align(label1, NULL, LV_ALIGN_CENTER, 0, 0); } It creates a label in the middle of the screen: The following creates a button which toggles a LED: static lv_res_t my_click_action(struct _lv_obj_t * obj) { LED_Toggle(); return LV_RES_INV; } static void click_button(void) { /*Add a button*/ lv_obj_t *btn1 = lv_btn_create(lv_scr_act(), NULL); /*Add to the active screen*/ lv_obj_set_pos(btn1, 2, 2); /*Adjust the position*/ lv_obj_set_size(btn1, 96, 30); /* set size of button */ lv_btn_set_action(btn1, LV_BTN_ACTION_CLICK, my_click_action); /*Assign a callback for clicking*/ /*Add text*/ lv_obj_t *label = lv_label_create(btn1, NULL); /*Put on 'btn1'*/ lv_label_set_text(label, "Click"); } Another example to display an image: extern const lv_img_t red_flower; static void show_image(void) { lv_obj_t *img_src = lv_img_create(lv_scr_act(), NULL); /* Crate an image object */ lv_img_set_src(img_src, &red_flower); /* Set the created file as image (a red flower) */ lv_obj_set_pos(img_src, 10, 10); /* Set the positions */ lv_obj_set_drag(img_src, true); /* Make the image dragable */ lv_obj_t *img_symbol = lv_img_create(lv_scr_act(), NULL); /* create symbol */ lv_img_set_src(img_symbol, SYMBOL_OK); /* use 'checkmark' as symbol */ lv_obj_set_drag(img_symbol, true); /* make the symbol dragable */ lv_obj_align(img_symbol, img_src, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 20); /* Align next to the source image */ } It creates an image plus a label with a symbol (a check mark) and makes both 'dragable' so I can move them around on the screen using the touch input: There are different examples and tutorials available in. Simple Demo Within a two hours, I was able to pull together a quick demo on the LCD. It is not a perfect demo, but shows how powerful and easy this library is. A simple main menu with three buttons: A system monitor updating periodically a graph with CPU and memory usage: A screen showing the status of the LED and x, y and z of the accelerometer, everything updated in realtime: An updated LittlevGL GUI demo with tabs and different input schemes: Using on-screen keyboard as input device: Dialog box usage: Scroll-able list with symbols: Dynamic bar chart: Further Information LittlevGL is documented very well, so be sure to check out the pages at: - Porting guide: - Introduction and basic concepts: - Overview of different GUI objects: LittlevGL does not include a 'designer tool', but I have not found something like this missing. It includes a simulator under Eclipse (). It includes utilities as a font converter () and an image converter () Summary I have found LittlevGL extremely easy-to-use and very powerful. It is very, very well documented on and available in a permissible open source license. It nicely works with any microcontroller and hardware, either bare-metal or with an RTOS. So if you are looking for a library for small displays, open source and free-of-charge, then this might be right for you too. 💡 If you are going to use LittlevGL, consider donating to support this awesome project. And the GUI nicely works on smaller displays too: below how it runs on a 128x128 SSD1351 display: Happy GUI'ing 🙂 Links - LittlevGL home page: - Littlevgl on GitHub: - McuOnEclipse example on GitHub: - MCUXpresso SDK: - MCUXpresso IDE: - Example used in this tutorial: - LittlevGL examples: Looks like a very good solution for low-end micro-controllers. Think I might try to get this working with Micropython at some stage 🙂 Thanks very much for your wonderful blogs Eric !! Hi Brendan, I think not only for low-end microcontrollers, but as well for mid-range ones with say displays in the 600×400 or even higher areas. Of course usually with bigger sizes the RAM needs increase, but LittlevGL only needs a fraction of the memory buffer for its operations. Geat job Erich, I was looking for open source graphics library. It seems that it is very good solution Do you know if there is a possibility to run LittlevGL on S12X controlers with CW? I suppose that the endianess would be a problem. I don’t think there will be any problems, especially if the display only uses 8bit data or monochrome pixels. Endianess can be a problem even for ARM, so for example for a SSD1351 display I had to send first the high byte and then the low byte. But this is something you can handle in the display writing routine (as did for that case). Hi Erich I will try to run LittlevGL on S12X. I have some projects with seven segment display that should update them with a TFT display. Is there a link for the project with the FRDM K64F in order to download it? I can use it as starting point. It is here: Note that this is a Processor Expert component and uses the latest components from Pingback: Tutorial: First Steps with Embedded Artists NXP i.MX RT1052 OEM Module | MCU on Eclipse Hello Erich, thank you very much for your article, I have also started to working with this board and try to implement LittlevGL into my project. But I have a question regarding using real double buffering with this library. It seems not to support video buffer switching like emWin does it. The virtual buffer is just an area in RAM and is copied to LCD RAM buffer pixel by pixel in the ex_disp_flush routine. It is not so terrible, static windows work just fine and it spares memory, but if you try to swipe windows you can easily observe visual artefacts. I have already disabled cache, but it will not help, because virtual buffer is drawn during the refreshing of the display picture. I haven’t found any possibility to implement double buffering by switching memory areas after the LCDIF_IRQHandler interrupt. But I have noticed some routines regarding switching buffers in your source code, but they seem not to be active. What do you think about it, do you mean it is possible to imlement such functionality or is it to complex? With best regards, Alex Hi Alex, yes, the library supports double buffering and I have not used that not to waste memory. If might add a define or so to switch between double buffering and normal buffering? Hi Alex, See and the define PL_CONFIG_USE_LCD_DOUBLE_BUFFER platform.h: it enables using the LCDIF_IRQHandler. I think this could be even combined with using LV_VDB_DOUBLE, but I have not tried that yet. Pingback: McuOnEclipse Components: 30-Sept-2018 Release | MCU on Eclipse Pingback: First Steps with the NXP i.MX RT1064-EVK Board | MCU on Eclipse Pingback: Building a Raspberry Pi UPS and Serial Login Console with tinyK22 (NXP K22FN512) | MCU on Eclipse
https://mcuoneclipse.com/2018/08/12/tutorial-open-source-embedded-gui-library-littlevgl-with-i-mx-rt1050-evk/
CC-MAIN-2019-43
refinedweb
2,037
57.4
The new version of the Silverlight Toolkit (December 2011) for Silverlight 5 is out and you can grab it here: Update: Babylon Engine now uses Silverlight 5 Toolkit: I had the pleasure of working on this version and I’m pleased to write this article to help you discover how the Toolkit enhances Silverlight 5 with the following features: The toolkit comes with a new assembly : Microsoft.Xna.Framework.Content.dll. This assembly allows you to load assets from the .xnb file format (produced by the Content Pipeline). Using the new Visual Studio templates (which I will describe later), you can now easily port existing 3D projects directly to Silverlight 5! Microsoft.Xna.Framework.Content.dll assembly will add the following classes to Silverlight 5: The toolkit comes also with the Microsoft.Xna.Framework.Tookit.dll assembly which will add the following classes to Silverlight 5: The documentation for this class can be found here: The ContentManager class is the representative for the Content Pipeline inside your code. It is responsible for loading objects from .xnb files. To create a ContentManager you just have to call the following code: There are restrictions for this class : *The ContentManager for Silverlight can only support one Content project and the RootDirectory must be set to “Content”* Using it is really simple because it provides a simple Load method which can be used to create your objects: The documentation for this class can be found here: The model class has the same API as in XNA 4 and it will allow you to load and render 3D models from XNB files: You can also use bones if your model supports them: You can import models using .x or .fbx format: And thanks to the FBX importer, you can also import .3ds, .obj, .dxf and even Collada. The documentation for these classes can be found here: The SpriteBatch class is used to display 2D textures on top of the render. You can use them for displaying a UI or sprites. As you can see, SpriteBatch only needs a texture to display. SpriteFont allows you to use sprites to display text. SpriteFont relies on SpriteBatch to draw and needs a font definition from the ContentManager: The toolkit introduces a new class called SilverlightEffect which can be used to apply .fx files. It also support .slfx which is the default extension. There is no difference between .slfx and .fx but as XNA Effect Processor is already associated with .fx, the Silverlight Content Pipeline had to select another one. You can now define a complete effect inside a Content project and use it for rendering your models. To do so: For example here is a simple .fx file: The Toolkit will add required processors to the Content Pipeline in order to create the .xnb file for this effect: To use this effect, you just have to instantiate a new SilverlightEffect inside your code: Then, you can retrieve effect’s parameters: To render an object with your effect, it is the same code as in XNA 4: Silverlight 5 provides Texture2D, TextureCube and SoundEffect classes. With the Toolkit, you will be able to load them from the ContentManager: In order to facilitate porting existing 3D applications and to accommodate polling input application models, we also added partial support for Microsoft.Xna.Framework.Input namespace. So you will be able to request MouseState and KeyboardState everywhere you want: However, there is a slight difference from original XNA on other endpoints: you have to register the root control which will provide the events for Mouse and Keyboard. The MouseState positions will be relative to the upper left corner of this control: The MouseState and KeyboardState are similar to XNA versions: Silverlight Content Pipeline can be extended the same way as the XNA Content Pipeline on other endpoints. You can provide your own implementation for loading assets from elsewhere than the embedded .xnb files. For example you can write a class that will stream .xnb from the network. To do so, you have to inherit from ContentManager and provide your own implementation for OpenStream: You can also provide our own type reader. Here is for example the custom type reader for SilverlightEffect: The toolkit will install two new project templates and a new item template: This template will produce a full working Silverlight 3D application. The new solution will be composed of 4 projects: The main project (Silverlight3DApp) is built around two objects: This template will produce a Silverlight Library without any content but with all Microsoft.Xna.Framework references set: And the resulting project will look like: This item template can be used inside a Content project to add a custom .slfx file that will work with SilverlightEffect class: The file content will be the following: Finally, to help you discover and learn all these features, we added some cools samples: This sample shows you how to use sprites to accomplish post-processing effects such as “bloom”. It also uses the Content Pipeline to import a tank model from a .fbx file. This sample shows you how custom effects can be applied to a model using the Content Pipeline. This sample shows how 3D models can be generated by code during the Content Pipeline build process. This sample introduces the concept of a particle system, and shows how to draw particle effects using SpriteBatch. Two particle effects are demonstrated: an explosion and a rising plume of smoke: This sample provides easily reusable code for drawing basic geometric primitives: This sample is a complete game with 3 levels provided (you can easily add yours). It shows the usage of SpriteBatch, SpriteFont and SoundEffect inside a platform game. It also uses Keyboard class to control the player. This sample shows how to apply program controlled rigid body animation to a 3D model loaded with the ContentManager: This sample shows how to process and render a skinned character model using the Content Pipeline. As you noticed, all these new additions to the Silverlight Toolkit are made to make it easy to get started with new Silverlight 3D features by providing developer tools to improve usability and productivity. You can now easily start a new project that leverages both concepts of XNA and Silverlight. It becomes easy to work with 3D concepts and resources like shaders, model, sprites, effects, etc... We also try to reduce the effort to port existing 3D applications to Silverlight. So now it’s up to you to discover the wonderful world of 3D using Silverlight 5! Awesome
http://blogs.msdn.com/b/eternalcoding/archive/2011/12/10/silverlight-toolkit-september-2011-for-silverlight-5-what-s-new.aspx?PageIndex=1
CC-MAIN-2014-52
refinedweb
1,087
57.4
Greg Ewing wrote: > Bruce the yield goes away (both the statement and expression form). This would be replaced by builtin functions. I would propose that the builtins take optional pipe arguments that would default to the current thread's pipein/pipeout. I would also propose that each thread be allowed multiple input and/or output pipes and that the selection of which to use could be done by passing an integer value for the pipe argument. For example: send(obj, pipeout = None) send_from(iterable, pipeout = None) # does what "yield from" is supposed to do next(iterator = None) num_input_pipes() num_output_pipes() You may need a few more functions to round this out: pipein(index = 0) # returns the current thread's pipein[index] object, could also use iter() for this. pipeout(index = 0) # returns the current thread's pipeout[index] object throwforward(exc_type, exc_value = None, traceback = None, pipeout = None) throwback(exc_type, exc_value = None, traceback = None, pipein = None) Thus: yield expr becomes send(expr) which doesn't mean "this is generator" or that control will *necessarily* be transfered to another thread here. It depends on whether the other thread has already done a next on the corresponding pipein. I'm thinking that the C code (byte interpretor) that manages Python stack frame objects become detached from Python stack, so that a Python to Python call does not grow the C stack. This would allow the C code to fork the Python stack and switch between branches quite easily. This separation of input and output would clean up most generator examples. Guido's tree flattener has special code to yield SKIP in response to SKIP, because he doesn't really want a value returned from sending a SKIP in. This would no longer be necessary. def __iter__(self): skip = yield self.label if skip == SKIP: yield SKIPPED else: skip = yield ENTER if skip == SKIP: yield SKIPPED else: for child in self.children: yield from child yield LEAVE # I guess a SKIP can't be returned here? becomes: def __iter__(self): return generate(self.flatten) def flatten(self): send(self.label) if next() != SKIP: send(ENTER) if next() != SKIP: for child in self.children: child.flatten() send(LEAVE) Also, the caller could then simply look like: for token in tree(): if too_deep: send(SKIP) else: send(None) <process token> rather than: response = None gen = tree() try: while True: token = gen.send(response) if too_deep: response = SKIP else: response = None <process token> except StopIteration: pass The reason for this extra complexity is that send returns a value. Separating send from yielding values lets you call send from within for statements without having another value land in your lap that you really would rather have sent to the for statement. The same thing applies to throw. If throw didn't return a value, then it could be easily called within for statements. The parsing example goes from: def scanner(text): for m in pat.finditer(text): token = m.group(0) print "Feeding:", repr(token) yield token yield None # to signal EOF def parse_items(closing_tag = None): elems = [] while 1: token = token_stream.next() if not token: break # EOF if is_opening_tag(token): elems.append(parse_elem(token)) elif token == closing_tag: break else: elems.append(token) return elems def parse_elem(opening_tag): name = opening_tag[1:-1] closing_tag = "</%s>" % name items = parse_items(closing_tag) return (name, items) to def scanner(text): for m in pat.finditer(text): token = m.group(0) print "Feeding:", repr(token) send(token) def parse_items(closing_tag = None): for token in next(): if is_opening_tag(token): send(parse_elem(token)) elif token == closing_tag: break else: send(token) def parse_elem(opening_tag): name = opening_tag[1:-1] closing_tag = "</%s>" % name items = list(generate(parse_items(closing_tag), pipein=pipein())) return (name, items) and perhaps called as: tree = list(scanner(text) | parse_items()) This also obviates the need to do an initial next call when pushing (sending) to generators which are acting as consumers. A need which is difficult to explain and to understand. > >> *. I didn't mean to imply that buffering was required, or even desired. With no buffering, the sender and receiver stay in-sync, just like generators. A write would suspend until a matching read, and vice versa. Only when the pipe sees both a write and a read would the object be transfered from the writer to the reader. Thus, write/read replaces yield as the way to suspend the current "thread". This avoids the confusion about whether we're "pushing" or "pulling" to/from a generator. For example, itertools.tee is currently designed as a generator that "pulls" values from its iterable parameter. But then it can't switch roles to "push" values to its consumers, and so must be prepared to store values in case the consumers aren't synchronized with each other. With this new approach, the consumer waiting for the send value would be activated by the pipe connecting it to tee. And if that consumer wasn't ready for a value yet, tee would be suspended until it was. So tee would not have to store any values. def tee(): num_outputs = num_output_pipes() for input in next(): for i in range(num_outputs): send(input, i) Does this help? -bruce frederiksen
https://mail.python.org/pipermail/python-ideas/2009-February/003044.html
CC-MAIN-2014-15
refinedweb
856
63.39
Microsoft Corporation April 2006 Applies to: Visual Studio 2005 Visual Studio .NET 2003 Summary: Find out how to use the new project type, the Web application project, as an alternative to the Web site project model already available in Visual Studio 2005. (27 printed pages). This paper describes Web application projects and offers information on when you might choose between a Web application project and a Web site project model in Visual Studio 2005. The paper also walks you through the following common scenarios: In addition, an appendix lists known issues with Web application projects. Adding Web application projects to Visual Studio 2005 requires you to install both an update and an add-in to Visual Studio 2005. The two installations perform the following tasks:. You can subdivide one ASP.NET application into multiple Visual Studio projects. You can easily exclude files from the project and from source code-control. This project type is desirable if you have an existing folder structure representing an ASP.NET application that you want to edit in Visual Studio without having to explicitly create a project file. All code-behind class files and stand-alone class files in the project are compiled into a single assembly, which is placed in the Bin folder. Because this is a single assembly, you can specify attributes such as assembly name and version, as well as the location of the output assembly. Certain other applications scenarios are better enabled, such as the Model-View-Controller (MVC) pattern, because they allow stand-alone classes in the project to reference page and user control classes. Alternatively, you can precompile the site for performance, which uses the same compilation semantics as ASP.NET dynamic compilation. The ASP.NET dynamic compilation system has two modes—batch mode (the default) and fixed-names mode. In batch mode, many assemblies (typically one per folder) are produced when precompiling the site. In fixed mode, one assembly is produced for each page or user control in the Web site. Because pages are compiled dynamically and compiled into different assemblies as needed, it is not required that the entire project compile successfully in order to run and debug a page. By default, Visual Studio completely compiles Web site projects whenever you run or debug any page. This is done to identify compile-time errors anywhere in the site. However, a complete site build can significantly slow down the iterative development process, so it is generally recommended that you change the build project option to compile only the current page on run or debug. In this model, .aspx files are not compiled until they are run in the browser. However, when used with Web Deployment Projects (a downloadable add-in to Visual Studio 2005), the .aspx files can also be compiled and included in a single assembly for deployment. Each time you deploy the single assembly produced in this model, you replace the code for all pages in the project. The default mode for precompiling produces several assemblies in the Bin folder, typically one per folder. The fixed-names option produces one assembly per page or user control and can be used to create deployable versions of individual pages. However, the fixed-names option increases the number of assemblies and can result in increased memory usage. This section walks you through creating a new Web application project. It also examines how page code is handled in a Visual Studio 2005 Web application project. The examples shown here are in C#. The steps for working with Visual Basic are very similar, but file names and code will differ slightly.: Figure 1. Creating a new Web Application Project Name the project and specify a location. When you click OK, Visual Studio creates and opens a new Web project with a single page named Default.aspx, an AssemblyInfo.cs file (.vb file), and a Web.config file:; } } } Run the project in debug mode by pressing F5 or clicking Run in the Debug menu. By default, Web application projects use the built-in ASP.NET Development Server using a random port as the root site (for example, the site's URL might: Figure 4. Setting output build location After building the project, you can examine the results. In Solution Explorer, click Show All Files: Figure 5. Results of building a Web application project This works the same as it does in Visual Studio .NET 2003 ASP.NET Web.:. Be sure you have installed Web Application Projects in Visual Studio 2005 by following the steps in the Installing Web Application Projects section earlier in this paper..:. After the solution and project files are upgraded to Visual Studio 2005 format, validate that your application builds without errors and runs as expected. At this point, the most common errors or warnings will be of these types:: This appendix lists known issues with Web application projects.. <%@ Register <%@ Import Namespace="wap1" %> <pages> <namespaces> <add namespace="wap1"/> </namespaces> </pages> . <asp:ObjectDataSource.
http://msdn.microsoft.com/en-us/library/aa730880%28VS.80%29.aspx
crawl-002
refinedweb
823
55.64
Solving software challenges - Synopsys Pesti Challenge 2016 I like mysteries and puzzles. They provide solid, exciting and interesting base for movies, books and recreational activities. And, at least in the software industry, they can be used in recruitment prescreening and/or candidate selection. This was also the case in Synopsys Pesti Challenge 2016, which I stumbled upon when reading backlogs Geek Collision's IRC channel. The challenge was part of the Pesti Career Day, a networking event aimed at the students of University of Oulu. Spoiler alert! Detailed solutions ahead! Mission 1 The zip archive contains three files: instructions.txt mission2.zip traffic.pcap The instructions tells you to find a password from traffic.pcap and use it to open the encrypted mission2.zip archive. Sounds quite straightforward. So, pcap files are network packet capture files, recorded for example by tcpdump. I used tshark (a network analyzer with a command line interface, member of the Wireshark suite) to decode the file as plain text: tshark -V -r traffic.pcap | less And because I was looking for a password, I decided to give a try and searched for words "password" and "Password". Luckily, the latter gave a match: X-Shadows: Password for mission2.zip is same as for this webpage.\n That line was a HTTP header field, part of a response message (in frame 251) to a previously sent HTTP request. The "mission1" was starting to look really easy and almost solved; all captured HTTP traffic was unencrypted, so the password was there, just waiting for me to read it. The original HTTP request was couple of frames before (frame number 247) and it contained the basic auth header in plain text, alongside with its base64 decoded payload: Authorization: Basic TXJKb2huc29uOlJ1bm5pbmdJblRoZVNoYWRvd3M=\r\n Credentials: MrJohnson:RunningInTheShadows Mission accomplished, that was easy. Mission 2 With the correct password, mission2.zip revealed following secrets: instructions.txt logo.bmp mission3.zip Now, the mission was once again, to find a correct password for mission3.zip. Instructions hinted that the password was somewhere inside logo.bmp. I decided to have look at it with my preferred image viewer, sxiv. Unfortunately, the image format was unsupported, which was not a big surprise, since BMP is a bitmap file format specificed by Microsoft. Firefox was my second choice, and it revealed the secrets of the image right away; it was a blend of a very crude logo and a QR code: Poor man's steganography, that is. So, the password was probably encoded as a QR code which in turn was blended with another image to make it hard to decipher. Well, because QR codes are binary images, one bit per pixel is enough for conveying the code. Perhaps it was the least significant bit? I just had to extract the QR code from the image and make it actually machine-readable for a barcode scanner app. I had experience on mangling bitmaps with Python and PIL (Pillow actually), so writing a short Python script for the task was the most natural thing to do for me. I guess I could have extracted the bardcode from the image with Gimp or such, but mouse-surfing through menus, dialogs and buttons is not my cup of tea. Hacking with my keyboard is: import PIL.Image img1 = PIL.Image.open("logo.bmp") img1_bytes = img1.tobytes() img2 = PIL.Image.new("RGB", img1.size) img2_pixels = img2.load() for i in range(img1.size[0]): for j in range(img1.size[1]): byte = ord(img1_bytes[i + j * img1.size[0]]) img2_pixels[i, j] = ((byte & 1) * 255,) * 3 img2.save("logo_unmasked.png") And out came the password: 440e167fdec Mission 3 The final archive, mission3.zip, contains the following files: final.txt.gpg strange.txt task.txt The mission, as described in task.txt, is to parse the password for the symmetrically encrypted final.txt.pgp file from strange.txt with the following rules: - Begin from the start until the first occurrence of '/' (inclusive). - Take all occurences of 'h' followed by 4 uppercase letters, 3 numbers and 2 next characters. - Take everything between 'e' and '/' (inclusive). - Take all occurences of 'i' and any 5 characters. - Take 'SYN' and 'ACK' and everything between. - Take 'RST' and 15 next characters. - All found matches regardless of match type must be in the order they are found in strange.txt. I must say that I find the parsing rules somewhat ambiguous, probably intentionally, it is part of the "challenge" afterall, right? After I read those rules couple of times, I came up with the following short Python script: import re with open("strange.txt") as f: strange = f.read() parts = [] patterns = ( r'^.*?/', r'h[A-Z]{4}[0-9]{3}..', r'e.*?/', r'i.{5}', r'SYN.*?ACK', r'RST.{15}', ) for pattern in patterns: for match in re.finditer(pattern, strange): parts.append((match.start(), match.group())) print(''.join(list(zip(*sorted(parts)))[1]), end='') So the first six rules translate directly to the six regular expression patterns. Nothing special there. But the trick of this mission was to join all matched substrings in the right order. The seventh rule states that all matches must be concatenated in the order they are found. So, to concatenate matches in the right order (not in the order the patterns were matched, but in the order the password substrings are located in the original string), I had to sort the results before joining them together. Hence I used the start offset of each match to sort all substrings. And then again, out came the password: DCWdszB5rVbamS6S8pLVBx2KzSktPxU2CsbbMdFLqLc2w78Tt0YTyD3PaubkmDHr1ZcbD0XD3I/SYNj4xqSU7ACKe8yUz4wB46FsoLJIIRJAMuVoCeFbqb2Ij5KLsel2NSjKCudMEtj8vIONhQIYZewUt7mqjkIuz9zD5U/iE2J6UhGKON356QDiOJ7WUiap7y1hCDUE295qfi03sk2eMs5orW9nr2UAkWWUuTgAAxT/iwg8R7hHJDH026COelPC/e3yNlz5y5L/eVTZzaMaE1ZW/SYNuqoOPnGEHuOVKgQrJ7dr4duJfWRZfKmo74pP7sUvPRgtNY8j30Yp5APPgWwf4DQqDgb9YszYPt5K77VcaI3WVKgAJ1YNdY9urAMn07NIT1R4z4UZg8OzMc9yWIKfcntt1DlLACKiQX95bhDSIX661jkeu1HLxFpqJLz2CTkfYpxJJ6ooWJzEmkNqXpjf0wKmPtHH7/SYNtzLBcSaoKjP0m8BA+ull2JaJld26Kf8Ol92+KJQggBrTglzRd+36GVCoTnNSsACKegPwJ2kj7dQmlc/hULOR911nriY0vRUhKYPM777rheFPo7mCrp+uRWpFHHw+bERn65ZkXKv3f8FuHdD8Ocos/iWgUqaiproB3ej5YV/ecpqNwsm2LmAFvLzwrsj/RSTTKcTPVwIjLKdTgl Decrypted final.txt welcomes the reader to visit Synopsys's Pesti Career Day booth to claim a prize. The challenge was Truly Covered, yay. Not much of a challenge though, but still a nice snack. Few months ago I solved a reverse engineering challenge, named Cyber Challenge 2015. It was a somewhat more challenging task than this and proved to bring more joy. I'll write a post about it the next time I find some time.
http://tjjr.fi/posts/solving-software-challenges-synopsys-pesti-challenge-2016/
CC-MAIN-2019-09
refinedweb
1,020
58.38
How can I draw text label over Sprite (new Unity 4.3) feature. I have sprite hirarchy Screen (base background sprite: order in layer = 0) +--> Progress (progress bar bar sprite: order layer = 2) +--> Text (progress bar text) I have progress bar script (on LoadingProgress GameObject) which automatically takes Progress and Text objects if they exist and updates Progress scale and Text text to current progress values (ex. 10/100) The problem is Text is not visible. Have tried to make Text as TextMesh - than it is only visible if progress is empty - Progress sprite is drawn on top of Text. Have tried to make Text a GUIText - but have a problem converting world coordinates to GUI coordiantes. GUIUtility.ScreenToGUIPoint(Camera.main.WorldToScreenPoint(text.transform.position)) always returns (0, 0) so text is drawn in lower left corner of the screen. GUIUtility.ScreenToGUIPoint(Camera.main.WorldToScreenPoint(text.transform.position)) upd: Figure out that GUIUtility.ScreenToGUIPoint is only working in OnGUI() function. Answer by mugathur · Nov 18, 2013 at 11:06 AM Currently, all non-sprites seem to go into the "Default" sorting layer. So if you put any sprites in a Sorting Layer or Order in Layer that is in front of Default/0, no amount of Z offsetting is going to get the non-sprite in front of the sprite. For now, I'm putting my UI Sprites back in my "Default" sorting layer and using position.z and the Offset Z field in TextMesh to push it in front of my sprite. Ha, yes this works. Also I found that it is possible to use negative Order in Layer. To pity I already wrote my text to sprite renderer. If you have a good reason for changing EVERY gameobjects sorting layer to Default, then go ahead, but this is a huge change for something as small as text rendering. That being said, none of the other answers have worked. So this answer takes the win! Answer by Neakiir · Mar 12, 2014 at 01:32 PM Another option I have found is to put the textmesh entity's renderer to be the same layer as another entity's. I have put my textmesh as a child of an entity with a sprite renderer and set the sorting layer to be that of the parent's. void Start () { this.renderer.sortingLayerID = this.transform.parent.renderer.sortingLayerID; } Works great! Thanks! This worked for me aswell :) I think this should be accepted as the correct answer This is a nice solution, thanks. Answer by lordpaladin44 · Oct 23, 2015 at 12:20 PM Textmesh components are Renderer components as noted in a previous answer. Its easy to add your own component that sets the renderer SortingLayerID or SortingOrder to match the sprite you want the text to sit on top of (to be Z based). See sample. public class RendererSortingLayer : MonoBehaviour { public int SortLayer = 0; public int SortingLayerID = SortingLayer.GetLayerValueFromName("Default"); // Use this for initialization void Start () { Renderer renderer = this.gameObject.GetComponent<Renderer>(); if(renderer != null) { renderer.sortingOrder = SortLayer; renderer.sortingLayerID = SortingLayerID; } } } Answer by shopguy · Jul 21, 2015 at 05:20 AM Another option is to place the "Default" default sorting layer in front of all other layers (drag/drop in editor). Of course none of these answers are perfect, but just another option that might work for some. Would be nice if we could get a sorting layer for a TextMesh, that we can set in the editor. Answer by yatagarasu · Nov 14, 2013 at 12:14 PM Ok, I figured out that I should scale screen coordinates. Vector2 screenPosition = Camera.main.WorldToScreenPoint(text.transform.position); Vector2 guiPosition = new Vector2(screenPosition.x / Screen.width, screenPosition.y / Screen.height); text.transform.position = GUIUtility.ScreenToGUIPoint(guiPosition); Works ok. But one question still remains - Is it possible to draw TextMesh over sprite? have same question, any one have solution?? i want to add text in front of my sprite button gui text seem draw call,tris and verts work on unity? 1 Answer Atlas size based on sprite 0 Answers Sprite Rendering Cost Calculation 1 Answer Determine Texture Size 0 Answers Jelly Object for 2D Game 2 Answers
https://answers.unity.com/questions/575342/how-to-draw-text-over-sprite.html
CC-MAIN-2019-39
refinedweb
692
55.03
SR300 - Frame Rate minimal valueDeanM Jun 26, 2017 4:04 AM Hi 1. Re: SR300 - Frame Rate minimal valueMartyG Jun 26, 2017 5:20 AM (in response to DeanM) 2. Re: SR300 - Frame Rate minimal valueDeanM Jun 26, 2017 5:38 AM (in response to MartyG) Hi Marty, Thank you for a quick replay regarding this. I expected as much, just wanted to confirm it. I spent a lot of time trying different things to improve the quality of the frames and I couldn't manage to bring the FPS bellow 30. 3. Re: SR300 - Frame Rate minimal valueMartyG Jun 26, 2017 5:43 AM (in response to DeanM) You're very welcome. I wish you the best of luck with getting 10 fps up and running, if you choose to use Librealsense. 4. Re: SR300 - Frame Rate minimal valuemchip Sep 30, 2017 12:01 PM (in response to MartyG) I have the same trouble but with windows 10, the rs300 works fine with framerate 60 and 30, put I cant set 10, somebody know how can I Change this? 5. Re: SR300 - Frame Rate minimal valueMartyG Sep 30, 2017 12:53 PM (in response to mchip) I believe your best chance of setting 10 FPS may be to use Librealsense, given the 10 FPS patch that was developed for Librealsense. Depth/IR streams always 30FPS for SR300 and F200 · Issue #361 · IntelRealSense/librealsense · GitHub Whilst using Librealsense with Windows was an awkward option once, you may find that the new RealSense SDK 2.0- - which is a new and improved Librealsense that works on Windows 10 as well as Linux and is SR300 compatible - may make life easier for you in regard to writing a 10 FPS application. This is dependent on whether the 10 FPS patch would function with SDK 2.0, of course. GitHub - IntelRealSense/librealsense at development 6. Re: SR300 - Frame Rate minimal valuemchip Oct 18, 2017 1:10 AM (in response to MartyG) Thank you somuch, Now I have other quations, I tried to use , realsense on linux, but all examples are for windows, so I always see the PXCSensemanager for make a new conections, but on linux this class not exist, so I tried to used java and is ridiculus that only works again for windows (so does not have sense), I instaled libgdx for java on linux and again, only works for windows, I can not understand whay this apis says "cross" when not working in linux. There are some posibilite to compile de realsense class "PXC(classes)" for linux???, for not use the realsense/rs.h. 7. Re: SR300 - Frame Rate minimal valueMartyG Oct 18, 2017 1:39 AM (in response to mchip) If you are using Linux then I would recommend using the new RealSense SDK 2.0, which is an advanced form of Librealsense and is compatible with the SR300. It is a cross-platform, open source SDK that works on Windows and Linux, with Mac OSX support coming. I believe that SDK 2.0 will be the single standard SDK for RealSense from this point onward. I understand that this is awkward from the perspective of having to find examples in the Librealsense language instead of the Windows PCX samples. By adopting SDK 2.0 though, you will be future-proofing your work, since the old Windows SDKs will not be receiving further updates. SDK 2.0 comes with some sample scripts that you can use as a reference RealSense SDK 2.0 documentation 8. Re: SR300 - Frame Rate minimal valuemchip Oct 18, 2017 2:41 PM (in response to MartyG) Thank you, I see that the project for windows include cpp2c with the c++ implementation code, Can I take this project and Compiler on linux??? and reproduce .so bin?? Best regards! 9. Re: SR300 - Frame Rate minimal valueMartyG Oct 18, 2017 3:15 PM (in response to DeanM) SDK 2.0 is cross-platform, so an SDK 2.0 script should work in a Linux compiler so long as you use an include in your C++ script to call the SDK's API, as described in the tutorial examples. #include <librealsense2/rs.hpp> // Include RealSense Cross Platform API 10. Re: SR300 - Frame Rate minimal valuemchip Oct 18, 2017 4:27 PM (in response to MartyG) I meand that the windows project rssdk has the cpp for PXCSENSEMANAGER.cpp and I see that has other resource. I just install the librealsense 2 but not works, I get error 11. Re: SR300 - Frame Rate minimal valueMartyG Oct 18, 2017 4:34 PM (in response to mchip) There is no compatibility between the previous Windows RealSense SDK (RSSDK) that has the PXCSensemanager file and the Librealsense-based SDK 2.0. They have completely different DLL library files. 12. Re: SR300 - Frame Rate minimal valuemchip Oct 18, 2017 6:29 PM (in response to MartyG) ok, I made this sample: // Create(); // The frameset might not contain a depth frame, if so continue until it does if (!depth) continue; //"; } Ok. I just compile sample on linux for realsense2 and a get this error: En la fución 'rs2::pipeline::start()', /usr/include/librealsense2/hpp/rs_pipeline.hpp: 371 referencia a 'rs2_pipeline_start' sin definir. Why happend this??
https://communities.intel.com/message/483313
CC-MAIN-2018-43
refinedweb
871
68.5
Application. For many small and medium sized programs, it isn't too difficult to find and fix bugs based on reproducible information from users. As applications increase in size and complexity, the ability to figure out what is causing a bug becomes more difficult. On larger enterprise systems you need a way to track what is happening to find out what is causing problems. You must instrument your application so you can turn on tracing that will reveal pertinent information about your program's behavior. The Trace class allows you to perform logging in a production system, giving you the ability to analyze application behavior during run time. Two of the primary types in the System.Diagnostics namespace for application instrumentation are the Debug and Trace classes. Both classes have the same functionality but different use cases. Use the Debug class during development and use the Trace class in production applications. The types for debugging and tracing, which come with the .NET Framework library, are convenient because they provide reuse and extendable functionality. You don't have to create your own logging library and you can build custom instrumentation types. When tracing, you can control output with switches. A BooleanSwitch turns tracing on and off. TraceSwitch lets you trace at different levels. Alternatively, you can create a custom switch to define identifiers, granularity, and logic that meets the requirements of a given application. Trace output is sent to another type called a TraceListener. .NET ships with trace listeners for writing to the console, event log, or text files. You can also define your own trace listener for output to the stream of your choice. Instrumentation is a critical component of enterprise application development, enabling you to build maintainable, reliable, and robust systems. Through Debug and Trace classes, switches, and trace listeners, you have the ability to instrument your application in an easy and flexible manner. Configuration The Debug and Trace classes have the same functionality, but Microsoft designed them for different purposes. You use the Debug class for development purposes and it relies on DEBUG being defined. Use the Trace class for production purposes. It relies on TRACE being defined. By default, Visual Studio .NET (VS.NET) defines both DEBUG and TRACE for Debug (development) configurations and only TRACE for Release (production) configurations. To view your project configurations in VS.NET, right-click on the project, select Properties, select Configuration Properties, select the Build option, and view the Conditional Compilation Constants property. When compiling C# applications from the command-line, compilation configuration options are specified with the /define: or /d: option, as follows: csc.exe /d:TRACE MyApp.cs Basic Tracing For this article we'll use the Trace class to show how to use .NET types for instrumentation of production systems. While I wrote the examples in this article as Console applications for simplicity, you can use this information for instrumenting any kind of .NET application, including ASP.NET, remoting, Web services, and Windows Forms. The Trace class has several members that control output, which you can see in Listing 1. When your tracing needs are simple, that is, you only need to turn tracing on or off, a Boolean switch is a good choice. The first line in Listing 1 adds a TraceListener to the Listeners collection. TraceListeners are discussed in the Trace Listeners section of this article. They let you specify where the output of write statements will go. The WriteLine and Write methods write output with and without a newline, respectively. The WriteLineIf and WriteIf methods write output if a condition evaluates to true. The category parameter enables you to prefix the output with a tag string, which is useful for filtering log entries. The Assert method displays a dialog and writes output when the specified condition evaluates to false. The condition is explicitly set to false in Listing 1 to raise the assertion. You normally use the Assert method with the Debug class so you can test assumptions in your code during development. You don't normally want assertion message boxes popping up in front of users. The Fail method raises an assertion dialog and writes to output unconditionally. Although Listing 1 shows the Fail statement with the Trace class, you should use it with the Debug class because you don't want a message box popping up in front of your users. You can use the Fail method when you reach an illogical segment of code such as a default in a switch statement that doesn't make sense or in an exception catch block. The benefit of the Fail method is that you can press the Retry button and break into the debugger to determine the cause of the problem. The Trace class also includes other members for controlling output, including properties for indentation, output flushing, and closing listeners. Their implementations are straight forward and I refer you to the documentation for more information. The next two sections discuss switches, which you use for conditional output with the WriteIf and WriteLineIf methods. Boolean Switches A BooleanSwitch will allow you to produce trace output only when the switch is true. When all tracing is turned on, the output can quickly use a lot of resources if saving output to file or some other persistent store. If your application is small or you don't hold log information longer than immediate diagnosis, a BooleanSwitch will work fine. Listing 2 shows how to use a BooleanSwitch. The code in Listing 2 is very simple?if boolSwitch.Enabled evaluates to true, then the string parameter to the WriteLineIf method is sent to output. When instantiating the boolSwitch variable, you set the first parameter to a configuration file parameter named MyBooleanSwitch. As shown in Listing 3, the System.Diagnostics element contains a switches element where you can add a switch statement. In this case there is an element for MyBooleanSwitch and it is turned on. A value of 1 turns the switch on and 0 turns the switch off. You can add multiple switches to the configuration file to help manage tracing at a more granular level in different parts of your application. Trace Switches The problem with a BooleanSwitch approach to instrumentation is that it is all-or-nothing. Most of the time, you need more granularity in your approach. For example, perhaps during normal operations you only want to know about error conditions. However, to diagnose a problem, you need the ability to trace more information for a short period of time. The level of information you need at any given time could vary depending on what you need to know. Here you'll find value using the TraceSwitch. The TraceSwitch has five levels of control, defined by the TraceLevel enum (with corresponding value): Off (0), Error (1), Warning (2), Info (3), and Verbose (4). You determine when to use each switch level. To help out, I'll explain how I use them. I use Error to detect errors in code, catch filters, and global exception handlers. I rarely use Warning, but I use it for strange situations that aren't really errors but I should pay attention to them. If that sounds ambiguous, it is; which is why I rarely use Warning. I use Info to enter and exit methods. I log state conditions in an algorithm with Verbose. Be aware that too many trace statements could make an algorithm harder to read, so use them only where you think they have debugging value. Basically, think about what information you need to detect problems and debug your application if something went wrong. Listing 4 shows how to use TraceSwitch in your code. Use a TraceSwitch switch when you need to filter the amount of output based on an increasing level of detail and severity. When your code declares the TraceSwitch variable, it is instantiated with the MyTraceSwitch parameter, which corresponds to the same entry in the switches element of the configuration file in Listing 5. This configuration file sets MyTraceSwitch to 4, which turns on tracing for Verbose and every level below it. As implied, the trace level setting in the configuration file turns on tracing for the level it is set at in addition to all lower levels. The TraceSwitch class has Boolean properties that correspond to each trace level. Listing 4 demonstrates how to use the traceSwitch variable as the first parameter to WriteLineIf to determine if a specific trace level is set before logging output. Custom Switches Switches that ship with .NET will work fine for most cases. However, there are times when you may want to implement your own custom switches. Perhaps you want to migrate another system where you have a different logging strategy that worked and you want to mimic that strategy in .NET. What if the all-inclusive logic of the TraceSwitch didn't quite meet your needs? Existing switches don't provide the output control you need? With reusable types in the .NET Framework Class Library you can create your own custom switch. I'll demonstrate how to create a custom switch. I designed my example to give you ideas of how you could implement your own custom switch to achieve the granularity and logic handling appropriate for your needs. The custom switch in Listing 6, FlagSwitch, creates new switch categories: None, Enter, Exit, Info, and Exception. As opposed to the TraceSwitch where higher switch levels are all inclusive of lower levels, the FlagSwitch lets you turn categories on and off at will. The FlagLevel enum is decorated with the [Flags] attribute, allowing you to use it in bitwise operations. You can explicitly set each element with a hex value to ensure their values don't overlap. Notice how my example exposes each switch setting as a property. The get accessors use the SwitchSetting of the base class, Switch, and use a bit-wise AND operation to check if the bit representing that condition is set. The Switch class takes care of reading configuration file settings and ensures that the SwitchSetting property is set accordingly. The implementation also ensures that in all properties, except for None, the None bit is turned off, since this would represent an illogical condition. Trace Configuration The configuration files in previous examples showed how to add a single switch to an application. You can do more with configuration files including add additional switches and remove switches. The following snippet shows these additional switch configuration capabilities: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.diagnostics> <switches> <add name="TraceSwitch3" value="4" /> <add name="TraceSwitch2" value="4" /> <add name="TraceSwitch1" value="4" /> <remove name="TraceSwitch2" /> </switches> </system.diagnostics> </configuration> The configuration file adds three switches, which you can use in different parts of an application to give you more control over where you want to view debug output. The remove element essentially un-defines TraceSwitch2, making any conditional Trace statements in your code evaluate to false and not print. The remove element provides a way to turn a switch off, which is an alternative to deleting, commenting, or setting a value to 0 (assuming that 0 represents a condition that prevents trace output) of an existing switch. Dynamic Switch Settings Besides using configuration files, you can change switch settings dynamically in code. For example, the following code modifies the TraceLevel setting to None for a TraceSwitch: switch1.Level = TraceLevel.Off; If you needed to dynamically set the switch on a custom switch, you should provide a property that accepts an enum for the custom switch type. The implementation of that property can get and set base.SwitchSetting appropriately. The following property implements this for the custom switch described in the Custom Switches section of this article: public FlagLevel Level { get { return base.SwitchSetting; } set { base.SwitchSetting = (int)value; } } This is necessary because the Switch.SwitchSetting property has protected visibility. Trace Listeners You use tracing so you can collect run time information from your application to diagnose problems. This means that there is a location where you can obtain the information, which is where trace listeners come in. A trace listener is a type that allows you to persist your trace information to a location where it can be stored and analyzed. .NET ships with three built-in trace listeners: DefaultTraceListener, TextWriterTraceListener, and EventLogTraceListener. Using DefaultTraceListener The DefaultTraceListener, as its name implies, is where .NET automatically sends all trace output. The output is sent to a Win32 API called OutputDebugString. In Visual Studio .NET, the DefaultTraceListener output appears in the Output window. You can use trace listeners to control output destination including debug output, console, or the Windows Event Log. You can configure a given application with multiple trace listeners. When this occurs, each write operation will be routed to every trace listener installed. Additionally, .NET shares all trace listeners with the Debug and Trace classes, regardless of what switch they are using. The Listeners property of the Trace class exposes a ListenersCollection type, which implements IList. This means that if you prefer not to have output sent to the DefaultTraceListener you can use the Remove method as follows: Trace.Listeners.Remove("Default"); Using TextWriterTraceListener A TextWriterTraceListener writes trace output to a file. To use it, instantiate a TextWriterTraceListener class and add it to the Listeners collection. Listing 7 shows you how to set up a TextWriterTraceListener. The code in Listing 7 creates a file stream and passes it to the TextWriterTraceListener, which will then write trace output to the TraceDemo.log file as well as to all the other trace listeners in the Listeners collection. Using EventLogTraceListener Another trace listener that ships with .NET is the EventLogTraceListener, which writes to the Windows Event Log. Listing 8 shows how to use the EventLogTraceListener. The code in Listing 8 adds an EventLogTraceListener type to the Trace class Listeners collection, along with other listeners. The algorithm automatically starts the mmc snap-in for the Windows Event Viewer so you can see the new entry. Because Windows optimizes access to the Event Log, the EventLogTraceListener is a very efficient way to write trace output. However, one concern with writing to the Event Log is the fact that it could run out of space quickly, depending on how the administrator has the Windows Event Log configured. For this reason, I prefer using the TextWriterTraceListener because it creates a file that I can refer to immediately and then archive for later analysis. Creating a Custom Trace Listener The trace listeners that ship with .NET are good for most applications. However, you may need to direct trace output to another destination that the existing trace listeners don't support. For example, suppose you want to send trace output to a database or maybe output to a special window in your application? Fortunately, you can use types in the .NET Framework Library to create a custom trace listener. When existing trace listeners don't meet your needs, you can create your own. All trace listeners inherit the TraceListener class, an abstract class providing default behavior and virtual methods for you to override in your own custom trace listener. The TraceListener class has abstract Write and WriteLine methods that take a single string as a parameter. Listing 9 shows the implementation of the custom trace listener. The demo in Listing 9 contains a custom trace listener, WindowTraceListener, which opens a Windows Form and writes trace output to a text box. The WindowTraceListener class inherits TraceListener. Its implementation is minimal, overriding only the required Write and WriteLine methods, but Listing 9 demonstrates how easy it is to create a custom trace listener. You will want to override all of the virtual overloads of the TraceListener class for Write, WriteLine, Fail, and Assert for a more robust implementation. Conclusion The .NET Framework ships with several types that make it easy to instrument your applications. You can use BooleanSwitches, TraceSwitches, or create your own switch to specify conditions under which logging will occur. To specify the destination of your tracing output, use the DefaultTraceListener, TextWriterTraceListener, and EventLogTraceListener. Because these libraries are extensible you can also create your own trace listener for sending instrumentation output to the destination of your choice. Instrumentation is a critical part of enterprise application development and the types presented in this article should provide you with more tools to accomplish your work.
http://www.codemag.com/article/0409081
CC-MAIN-2018-26
refinedweb
2,721
55.54
(Technically speaking, this post doesn’t require Groovy. You could do the same thing in Java. Still, as usual, Groovy is easier.) I’m teaching a Groovy course this week and having a great time doing it. One of the exercises I put together is to create a concordance, which is a map relating individual words to the lines in a file on which they appear. The program is a variation on a similar one shown in Barclay and Savage’s Groovy Programming book, and is a good illustration of how easy it is to work with maps in Groovy. A concordance needs to be based on some text somewhere, so I decided to use section 8.00 of the Official Rules of Baseball, which deals with the pitcher. (And even after reading it again, I couldn’t really explain what a balk really is and what it isn’t, but so be it.) I copied the text from the web page and pasted it into a text file. Then the exercise code reads the file line by line, breaks each line into words, and then adds them as keys to a map where the values are lists of line numbers. It’s a good example of using eachWithIndex, and map.get(word,[]) + 1, and so on. Once we’ve made each line lower case (so that ‘Pitcher’ and ‘pitcher’ are the same) and coerced the list values to Sets in order to eliminate duplicates, we’re pretty close to a reasonable solution. The passage is filled with punctuation, however. Fortunately, the tokenize() method in String is overloaded to take a String argument representing the delimiters. Most of the delimiters are obvious and no problem at all (i.e., " .,;:()\'\"). It turns out, however, that the passage also includes sections like: Pitchers are constantly attempting to “beat the rule” in their efforts to hold runners on bases and in cases where the pitcher fails to make a complete “stop” called for in the rules, the umpire should immediately call a “Balk.” which are using so-called “smart” quotes. They don’t match the double-quotes in my delimiter string. In other places, there are also possessives which use “smart” apostrophes. How can I add those to my delimiters? What I needed was the Unicode equivalents for the punctuation. If I know the Unicode values, I can add them as hex values to my delimiters string, like \uXXXX. After some discussions, I decided to parse the entire passage character by character, and add all non-word characters to a map with their Unicode values. The code looks like this: def delimiters = [:] def data = new File('pitcherrules.txt').text data.each { c -> def str = Integer.toHexString(c as int) if (!(c =~ /\w/)) { delimiters[c] = str } } println delimiters It’s pretty straightforward once you know what to look for. Java supplies the Integer.toHexString() method, which takes an int. I read the entire passage into the data variable, then iterated over it, passing each character to the toHexString method. The key was to coerce the character to an int, otherwise I get a MissingMethodException. I originally had a different expression in the if statement. I was using (c < 'A' || c > 'z') instead. The result included the numbers 0 to 9. By matching against a regular expression consisting of \w, though, I check for all word characters, which is equivalent to [A-Za-z0-9]. The output of the code is [" ":"20", ":":"3a", ".":"2e", "\r":"d", "\n":"a", ",":"2c", "(":"28", ")":"29", "’":"2019", "“":"201c", "”":"201d", "-":"2d", "—":"2014", ";":"3b"] which tells me that the Unicode values I need are \u2019, \u201c, \u201d, and \u2014. It’s only a small part of a larger problem, but it’s an easy, useful, interesting script that was probably as much of a learning experience as the original lab. It’s all good. 🙂 Now the real question is how much of this will actually render properly in this blog post. 3 replies on “Using Groovy to determine Unicode characters” Hello…Man i love reading your blog, interesting posts ! it was a great Friday . Sorry!…price generic!!!!! Bye!! ____________________________ purchase generic Thanks for your article! I didn’t get one thing: Shouldn’t “c as int” in “Integer.toHexString(c as int)” be “(c as char) as int”? For the method String.each iterates over a list of strings, doesn’t it?
https://kousenit.org/2008/03/20/using-groovy-to-determine-unicode-characters/
CC-MAIN-2020-29
refinedweb
730
74.08
Three Little Hive UDFs: Part 1 By dan.mcclary on Apr 04, 2013 Introduction In our ongoing series of posts explaining the in's and out's of Hive User Defined Functions, we're starting with the simplest case. Of the three little UDFs, today's entry built a straw house: simple, easy to put together, but limited in applicability. We'll walk through important parts of the code, but you can grab the whole source from github here. Extending UDF The first few lines of interest are very straightforward: @Description(name = "moving_avg", value = "_FUNC_(x, n) - Returns the moving mean of a set of numbers over a window of n observations")@UDFType(deterministic = false, stateful = true) public class UDFSimpleMovingAverage extends UDF We're extending the UDF class with some decoration. The decoration is important for usability and functionality. The description decorator allows us to give the Hive some information to show users about how to use our UDF and what it's method signature will be. The UDFType decoration tells Hive what sort of behavior to expect from our function. A deterministic UDF will always return the same output given a particular input. A square-root computing UDF will always return the same square root for 4, so we can say it is deterministic; a call to get the system time would not be. The stateful annotation of the UDFType decoration is relatively new to Hive (e.g., CDH4 and above). The stateful directive allows Hive to keep some static variables available across rows. The simplest example of this is a "row-sequence," which maintains a static counter which increments with each row processed. Since square-root and row-counting aren't terribly interesting, we'll use the stateful annotation to build a simple moving average function. We'll return to the notion of a moving average later when we build a UDAF, so as to compare the two approaches. private DoubleWritable result = new DoubleWritable();private static ArrayDeque<Double> window;int windowSize;public UDFSimpleMovingAverage() {result.set(0); } The above code is basic initialization. We make a double in which to hold the result, but it needs to be of class DoubleWritable so that MapReduce can properly serialize the data. We use a deque to hold our sliding window, and we need to keep track of the window's size. Finally, we implement a constructor for the UDF class. public DoubleWritable evaluate(DoubleWritable v, IntWritable n) {double sum = 0.0;double moving_average;double residual;if (window == null){window = new ArrayDeque<Double>(); } Here's the meat of the class: the evaluate method. This method will be called on each row by the map tasks. For any given row, we can't say whether or not our sliding window exists, so we initialize it if it's null. //slide the windowif (window.size() == n.get())window.pop();window.addLast(new Double(v.get()));// compute the averagefor (Iterator<Double> i = window.iterator(); i.hasNext();) sum += i.next().doubleValue(); Here we deal with the deque and compute the sum of the window's elements. Deques are essentially double-ended queues, so they make excellent sliding windows. If the window is full, we pop the oldest element and add the current value. moving_average = sum/window.size();result.set(moving_average); return result; Computing the moving average without weighting is simply dividing the sum of our window by its size. We then set that value in our Writable variable and return it. The value is then emitted as part of the map task executing the UDF function. Going Further The stateful annotation made it simple for us to compute a moving average since we could keep the deque static. However, how would we compute a moving average if there was no notion of state between Hadoop tasks? At the end of the series we'll examine a UDAF that does this, but the algorithm ends up being much different. In the meantime, I challenge the reader to think about what sort of approach is needed to compute the window.
https://blogs.oracle.com/datawarehousing/entry/three_little_hive_udfs_part
CC-MAIN-2015-11
refinedweb
672
55.13
post I will show you how bundling and minifying works in ASP.NET MVC. What is bundling and minifying? Bundling helps you to download files of same type using one request instead of multiple requests. This way you can download styles and scripts using less requests than it takes to request all files separately. Minifying helps you make files smaller by removing unnecessary whitespace. Together these two lessen the amount of requests and bytes to get page loaded by browser. How bundling and minifying works in ASP.NET MVC In ASP.NET MVC 4 web application you can find BundleConfig.cs file under App_Start folder. This file contains BundleConfig class that has only one method – RegisterBundles(). In this method files that must be downloaded with one request are added to bundles.")); } Here all files in each bundle are concatenated together and downloaded as one file. It means that this method defines the following URL-s to download files: - ~/bundles/jquery - ~/bundles/jqueryui - ~/bundles/jqueryval - ~/bundles/modernizr - ~/Content/css - ~/Content/themes/base/css Take a good look at file definitions. You can see that you can specify files not only by name but also by name pattern. Special placeholder {version} in file name means that file name may contain version number. This name pattern is specially good for jQuery that is updated often. When you replace your old jQuery file that has version number in its name with newer version then you don’t have to rename the file. It is enough when file has different version number in its name. NB! In debug-mode bundling is switched off by default. To force bundling in debug-mode add the following line in the beginning of RegisterBundles() method:BundleTable.EnableOptimizations = true; If you open _Layout.cs view of your application you can see how style and script bundles are included to page: @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") @Scripts.Render("~/bundles/jquery") Although we have more bundles defined these are there for using with pages where they are actually needed. ScriptBundle and StyleBundle If you noticed then script bundle and style bundle have different classes. ScriptBundle is targeted to scripts and you shouldn’t add any other files to script bundles. Same with styles goes for StyleBundle. Both of these classes extend general Bundle class that offers bundling functionality. Taking care of minifying is tricky. Neither of these classes have no functionality like this. All they do is they add correct minifier to their transforms collection. There are two minifying classes defined in System.Web.Optimizations namespace: These are the classes that make the actual work. Same way can everybody write minification transforms one needs and if it is desired to keep same style as built-in bundles then one can create new bundle class that adds custom minifier to transforms collection when new bundle is created. Switching off minifying Yesterday I found out that CssMinify gets stuck with some style files. In the case of problems bundlers write problems out as comments to file they are transforming. Problems are reported in the beginning of file. While developers try to find out what is wrong with those style files we cannot keep minifying turned on for styles but we still want bundling to work. There are two ways how to do it. - Use Bundle class. Bundle class that other bundling classes extend is not abstract class. We can create instance of it. This way we can bundle whatever files we want. - Clear transforms collection of StyleBundle. Clearing transforms collection is same as using Bundle class with empty transforms collection. Tips and tricks Here are some tips and tricks related to bundling. - Bundles are cached. If not specified differently in bundle class then bundle is created on first request and cached on server. All following requests for bundles are served from cache. - Always test bundling. Bundling may seems like what-can-go-wrong feature. You just turn it on before deploying your system to production. But don’t forget these to transform classes I introduced. These classes may face unexpected situations they are not able to handle. Before deploying your system to production make sure that bundling and minifying works like expected. - Be careful with styles. When bundling style sheets make sure that bundle path is same “deep” as style sheet path. If style sheet refers to images or other styles using relative URL-s and you change depth of path then all these references are broken. Conclusion Bundling and minifying is powerful feature that helps us optimize our web pages. Bundles are easy to use and they are supported out-of-box. Actually almost all ASP.NET MVC templates use bundles. Thanks to easy and flexible API we can control almost every aspect of bundling. Also we can create our own custom bundle types and define custom transforms that are applied to files in bundles. Although bundling is very good it has its own limits and tricks you must know to use them successfully. Good thing is – there are only few things that can go wrong. {{ parent.title || parent.header.title}} {{ parent.tldr }} {{ parent.linkDescription }}{{ parent.urlSource.name }}
https://dzone.com/articles/bundling-and-minifying-aspnet?mz=110215-high-perf
CC-MAIN-2016-07
refinedweb
858
67.45
Apache JMeter – Basic and Advance Tutorial In this post, I have created a simple presentation which covers basic and advance concepts of Apache JMeter. Basically JMeter is very robust tool for Performance Testing. The main advantage of JMeter is its FREE, unlike costly tools available in the market. But the major drawback in JMeter is engineers should accomplish their task manually. e.g. if the detailed report needs to prepared they should generate manually or need to use plugins. Sometimes the plugins functionality will not meet the requirements. In case of licensed tools like HP LoadRunner, IBM Rational Performance Tester customized reports can be generated by few clicks. Anyway, it is always best to learn at least one open source tool. Here it 6 Comments on “Apache JMeter – Basic and Advance Tutorial” SwaminathanNovember 1, 2012 at 6:48 pm Hi Naveen, Greetings. Since I saw ur recent post on JMeter, thought of asking this question. Question: How do we achieve the performance testing of workflow based API methods? Explanation: say we have two xmls Search a toy and update the shopping cart. 1) I want to create a workflow based test execution. I.e) I want to search for an item using the search XML request, say pickup the 3rd item from the search response and pass it to the update request. 2) To archive this, I am pretty sure we have XPATH extractor or few other samplers in JMeter.. But my problem is I am not able to get it working since SOAP based requests involves namespaces and I am not able to get the exact XPATH in JMeter recognizible format and do a data transfer. Kindly let me know the answer if you know how to achieve this.. 🙂 thanks in advance.. NaveenKumarNovember 4, 2012 at 1:42 pm Hi Swaminathan, I hope you are using SOAP XML RPC request. I suggest you to use HTTP Sampler. If HTTP Sampler is not working. Follow below steps. Add XPath Extractor as a child of your HTTP Sampler. Then add a Bean Sampler. Thank you, Please subscribe for our feeds to get free updates on Software Testing. SwaminathanNovember 5, 2012 at 12:08 pm Hi Naveen, I am using a Web Service(SOAP) Request. SOAP/XML-RPC Request does not allow me to configure the reqired protocol, server IP and Port Number. Also, if i use a HTTP Request Sampler, where do I place my XML Request? Also, my XPATH Extractor doesn’t seem to work because of the Namespaces/XPath. Eg: For the below XML Response, SUCCESS say I want to extract the value of Rate Node’s->ExpireDate attribute. Can you gimme the exact XPATH Query which I have to use in the Xpath extractor? Hope my question is clear. Do let me know if you need any more details. thanks again Naveen. SwaminathanNovember 5, 2012 at 12:09 pm SUCCESS SwaminathanNovember 5, 2012 at 12:14 pm I have sent u an email since I was not able to paste the XML here. DzmitryKashlachMarch 11, 2013 at 1:20 pm It seems to me, that Jmeter is well-extended by different enthusiasts and companies. For example, there is a plugin, which allows uploading results to cloud for storing and comparison with previous executions.
http://qainsights.com/apache-jmeter-basic-and-advance-tutorial/
CC-MAIN-2017-30
refinedweb
545
73.88
#include <hallo.h> * Joerg Schilling [Sun, Oct 29 2006, 02:49:32PM]: > Eduard Bloch <edi@gmx.de> wrote: > > > #include <hallo.h> > > * Joerg Schilling [Sun, Oct 29 2006, 10:51:58AM]: > > > Eduard Bloch <blade@master.debian.org> wrote: > > > > > > > > Let me repeat: > > > > > > > > > > In order to investigate on the claim that there is a problem with a missing > > > > > isnan(), I need the output from the "configure" run _and_ I need the content > > > > > > > > It is not missing. It is in libm which you don't link with. I told you > > > > that already. I pointed you even to our linker test to detect the issue. > > > > > > Ist is not a problem being an inexperienced programmer like you are.... > > > > No. It is a problem with people like you who cannot stand that someone > > may know better and therefore try to invent something by their own and > > As long as you accusingly write in the public about things that rather > blame you, you need to be called a person that poisons OSS projects in the > public. Yeah. Sure. Thanks for keeping quotes this time, so it is easy to see who starts writing accusingly and who pulls down the discussion to personal level. Eduard. -- * maxx hat weasel seine erste packung suse gebracht, der hat mich dafür später zu debian gebracht <weasel> .oO( und jetzt ist der DD. jeder macht mal fehler.. ) <maxx> du hast 2 gemacht.... du warst auch noch advocate :P
https://lists.debian.org/cdwrite/2006/10/msg00112.html
CC-MAIN-2015-40
refinedweb
234
81.83
The function Generate_And_Display_Bill() has no formal parameters and returns a variable of type float. The function generates a random number between $0.01 and $99.99 and returns the value to main(). This is what I've created so far in my function declaration; #include <iostream> #include <ctime> float Generate_And_Display_Bill() { float Random_Bill; srand(time(NULL)); for(float index=0.01; index < 99.99; index++) { Random_Bill = (rand()%99.99)+1; cout << Random_Bill << endl; } return (Random_Bill); } I'm receiving an error telling me that in line 14 the 99.99 must be have integral or enum type, I want to display a random bill with decimals and I've declared Random_Bill as a float, what am I doing wrong? Also for some odd reason "cout" and "endl" are giving me unidentified error messages even though I have included the iostream library, please help
https://www.daniweb.com/programming/software-development/threads/346376/random-bill-function
CC-MAIN-2017-34
refinedweb
141
67.15
The information in this chapter is only available if Physical Content Management has been enabled.. After a reservation request is made, an e-mail notification is sent to the administrator, who processes the request and starts the reservation fulfillment process in accordance with the applicable procedures in the organization. If you are a user with the standard reservation privileges, you cannot make any changes to an existing reservation. You can only do so if your administrator has granted you special privileges beyond the defaults for a PCM requestor. Each user can normally place only one reservation request for the same item. However, the administrator may have set up the system so a user can make multiple requests. This may be useful in environments where there are users who make reservation requests on behalf of several people. This chapter discusses the following topics about reservations: Section 10.1, "Reservation Request Properties" Section 10.2, "Managing Reservations" Each reservation request has several properties, including the following: Section 10.1.1, "Request Status" Section 10.1.2, "Transfer Method" Section 10.1.3, "Priority" The request status specifies the current status for a reserved physical item, which can be any of the following: Waiting List: The request item is currently already checked out to someone else. It becomes available to the next requestor upon its return (unless the turned off. Returned: The checked-out item was returned to the storage repository, so it is available for other users to reserve and check out. The transfer method specifies how the person who made the request (the requestor) will receive the reserved item. Users specify the desired. Email: The content item will be e-mailed to its intended recipient. The priority of a reservation request specifies the urgency with which it must be fulfilled. User specify the desired following tasks are included when managing reservations: Section 10.2.1, "Creating a Reservation Request" Section 10.2.2, "Editing a Reservation Request" Section 10.2.3, "Deleting a Reservation Request" Section 10.2.4, "Viewing Reservations for a Physical Item" Section 10.2.5, "Changing the Status of a Request Item" Permissions:The PCM.Reservation.Create right is required to perform this task. This right is assigned by default to the predefined PCM Requestor and PCM Administrator roles. Use this procedure to create a new reservation request for one or more physical items. Reservation requests can only be made for physical (external) items. Error messages are displayed if an attempt is made to reserve electronic (internal) items. If a reservation request is created for a physical item containing other items, the other items are included in the reservation. The child items are not seen in the request, but when a checkout is done for the parent item, all child items are also checked out. A request can be made for each of the child items, but they cannot be checked out until the parent item is returned. As soon as a reservation request is submitted, the status of all request items is automatically changed to In Process, unless their status is already In Process or Checked Out. In that case, it is changed to Waiting List. Users with the standard reservation privileges (those with the predefined 'pcmrequestor' role) cannot make any changes to an existing reservation by default. In order to edit reservation requests, they must be given the PCM.Reservation.Edit right. To make a reservation request, complete the following steps: Search for the physical item(s) to reserve and add them to the content basket. Choose My Content Server then My Content Basket. The Content Basket Page opens. Select the checkbox of each physical item to reserve and choose Request then Request Selected Items from the Table menu. To reserve all items in the content basket, choose Request All Items. A prompt is displayed asking if the selected items should be removed from the content basket after they are reserved. Click Yes or No. Click Cancel to stop the reservation request. The Create or Edit Request Page opens. Specify the properties of the new reservation request: Request Name: Name for the reservation. Note that this is not required to be unique. Each reservation request has a unique system-internal reference. The system tracks reservation requests using this internal reference, not the request name. Therefore, multiple reservations can have the same name. Maximum characters: 30. Request Date: Date and time the request is made. Default is the current date and time. Requestor: Person submitting the request. Default is currently logged-in user. Security Group: Group to which the request is assigned. Security groups can be used to limit the requests to which users have access. Transfer Method and Priority: Desired transfer method and priority to be used. Required By Date: Date when the items are needed. Click the calendar icon to select a date. Providing a time is optional. If not specified, midnight (12:00) is used. Deliver To Location and Location Comment: Location where the item should be delivered. If the location is in the storage hierarchy, click Browse to search for and select the location. If not in the hierarchy, use the Comment field to provide delivery details. If an item is checked out, its current location (as shown on the Physical Item Information page) is automatically set to the value of this field for the associated reservation request. If no value was entered, the current location is set to OTHER. Click Create when finished. The status of all request items is now automatically changed to In Process, unless their status is already In Process or Checked Out. In that case, it is changed to Waiting List. The items are reserved and the administrator is notified about the reservation request. After the administrator processes the reservation request, it can be fulfilled in accordance with the procedures in the organization. Permissions:The PCM.Reservation.Edit right is required to perform this task. This right is assigned by default to the predefined PCM Administrator role. A user can edit an owned reservation without this right depending on the settings when PCM was configured. Use this procedure to modify the properties of a reservation request. Choose Physical then Reservations from the Top menu. The Reservation Search Results Page opens. Locate the reservation request to edit and choose Edit then Edit Request from its Actions menu. The Create or Edit Request Page opens. Modify the properties of the reservation request and click Submit Update when finished. Permissions:The PCM.Reservation.Delete right is required to perform this task. This right is assigned by default to the predefined PCM Administrator role. A user can delete an owned reservation without this right depending on the setting when PCM is configured. Use this procedure to delete a reservation request. Deleting a reservation request effectively cancels it. Choose Physical then Reservations from the Top menu. The Reservation Search Results Page opens. Locate the reservation request to delete and choose Delete Request from its Actions menu. The reservation request is deleted immediately, without any further prompts. If there were no errors, a message is displayed stating the reservation request was deleted successfully. Permissions:The PCM.Reservation.Read right is required to perform this task. This right is assigned by default to the predefined PCM Requestor and PCM Administrator roles. Use this procedure to view all outstanding reservation requests for a physical item. On the search results page, choose Information then View Reservations in the item's Actions menu. The Reservation Search Results Page opens listing all outstanding reservation request for the current physical item. Permissions:The PCM.Reservation.Edit right is required to perform this task. This right is assigned by default to the predefined PCM Administrator role. Users can change the status of an owned reservation without this right depending on the settings when PCM was configured. Use this procedure to change the status of a request item in a reservation request. On the Reservation Search Results Page locate the request item with statuses to change and choose Information then Request Item Information from its Actions menu. The Request Item Information Page opens. Choose Edit on the Page menu. The Edit Request Item Page opens. Select a new status and click Submit Update when finished.
http://docs.oracle.com/cd/E23943_01/doc.1111/e10733/c10_reservations.htm
CC-MAIN-2016-07
refinedweb
1,374
58.69
. Example 6-1. procfs.c /* procfs.c - create a "file" in /proc, which allows both input and output. */ #include <linux/kernel.h> /* We're doing kernel work */ #include <linux/module.h> /* Specifically, a module */ /* Necessary because we use]; /* We return 0 to indicate end of file, that we have * no more information. Otherwise, processes will * continue to read from us in an endless loop. */ if (finished) { finished = 0; return 0; } /* We use put_user to copy the string from the kernel's * memory segment to the memory segment of the process * that called us. get_user, BTW, is * used for the reverse. */ sprintf(message, "Last input:%s", Message); for(i=0; i<len && message[i]; i++) put_user(message[i], buf+i); /* Notice, we assume here that the size of the message * is below len, or it will be received cut. In a real * life situation, if the size of the message is less * than len then we'd return len and on the second call * start filling the buffer with the len+1'th byte of * the message. */); /* In version 2.2 the semantics of get_user changed, * it not longer returns a character, but expects a * variable to fill up as its first argument and a * user segment pointer to fill it from as the its * second. * * The reason for this change is that the version 2.2 * get_user can also read an short or an int. The way * it knows the type of the variable it should read * is by using sizeof, and for that it needs the * variable itself. */ #else Message[i] = get_user(buf+i); #endif Message[i] = '\0'; /* we want a standard, zero * terminated string */ /* We need to return the number of input characters * used */ return i; } /*; } /* The file is opened - we don't really care about * that, but it does mean we need to increment the * module's reference count. */ int module_open(struct inode *inode, struct file *file) { MOD_INC_USE_COUNT; return 0; } /* The file is closed - again, interesting only because * of the reference count. */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) int module_close(struct inode *inode, struct file *file) #else void module_close(struct inode *inode, struct file *file) #endif { MOD_DEC_USE_COUNT; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) return 0; /* success */ #endif } /*, /* Somebody opened the file */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) NULL, /* flush, added here in version 2.2 */ #endif module_close, /* Somebody closed the file */ /* etc. etc. etc. (they are all given in * /usr/include/linux/fs.h). Since we don't put * anything here, the system will keep the default * data, which in Unix is zeros (NULLs when taken as * pointers). */ }; /* Inode operations for our proc file. We need it so * we'll have some place] */ 7, /* Length of the file name */ "rw_test", /* The file name */ S_IFREG | S_IRUGO | S_IWUSR, /*. */ 1, /* Number of links (directories where the * file is referenced) */ 0, 0, /* The uid and gid for the file - * we give it to root */ 80, /* The size of the file reported by ls. */ &Inode_Ops_4_Our_Proc_File, /* A pointer to the inode structure for * the file, if we need it. In our case we * do, because we need a write function. */ NULL /* The read function for the file. Irrelevant, * because we put it in the inode structure above */ }; /* Module initialization and cleanup ******************* */ /* */ return proc_register(&proc_root, &Our_Proc_File); #else return proc_register_dynamic(&proc_root, &Our_Proc_File); #endif } /* Cleanup - unregister our file from /proc */ void cleanup_module() { proc_unregister(&proc_root, Our_Proc_File.low_ino); }
http://www.tldp.org/LDP/lkmpg/2.4/html/c768.htm
CC-MAIN-2015-27
refinedweb
560
60.14
But if I want draw 5k roads i have to 10k lines instead 5k But if I want draw 5k roads i have to 10k lines instead 5k but instead draw 5000 lines I would have to draw 10k. But it seems there isn't better solution. Hello, I want to draw on QImage line that for example has black edge and green fill. I can draw very long and thin ractangle. I want to show map so there will be a lot of line and i worry than when... hello, I know how to get sms from inbox and how to get text of a message. But to get phone number of a sender?? Hello, I have a little problem with using of messaging. Everything was fine when had one thread-the main thread. Then I tryed to put my code to another thread and there is problem during working of... Sometimes ago I meneage istall QtMobility tech preview 2. Now I want update version and use the latest version : 1.0 I try to write application on WinCE. I am using the same way that was good for... maybe anyone has some example od Gestures cooperate with QGraphicsView and QGraphicsObject / QGraphicsItem / QGraphicsWidget? I would be very grateful for any piece of code Hello, I want to use gesture framework, but at the begining I have some problems. I have QGraphicsView and QGraphicsScene view->addScene(myScene); At the myScene threre are few... hello, is there any posibility to recover contats after hard reset? on n95 is symbian 9.3 so maybe there is some way to get to inner memory and try to run some program to file recovery. Hello. This is my problem: I have QgrahicsView and QgraphicsScene. Put the scene on Point(0,0) and take Scene Rect view->sceneRect(); and I hae QRectF(0,0, 400x500); Then I make ... hello, as I know Maemo is linux system base on debian, so it some kind of linux. Am I right? If I am right what is difference between Qt for maemo and Qt for embedded linux? I found on wikipedia -... dear dalaing I made some progres :) Have you ever seen something like that: when I have: #ifdef Q_OS_SYMBIAN #include <qsysteminfo.h> #else #include <QSystemInfo> //(1) #endif using... int file with log from nmake you have: 'C:\Qt\4.6.1\bin\lrelease' is not recognized as an internal or external command, operable program or batch file. NMAKE : fatal error U1077: 'echo' :... You think about?: LIBS += c:/QtMobility/lib/QtSystemInfo_tpd.lib Unfortunately it does not help. Do you run it on Visual Studio? source code: source-link pro file: pro-link Visual studio also create *.pri # ---------------------------------------------------- # This file is generated by the Qt Visual Studio Add-in. #... I made some progress. I use qmake form Qt 4.6.1 for Windows. I have installed QtMobility and now I am trying to write first application in Visual Studio 2008. 1.I created Qt4 Gui Application. 2.... QRectF geometry = view.contentsRect(); It works excelent:) Thank you very much for yours time. I have only GraphicsView, I have put it using qt designer and the sizePolicy is expanding. For my phone coordinates of right-bottom corner in graphicsScene are(aproximately, +/- 5) x=205 y=237, I... Unfortunately your code did not produce property value. Your code give x=189 y=269 and the icon unseen on the screen, i have to use scrollbars to see it. The property( I check it by hand after few... I have starteed at the begining: from visual studio 2008 comand prompt nmake clean configure -vc //discovery qmake 4.6.1 (from Qt for winCE) nmake nmake install Then I create new project... Yours code give me size of the screen, but how to translate this to QGraphicsScene? I have something like this: QGraphicsScene *scene = new QGraphicsScene(); w.addScene(scene); //w is... hello I want to write something independent from device screen size. I want set position of icons on QGraphicsScene. I have to know the scene size in order to all icons set on the device screen... I want write somme app that wil be working on every device, so at the first i want to install whole enviroment. I have some problem with qt mobility and visual studio 2008. Qt and qt for winCE work... May you give some exemaple showing how to do this? I don't knwo if I'am right. In the exaplme there is something like this: S1 -click -> S12 -click -> S22 - click -> S3 is there any way to write code that behave like this: S1 -click -> S12...
http://developer.nokia.com/community/discussion/search.php?s=41f8f8c3cf796ed040ec4ae03243b98c&searchid=2411217
CC-MAIN-2014-23
refinedweb
768
76.52
App Engine applications can send email messages on behalf of the app's administrators, and on behalf of users with Google Accounts. Apps can receive email at various addresses. Apps send messages using the Mail service and receive messages in the form of HTTP requests initiated by App Engine and posted to the app. - Sending mail in Python - Receiving mail in Python - Sending mail - Receiving mail - Receiving bounce notification - Sending mail with attachments - Sending mail with headers - Mail and the development server - Authenticating mail: DKIM - Bulk senders guidelines - Quotas and limits Sending mail in Python The mail.send_mail() function sends an email message from the application. The From: address can be the email address of a registered administrator (developer) of the application, the current user if signed in with Google Accounts, or any valid email receiving address for the app (that is, an address of the form string@appid.appspotmail.com). The following example sends an email message to the user as confirmation that the user created a new account with the application: import webapp2 from google.appengine.api import mail class ConfirmUserSignup(webapp2.RequestHandler): def post(self): user_address = self.request.get("email_address") if not mail.is_email_valid(user_address): # prompt user to enter a valid address else: confirmation_url = createNewUserConfirmation(self.request) sender_address = "Example.com Support <support@example.com>" subject = "Confirm your registration" body = """ Thank you for creating an account! Please confirm your email address by clicking on the link below: %s """ % confirmation_url mail.send_mail(sender_address, user_address, subject, body) The Python Mail API also includes an object-oriented interface with similar functionality. Receiving mail in Python You can set up your app to receive incoming email at addresses in the following format: string@appid.appspotmail.com To receive email, you must put a section that enables incoming mail in your app's app.yaml file: inbound_services: - mail Incoming email in App Engine works by posting HTTP requests containing MIME data to your app. The email's MIME data is supplied to your app as the contents of an HTTP POST request, and you process this data in your handler. In your app.yaml file, you must create mappings from URL paths that represent email addresses to handlers in your app's code: - url: /_ah/mail/.+ script: handle_incoming_email.app login: admin The URL path is /_ah/mail/ followed by the incoming email address used. The pattern /_ah/mail/.+ matches all incoming email addresses. In your app, you include the code for the handlers you specified. The Python SDK includes the InboundEmailMessage class which you can use to parse email messages in your handlers: from google.appengine.api import mail message = mail.InboundEmailMessage(self.request.body) In addition, the InboundEmailMessage class includes attributes for fields in the message. "Permissions" section of the Admin Console. Accounts must be given "Owner" or "Developer" level access when added. You can also send mail using a domain account by adding the domain account under "Permissions" The development server can be configured to send email messages directly from your computer when you test a feature of your app that sends messages. You can configure the development server to use an SMTP server of your choice. Alternatively, you can tell it to use Sendmail, if Sendmail is installed on your computer and set up for sending email. If you do not configure an SMTP server or enable Sendmail, when your app calls the Mail service, the development server will log the contents of the message, and not send the. - You can use the Sockets API to connect directly to an SMTP:
https://cloud.google.com/appengine/docs/python/mail/
CC-MAIN-2015-22
refinedweb
591
55.95
InterSystems Open Exchange March 2021 Digest ✓ 431 published apps in total ✓ 650 downloads in March ✓ 1102 developers joined IO Redirect in ObjectScript Forms adapter for InterSystems IRIS RAD Studio Caché ECP Server in Docker A Python Extension for InterSystems Caché/IRIS. Fast setup of ECP client / sever with almost no manual intervention. IRIS ECP Client in Docker to use Caché ECP Server Template and examples for creating a user interface for a smart home Self training for IAM (InterSystems API Manager). Template and examples for creating a user interface for a media file storage v0.0.3 Sergey M added Description to module.xml v3.1.0 - introduced new addon system. use ./src/addons/simple-addon.component.tsas reference. Do not compile old addons - they won't work. Now there is no need to compile DSW with addon. Addon can be used in different build of DSW. - added addon versioning support, checks and warning if inappropriate addon version loaded in DSW - added detailed addons documentation Addons.md - added detailed addon example code with comments - now addon builder produces correct and same names for addon files my-addon.ts> my-addon.js(previously, Angular CLI creates addon-0, addon-1, etc.) - now, after addition of new services to base widget class, there is no need to recompile and redeploy all addons - updated to Angular 11.2.3 - changed folder for built addons to dist-addons - now all built addons are included in distribution undef addonsfolder - WoldMap and HtmlViewer now separated from build and bundled as addons - updated addons documentation(added section about local testing, added portlet information) - added highcharts missing modules for addons - fixed issue with widget type comparison for addons - temporary disabled buildOptimizer to be able load addons on production releases - added error logging for missing modules during addon loading - fixed parallel addons loading issue - added support for "horizontalControls"/"verticalControls" widgets - added icon for PWA for Android/IOS - fixed issue with "Show Zero" button (#171) - improved meter widget (#166): - added support for multiple meters - added display of labels - added display of threshold - added display of target value - fixed issue with values in range 0..1 - fixed issues with date interval filters (#167) - fixed issues with dimension details (#172) - removed '-' character from addons (#174) - fixed polygon filename issue while loading polygons - polygon in js format supported - added missing main.js to dist - fixed polygon loading issue - fixed issue with settings loading and DefaultApp - fixed styling issue with "Reset click filter" and "Back button" - fixed issue with data values as empty string - added missing files to dist - fixed combo chart display issue - added support for min/max values for combo chart percentage axis - added support axis types for combo chart - fixed issue with percentage axis labels rounding(eg. 52.33333333%) v0.1.1 - Windows x64 and macOS versions available - Example of code on Rust v1.1.4 Added the platform for the rapid creation of a prototype of any solution. For example, Photo Album, Music Player, and Personal Books Library all come together in a user-friendly treasure chest design.v1.1.5 Added favotite linkv1.1.6 update descriptionv1.1.7 update descriptionv1.1.8 fixed mistakev1.1.9 added permiss project v1.0.4 Fixed bug with incorrect handling of input parameters when operations were invoked via HTTP POST.v1.0.5 Updated version in module.xml v1.0.4 Update .png files and Description v0.0.4 Added a Unit Testv0.0.5 Added data model API for Riches.Category classv0.0.6 Enhanced the Account.csp to allow selecting a table to import data intov0.0.7 Added automated sizing for iframev1.0.2 Implemented proper security for /restapi Web Application to run Unauthenticated. Achieve successful import from Account.csp page into three tables, Category, Merchant and Transact v1.0.11 added command extension repov1.0.12 Added command: upgrade Update the versions of modules installed in the current namespace.v1.0.13 updated modulev1.0.14 cmd -init Reload all commands. Run do ##class(%ZAPM.ext.zapp).init() hist Alias: ?? Show all history. hist hist - hist + hist -del Number_day Delete all history older than the number of days. hist -add Number_hist Added history in list for non-removable. hist -add Number_hist [name_cmd] [a/i/n] description Added history in list commans.v1.0.15 Added command: upg Update the versions of modules installed in the current namespace. info Show more complete information about modules in the current namespace. info -m module Show file module.xml. info -f module List file in repository. info -r module Show file readme.md.v1.0.16 Added preload. v1.0.17v1.0.17 Added command: upg Update the versions of modules installed in the current namespace. info Show more complete information about modules in the current namespace. info -m module Show file module.xml. info -f module List file in repository. info -r module Show file readme.md. Added preload. added support editors v1.0.2 . Article's link . Class Creator - Create persistent classes for your projects with a simple wizard.v1.0.3 Youtube video with a brief explanation of a new feature in IRIS RAD Studiov1.0.4 added module.xml with zpm supportv1.0.5 module bump + fixed ModuleReferencesv1.0.6 DSW version fix, module bump, removed AnalyzeThis from repo and added as ModuleReference in module.xmlv1.0.7 module bump to release fix menuv1.0.8 Create class workaroundv1.0.9 module.xml bumpv1.1.0 code clean up for better use of ZPM v1.1.5 updated descriptionv1.1.6 added permiss project v1.1.0 support for syntax is introduced by Lorenzo Skalesev1.1.1 A method Start now supports arbitrary cron expressions too. The task name parameter is introduced to the Start method v1.0.3 ZPM module was addedv1.0.4 Adjust \ v1.1.7 Management of "-" and "_" in object names. v1.0.1 Added an online demo fixed the bug v1.0.4 add \ v1.0.3 Version number was updated in module.xml. v1.0.1 Adjust \ v1.0.2 Adjust \ v1.0.3 Adjust \ v1.0.2 Adjust \ v1.0.1 Adjust \ v1.0.2 Adjust \ v1.0.9 Adjust \ v0.0.3 Adjust \ v0.0.3 Adjust \ v1.0.2 Adjust \ v0.0.3 Adjust \ v1.0.7 Adjust \ - add selectable installation of Command Extension ZME - add demo video v1.0.6 Adjust \ v1.0.3 Adjust \ v1.0.6 Adjust \ v1.0.4 Adjust \ v1.0.5 Adjust \ v1.0.3 Adjust \ v1.0.3 Adjust \ v1.0.6 Adjust \ v1.0.5 Adjust \ v1.0.5 Adjust \ v1.0.6 Adjust \ v1.0.9 Adjust \ v0.0.5 Adjust \ v1.0.4 Adjust \ v1.0.7 added shields v1.0.4 set module name same as already in ZPM echoserver-wsock-iris v1.1.11 Module description is introduced v1.0.4 add to ZPM v1.0.9 - Allow system files (% classes) to be searched from non-%SYS namespace. - Handle objectscript.conn.serverreferencing non-existent intersystems.serversentry (#586) - Improve README. - Upgrade vulnerable dependencies. - Implement isfs://server:namespace/syntax as an alternative to the ns=NAMESPACEquery parameter (#450) - Use new isfs notation in entries created by 'Add Server Namespace to Workspace' (#554) - Load server-side (isfs) folder-specific snippets (#552) - Improve snippets: - Add a ///-comment tabstop at the start of all snippets used in class definitions. - Add descriptive default text to more tabstops. - Add third superclass to multi-superclass snippet. - Uniformly use Capitalized command names and UPPERCASE function names in ObjectScript. - Standardize body layout in definitions to reflect layout of result. - Tidy how duplicate tabstops are used. - Support searching all Studio document types when using symbol search (Cmd/Ctrl + T). - Upgrade vulnerable dependency. v2.3.25 Release Notes in the README.md v1.2.4 Release Notes in the README.md v3.2.58 Release Notes in the README.md v2.2.42 Release Notes in the README.md v1.0.8 Included tags <Description> and <Keywords> to module.xml by Eduard Lebedyuk by John Murray by Peter Steiwer by Nikita Savchenko by Peter Steiwer
https://community.intersystems.com/post/intersystems-open-exchange-march-2021-digest
CC-MAIN-2021-21
refinedweb
1,348
53.98
On Fri, Aug 30, 2019 at 05:08:52PM +0200, Michal Privoznik wrote: > On 8/30/19 2:30 PM, Roman Kagan wrote: > > On Fri, Aug 30, 2019 at 10:09:06AM +0100, Daniel P. Berrangé wrote: > > > On Fri, Aug 30, 2019 at 08:44:03AM +0000, Nikolay Shirokovskiy wrote: > > > > Hi, all! > > > > > > > > We use an interesting approach when starting/migrating/etc domain with usb > > > > hostdev with startupPolicy=optional. We add qemu usb-host device with > > > > missing hostaddr/hostbus parameters (dummy device). I guess there are > > > > 2 reasons why we do it. First without dummy device migration will fail as > > > > described in [1]. Second is an interesting property of dummy device that > > > > qemu starts to monitor for attaching of usb devices and binds the first > > > > attached to node to the dummy device. So one can start a domain with > > > > missing hostdev and attach it later or migrate a domain then detach > > > > hostdev on source and attach it on destination. But as qemu binds the > > > > first attached device this is not reliable, to say the least. And after > > > > all this does not work if domain uses distinct mount namespace which > > > > is default. > > > > > > Even without mount namespaces, it should fail as QEMU is running non-root > > > and libvirt won't have granted access to any host USB devices in /dev, and > > > also SELinux policy will forbid this. > > > > Right, but the case with mount namespaces is particularly problematic: > > if the device open fails due to missing device node, libusb removes the > > device from its internal device list. This results in the following > > scenario: > > > > - libvirt adds a dummy usb-host device to QEMU in place of a missing > > device > > > > - QEMU (via libusb) installs a watch for udev add events > > > > - the physical device is plugged into the host > > > > - QEMU detects the addition of the device and, since the dummy device > > matches everything, tries to open it > > > > - by this time libvirt may have not created a device node in QEMU's > > mount namespace, so the open fails due to missing device node, and > > libusb removes the device from its internal list > > > > - libvirt removes the dummy usb-host device and adds the actual usb-host > > device > > > > - QEMU fails to open it because it's no longer seen by libusb > > There is a bug filed against libusb exactly for this: > > > > BTW: you don't have to migrate, it's sufficient to start a domain with a > missing USB and startupPolicy='optional' and then physically plug it into > the host and then try to hotplug it into the domain. AFAIR, the startupPolicy=optional was never really intended to allow for the device to be dynamically added after startup. It was only trying drop the device if it didn't exist at startup. If we do want a way to dynamically add after startup, then libvirt itself would have to monitor the USB devices on the host, and then perform QMP commands to hot-add to QEMU. Regards, Daniel -- |: -o- :| |: -o- :| |: -o- :|
https://www.redhat.com/archives/libvir-list/2019-August/msg01442.html
CC-MAIN-2020-29
refinedweb
491
52.23
Issues List for xpath-functions This document identifies the status of Last Call issues on XQuery 1.0 and XPath 2.0 Functions and Operators as of October 29, 2004. The XQuery 1.0 and XPath 2.0 Functions and Operators has been defined jointly by the XML Query Working Group and the XSL Working Group (both part of the XML Activity). The October 29, 2004 263 issue(s). 12 raised (7 substantive), 23 proposed, 210 decided, 1 announced and 16 acknowledged. X(n,}? matches X, at least n times Would it not be X{n,}? ... (i.e. a left curly bracket instead of a left round bracket) STATUS: Fixed Section 15.4.4 fn:doc Editorial Make the return type bold as the type is defined in the formal semantics (the type is potentially found in the static document map context). RATIONALE: The return type is bold only if the type of the return depends on the type of the arguments. Not the case here. SECTION Status The bullet reading "The rules for converting numbers to strings have be amplified..." has a typo (change "be" to "been"). - Steve B. STATUS: Overtaken by events. Throughout F&O, accommodate is misspelled; it has two m's. Thanks, Priscilla STATUS: Editorial. Fixed. In the new spec, 0E0.0 is used in several places where it should be 0.0E0. For example, see the substring examples (7.4.3.1). --Sarah STATUS: Editorial. Will fix as needed. In section 7.1, the second note has the following sentence: "In functions that involve character counting [...] what is counted is the of XML characters [...]" It seems to me that the word "number" is missing Alberto STATUS: Editorial. Fixed. We think that there are two possible problems out here. 1. Default namespace : The XQuery draft does not define any standard namespace like "err" which would be present by default. Such kind of default namespace would be useful. A namespace defined in the draft: does not give details of any error codes to be used. If a default namespace err is provided, then user would not have to define the namespace explicitly when he/she wishes to do some error handling. 2. User defined namespaces and error codes. The draft does not speak much about how a user can define his own namespace and error codes for errors. Is it possible to do this in XQuery ? It would be great to have some information on this aspect in the draft.. Mike Kay suggests use fn:normalize-space: I don't think that the concept of normalized value applies to xs:date. There is no equivalent value to xs:date('2004-09-09-04:00') that uses 'Z'. xs:date('2004-09-09-04:00') and xs:date('2004-09-09Z') are not equal. In F&O 14.1.3, namespace-uri was changed to return an xs:anyURI instead of an xs:string. The sentence "If $arg is the empty sequence, the zero-length string is returned" is no longer valid. There may be other occurrences of this in the document where xs:string was changed to xs:anyURI. In similar cases (11.2.3) the signature is xs:anyURI?. So either: fn:namespace-uri() as xs:anyURI? fn:namespace-uri($arg as node()?) as xs:anyURI? If $arg is the empty sequence, the empty sequence returned. or: fn:namespace-uri() as xs:anyURI fn:namespace-uri($arg as node()?) as xs:anyURI If $arg is the empty sequence, xs:anyURI("") is returned. Mike Kay in recommends we treat the empty string as a valid URI and return it. The WGs agreed on 2004-09-28 that the zero-length string was a valid URI and that this comment could be closed with appropriate editorial changes. Acknowledged.... Would like a signature fn:error(xs:string) The WGs agreed on 2004-09-28 to change the third and fourth signatures of fn:error to allow the empty sequence as the first argument with the semantic that this indicated the QName err:FOER0000 - Unidentified error. Two functions that I'd like to see added to xquery operators are: fn:match($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:string* fn:match($input as xs:string?, $pattern as xs:string) as xs:string* The function fn:match supports capturing parentheses: fn:match("alpha/beta/gamma", "^(\w*).*(\w*)$") returns ("alpha", "gamma") It the entire pattern does not match, then it returns the empty sequence. fn:apply($funcname as xs:QName, $args as xs:anyType*) as xs:anyType* The function fn:apply allows calling a function whose name may not be known statically, for example based on input. let $f1 := 'fn:sum'; let $call := <fn:sum><arg1>1</arg1><arg2>2</arg2></fn:sum> fn:apply($f1, (1, 2)) fn:apply(fn:name($f1), $call/text()) The function fn:apply does not allow for arguments which are themselves sequences, since nested sequences are not allowed in XQuery. An alternative would be fn:call with versions for any arity: fn:call($funcname as xs:QName) as xs:anyType* fn:call($funcname as xs:QName, $arg1 as xs:anyType*) as xs:anyType* fn:call($funcname as xs:QName, $arg1 as xs:anyType*, $arg2 as xs:anyType*) as xs:anyType* .... The WGs agreed on 2004-08-26 not to add the requested functionality. Currently the casting table in Section 17.1 of Functions and Operators shows that xs:time can be cast into xs:dateTime. In Section 17.10, Rule 2 states that this cast is done by merging the given time with the current date. But this rule makes the cast from xs:time to xs:dateTime nondeterministic. Every day it gives a different result. This kind of nondeterminism is very undesirable. It makes queries nonreproducible and it makes casting very difficult to test. A user who attempts to cast an xs:time into an xs:dateTime is probably confused. It is dangerous to silently append the date on which the query happens to be running. It would be far better to make it an error to cast an xs:time into an xs:dateTime, and to provide an explicit two-operand constructor to construct an xs:dateTime from an xs:date and an xs:time. This would support the current functionality and more as well, would be safer, and would keep all our casts deterministic. Proposal: (1) In Section 17.1, change the table to show that xs:time is not castable into xs:dateTime. (2) In Section 17.10, delete the rules that show how xs:time is cast into xs:dateTime. (3) Introduce a new constructor function: fn:dateTime($arg1 as xs:date, $arg2 as xs:time) as xs:dateTime Note that both arguments are required (neither can be an empty sequence). If a user wishes one of the arguments to be the current date or the current time, she can generate this argument by calling fn:current-date() or fn:current-time(). It has been noted that the proposed function can be defined as follows: declare function fn:dateTime($arg1 as xs:date, $arg2 as xs:time) as xs:dateTime { xs:dateTime($arg1) + ($arg2 - xs:time('00:00:00')) } Nevertheless, I believe that the proposed function should be built-in rather than user-defined. The namespace of the new function could be either fn: or xs: (following the convention of the other constructor functions). The WGs agreed to make the recommended changes. From the minutes of the 2004-03-16 minutes of the joint telecon on F&O issues [1]: << 5. Normative description of case mapping ACTION HZ will propose. ACTION MHK reply to Igor Herscht. >> The problem that we were trying to point out in qt-2004Feb0979-01 [2] was that the first entry in the table in Section 1.2 of Unicode TR#21 [3] states, in part, "Only legacy implementations that cannot handle case mappings that increase string lengths use UnicodeData case mappings alone." The penultimate paragraph of that section states, in part, "The full case mappings for Unicode characters are obtained by using the mappings from SpecialCasing plus the mappings from UnicodeData, excluding any latter mappings that would conflict." Similarly, the first paragraph of Section 2.3 of TR#21 [4] reads as follows. << The following specify the default case conversion operations for Unicode strings, in the absence of tailoring. In each instance, there are two variants: simple case conversion and full case conversion. In the full case conversion, the context-dependent mappings mentioned above must be used. >> All this seems to admit of (at least) two possible case mappings. We believe that full case conversion was intended. I propose that in the first paragraph of each of Section 7.4.7 of F&O, we change "The precise mapping is determined using [Unicode Case Mappings]," to read "The precise mapping is the full case mapping variant of the toUpperCase operation defined in [Unicode Case Mappings]," with an analogous change to 7.4.8. Thanks, Henry [2] [3] [4] [5] ------------------------------------------------------------------. The comment is based on the entry in the Xquery document > err:XQ0052 > > It is a dynamic error if the content of an element or attribute > constructor includes an atomic value that cannot be cast into a string, > such as a value of type xs:QName or xs:NOTATION. But it presumably applies to XPath and so XSLT as well, so I have not prefixed the subject line with [Xquery] I can see that there are problems with casting QNames due to prefix bindings but NOTATION (and also ID, etc) do not have this problem as they are NCNames and don't have a prefix (or take part in namespace processing) so the URI part of the QName should always be "". as such there should be a trivial casting to string, namely taking the name() = local-name(). schema part 1 says: Schema Component: Notation Declaration {name} An NCName as defined by [XML-Namespaces]. ^^ XML namespaces 1.0 was famously vague on this point but the wording is clarified in 1.1: No attributes with a declared type of ID, IDREF(S), ENTITY(IES), or NOTATION contain any colons. David Resolved with the adoption of the 'triples' proposal: (IBM-FO-044): The F&O document, section 17 (Casting) says "Constructor functions and cast expressions ... both convert a value to a given type with identical semantics and different syntax." The XQuery language document agrees, in Section 3.12.5 (Constructor Functions): "The constructor function for type T .... has exactly the same semantics as a cast expression with target type T." But this equivalence does not seem to extend to error messages. (a) The language document, Section 3.12.3 (Cast) says that a Cast expression can raise a type error (XQ0004 or XP0006), a dynamic error XQ0021 ("value cannot be cast to the required type"), or a dynamic error XQ0029 ("value does not satisfy facets of target type"). The language document does not list any errors for constructor functions. (b) The F&O document, on the other hand, lists various casting-related error messages with names like "error in casting to decimal", "error in casting to integer", "invalid value for cast", etc. Some target types have specific error messages, but most do not. It is generally not specified which errors are dynamic and which are static. The language document and the F&O document are not consistent in their handling of errors in casting, and it is not clear whether cast expressions and constructor functions return the same error messages. This latter property would be beneficial because it would allow implementations to transform cast expressions into constructor functions. --Don Chamberlin Minutes of San Jose meeting. XQuery will align its error messages with F&O. (IBM-FO-043): Section 17 (Casting), paragraph 3 says "If an empty sequence is passed to a cast expression, an error is raised [invalid value for cast]." This is not correct. The XQuery syntax provides a way for the user to specify whether empty sequences are acceptable in a path expression. This feature was first added to the XQuery language document in the Nov. 15, 2002 version, after discussions at the Query Working Group meeting at Chapel Hill, NC. The feature is described in the XQuery language document, Section 3.12.3 (Cast) as follows: If the result of atomization is an empty sequence: (a) If ? is specified after the target type, the result of the cast expression is an empty sequence. (b) If ? is not specified after the target type, a type error is raised. [XQ0004] [XP0006] This part of the F&O document should be made consistent with the language document. --Don Chamberlin The WGs agreed to accept the suggestion at the San Jose meeting. Acknowledged. F The WGs agreed to clarify the wording and add an example. Joint WGs telcon May 26, 2004 General Conformance Make explicit collation argument support an optional feature. NOTE: This comment marks the end of our comments on the data model, serialization, XQuery and F&O documents. We reserve the right to send individual comments on issues that we may discover later. General Conformance There are way too many functions (especially datetime and duration functions). Please allow implementations to define function profiles as part of a feature subsetting. Section 17 Casting Editorial/Technical The casting rules from string to integer are unclear: How can I cast a string "2.0" to and integer and get an error if I try to cast "2.8"? The WGs ruled that the rules are clear and that no change is needed. Joint WGs telcon May 26, 2004 Section 16.6 fn:default-collation Conformance Make support for this function optional dependent on whether explicit collation support is provided. Section 15.4.4 fn:doc Technical Remove the sentence about not containing a fragment identifier. That should be handled by the URI resolver. However please keep that the result is always a document node or the empty sequence. WGs agreed to remove the sentence and make other changes to the wording to make it consistent. Joint WGs telcon, May 25, 2004. Accepts the decision Section. The WGs decided not to remove the function Accepts decision. Hopes it will be made optional. Section. This has been overtaken by events. Wording no longer exists in this form. Joint WGs telcon, May 25, 2004. Accepts the decision Section 15.1.14 fn:unordered Editorial/Technical Please use the following definition (and maybe change name to fn:unorder()): Returns the input sequence in a non-deterministic order. The WGs agreed to accept the suggested rewording. Acknowledged. Sections 10.2.2/14.1.2 Technical Change result type to xs:NCName? of functions fn:get-local-name-from-QName/fn:local-name. This is more precise and will be more useful if passed to another function argument that expects xs:NCName. The WGs agreed to change the return type of fn:get-local-name-from-QName as suggested but declined to change the return type on fn:local-name. Joint WGs telcon May 26, 2004 Section 9.1.1 Limits and Precision Conformance We would like the minimal required range of years to be [0,9999]. The WGs declined to make the recommended changes. Can be brought up again during CR Objected. Section 1.6 Technical We reiterate our comment submitted during our first last call review at about the problem of the current requirement to preserve Timezones on datetime values. Section 5 Constructor Functions Technical Constructor function signatures should have the following signature: pref:TYPE($arg as xdt:anyAtomicType?) as pref:TYPE? See also comment MS-XQ-LC1-121 ( l) The WGs agreed to accept the suggestion at the San Jose meeting. Acknowledged., Decided not to add the functionality requested at San Jose meeting, 4/13/2004. There's no easy way right now to check for the existance of a local file except by trying to parse (and possibly validate) it with document(). For example, consider using XML Query to generate an XHTML Web page with embedded images. One might not want to include an image if the file isn't there, but there's no way to test for a non-XML file in F&O today. I suggest adding file-exists($fname as XS:string) An alternative I shall propose in a separate comment is to provide more access to an implementation's underlying URI resolver library. Liam -- Liam Quin, W3C XML Activity Lead, Decided not to add the functionality requested at San Jose meeting, 4/13/2004. F&O currently provides limited access to URL resolution via fn:document() (section 15.5.4). There's no support for HTTP POST, nor for MIME parameters, nor for query parameters. There's also no clear indication of a result code, nor access to language or media type information, if available. If resolution fails, or if parsing the resulting resource representation as XML fails, a fatal error is raised. In the absence of a try/catch mechanism, having URI resulution failure be a fatal error means you can't probe for the existence of a document. I propose that we supply a resolve-uri function, and that document() be defined in terms of resolve-uri. This adds significant functionality to XQuery without a large additional cost, because implementations already have such a resolver. The following proposal is a little half-baked right now. I'm looking for the minimum that would be enough for XQ to build on later. I'm worried that if we neither support Web Services directly nor open up the URI resolver it'll be really hard to add WSDL support later - and also that we may have problems with internationalized queries and content negotiation. If there's interest, I'm prepared to work on making this a more robust proposal. Leaving it for a future version would be a satisfactory response for me if file-exists() and some form of WSDL support are defined. * function resolve-uri($uri,$method,$http-params,$uri-params) resolves the given URI using the given method (GET, HEAD, POST, etc) if appropriate, and with the given parameters, e.g. as key/value pairs for POST. The URI parameters are a sequence alternating between a string and an item (ewwww, or is it better to use <param><name>xxx</name><value>yyy</value></param>, since the efficiency loss is minimal compared to the amount of I/O involved?) They might go after a ? separated by ; or & for an HTTP GET, e.g. The optional Mime parameters are in the same format, and are most likely to be an Accept list (e.g. to generate Accept: text/*, application/*) but can also be used for content negotiation to support internationalisation. resolve-uri returns a sequence: (1) a result code, as per HTTP and (compatibly) FTP; for a file: URL, the only likely codes are 20x OK, 40x fail, or maybe 30x redirected. A code starting with a 2 indicates success. (2) a string, the URI actually fetched, which may differ from that requested, for example because of symbolic links/shortcuts or because of HTTP redirects (3) the MIME Media type (4) the result, which in the case of error may be the empty sequence or may be an (X)HTML document describing the error. In the case of multi-part responses, the result may be a sequence of document nodes. Liam -- Liam Quin, W3C XML Activity Lead, Decided not to add the functionality requested at San Jose meeting, 4/13/2004. Unless there is a good reason not to, please provide a schema document for the xmlns:xdt="" namespace, containing at least the definitions for xdt:yearMonthDuration and xdt:dayTimeDuration, to facilate their use by schema authors. I would recommend that such a schema document should appear both as a normative appendix to one of the spec. documents _and_ as an independent document at the namespace URI, i.e. at The latter document should be governed by the W3C policy for namespace-related documents, reference available on WGs agreed on 2004-08-26 to accept Henry's suggestion. F). Date/time component Extraction functions work on localized values. (IB On May 4, 2004 we decided to accept wording suggested by Mike Kay. (IB The WGs decided not to make the suggested change at the Cambridge meeting. (IBM-FO-034): Section 14.1.3 (fn:namespace-uri): Describes what happens if the argument is "an element or attribute node that has no QName". How could an element or attribute node not have a QName? --Don Chamberlin We discussed in Cannes and agreed to fix wording. (IB Fixed in response to an earlier comment. (IB The WGs agreed accept Andrew Eisenberg's proposal: and close the comment. Acknowledged. I have been testing the example stylesheets in my XSLT Programmer's Reference under XSLT 2.0. Three or four of the examples (so far) have failed with the same error: concat() in XPath 2.0 requires the arguments to be supplied as strings. The most common examples are things like: <title><xsl:value-of</title> It doesn't fail under backwards compatibility mode, of course. But that's not good enough, we want to encourage users to run in pure 2.0 mode whenever possible. It doesn't seem reasonable here to ask users to write string(position()). How can we justify asking them to make such changes - where are the benefits? It's not required in XQuery, whose equivalent construct is: <title>Chapter {position()}</title> If this can implicitly cast to string, why can't concat()? Java has a general policy of strict typing, but it makes an exception for the string concatenation operator, which casts its operands implicitly to strings. In XPath, concat() is already special-cased by allowing a variable number of arguments. I believe we should change the signature of concat() so its arguments are defined as anyAtomicType, and are implicitly cast to strings. Michael Kay The WGs agreed to make the suggested change. Dear colleagues, This note is to ensure that your last-call issues list includes a question we raised already in our earlier review of the Functions and Operators specification; in our notes on that spec of last 1 August, it had item number 1.4 [1]. (I took an action to write you on this account some time ago. My apologies for the delay, but I venture to hope that our concern will not come as a surprise to you.) While we understand (even if we do not fully agree with) the reasoning which has led you to make all of the functions for operations upon URIs accept strings as arguments, we have not understood the reasoning which leads you to require that they raise an error if they are given an argument of type anyURI, and we respectfully suggest that you ensure that these functions can be called upon arguments of type anyURI without raising a type error, and that the results can where appropriate conveniently be coerced into type anyURI. The status quo would have the effect of discouraging the use of the anyURI type and of encouraging users to lie to their processors by typing values as strings instead of typing them, more accurately and more usefully, as URIs. with best regards, -C. M. Sperberg-McQueen on behalf of the W3C XML Schema Working Group [1] The WGs agreed to an anyURI to string promotion scheme. April 13, 2004 in the San Jose meeting. The WGs considered this in Cannes and decided not to add this function. (IBM-FO-019) Section 15, Functions and Operators on Sequences: There should be a "deep-distinct" function that eliminates duplicate items from sequences. Duplicate atomic values should be defined by the "eq" operator. Duplicate nodes should be defined by fn:deep-equal(). In the case of duplicate nodes, the node that is retained should be implementation-dependent. This function is needed by queries that need to perform grouping where the grouping-key is a node (for example, grouping by <address> that has subelements <street> and <city>, or grouping by <author> that has subelements <first-name> and <last-name>.) --Don Chamberlin The WGs agreed not to add the function as it would be too fragile for order-by. A better approach is to use constructed compound keys. Joint WGs telcon, May 26, 2004. (IB The WGs agreed on 2004-10-20 that this issue should be postponed and considered as a feature for the next version of XML Query. (IB The WGs agreed to accept Michael Kay's "triples" proposal. This addresses the issues raised. Acknowledged. (IB The WGs agreed to make the suggested changes. (IBM-FO-012) Section 5.1, Constructor Functions for Built-in Types: The return types for the xs:dateTime, xs:time, and xs:date functions are not valid SequenceTypes. We do not have tuple-types in the data model. In general, handling of timezones in dates and times needs to be clarified throughout the Data Model and F&O books. All our functions should be closed under the Data Model and should not return things that are not Data Model values (like "tuples"). --Don Chamberlin The WGs agreed to change the constructor functions to return single values of the appropriate type. Joint WG telcon May 26, 2004 (IBM-FO-011) Section 4, The Trace Function: I suggest that the actual creation of a trace data set be made optional. Say that this function supports debugging of queries in a portable way, by allowing an implementation to optionally provide a data set containing a trace of execution. The only normative requirement for this function is that it returns its first argument. If an implementation chooses to provide a trace data set, the string values of the first and second arguments are directed to the trace data set. (Location, format, and ordering are implementation-dependent, as stated.) In effect, fn:trace becomes a function that systems can either implement or ignore without raising an error. --Don Chamberlin The WGs adopted the suggestion to make the creation of the trace dataset optional. (IBM-FO-010) Section 2, Accessors: We need functions to expose the dm:unparsed-entity-system-id() and dm:unparsed-entity-public-id() accessors of a document node. Otherwise, what are these dm: accessors good for? --Don Chamberlin STATUS: Discussed in Cannes: "Postponed for later discussion (related DM issues, clustered by Norm)" (IBM-FO-008) Section 1.5.2, xdt:untypedAtomic: Delete "or a DTD". We do not support DTD validation. --Don Chamberlin The datamodel supports XML docuemnts that are DTD validated. (IBM-FO-006) Section 1.4, Type Hierarchy: The third table in this section contains an entry for "user-defined document types". But there is no such box in the type hierarchy diagram, and there is no such notion in XML Schema. This entry should be deleted. --Don Chamberlin Fixed in the current version of the F&O. fn:base-uri() called without arguments returns base-uri property from static context. But many users may think it returns property of context node like all other functions taking zero or one argument [fn:name(), fn:local-name(), fn:namespace-uri(), fn:number(), fn:root() ]. This could lead to many hard to find errors. I propose changing name of zero argument version of function to prevent confusion. Maybe fn:static-base-uri() or fn:implicit-base-uri() ? Best Regards, Noe Michejda 7th Portal S.C. The WGs adopted the suggestion to change the no-argument version of fn:base-uri to return the base-uri of the context item and add a function fn:static-base-uri to return the base-uri from the static context. Build-in type xs:anyUri deserves better treatment in my opinion. Currently it can be only compared with another xs:anyUri or casted to string. But basically it is a string with additional restriction on structure (like pattern facet). So xs:anyUri should be treated as derivation by restriction from xs:string by all XPath/XQuery rules. This will allow to define function signatures using xs:anyUri and remove lexical checks from definitions of functions. Maybe it will be possible to change derivation diagram in XML Schema 1.1 and reference it instead of 1.0 in XPath 2.0 / XQuery 1.0 ? This will be simpliest solution. (and btw allow placing dayTimeDuration and yearMonthDuration in schema namespace) Best Regards, Noe Michejda 7th Portal S.C. The WGs agreed to an anyURI to string promotion scheme. April 13, 2004 in the San Jose meeting. SECTION. The Wgs discussed this on 3/16 and declined to make the change. I The WGs agreed to make the suggested changes. In this case it would be consistent to change the definition of the zero-argument base-uri() function in F+O so that if no base URI is defined in the static context, an empty sequence is returned. Michael Kay STATUS: We agreed to do this in Cannes. -----Original Message----- From: public-qt-comments-request@w3.org [mailto:public-qt-comments-request@w3.org] On Behalf Of Don Chamberlin Sent: 19 February 2004 00:55 To: Daniela Florescu Cc: public-qt-comments@w3.org Subject: Re: [XQuery] BEA_028 Dear Daniela, The following sentence has been added to XQuery Section 3.7.1: "If no Base URI is defined in the static context, the Base URIs of the constructed and copied nodes are set to the empty sequence." Similiar sentences have been added to Sections 3.7.3.1 and 3.7.3.3. Please let us know whether you are satisfied with this resolution of your issue. Regards, --Don Chamberlin Daniela Florescu <danielaf@bea.com> Sent by: public-qt-comments-request@w3.org 02/15/2004 10:25 PM To public-qt-comments@w3.org cc Subject [XQuery] BEA_028 XQuery: incomplete specification Section 3.7.1 and 3.7.3 discuss the base-uri property of the new nodes but does not say what should happen when the static context has no base uri defined. Agreed to elaborate the wording.. Discussed at Cannes. WGs declined to make the change. [My. [My? adopted the proposal from Andrew Eisenberg in and agreed to remove the functions: fn:subtract-dateTimes-yielding-yearMonthDuration and fn:subtract-dates-yielding-yearMonthDuration which has the same problem. [My. make the suggested change. [My apologies that these comments are coming in after the end of the Last Call comment period.] Section 7.5 According to the sixth paragraph of this section, "In the definitions below, we say that $arg1 contains $arg2 at positions m through n if the collation units corresponding to characters in positions m to n of $arg1 are the same as the collation units corresponding to all the characters of $arg2." This definition is not sufficiently precise in the presence of ignorable collation units. The rules should be based on (e.g. minimal or maximal. For all positive i and j, there is no match at Q[s-i,e+j].) For example, '-' is ignorable for some collations. It is not clear whether substring-before("a-b", "b") returns "a" or "a-". This needs to be clearly specified. If it is implementation-dependent or implementation-defined, that should be clearly specified. add wording to explain the situation. [My. Thanks, Henry [Speaking on behalf of reviewers from IBM.] ------------------------------------------------------------------ Henry Zongaro Xalan development IBM SWS Toronto Lab T/L 969-6044; Phone +1 905 413-6044 mailto:zongaro@ca.ibm.com The wording has been changed and does not refer to "system define default collation". [My apologies that these comments are coming in after the end of the Last Call comment period.] Section 1.5 The first paragraphs of 1.5.2 and 1.5.3.] ------------------------------------------------------------------ Henry Zongaro Xalan development IBM SWS Toronto Lab T/L 969-6044; Phone +1 905 413-6044 mailto:zongaro@ca.ibm.com STATUS: These definitions were moved to the Datamodel document. The two types mentioned are now defined as concrete types. SECTION. STATUS: This was discussed at the Cannes meeting and there was insufficient support to change the signature. SECTION. Decided to add the suggested wording at the San Jose meeting, 4/13/2004. SECTION. The WGs agreed to add a definition for collation. SECTION 15.4.2: fn:id It would be nice to have overloaded versions for fn:id and fn:idref, which explicitly specify the document node to be searched from. fn:id($arg1 as xs:string*, $arg2 as node()?) as element()* fn:idref($arg1 as xs:string*, $arg2 as node()?) as node()* - Steve B. STATUS: This was approved at the Cannes meeting. SECTION 15.1.10: fn:insert-before The numeric types of parameters in fn:substring, fn:subsequence, fn:insert-before and fn:remove should be consistent, either all of xs:double, or all of xs:integer. - Steve B. The WGs decided not to make the suggested change at the Cambridge meeting... The WGs agreed to add this signature. SECTION Annex D: Error Summary The F&O document (as well as other documents) summarize error codes in an Annex that is labelled to be non-normative. In some ways, this makes sense, because XQuery does not specify any sort of an API by which errors can be "returned" to any entity. However, it is clear that there will be more than one such API (e.g., JSR 225, XQJ, is defining such an API for use by Java programmers). It would be a serious problem if each API, and each XQuery implementation, were free to return radically different error codes for identical errors, as programmers would be unable to write code that is portable among XQuery engines. Some way to make the error codes themselves normative (but, of course, *not* the natural-language phrase that is associated with the codes). One approach might be to state that whenever the XQuery specification indicates that a specific error is to be raised, that the specified (normative) error code must be made available in an implementation-defined way to the agent that caused the XQuery to be evaluted by the XQuery engine. This is crude and clumsy, but definitely better than nothing! The alternative would be to create an SQL-like diagnostics facility that would allow users to execute a subsequent query to retrieve the error code, etc. I doubt that would be acceptable for XQuery 1.0, but would be deferred to a future version. - Steve B. This was agreed to as part of Andrew Eisenberg's errors proposal on May 4, 2005. SECTION D: Error summary (nonnormative) The title says this section is nonnormative. However, in the normative part of the text, errors are not listed with both the QName and the mnemonic text. See for example 5.1 "Constructor functions for XML Schema built-in types", which has an error [invalid value for constructor]. If this section is not normative, where is the normative list of correspondences between QNames and mnemonic texts for errors? Note that in the XQuery language specification, this appendix is not labelled non-normative. - Steve B. This was agreed to as part of Andrew Eisenberg's errors proposal on May 4, 2005. SECTION 17.1: casting from primitive types to primitive types I have heard it said that xdt:dayTimeDuration and xdt:yearMonthDuration are to be treated as if they were primitive types. The fact that they are listed in this section seems to put them on a par with the primitive types, but you don't actually say so. If this is the intention, it would be better to adopt some other term than "primitive". Lincoln once asked, how many legs does a dog have, if you call a tail a leg? Answer: four; calling a tail a leg doesn't make it a leg. Just the same, calling a derived type a primitive type just shows that there is sone confusion about the distinction between the two categories. My thesaurus gives the following synonyms for primitive that you might consider: basic, elementary, primary. - Steve B. The WGs agreed to add wording to explain the situation. F&O [6.2] xs:decimal overflow should not happen on rounding As currently written the expression "1 div 3 * 100" causes a mandatory overflow error. Per F&O 6.2: "For xs:decimal operations, overflow behavior ·must· raise an error [numeric operation overflow/underflow]. On underflow, 0.0 must be returned." Per F&O 6.2.4: "As a special case, if the types of both $arg1 and $arg2 are xs:integer, then the return type is xs:decimal." So 1 and 3 are typed as xs:integer and their division results in an xs:decimal which cannot be precisely represented, causing an overflow error. This should not happen. (Note that depending on your reading of the spec, the simple division may not be an "xs:decimal" operation, but the "* 100" clearly makes it an xs:decimal operation which will cause an overflow error.) Solution: Overflow/underflow should happen only for numbers exceeding the implementation's xs:decimal range, not for precision-related roundings. This is especially onerous given that such errors cannot be caught and handled by the XQuery application; see CER-05. Please propose new wording. F&O 7.6 Add a function that gives the matches of a regular expression. fn:extract-match( $source as xs:string, $regex as xs:string ) as xs:string* For example: extract-match( "some text with 12-11-02 in it", "(\d{2})-(\d{2})-(\d{2})" ) => ("12", "11", "02" ) This ability is necessary for implementing replace() anyway, but you cannot do this inside XQuery otherwise, and it is key for performing data normalization or hit highlighting against regular expression matches. The WGs decided not to make the suggested change at the Cambridge meeting.. This has been discussed and there is significant support for keeping these functions. F&O 7.4.3 Making the positional parameters to fn:substring be xs:double instead of xs:integer adds complexity and confusion for no obvious benefit. If the rationale is to take advantage of the automatic promotion rules, it is difficult to come up with realistic use cases involving mathematic expressions on substring positions that would lead to values requiring such promotion. Request that if there is no sound justification, change the signatures to use xs:integer instead. The WGs decided not to make the suggested change at the Cambridge meeting.. F&O 7.4.3 fn:substring takes positional parameters to figure out which substring to select, but no functions are provided to determine the position of any interesting piece of a string. Request the addition of such functions. Options: (a) One function that returns positions of all matches, similar to fn:index-of for sequence: fn:position-of( $source as xs:string, $pattern as xs:string ) as xs:integer* Example: let $suffix := substring( $url, position-of( $url, "/")[last()] ) return substring( $suffix, position-of( $suffix, "#" )[1] ) (b) One function that gives first matching position, and one that gives the last matching position, similar to similar functions in various programming languages: fn:position-of( $source as xs:string, $pattern as xs:string ) as xs:integer fn:last-position-of( $source as xs:string, $pattern as xs:string ) as xs:integer Example: let $suffix := substring( $url, last-position-of( $url, "/" ) ) return substring( $suffix, position-of( $suffix, "#" ) ) The WGs decided not to make the suggested change at the Cambridge meeting.. SECTION. The WGs decided to accept the proposal by Michael Kay in to address this issue. SECTION 17.5: Casting across the type hierarchy Step 1 says to cast up the hierarchy to the primitive type of the source. It is not clear whether the types xdt:yearMonthDuration and xdt:dayTimeDuration are regarded as primitive types for the purpose of this step. If the source value's type is one of these types, or a restriction of them, do you cast back to xs:duration or just to xdt:yearMonthDuration or xdt:dayTimeDuration? The same remark probably applies to xs:integer, since I have heard it said that xs:integer is to be treated as if it were a primitive type for purposes of casting. - Steve B. The WGs agreed to add wording to explain the situation. SECTION 16.4: fn:current-date It is not stated whether there is any relationship between the value of fn:current-date and fn:current-dateTime, merely that both are stable and both represent some instant during the current query or transformation. This seemingly means that if a query or transformation runs across a change of day, then fn:current-date might not be the same as xs:date (fn:current-dateTime). This seems undesirable. It would be preferable to simply define fn:current-date() as xs:date (fn:current-dateTime()). Similarly, fn:current-time() should be defined as xs:time (fn:current-dateTime()) - Steve B. The WGs agreed to make the suggested change. SECTION. The WGs decided not to change the stability requirement for fn:collection. SECTION. The WGs said that this was a conscious decision and changing it would do more harm than good. Implementations could provide functions with alternate semantics if they so desired. Joint WGs telcon, May 25, 2004. SECTION 9.7.1: fn:subtract-dateTimes-yielding-yearMonthDuration The name of this function is too long. Perhaps fn:yearMonth-subtraction ? Similarly for fn:subtract-dateTimes-yielding-dayTimeDuration. - Steve B. The WGs decided not to make the suggested change at the Cambridge meeting.. SECTION 9.4: component extraction functions on duration, date and time The names of these functions are rather long, and could be shortened by using overloading on argument types to just fn:get-year, etc. - Steve B. The WGs decided not to make the suggested change at the Cambridge meeting.. SECTION 6.4.1: fn:abs This function may raise an overflow error if the absolute value exceeds the capacity of the return type. - Steve B. I thought positive and negative numbers had equal magnitudes. Jim Melton is right. We need an error condition to cover this case. SECTION 6.2.8: op:numeric-unary-minus You should also say that this function might raise an overflow exception if the negative value exceeds the capacity of the type, which typically happens for the largest negative value of xs:integer. - Steve B. I thought positive and negative numbers had equal magnitudes. Jim Melton is right. We need an error condition to cover this case. SECTION 6.2: functions and operators on numerics There is no statement about how to deal with truncation or rounding. For xs:float or xs:double, you can say that you follow the IEEE rules. For integers, this is only an issue for op:numeric-divide (you have a statement that there is no rounding in op:numeric-integer-divide). The main issue is xs:decimal. At the very least, this should be implementation-defined. - Steve B. The WGs agreed to add clarifying wording. This The WGs agreed to make the suggested change. I think it's editorial error: If input sequence is not empty, doesn't contains NaN's and error is not raised, the result of the function is defined as result of the expression: $c[1] + fn:sum(subsequence($c, 2)) So in last recursion, when count($c)=1, fn:sum is called again with empty sequence as parameter and returns 0.0e0 of type double. When sequence contains values of types other than numeric (dayTimeDuration etc), addition will raise type error. According to this fn:sum will not work for sequence of any types other than numeric... Also this expression should be defined for two-argument version of fn:sum and say that second argument is assumend 0.0e0 if not specified. It should be: if (count($c)=1) $c[1] else $c[1] + fn:sum(subsequence($c, 2),$zero) Similar definitions in fn:min and fn:max are not clear: "If the items in the value of $arg are of type xs:string or types derived by restriction from xs:string, then the determination of the greatest item is made according to the collation that is used." "according to the collation" is not precise, expression with fn:compare should be used. Plus there are two typos in expressions used for general case: ')' on end of first line and ']' on end of third and variable $collation mentioned below expression is not used. Best Regards, Noe Michejda 7th Portal S.C. Thank you for your valuable editorial suggestions. WGs decided on 8/23 that such functionality should be postponed to vNext. Collections look like a nice concept, but they don't currently exist on the Web. It's straightforward to take a document identified by an URI and use the Web to access that document. For collections, there is no protocol or mechanism. The way the specs currently read, they will either stay vaporware or be badly implementation-dependent. Regards, Martin. The WGs decided to add some wording motivating the function.8? Thank you for your editorial comments. We have revised the wording taking these into account.7 Casting numerics and inconsistency (17.8) We note that 17.8.3 can raise one error for any failure to convert to decimal, but 17.8.4 can use one of two errors for failure to convert to integer. We believe the failure cases are the same (number too large or illegal value, e.g., NaN), so we think these sections should be consistent.. Thanks! The wording has been aligned. 1) The algorithm contains: if ($parameter1 instance of element(*, xs:anySimpleType) and ($parameter2 instance of element(*, xs:anySimpleType)) return fn:deep-equal(fn:data($parameter1), fn:data($parameter2)) Why is no collation parameter passed to the recursive call of fn:deep-equal? 2) The formatting and indentation of the code is inconsistent. Till Westmann On May 4, 2004 we decided to accept wording suggested by Mike Kay. The dynamic type of this function should depend on the types of its arguments. So bold italics should be used for the result type and there should be a reference to the formal semantics. Till Westmann The WGs agreed to add clarifying wording. The This is a typo. Will fix. The description contains: If the argument is less than zero (0), but greater than or equal to -0.5, then negative zero (-0) is returned. So ceiling(-0.5) = -0 and ceiling(-0.6) = +0? Till Westmann STATUS: This is a bug. Fixed. The text says that "If the static context does not have a default collation specified, a system defined default can be invoked." but in the algorithm that follows this "system defined default" is not mentioned. This should be fixed. Till Westmann The wording has been changed and does not refer to "system define default collation". There is no description of the result for small negatives. Is fn:round-half-to-even(xs:double(-0.3)) eq -0 (as is fn:round(xs:double(-0.3))) or is it +0? Till Westmann Added appropriate wording. The function descriptions contain If the type of $arg is a type derived from one of the numeric types, the type of the return is the parent numeric type. 1) The formal semantics say that the input type is promoted. The descriptions in the F&O and in the FS should be aligned. 2) Instead of "the return" it should be "the return value" or "the result". Till Westmann The WGs agreed to make editorial changes to address the comment. Joint WG telcon May 26, 2004 The result types for these constructor functions: xs:dateTime($arg as xdt:anyAtomicType) as (xs:dateTime, xdt:dayTimeDuration) xs:time($arg as xdt:anyAtomicType) as (xs:time, xdt:dayTimeDuration) xs:date($arg as xdt:anyAtomicType) as (xs:date, xdt:dayTimeDuration) are no SequenceTypes. This is inconsistent wrt function declarations in the query prolog. Till Westmann The WGs agreed to change the constructor functions to return single values of the appropriate type. Joint WG telcon May 26, 2004 The document says: "Each error defined in this document is identified by an xs:QName that is in the namespace asssociated with the xdt: prefix.". But in Appendix D the "err:" prefix is used instead of the "xdt:" prefix. Till Westmann STATUS: Fixed. The summary for the second form of the base-uri mentions "the preceding rules". What rules are there/needed to get the base-uri property from the static context? Till Westmann This is a typo. Will fix.>. Jonathan WGs agreed that no change was needed. We WGs agreed that no change was needed. The We decided add references to a section in FS that explains the types in detail. The fn:replace() function now allows $0 in the replacement string but the error message still says: An error is raised [invalid replacement string] if the value of $replacement contains a "$" character that is not immediately followed by a digit 1-9 and not immediately preceded by a "\". Change 1-9 to read 0-9. Michael Kay STATUS: Fixed. WGs agreed that wording should be improved and a single error returned. This function raises an error if the second argument is an empty sequence. So why does the signature allow an empty sequence? Also, the error raised (invalid lexical value) is inappropriate. Michael Kay WGs agreed to make this change. Hi, XML 1.0 TE: [...] Note: Language information may also be provided by external transport protocols (e.g. HTTP or MIME). When available, this information may be used by XML applications, but the more local information provided by xml:lang should be considered to override it. [...] The definiton of lang() does not consider such protocol information. Please include explicit information whether implementations must use such information or must not use such information. We decided no change was required. Disagrees with the WG decision. Joint WGs telcon, May 25, 2004. The WGs took the position that protocol information was not stored in the datamodel and was not used by fn:lang(). Agreed to clarify wording. The description of the resolve-QName function says that the error "invalid lexical value" is raised if $element is the empty sequence. This seems to be the wrong error message. Perhaps "no namespace found for prefix" would be more appropriate? I'm also not sure I understand why the function signature even allows $element to be the empty sequence, if the processor automatically raises an error when it is the empty sequence. Thanks, Priscilla Walmsley WGs agreed to make this Thanks! That's better wording. This Last Call comment proposes a new XPath/XQuery function, possibly named fn:atom(). The result of fn:atom() is the same as that of fn:data(), except in those cases where fn:data() would construct a typed value by concatenating the string values of descendant elements. In these cases, fn:atom() returns an empty sequence. The definition of fn:atom() is as follows: fn:atom($arg as item()*) as xdt:anyAtomicType* The result of fn:atom is the sequence of atomic values produced by applying the following rules to each item in $arg: 1. If the item is an atomic value, it is returned. 2. If the item is a document node, the result is (). 3. If the item is an attribute, text, comment, processing instruction, or namespace node, the typed value of the node is returned (same as fn:data). 4. If the item is an element node (regardless of type annotation) that has no child element node, the typed value of the node is returned. 5. If the item is an element node (regardless of type annotation) that has a child element node, an empty sequence is returned. The advantages of the proposed function are as follows: (a) Suppose that $node1 and $node2 are element nodes with a type annotation that permits mixed content. Suppose that $node1 is bound to <node><a>1</a><b>2</b></node>, and $node2 is bound to <node><b>1</b><a>2</a></node>. Then data($node1) = data($node2) is true, because the typed value returned by the data function ignores nested markup. This is a undesirable result in certain applications. The atom() function would enable a user to avoid this anomaly by writing atom($node1) = atom($node2). In this case both atom() functions would return () and the result of the predicate would be false. (b) Suppose $sal is bound to the following untyped node: <salary><base>17</base><bonus>25</bonus></salary>. Consider the predicate $sal > 300. In processing this query, the data function will be implicitly invoked and will return the untyped atomic value "1725". Comparing this value with 300 will implicitly cast it to the integer 1725. The value of the predicate is true. This anomaly could be avoided by using the atom function, as follows: atom($sal) > 300. This revised predicate is false. (c) The fn:atom function can be used to search for elements that have a given atomic value without incurring the cost of concatenating potentially huge volumes of data. For example, consider the query: /book[title = "War and Peace"]//*[atom(.) = "Leo Tolstoy"] This query can quickly find leaf nodes with the atomic content "Leo Tolstoy" without computing the string-values of all the intermediate nodes in the tree, some of which are very large (the topmost element contains the whole book!) We believe that this function is sufficiently important to justify including it in the standard function library in order to make applications portable. Cheers, --Don Chamberlin WGs decided not to add this function.. STATUS: Agreed to fix example in Tampa. Agreed to fix the example. SUGGESTION 1: 7.4.7 fn:upper-case and 7.4.8 fn:lower-case How we can find what language to use? From default collation? It is not going to be flexible if from default collation. Possible solution- second optional parameter xml:lang SUGGESTION 2: 7.5 Functions Based on Substring Matching The rules are ambiguous if there are ignorable collation units. example '-' is ignorable for some collations. substring-before("a-b", "b") returns "a" or "a-"? Matching rules should be more precise and based on (e.g. minimal or maximal. For all positive i and j, there is no match at Q[s-i,e+j].) Igor Hersht XSLT Development IBM Canada Ltd., 8200 Warden Avenue, Markham, Ontario L6G 1C7 Office D2-260, Phone (905)413-3240 ; FAX (905)413-4839? I think the rationale is: Firstly, we aren't insisting that all collations use the Unicode collation algorithm. Secondly, the Unicode TR is not rigorous enough. The "Searching" section is labeled as "informative", and it's written in the style of a discussion of options and possibilities, not a specification that products can conform to. However, we have been guided in writing these specifications by the Unicode work (which has gone on in parallel - it wasn't all there when we started) and this should continue. We could also probably align the terminology better - I think our collation units are probably the same thing as Unicode's collation elements (though perhaps we avoided "elements" as being a reserved word). > > >I think the rules for starts-with, contains, and ends-with are > >unambiguous > I think they are ambiguous starts-with("-a", " a") true a false? > Sorry, I meant that the rules were unambiguous given the existence of a function that maps a sequence of characters to a sequence of collation units (which is what the collation provides). fn:lang returns 'false' if there is no context node. Other compatibility functions, such as fn:id, raise an error if there is no context node. Is there a reason for this discrepancy? STATUS: On the Feb 3 F&O telcon we agreed to raise errors: context item undefined - FONC0001 context item not a node - FONC0002 Proposal: Nothing SUGGESTED WORDING NaN has the canonical form "NaN". Infinity and negative infinity have the canonical forms INF and -INF respectively. Besides these special values, the general form of the canonical form for float/double is a mantissa, which is a decimal, followed by E followed by an exponent which is an integer. Leading zeroes and the preceding optional "+" sign are prohibited in the exponent. If the exponent is zero it must be indicated by E0 For the mantissa, the preceding optional "+" form of positive zero is 0.0E0. If implementations need to distinguish negative zero from positive zero, the canonical form for negative zero is -0.0E0. Beyond the one required digit after the decimal point in the mantissa, there must be as many, but only as many, additional digits as are needed to uniquely distinguish the value from all other values for the datatype. WGs approved precise wording for casting float/double to string. The. STATUS: We discussed on 1/6 F&O telcon. Agreed to adopt wording on 1/19. Close. This comment could be regarded as a follow-up to my post 2003Jun/0113.html Now the situation is the other way around: sum() returns NaN if the value NaN occurs within the sequence (like in XPath1) but appendix B states that NaNs are discarded (this is the definition in the previous version). Regards, Oliver Becker It appears that the compatibility appendix was not updated when the definition of the function was changed. We will fix that. I commented on the previous draft (a day or so before the release of the current draft) that deep-equal would be better in the user-defined appendix: 2003Nov/0210.html The version in this draft appears to be unchanged, so the comments made there still apply. (deep-equal appears to be completely broken wrt to document nodes). In addition I have noticed some further problems with the given definition. 1) The is-namespace-node() function should be in some non null (example.org) namespace so that this definition is legal in xslt as a user-defined function. 2) the note The contents of comments and processing instructions are significant only if these nodes are used directly as arguments to the function, not if they appear as children of the nodes supplied as arguments. is strictly true (the content is insignificant) but it is rather misleading. The _content_ of comments are (bizarrely) not compared by the given definition unless they are items in the sequence being compared, but comments are not ignored: their _presence_ affects the equality. given 1 <x>ab</x> 2 <x><!-- z -->ab</x> 3 <x>a<!-- z -->b</x> 4 <x>ab<!-- z --></x> 5 <x>a<!-- zz -->b</x> 1 == 2 == 4 3 == 5 as in 1,2,4 x has a single text node child with value ab but in 3 and 5 there are two text node children. This is a particularly arbitrary choice of equality definition. David On May 4, 2004 we decided to accept Mike Kay's proposal for this function. Acknowledged. fn. We are glad that you like the definition of fn:root(). However, we could not find other functions that allow node()* or item()* that you suggested should be changed. If you can make specific suggestions, the WGs would be happy to consider them.. Two issues and a comment: Issue 1: ======= The following text contradicts the code that it attempts to explain: "Return true if the the two nodes have names that compare equal as xs:QNames or if they do not have names. if (not(fn:deep-equal(fn:node-name($parameter1), fn:node-name($parameter2)))) then fn:false() else" Obviuosly, the explanation must be something like: "Return false if the two nodes have different names." Issue 2: ======= "Check if both element nodes have simple types. if so, compare their typed values, else compare their children recursively. The result is true if and only if the children of both nodes are all pairwise deep-equal, ignoring comment and processing instruction node children in both cases." What is the rationale for ignoring comment and PI children? Such a decision results in the strange fact that two nodes with different number of children may be deep-equal. Comment: ======= Using code to define the function is a good step forward, however the presented code seems too lengthy and unstructured. Probably the code would be shorter and more understandable if a few auxiliarry functions were defined and used in it. Dimitre Novatchev. On May 4, 2004 we decided to accept wording suggested by Mike Kay. There are two issues with this function: 1. The function name does not accurately reflect its semantic � it does not provide an answer if a sequence exists, but if a sequence is non-empty. Because not(empty($seq)) = exists($seq) a better name for this function would be notEmpty() or nonEmpty() 2. The example in 15.1.8.1 is incorrect: "fn:exists($seq) returns true." The above statement is true only if $seq is non-empty and $seq has not been defined. One can incorrectly deduce that the function returns true for any sequence. Dimitre Novatchev. We discussed this on the 12/2/2003 telcon and decided not to change the name of the function. "empty" is as imprecise a word as "exists" and it did not seem that a change in the name of the function would benefit our users. Accepts decision. Section 15.1 Functions and Operators on Sequences defines the functions zero-or-one(), one-or-more(), exactly-one(). The function definitions are: fn:zero-or-one($srcval as item*) as item? fn:one-or-more($srcval as item*) as item+ fn:exactly-one($srcval as item*) as item The main purpose of these functions is to raise an error if the property they name is not true for the parameter-sequence. Such functions are not necessary and useful, because, had their type been specified as: fn:zero-or-one($srcval as item?) as item? fn:one-or-more($srcval as item+) as item+ fn:exactly-one($srcval as item) as item then the error would be raised automatically if $srcval was not of the correct type. Such automatic errors would be raised for any function when passed parameters not matching the defined types of its arguments -- therefore the above three functions are not necessary at all. Solution: remove the functions fn:zero-or-one(), fn:one-or-more() and fn:exactly-one() Dimitre Novatchev STATUS: MHK: DN: Closed with no action on 1/19. Paul Cotton replied.. There is subsequent mail on this thread. Pointers to above-referenced mail.illa STATUS: Response from AM saying text had been changed due to separate discussion. Text changed due to previous discussion. Accepted. I'm curious why the subtract functions on date/time were changed to take the empty sequence but the ones on durations were not. Is this a bug or is there a decision behind it? The ones that can take the empty sequence are: op:subtract-dates fn:subtract-dateTimes-yielding-dayTimeDuration fn:subtract-dateTimes-yielding-yearMonthDuration op:subtract-times The ones that cannot are: op:subtract-dayTimeDuration-from-date op:subtract-dayTimeDuration-from-dateTime op:subtract-dayTimeDuration-from-time op:subtract-dayTimeDurations op:subtract-yearMonthDuration-from-date op:subtract-yearMonthDuration-from-dateTime op:subtract-yearMonthDurations --Sarah STATUS: On the 12/02 F&O Telcon we decided to accept Sarah's suggestion and make the change. We decided this was minor and the WGs had to be informed but did not have to approve. The F&O Taskforce agreed to make this change on the 12/2 telcon. This STATUS: Subsumed by the existing issue on this subject. This was raised by Mike Kay in and Jeni Tennison in Response from Jim Melton On 1/19 agreed to close with no action. AM replied: David Carlisle agreed: Jeni Tennisons note above asks for additional duration functions. Put on F&O agenda. Still pending. See F&O minutes Feb 3, 2004. Pointers to referenced messages: fn STATUS: Addison Phillips provided algorithm Paul Cotton asked for a normative reference and offered to postpone until the March meeting. Addison Phillips offered agreed to provide a normative reference by March, or earlier. STATUS: Discussed again at Redmond meeting on August 26, 2004. Decided to postpone until stable versions of the Charmod documents are available. STATUS: Cannot process now. Decided to close and re-raise at last call. See member-only minutes: There is a normative reference to an earlier charmod draft however the current draft, is David STATUS: AM agreed to change but we think Anders replied that change should not be made. AM replied: DC accepted response: There are follow-up messages on this thread from Paul Cotton. The status of the document is unclear. Suggest we keep open. STATUS: Discussed again at Redmond meeting on August 26, 2004. Decided to postpone until stable versions of the Charmod documents are available. STATUS: Cannot process now. Decided to close and re-raise at last call. See member-only minutes:berto Agreed to make the suggested editorial change. I On May 4 we decided to accept wording suggested by Mike Kay. The We discussed this on the 12/2/2003 telcon and decided that the wording was correct since both the implementations use fn:distinct-nodes. Accepts decision Theberto Seems like a bug! I'll take a look. No change needed Accepts decision > The F&O taskforce discussed this on 12/2/2003 and decided not to make the change to allow characters that are not legal XML characters. We will look into changing the wording to clarify which version on XML is supported. For the record, I'm happy enough with that. I thought I would float it as a suggestion but I don't object to a "no". The STATUS: Agreed to close in Tampa. Norm to respond. Comment 2.8 in XML Schema WG comments on Functions and Operators (below) said: The rules for escaping URIs should be aligned across all W3C specifications; otherwise, we will drive our users crazy. We think that means that you should reference and implement the algorithm specified in the XML Linking specification ([30]) There was a similar comment from the i18N WG. We agreed to align the description with the above algorithm which says that all characters disallowed in URIs according to RFC 2396 except for the number sign (#) and percent sign (%). Thus, the number sign (#) and percent sign (%) are never escaped. The forthcoming URI syntax draft adds the number sign (#) to the list of reserved characters so it seems that it should be escaped. This would be at variance with the Linking spec but seems to be the correct decision. Also, the linking spec says the square brackets should not be escaped as they are now allowed in per RFC 2732. Our spec escapes them. This seems to be a bug and needs to be fixed. Please provide guidance. All the best, Ashok The WGs agreed on 2004-09-28 that the semantics of fn:escape-uri should be aligned with XLink and the semantics were correct as written and that this comment could be closed with appropriate editorial changes. There is an error in the final example of fn:index-of. In my opinion in the attribute value a="red green blue" the the attribute 'a' would atomize to a single string value, not three. STATUS: Fixed as per MHK suggestion in to change type of attribute to NMTOKENS. According to section 6.2 of the 2004-07-23 Working Draft of F&O, "For op:numeric-add, op:numeric-subtract and op:numeric-multiply if either operand is INF or -INF the result is NaN." I believe that statement is not consistent with IEEE-754. Multiplying a zero value by an Infinity, adding Infinities that have opposite signs, or subtracting Infinities that have the same sign should result in NaN. In addition, adding, subtracting or multiplying an Infinity and a NaN should result in a NaN. Other combinations involving an operand with infinite magnitude will result in an infinity with the appropriate sign. STATUS: Fixed. General Editorial Examples with op: functions: Should use actual operator since function is not directly available for user. Otherwise it implies that users could type this example. STATUS: On the 2004-05-26 telcon the WGs agreed to make this change. Section 15.3.2 fn:avg Editorial/Technical What is the result of avg( (inf, -inf) )? Please add this as example. STATUS: Example added. Section 15.3 Aggregators Editorial/Technical Can sequence contain xdt:untypedAtomic? Mention it in intro. STATUS: Done! Section 15.1.13 Editorial/Technical Please give semantics for NaN. STATUS: This is covered by the rules given. General Editorial Add link to specific FS section for special type rules for all functions with special typing rules (this also assures that we have them defined in the Formal Semantics). STATUS: Done! Section 14.1.3 Editorial What does "attribute/element node without QName" mean? Please clarify wording or remove. STATUS: Fixed in response to another comment. Section 9.2 Editorial Remove the Note about XSD potentially including the new duration types. XSD 1.0 is not adding these types, therefore we cannot remove them from XQuery 1.0. Section 7.4.3.1 fn:substring Editorial In F&O substring function [] examples, 0E0.0 is not valid double format... should be 0E0. STATUS: Fixed as a result of another comment. Sections 6.2 and others Editorial We reiterate our comment submitted during our first last call review at about rewriting the operator mapping to have op: functions allow to take empty sequences or at least call out where the empty sequence behaviour is defined. See also . The WGs agreed to add wording to explain the situation. Section 1.7 Editorial The spec says:"The namespace prefix for these functions and datatypes can vary, as long as the prefix is bound to the correct URI. The URIs of the namespaces are: for constructors for functions. for the datatypes." It is not clear what the meaning of the URIs are. The schema and the xpath-datatype namespace both are used for the types and the constructors. It would be better to say " The following prefixes and namespace URIs are being used: The prefix xs is bound to. The prefix fn is bound to. The prefix xdt is bound to." STATUS: Fixed as a result of an earlier message. (IBM-FO-042): Section 15.4.4 (fn:doc): Result type in signature is not a valid SequenceType. Change "document?" to "document-node()?". --Don Chamberlin STATUS: Done. (IBM-FO-041): Section 15.3.5 (fn:sum): Second paragraph says that "The items in the resulting sequence may be reordered in an arbitrary order." I don't think this is relevant to the fn:sum function. --Don Chamberlin STATUS: Done. (IB STATUS: Done. (IBM-FO-039): Sections 15.3.3 (fn:max) and 15.3.4 (fn:min): These sections say that "$arg must contain only items of a single type or one of its subtypes for which the gt operator is defined." This would seem to prevent (for example) finding the max of two values of type xs:long and xs:short, even they are both derived from xs:integer which has a gt operator. It would also prevent finding the max of two values whose types are both derived from xs:string. I do not think this is intended. I think you mean to say that "all the items in $arg must either be numeric or be derived from a common base type that has a gt operator." Similarly, Section 15.3.5 (fn:sum) says that "The input sequence must contain items of a single type or one of its subtypes." Again, this would prevent finding the sum of two values of type xs:long and xs:short. The rule should be restated to accept all numeric values. --Don Chamberlin STATUS: Fixed. (IB STATUS: On 8/23/2004 the joint WGs decided to accept the wording recommended by Michael Rys in marginally amended to read "Returns the items of $sourceSeq in a non-deterministic order." (IB STATUS: Wording corrected. (IBM-FO-033): Sections 10.2.4 (fn:get-namespace-uri-for-prefix) and 10.2.5 (fn:get-in-scope-prefixes): Both of these functions have signatures containing types that are not valid SequenceTypes ("element" should be element()".) --Don Chamberlin STATUS: Fixed. (IBM-FO-031): Section 9.7.2, fn:subtract-dateTimes-yielding-dayTimeDuration(): This section should say that its function backs up the subtract operator on dateTime values (but it should still be in namespace fn: rather than op:). --Don Chamberlin STATUS: Fixed. (IBM-FO-030): Section 9.7, Adding and Subtracting Durations ...": This section should have a more general title, since some of its functions do not operate on durations (for example, op:subtract-dates). --Don Chamberlin STATUS: Fixed. (IBM-FO-029): Section 9.6.2, "fn:adjust-date-to-timezone": In this section, the "summary" paragraph is followed by 7 rules. Rules 5 and 7 seem redundant. Both rules deal with the case where $timezone is not empty. Probably the last rule was intended to deal with the case where $arg has a timezone and $timezone also contains a timezone. The last rule should be rewritten to correctly describe this case. --Don Chamberlin STATUS: Fixed in response to an earlier comment. (IB STATUS: Fixed. (IBM-FO-027): Section 9.4.18, fn:get-hours-from-time(), contains four bulleted examples, and states that the last example returns 6. Please take a close look at this. I think the correct result for this example is 20. --Don Chamberlin STATUS: Fixed. (IB STATUS: The component extraction functions now used the localized values. This comment is, thus, moot. (IBM-FO-025): Section 9.3.8, op:dateTime-equal(), would benefit from an example of comparing two dateTimes that are equal although their normalized values are in different days. For example, what is the result of op:dateTime-equal(xs:dateTime("2002-04-02T23:00:00-04:00"), xs:dateTime("2002-04-03T02:00:00-01:00"))? (I predict the answer is True.) --Don Chamberlin STATUS: Fixed. (IB STATUS: Fixed as the result of another comment. (IBM-FO-022): Section 7.3.2 says that fn:compare() with the second signature backs up "eq" and other value comparisons on strings. Actually, the first signature is used (since the value comparison operators have no way to specify a non-default collation). --Don Chamberlin STATUS: Fixed. (IB STATUS: Fixed except for (e) which requires some thought. (IB STATUS: Bug. Fixed. (IB STATUS: Wording changed. (IBM-FO-013) Section 5.1, Constructor Functions for Built-in Types: I don't think the note under xs:QName adds anything. All the constructors are defined by references to casting semantics, not just this one. --Don Chamberlin STATUS: Semantics of this constructor changed. Note removed. (IBM-FO-009) Section 1.7, Namespaces and Prefixes, needs the following changes: (a) Section claims that all functions defined in this document are in three namespaces. Actually it should be four (xdt: contains some constructor functions). (b) The first paragraph and the last paragraph both say that fn: functions are visible to users and op: functions are not. There's no need to say this twice. (c) In the bullet list, it would be helpful to list the pre-assigned prefixes as well as the namespace URIs (as in the XQuery book, section 4.4). --Don Chamberlin STATUS: Fixed. (IBM-FO-007) Section 1.5, xdt:anyAtomicType and xdt:untypedAtomic: This section needs a more general name, such as "Generic Types", especially since it now includes three types rather than two. --Don Chamberlin STATUS: Heading changed. (IBM-FO-005) Section 1.4, Type Hierarchy and throughout the whole document: Please replace xdt:untypedAny with the new name xdt:untyped as agreed at the working group meeting on 11/5/03. --Don Chamberlin STATUS: Done! (IBM-FO-004) Please improve the following cross-document references: (a) Section 1.2, Function Signatures and Descriptions: Paragraph beginning "As is customary" refers to XQuery Section B.1 (Type Promotion). A better reference would be XQuery Section 3.1.5 (Function Calls). (b) Section 1.5.1, xdt:anyAtomic Type: contains a reference to XQuery Section 3.12 (Expressions on SequenceTypes). A better reference would be to XQuery Section 2.4.3 (SequenceType Syntax). Same comment applies to Sections 1.5.2 (xdt:untypedAtomic) and 1.5.3 (xdt:untypedAny). --Don Chamberlin STATUS: Fixed. (IBM-FO-003) Section 1.2, Function Signatures and Descriptions: Please make the following changes to the paragraph beginning "In this notation": (a) Paragraph claims that each parameter has a non-normative name "used to describe the function's semantics". Please delete this phrase. The name of a parameter is not used to describe the function's semantics. (b) Paragraph says "In most cases, the dynamic type returned by the function is the same as its static type." Please delete "in most cases". This is either a rule or it is not. The rule should say that the dynamic type of the return value is always the static return type or derived from the static return type. (c) Paragraph says says the types "node" and "item" are indicated as "node()" and "item()". No need to treat these types as special cases. Instead, please state that all parameter types and return types are specified using the SequenceType notation defined in Section 2.4.3 of the XQuery book. This is a more comprehensive statement, and covers the whole notation including occurrence indicators, etc. Similarly, the last three paragraphs of Section 1.2 attempt to explain certain specific aspects of SequenceType notation. This should be covered by the general statement that all parameter types and return types are specified using the SequenceType notation. It's OK to include some examples that are of interest in function signatures, such as illustrating the difference between a function that takes no parameter and a function that has a parameter that accepts the empty sequence. --Don Chamberlin STATUS: Fixed. (IBM-FO-002) Section 1.1, Function Overloading: Should define what we mean by "function overloading". Specifically, should state that multiple functions with the same name but different numbers of parameters are permitted. --Don Chamberlin STATUS: Fixed. The F+O spec contains hyperlinks to the XQuery specification to explain concepts such as base URI, atomization, etc. These links should be to the XPath specification, to avoid creating any impression that they apply only when the relevant functions are used from within XQuery. Michael Kay STATUS: Done. [My apologies that these comments are coming in after the end of the Last Call comment period.] Hello, Following are comments on F&O that we believe to be editorial in nature. ------------------------------------------------------------------ Section 1.4 The type hierarchy diagram should include namespace nodes. A namespace node is a distinct type of node in the Data model, so omitting it from the diagram is just confusing. It also needs to be included in the last table in this section. ------------------------------------------------------------------ Section 1.4 In the third sentence of the first paragraph, xs:IDREFS is mentioned twice. ------------------------------------------------------------------ Section 1.4 In the type diagram, the line that connects xs:IDREFS, xs:NMTOKENS, xs:ENTITIES to xs:anySimpleType is also joined to the line from xdt:anyAtomicType to xs:anySimpleType. The line from xdt:anyAtomicType also leads to item. This makes it look like xs:IDREFS, et al. are subtypes of item, which is not the case. The two lines into xs:anySimpleType from its subtypes should be separated to avoid that potential confusion. ------------------------------------------------------------------ Section 1.5 The title of this section should include xdt:untypedAny, for completeness. ------------------------------------------------------------------ Section 1.8 In the definition of "stable", "fn:current-date" should be "fn:current-date()", in order to be consistent with other functions in the list. ------------------------------------------------------------------ Section 3 The first paragraph indicates that errors must be raised through a reference to the fn:error function. Some rationale as to why this is necessary should be provided. ------------------------------------------------------------------ Section 3.1 The example uses the prefix "xdt" for an F&O error, but Appendix D uses the prefix "err". ------------------------------------------------------------------ Section 4.1 The example indicates that if the first argument to fn:trace is of type xs:decimal, with the value 124.84, the string "124.84" is put into the trace data set. However, the description of the function does not indicate that any items in $value are converted to xs:string. Either the description of the function or the example needs to be corrected. ------------------------------------------------------------------ Section 5.1 In third sentence of the paragraph following the xs:unsignedInt example box, "that had a value equal to" should be "that had a typed value equal to". ------------------------------------------------------------------ Section 5.1 In fourth sentence of the paragraph following the xs:unsignedInt example box, "'atomize' the node to extract its value" should be "'atomize' the node to extract its typed value". ------------------------------------------------------------------ Section 7.1 In the second note, "is the of XML characters" should be "is the number of XML characters". ------------------------------------------------------------------ Section 7.3.1 In the first sentence of the second paragraph, "that that" should be "that". ------------------------------------------------------------------ Section 7.3.1 The seventh paragraph introduces the concept of a system defined default collation. The term "system defined" is never defined. Should this be "implementation dependent" or "implementation defined", instead? ------------------------------------------------------------------ Section 7.3.1 The second item in the numbered list indicates that fn:contains, et al. use the Unicode code point collation if no collation is explicitly specified. This should provide some rationale. ------------------------------------------------------------------ Section 7.5 The last paragraph of this section ends "the system may reject it." The term "the system" is not defined anywhere. This should probably be "the processor". ------------------------------------------------------------------ Sections 7.5.1.1, 7.5.2.1, 7.5.3.1 "Unicode default collation" should be "Unicode code point collation". ------------------------------------------------------------------ Section 8.3.1.1 The following example would be helpful: fn:not("false") returns false ------------------------------------------------------------------ Section 9.4.16.1 The second call to fn:get-day-from-date should return 1 rather than 01. ------------------------------------------------------------------ Section 9.4.18.1 In the fourth example, the result of evaluating fn:adjust-time-to-timezone(xs:time("01:23:00+05:00"), xdt:dayTimeDuration("PT0H")) should be the xs:time value 20:23:00-00:00. The result of applying fn:get-hours-from-time to that value should be 20, rather than 16. ------------------------------------------------------------------ Section 9.6.1 The fourth paragraph begins, "A dynamic error is raised (invalid timezone value). . . ." The name of the error should appear in square brackets, and be a link to Appendix D. This error is missing from Appendix D. ------------------------------------------------------------------ Section 9.6.2 The fourth paragraph begins, "A dynamic error is raised (invalid timezone value). . . ." The name of the error should appear in square brackets, and be a link to Appendix D. This error is missing from Appendix D. ------------------------------------------------------------------ Section 9.6.2 The last paragraph before the examples begins, "If $timezone is not the empty sequence. . . ." For the sake of clarity, this should probably be "If $arg has a timezone component and $timezone is not the empty sequence. . . ." It's not strictly necessary to mention $arg in this paragraph, but it is not necessary to mention it in the previous paragraph either. To mention it in one, but not the other is just confusing. ------------------------------------------------------------------ Section 9.6.3 The fourth paragraph begins, "A dynamic error is raised (invalid timezone value). . . ." The name of the error should appear in square brackets, and be a link to Appendix D. This error is missing from Appendix D. ------------------------------------------------------------------ Section 9.7.1 The third sentence of this section indicates that the difference between two values of type xs:dateTime can be viewed as the sum of an xdt:yearMonthDuration and an xdt:dayTimeDuration. The reader might be led to believe that fn:subtract-dateTimes-yielding-dayTimeDuration yields the second part of that sum, but in fact it does not - at least not directly. This should be clarified. ------------------------------------------------------------------ Section 9.7.3.1 As was done with xs:subtract-times, a second example involving a value with no timezone and a value with an explicit timezone should be shown. For instance, If the evaluation context provides an implicit timezone value of +05:00, op:subtract-dates(xs:date("2000-10-30"), xs:date("1999-11-28Z")) returns an xdt:dayTimeDuration value corresponding to 336 days ------------------------------------------------------------------ Section 9.7.11.1 Some other helpful examples: op:subtract-yearMonthDuration-from-date(xs:date("2000-02-29"), xdt:yearMonthDuration("P1Y")) returns the xs:date whose normalized value is Feb 28, 1999 op:subtract-yearMonthDuration-from-date(xs:date("2000-10-31"), xdt:yearMonthDuration("P1Y1M")) returns the xs:date whose normalized value is Sep 30, 1999 ------------------------------------------------------------------ Section 12.1 In the second paragraph, change "may" to "can" to avoid confusion with the RFC term. ------------------------------------------------------------------ Section 14.1.1 The seventh paragraph uses the words, "is chosen arbitrarily." That should be changed to "is chosen in an implementation-dependent manner" or something similar. ------------------------------------------------------------------ Section 14.1.1 The eighth paragraph states, "If there are several such namespace nodes, it chooses one of them arbitrarily." The clause "it chooses one of them arbitrarily" should be changed to "which is chosen is implementation-dependent." ------------------------------------------------------------------ Section 15.3.4 In the second note, "fn:max" should be "fn:min". In addition, "lt" should probably be "gt". ------------------------------------------------------------------ 7.3 The numbered list in this section indicates that the collation that is used for a function like fn:compare is: any collation specified as an argument to the function; if none is specified, the default collation from the static context; or if there is no default collation in the static context, the Unicode code-point collation. However, the paragraph preceding this list admits the possibility of a "system defined default" collation. That possibility needs to be included in this list. Thanks, Henry [Speaking on behalf of reviewers from IBM.] ------------------------------------------------------------------ Henry Zongaro Xalan development IBM SWS Toronto Lab T/L 969-6044; Phone +1 905 413-6044 mailto:zongaro@ca.ibm.com STATUS: Wording changed. Comment no longer applies. [My apologies that these comments are coming in after the end of the Last Call comment period.] Section 3 The second paragraph indicates that errors are identified by xs:QNames in the namespace identified by the xdt prefix. However, the list of errors that appears in appendix D uses a prefix of err, which is the same prefix used by XPath, and which is not in any namespace. If these errors really are in a namespace, a single consistent prefix needs to be used. Thanks, Henry [Speaking on behalf of reviewers from IBM.] ------------------------------------------------------------------ Henry Zongaro Xalan development IBM SWS Toronto Lab T/L 969-6044; Phone +1 905 413-6044 mailto:zongaro@ca.ibm.com STATUS: This was a typo and has been fixed. SECTION. STATUS: Fixed. Thanks! SECTION 1.7: Namespaces and prefixes This section describes three namespaces, which have distinct URIs, prefixes and purposes. It would be great to have a table that summarizes all of this. As it is right now, in the middle of the section you have a bulleted list that pulls together two out of three of these ingredients (the namespace URI and the purpose) but not the prefix. The correct prefixes are certainly deducible from other material in this section, but why not just put all the information together in one convenient table? - Steve B. SECTION 2.5: fn:document-uri In Section 2.5, "fnd:document-uri", we find the text "as defined by the accessor function dm:document-uri in Section 6.1 base-uri Accessor." It seems obvious that this is a typographical error, since the Functions & Operators section is named "document-uri"; we believe that the intent was to reference a section in the Data Model document dealing with dm:document-uri. However, there is no section at all in the Data Model document whose title is "base-uri Accessor"! In fact, the only uses of the term "document-uri" in the Data Model occur in Section 6.1.2, "Accessors", in which dm:document-uri appears as the third of "Three additional accessors". Perhaps the wording in F&O should be changed to read "as defined by the accessor function dm:document-uri in Section 6.1.2 Accessors." or perhaps to "...Section 6.1, Document Nodes". This is slightly more than the editorial comment that we have filed on F&O Section 2.5, "fn:base-uri", but it also raises the same concerns that additional references to the Data Model document may be incorrect. - Steve B. STATUS. Wording changed. SECTION. STATUS: Should be fixed with next build. SECTION. STATUS: Wording changed. Thanks! SECTION 7.5 : Functions based on substring matching Regarding collations that do not support collation units, the last sentence before the table in this section says "Such a collation may fail, or give unexpected results and the system may reject it." What is meant by "the collation may fail"? The collation is not a thing that can fail; it is just a subroutine that is called with certain defined arguments and mechanically gives a result. Perhaps you mean "the collation may not do what you expect it to do", but that is expressed better by the next clause, "or give unexpected results". Perhaps you mean "the collation may go into an infinite loop" which I guess would be a kind of failure, though based on my understanding of collations, this seems remote. More likely, you do not mean "the collation may fail", you mean "the function will not achieve its design goal." Moving on, what is meant by "the system may reject it"? First, who is "the system"? Is it the XQuery processor? Second question: what does "reject" mean? Does it mean "raise an exception"? If not, what happens when the system rejects it? - Steve B. STATUS: Wording changed. Thanks! SECTION 1.8: Terminology "Implementation defined" is not hyphenated, and probably should be (confer "implementation-dependent" immediately following). - Steve B. STATUS: Fixed. Thanks! SECTION. STATUS: Steve is correct. Changed wording to make treatment of xdt:untypedAtomic values clearer. SECTION 15.4.2: fn:id fn:id and fn:idref are node related functions. It would be clearer to define them in section 14 "Functions and Operators on Nodes". We can have cross references in 15.4 mentioning that those two functions will generate sequences. - Steve B. SECTION 15.2.2: op:union "Summary: Constructs a sequence containing every node that occurs in the values of either $parameter1 or $parameter2, eliminating duplicate nodes. Nodes are returned in document order. " If $parameter1 is empty sequence and $parameter2 has duplicate nodes and is not in document order, should we just return $parameter2 as it is, or normalize $parameter2 first, i.e. eliminating duplicate nodes and sorting in document order? op:intersect and op:except need clarification too. - Steve B. The WGs agreed to add clarifying wording. SECTION Annex D: Error Summary Some error codes (e.g., FOAR0001, division by zero) are accompanied by a natural language explanation of the code (the circumstances under which the error is raised, done informally). However, most of them are not. Consistency is highly desirable, and it seems most useful to readers to achieve consistency by adding such explanations for all codes that do not have them yet. - Steve B. SECTION 17.10: casting to date and time Rules 2 and following do not have "otherwise" cases, which presumably would raise an error. You need these "otherwise" rules to specify which error. This might be averted by refering to the table in 17.1 prior to all existing rules, and saying that whenever there is an N in that table, then such-and-such an error is raised. - Steve B. STATUS: Fixed as per Steve's second suggestion. SECTION 17.10: casting to date and time The definition of eg:convertTZtoString could be simplified by using eg:convertTo2CharString, as follows: let $tzhString := eg:convertTo2CharString (fn:abs($tzh)) let $tzmString := eg:convertTo2CharString (fn:abs($tzm)) - Steve B. STATUS: Fixed. SECTION 17.10: casting to date and time types Step number 1 defines CTZ as the current time zone. This quantity is never used in any subsequent step and so its definition can be deleted. Its use would be to default the timezone, but in fact the timezone is always defaulted from the timezone of the source value. - Steve B. STATUS: Fixed. SECTION. STATUS: Fixed. SECTION 17.10: casting to date and time types First para, last sentence: "...converting an xs:integer year value requires converting to xs:string with four or more characters preceded by a minus sign if the value is negative." The scope of "if the value is negative" is not clear. For correctness, it must apply only to the phrase "preceded by a minus sign", not to "with four or more characters..." or "to xs:string ..." or "converting an xs:integer year...". To fix this, insert a comma after "four or more characters". - Steve B. STATUS: Done. SECTION 17.9: casting to duration types The second and third bullets describe how to cast between xdt:yearMonthDuration and xdt:dayTimeDuration. The second bullet tells how to cast "...a type derived from xs:duration..." (which might be xdt:dayTimeDuration) to xdt:yearMonthDuration. (The result is P0M). Similarly, the third bullet tells how to cast from xdt:dayTimeDuration to xdt:yearMonthDuration (the result is PT0S). This contradicts the table in section 17.1, which says that these casts are not possible. This could be fixed in several ways: 1. The description of the table in section 1 could be changed. Currently it says that "N indicates that there are no supported conversions". As worded, this sounds merely descriptive rather than prescriptive. The description could be changed to read "N indicates that the conversion results in an error" (though it would still be necessary to specify which error). 2. The second and third bullets could be reworded to specifically exclude xdt:yearMonthDuration and xdt:dayTimeDuration, respectively, and types derived from them. 3. The second and third bullets could be removed entirely. In that case casting to xdt:yearMonthDuration and xdt:dayTimeDuration would fall under the general guidelines in 17.4 "Casting within a branch of the type hierarchy", meaning that their pattern facets would have to be satisfied in order for the cat to succeed. 4. The second and third bullets could be reworded to raise an error if the components to be discarded are not already 0 in the source. Though this would still permit casting the zero values of xdt:yearMonthDuration and xdt:dayTimeDuration to one another, so the table would have to say that the conversions may succeed. - Steve B. Fixed as per suggestion 2. SECTION. SECTION 17.9: casting to duration types The introductory paragraph says that this section applies "when a value of any primitive type is cast to xs:duration, xdt:yearMonthDuration or xdt:dayTimeDuration". The fourth bullet talks about "When ST is xdt:yearMonthDuration or xdt:dayTimeDuration...". But this case cannot arise, based on the introductory paragraph, because such an ST would not be a primitive type. - Steve B. STATUS: Wording changed. SECTION 17.4: casting within a branch of the type hierarchy Last paragraph, the hyperlink to 17.8 "Casting to numeric types" can be replaced by a link to the more specific reference 17.8.4 "Casting to xs:integer". - Steve B. STATUS: Fixed. SECTION. STATUS: Done. SECTION. STATUS: Wording changed. Thanks! SECTION 1.6: xs:dateTime, xs:date, xs:time You define a normalized value and a localized value, and give two examples. Each example uses the phrase "...has a value...". Are these examples of normalized value or localized value? Whichever, please also state what the other value is as well. - Steve B. STATUS: Good suggestion! Fixed. SECTION 1.4: type hierarchy The tables do not stick to the strict indenting rule you have described for some of the deeply derived numeric types. You have stacked up xs:short beneath xs:int, for example. At first I thought it was because you wanted to keep it all inside a printout width, but then I noticed that you did correctly indent xs:NCName and its subtypes, even though this overflowed my printer's page width. - Steve B. STAUS: Bug! Fixed. SECTION 1.4: type hierarchy The tabular presentations would fit on a normal width printout if you used a normal indented outline style with reasonably narrow indents, instead of treating the width of the largest subtype as the width of an indent. - Steve B. SECTION. SECTION 1.2: Function signatures and descriptions The description of the pseudotype "numeric" gives an example showing how to expand into four actual types. This example is followed by the sentence "Similarly, for return types". This sentence is not at all clear. You cannot mean fn:numeric-function(...) as numeric is equivalent to four signatures fn:numeric-function(...) as xs:integer, etc., because that would be ambiguous when it comes to determining the static type of the function. What I suspect you mean is fn:numeric-function($arg as numeric) as numeric expands into four signatures, each of which has the same type for the $arg and the return type. If this is what you mean, please say so. Note that you must also deal with the case where there is more than one argument. - Steve B. SECTION. STATUS: Fixed. SECTION 9.4.13: fn:get-timezone-from-dateTime It says "Returns the timezone component of $arg. The result is an xdt:dayTimeDuration...". This is not quite correct, since the return type is "xdt:dayTimeDuration?" . What you mean is, "Returns the timezone component of $arg, if any. If $arg has a timezone component, then the result is .... Otherwise the result is ()." Similar remarks apply to 9.4.17 fn:get-timezone-from-date and 9.4.21 fn:get-timezone-from-time. - Steve B. STATUS: Fixed. SECTION. SECTION 6.2.6 : op:numeric-mod last bullet for xs:float and xs:double, it says "Division is truncating division, analogous to integer division, not [IEEE 754-1985] rounding division." But there is more than one way to perform truncating division. For example, 2.0/3.0 can be truncated to 0, 0.6, 0.66, 0.666, etc. Judging by your example, what you mean is "truncate to an integer after the division. - Steve B. STATUS: Fixed. SECTION. STATUS: Fixed. SECTION 6.2: functions and operators on numerics last sentence before 6.2.1: "The number of digits of precision returned...is implementation-dependent." I think this statement is only necessary when the return type is xs:decimal. If the return type is xs:integer, then there are obviously 0 places precision after the decimal point, and the precision above is limited by the implementation-defined maximum and minimum values for xs:integer. If the return type is xs:float or xs:double, you can say that the operation, and hence the precision of the result, is dictated by the IEEE floating point standard. As for xs:decimal, the precision ought to be implementation-defined rather than implementation-dependent, which leaves the user completely in the dark about the behavior. - Steve B. STATUS: Fixed. SECTION. STATUS: Fixed. SECTION. STATUS: Fixed. Dear Colleagues, This comment pertains to the 25 December 2003 internal WD of XQuery 1.0 and XPath 2.0 Functions and Operators, as provided to our WG [1]. We do not expect a response for this purely editorial comment. [1] Xan Gregg, on behalf of the XML Schema Working Group ---------------------------------------------------- XSCH-FO-009 Editorial Misspelled: "follwed" in 1.6. Spurious full stop at beginning of sentence ".If" in 9.4.13. STATUS: Fixed.4 The WGs agreed on 2004-09-28 that the semantics of fn:escape-uri should be aligned with XLink and the semantics were correct as written and that this comment could be closed with appropriate editorial changes. Acknowledged.3 fn:data algorithm description (2.3) fn:data($arg as item()*) as xdt:anyAtomicType* Summary: fn:data takes a sequence of items and returns a sequence of atomic values. The result of fn:data is the sequence of atomic values produced by applying the following rules to each item in $arg: * If the item is an atomic value, it is returned. * If the item is a node, fn:data() returns the typed value of the node as defined by the accessor function dm:typed-value in Section 6.6 typed-value AccessorDM. The use of "returns" in the item description is confusing (since it implies the end of the function), and we're not sure what happens when the item is a node with a list type itself, since a sequence cannot contain other sequences. Perhaps it would be less confusing if the process were described as first creating an empty sequence, and then appending values to it for each input item as appropriate, and finally returning the composed sequence.1 Tabular type hierarchy errors (1.4) The tabular form of the type hierarchy contains the following errors: - positiveInteger is omitted - short and byte have the wrong parent type - unsignedInt, unsignedShort, and unsignedByte have the wrong parent type STATUS: Fixed. The XQuery version should shortened to: declare function eg:duration-equal($arg1 as xs:duration, $arg2 as xs:duration) as xs:boolean { return ( ( cast as xdt:yearMonthDuration($arg1) eq cast as xdt:yearMonthDuration($arg2) ) and ( cast as xdt:dayTimeDuration($arg1) eq cast as xdt:dayTimeDuration($arg2) ) } Till Westmann STATUS: This is a really minor change. It does not correct an error but merely rewrites the function a bit differently. I don't think we need to make this change. Ashok Malhotra There no error code for "Error retrieving resource". Till Westmann The WGs agreed to add this error message. this form. Joint WGs telcon, May 25, 2004. 1) The seventh paragraph talks about the "greatest" item. 2) All examples except for the first one are syntactically incorrect, as the parentheses are missing. Till Westmann This is a typo. Will fix. All examples except for the first one are syntactically incorrect, as the parentheses are missing. Till Westmann STATUS: Fixed. No reference for detailed type semantics given. Till Westmann STATUS: The WGs decided to accept the wording suggested by Michael Rys in. No type semantics are required. No reference for detailed type semantics given. Till Westmann STATUS: In the joint WG meeting on 8-23-2004 we decided to move this issue to the formal semantics cluster. When the semantics for this function are defined in the FS document we will add a pointer from the F&O to that definition. There is a "TT" in the second dateTime of the second example. Till Westmann STATUS: Fixed. The WGs decided to change the type of the arguments from double to decimal for the reasons stated. The example fn:get-hours-from-time(fn:adjust-time-to-timezone(xs:time("01:23:00+05: 00"), xdt:dayTimeDuration("PT0H"))) should return fn:get-hours-from-time(xs:time("20:23:00Z")) = 20. Till Westmann STATUS: Fixed. The example fn:get-minutes-from-dateTime(xs:dateTime("1999-05-31T13:30:00+05:30")) should return 30. Till Westmann STATUS: Fixed. 1) STATUS: Point 1 is incorrect. Made language change as suggested in 2. The text and the figure are not aligned concerning xs:IDREFS, xs:IDREFS, xs:NMTOKENS, xs:ENTITIES and user-defined list and union types. Till Westmann STATUS: Wording clarified. In F&O 17.10 Casting to date and time types The functions convertYearToString, convertTo2CharString, convertSecondsToString, convertTZtoString - use fn:length instead of fn:string-length - $intLength is cast as a string, then compared to an integer --Sarah STATUS: Fixed. The error message "invalid timezone value" that is raised by the adjust-* functions does not have a corresponding error number and is not listed in Appendix D. Thanks, Priscilla Walmsley Editorial. Fixed. AM 2004-03-04 The description for the fn:id function reads: "Each string in $arg is parsed as if it were of type xs:IDREFS, that is, $arg is treated as a space-separated sequence of tokens, each acting as an IDREF." But $arg itself is not space-separated, and the phrase "sequence of tokens" should really be "list of tokens" if you are talking about a space-separated string. I think it would be more correct/clear to say: "Each string in $arg is parsed as if it were of type xs:IDREFS, that is, each string in $arg is a space-separated list of IDREF tokens." Thanks, Priscilla Walmsley Appendix Fixed. In the description of deep-equal, F&O says: "The two nodes ... may also differ in their parent, their base URI, and their IDs. " Is this referring to node identity? If so, I think it should say "node identities" instead of "IDs", which might be confused with attributes of type xs:ID. Thanks, Priscilla Walmsley STATUS: Overtaken by events. Wording changed based on other decisions. Appendix STATUS: Editorial. AM to check and fix. The raising of errors has an inconsistent appearance across the family of documents. This issue is purely editorial in nature. XQuery 1.0, in Section 2.1.1, Static Context, states: If analysis of an expression relies on some component of the static context that has not been assigned a value, a static error is raised.[err:XP0001] Appendix F, Summary of Error Conditions, states: err:XP0001 It is a static error if analysis of an expression relies on some component of the static context that has not been assigned a value. F&O, in Section 7.5.1, fn:contains, states: If the specified collation is unsuitable for this function an error ·may· be raised [collation unsuitable for this function]. Section D, Error Summary (Non-Normative), states: err:FOCH0004, collation unsuitable for this function Finally, Serialization, in Section 2, Serializing Arbitrary Data Models, states: It is a serialization error if the value cannot be cast to xs:string. I suggest that clauses of this nature be made more consistent in their style. I prefer the style used by XQuery 1.0. -- Andrew -------------------- Andrew Eisenberg IBM 5 Technology Park Drive Westford, MA 01886 andrew.eisenberg@us.ibm.com Phone: 978-399-5158 Fax: 978-399-5117 STATUS: We agreed to follow the XQuery/XPath style. Fixed. In the examples section for fn:number the values for $item1 and $item2 are missing. 14.1.4.1 Examples * fn:number($item1/quantity) returns 5. * fn:number($item2) returns NaN. STATUS: The definitions appear at the start of the section. No action is needed. STATUS: Agreed to add note to datamodel document to clarify on 1/19 in Tampa. 14 Functions and Operators on Nodes 14.1 Functions and Operators on Nodes 14.1.1 fn:name 14.1.2 fn:local-name 14.1.3 fn:namespace-uri 14.1.4 fn:number 14.1.5 fn:lang 14.1.6 op:is-same-node 14.1.7 op:node-before 14.1.8 op:node-after 14.1.9 fn:root This is too-nested. Or do we miss section 14.2 ? Thanks, Dimitre Novatchev. STATUS: Fixed. Thanks! STATUS: Editorial. Fixed. The STATUS: Editorial. Fixed. I STATUS: Editorial. Fixed. The: .... Especially the "HH..." seems to suggest this interpretation. Perhaps the phrase "an escape sequence of %HH parts" or something like that makes the intention clearer and unambiguous. Regards, Oliver Becker STATUS: Editorial. Fixed. The. STATUS: Editorial. No change needed. The examples are: fn:deep-equal($item1, $item2) returns false. fn:deep-equal($item1, $item1) returns true . fn:deep-equal(($item1, $item2), 2.3E0) returns false. It is not clear why the result of the first example must be false as the variables $item1 and $item2 are not defined. Dimitre Novatchev STATUS: Editorial. No change needed. There are two issues with this function: 1. The description is confusing: �This function takes a sequence, or more typically, an expression, that evaluates to a sequence, as input .� Is �an expression, that evaluates to a sequence� a separate datatype in Xpath/Xquery 2.0? This phrase is not necessary, confusing and has to be removed. All other functions "take an expression" that evaluates to the necessary argument types -- we know this and don't need to be told this just for one specific function. 2. There isn't a meningful example to demonstrates the usefulness of this function. The explanation given does not tell the reader when and why to use the function: "Query optimizers may be able to do a better job if the order of the output sequence is not specified. For example, if you want to retrieve all the prices from a purchase order, and if there is an index on prices, it may be possible to compute an unordered result more efficiently." This tells the reader why he/she may receive unordered sequence as result, not why and when he/she should use fn:unordered() to provide an unordered sequence to other functions. Dimitre Novatchev. There are two issues here. Issue 1. ======== The "Summary" says: "Summary: Returns the sequence that results from removing from $arg all but one of a set of values that are eq to one other. Values that cannot be compared, i.e. the eq operator is not defined for their types, are considered to be distinct." According to this summary, the example given: "15.1.9.1 Examples fn:distinct-values(1, 2.0, 3, 2) might return (1, 3, 2.0)." is wrong. If we remove from (1, 2.0, 3, 2) all but one of a set of values that are eq to one other -- e.g. remove 2, then what we'll get will be: (1, 2.0, 3) The Summary misses the very important fact that the unique values are returned in any order -- so it is not just removing... This fact is mentioned just at the end of the section: "Which value of a set of values that compare equal is returned, along with its original type annotation, is �implementation dependent�. Note that xs:dateTime, xs:date or xs:time values can compare equal even if their timezones are different. The order in which the sequence of values is returned is �implementation dependent�." The reading and understanding of this paragraph is made difficult, because the meaning of the second sentence has nothing to do with the meaning of the first and third sentence. The second sentence has to be moved to its proper paragraph. Issue 2. ======= The example "15.1.9.1 Examples fn:distinct-values(1, 2.0, 3, 2) might return (1, 3, 2.0)." is also incorrect, because three arguments and not just one are passed to the function. In this case the function should throw an error. A correct example might be: fn:distinct-values( (1, 2.0, 3, 2) ) might return (1, 3, 2.0). Dimitre Novatchev STATUS: Editorial. Fixed. DN-FO-01: 15. Functions and operations on sequences Class: Editorial At present Chapter 15 has the following naming and structure: 15 Functions and Operators on Sequences 15.1 Functions and Operators on Sequences 15.1.1 fn:zero-or-one 15.1.2 fn:one-or-more 15.1.3 fn:exactly-one 15.1.4 fn:boolean 15.1.5 op:concatenate 15.1.6 fn:index-of 15.1.7 fn:empty 15.1.8 fn:exists 15.1.9 fn:distinct-values 15.1.10 fn:insert-before 15.1.11 fn:remove 15.1.12 fn:reverse 15.1.13 fn:subsequence 15.1.14 fn:unordered 15.2 Equals, Union, Intersection and Except 15.2.1 fn:deep-equal 15.2.2 op:union 15.2.3 op:intersect 15.2.4 op:except 15.3 Aggregate Functions 15.3.1 fn:count 15.3.2 fn:avg 15.3.3 fn:max 15.3.4 fn:min 15.3.5 fn:sum 15.4 Functions and Operators that Generate Sequences 15.4.1 op:to 15.4.2 fn:id 15.4.3 fn:idref 15.4.4 fn:doc 15.4.5 fn:collection Section 15.1 has exactly the same title as the whole chapter. Because the other sections in the chapter have other titles, the reader may wonder whether only the functions in section 1.1 really operate on sequences. Solution: Change the title of section 15.1 to something more specific. Dimitre Novatchev. P.S. This was essentially my comment from 23 June 2003. Nothing has changed in the new version of the WD... Hope this time there would be at least a response. STATUS: Editorial. Fixed. Several places in F&O, references are made to the special value "+INF". According to XML Schema, this is not a valid lexical form for float/double values - only "INF" is allowed. I think these references should be removed. Thanks, Priscilla STATUS: Editorial. Fixed.illa STATUS: Editorial. Fixed. Theilla STATUS: Editorial. Fixed. STATUS: Decided no change was needed. C STATUS: Mike Kay supplied the missing functions. Added. The informal description has a couple of instances of "then returns false." which would probably read better as "then the function returns false" as otherwise there doesn't appear to be a subject. > If $lang is the empty sequence it is interpreted as the zero-length string. This should presumably be $testlang as there is no parameter called $lang in the function signature. > (The character "-" is HYPHEN-MINUS, %x002D) The syntax %x002D isn't used elsewhere, I suspect that #x002D is meant, as that is used in other places to denote a character by hex unicode value. The relevent attribute is unambiguously specified by an Xpath expression but the equality test used is described by a rather contorted (and perhaps under specified) prose description. It would be clearer if function was specified in its entirety by an Xpath expression, something like fn:upper-case(fn:replace((ancestor-or-self::*/@xml:lang)[last()],'-.*','')) = fn:upper-case($testlang) using an explict expression (specified as using unicode codepoint collation) such as the above would make it clearer what is meant by the current wording "ignoring case". If "ignoring case" means first uppercase then compare then dotless i would compare equal to i and ess-zed would compare equal to SS however if "ignoring case" means first lowercase then compare then both of the above two comparisons would compare non-equal. I don't think the current wording defines which of these (or other possible interpretations) should be used. Alternatively (and perhaps preferably) "ignoring case" should be replaced by an explict reference to 1.3 Caseless Matching in the Unicode case mapping appendix (TR 21). Note however that the current normative reference to Tr21 in F&O is to however that page just says Superseded Technical Report UAX#21: Case Mappings has been incorporated into the Unicode Standard Version 4.0, and is thus now superseded. The last version of that document before it was superseded can be found at So it might be better to make the normative reference be Unicode 4, with a non-normative reference to tr21-5, for the benefit of those of us without a unicode 4 book. David STATUS: Editorial. Fixed. Section STATUS: Agreed to fix in Tampa. Close.
http://www.w3.org/2004/10/xpath-functions-issues.html
crawl-002
refinedweb
19,225
57.47
html tags - Struts struts html tags creating horizontal scroll-bar in struts HTML Hello ! I have a servlet page and want to make login page in struts 1.1 What changes should I make for this?also write struts-config.xml...{ response.setContentType("text/html"); PrintWriter pw Struts HTML Tags to include the following line in our JSP file: <%@ taglib uri="/tags/struts-html... the available error on the page. <html:file property="... Struts HTML Tags   Struts Guide from scratch. We will use this file to create our web application. - struts.... Latest version of struts can be downloaded from. We... and then receiving response from the controller and displaying the result to the user. HTML Tutorials . how to build a simple Struts HTML page using taglibs 6. how to code... struts-config.xml file for an existing Struts application into multiple... to struts-config.xml file. Then, open an editor for the struts-config.xml file STRUTS Suppose if you write label message with in your JSP page... file? What happens when you run that JSP? What error shows? If it is run is it display the fields design in that page (or) not? Explain struts struts <p>hi here is my code can you please help me to solve...=st.executeQuery("select type from userdetails1 where username=\'"+uname...; <h1></h1> <p>struts-config.xml</p> <p> Struts Articles is isolated from the user). Bridge the gap between Struts and Hibernate... built upon Struts and Hibernate can derive benefit from this generic extension... and add some lines to the struts-config.xml file to get this going Multiple file upload - Struts Multiple file upload HI all, I m trying to upload multiple files using struts and jsp. I m using enctype="multipart". and the number of files... in solving the problem : Upload page Struts framework Struts framework How to populate the value in textbox of one JSP page from listbox of another JSP page using Struts-html tag and java script converting html file into pdf - Struts converting html file into pdf i want to convert html file into pdf file using java code Struts File Upload and Save ;html:linkStruts File Upload</html:link> <br> Example shows you how to Upload File with Struts... Struts File Upload and Save   Struts Projects tested source code and ant build file How to used hibernate in the Struts...; Mockrunner does not read any configuration file like web.xml or struts... be configured from the log4j.xml configuration file is available through Developing Struts PlugIn are configured using the <plug-in> element within the Struts configuration file... about creating, configuring and checking Struts PlugIn. Our HelloWorld Stuts... the following line your struts-config.xml file. <plug-in className Hi.. - Struts in this file ans necessary also... struts-tiles.tld,struts-beans.tld,struts-html.tld,struts-logic.tld,struts-nested.tld and what is important of this file... useful in the creation of HTML-based user interfaces. struts-logic.tld Struts File Upload Example - Struts Struts File Upload Example hi, when i tried the struts file upload example(Author is Deepak) from the following URL i have succeeded. but when i try to upload file Struts Roseindia --> </struts> Here is the code of login.jsp file: <%@ page...Struts 2 Framework is used to develop enterprise web application.... Struts 2 Framework encourages Model-View-Controller based architecture How Struts Works the index file, the default welcome page, the mapping of our servlets... to the context elements. In the file WEB-INF/web.xml of struts...; In struts application we have another xml file which html:select in struts - Struts html select in struts What is the HTML select in struts default value Understanding Struts Action Class -config.xml file (action mapping is show later in this page). Here is code...; <html:linkTest the Action</html:link> Following... Understanding Struts Action Class   <html:text structs - Struts how can i display a value from database on jsp using struts form. the value should be populated on jsp load. can any body help me in this .... regards aftab Struts File Upload Example the form. <li> <html:linkStruts File...; <title>Struts File Upload Example</title> <html:base/>... Struts File Upload Example   Struts LookupDispatchAction Example ;Struts File Upload</html:link> <br> Example demonstrates how... to a property in the Struts Resource bundle file (ie...;Each ActionForward is defined in the struts-config.xml file (action mapping Struts LookupDispatchAction Example ;li> <html:linkStruts... to a property in the Struts Resource bundle file (ie..ApplicationResource.properties...;Each ActionForward is defined in the struts-config.xml file (action mapping Struts Links - Links to Many Struts Resources an application using Struts. * use the Struts bean and html tags. * process user input from HTML forms through Struts. Demystifying Jakarta Struts Also... to the expectations. Stepping through Jakarta Struts Struts, from the Jakarta Project Struts 2 File Upload Struts 2 File Upload In this section you will learn how to write program in Struts 2 to upload the file... be used to upload the multipart file in your Struts 2 application. In this section you Struts Dispatch Action Example in the struts-config.xml file (action mapping is shown later in this page.../DispatchAction.jsp">Struts File Upload</html:link> <br> Example...; Struts-Configuration file). Here the Dispatch_Action Struts Struts How to retrive data from database by using Struts show, hide, disable components on a page with struts - Struts show, hide, disable components on a page with struts disabling a textbox in struts.. in HTML its like disable="true/false" how can we do it in struts Struts MappingDispatchAction Example /MappingDispatchAction.jsp">Struts File Upload</html:link> <... file (action mapping is shown later in this page). ...; <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>  Struts MappingDispatchActionStruts File Upload</html... file (action mapping is shown later in this page). ...;p><html:link Struts-jdbc Struts-jdbc <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <%@ taglib <HEAD> <%@ page language="java html tag - Struts struts html tag Hi, the company I work for use an "id" tag on their tag like this: How can I do this with struts? I tried and they don't work Struts 2 Hello World Application using Eclipse Creating Hello World application in Struts 2 version 2.3.15.1 using Eclipse... applications based on Struts 2 Framework. Here we have used Eclipse IDE for creating... file. See the tutorial Downloading and installing Struts 2 2.3.15.1. Step 2 Struts 2 Hello World Example web application Add JSP and html page to the project Add the Struts 2.... Copy the JSP and html files from the code downloaded above to the Eclipse...Struts 2 Hello World Example - Video Tutorial that shows how to create Hello DynaActionForm in the struts-config.xml file. Add the following entry in the struts... in the struts-config.xml file...;%@ taglib uri="/tags/struts-html" prefix="html" %> <html struts struts why doc type is not manditory in struts configuration file Struts 2 Tutorial ; Struts 2 Hello World Application Creating the development directory... the mapping from struts.xml file to process the request.  ... name, the framework uses the mapping from struts.xml file to process struts validation ;%@ include file="../common/header.jsp"%> <%@ taglib uri="/WEB-INF/struts...="html" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <...=""/> <html:link<img src="../../images/btn_search Struts Struts What is called properties file in struts? How you call the properties message to the View (Front End) JSP Pages struts struts how to write Dao to select data from the database Creating Custom Validators in STRUTS Creating Custom Validators in STRUTS  ...;%@ taglib uri="struts-html.tld" prefix="html" %> <html... will learn how to develop Custom Validators in your Struts 1.3 applications. Struts struts struts i have no any idea about struts.please tell me briefly about struts?** Hi Friend, You can learn struts from the given link: Struts Tutorials Thanks Struts Tag: ; } Defining form Bean in struts-config.xml file : Add the following entry in the struts-config.xml file for Form Bean. <form...Struts Tag: bean:struts Tag Struts Am newly developed struts applipcation,I want to know how to logout the page using the strus Please visit the following link: Struts Login Logout Application What is Struts? the latest download link from the Struts download page. Struts technologies...;What is a Struts?". Tells you how Struts learning is useful in creating... of Struts Struts tutorial index page Struts 2 Tutorials Struts 1 Tutorial Struts Struts 1)in struts server side validations u are using programmatically validations and declarative validations? tell me which one is better ? 2) How to enable the validator plug-in file Creating Views Creating Views Struts provides their own JSP tag library for creating view. For using those library you need to import them on your page as <%@taglib... contains all the basic html tag to create a page. Consider the simple page written What is Struts? Hi hriends, Struts is a web page... web applications quickly and easily. Struts combines Java Servlets, Java Server... developers, and everyone between. Thanks. Hi friends, Struts is a web... visit for more information. Thanks Struts 1.1 Tutorials Struts 1.1 Tutorials This page... facilitate an HTML <input> element of type hidden, populated from... an HTML <input> element of type checkbox, populated from the specified java - Struts java Running login page i am getting the error.In my jsp page i am... file. function validate(objForm...._loginpage._jspx_meth_html_html_0(_loginpage.java:242) at com.ibm._jsp._loginpage Struts Alternative Struts Alternative Struts is very robust and widely used framework, but there exists the alternative to the struts framework... to the struts framework. Struts Alternatives: Cocoon struts struts i have one textbox for date field.when i selected date from datecalendar then the corresponding date will appear in textbox.i want code for this in struts.plz help me | Struts HTML Struts Validator Framework | Client Side... DynaActionForm | Struts File Upload | Struts file upload and save on server... | Downloading and Installing Struts 2 | Creating the development Struts Code - Struts Struts Code Hi I executed "select * from example" query... using struts . I am placing two links Update and Delete beside each record . Now I want to apend the id of the record with the Url using html:link Update What is Struts Framework? from the Apache Software foundation website. Apache Struts Framework... of writing this tutorial. You can view the latest Struts version at the page... on the development and maintenance of Struts Framework. The home page Introduction to Struts 2 Tags . In this page we will have listed all the Struts 2 Tags and in subsequent sections we... to display the data on the HTML page. The UI tags are driven by templates and themes... Struts 2 Tags In this section we Show Hyperlink in HTML Page this as- Move to the next URL page by clicking on an source image file in HTML... Show Hyperlink in HTML Page  ... to connect from one page to another page of the web. The anchor (<a>...< Jakarta Struts Interview Questions Resources Definitions file to the Struts Framework Environment... Resources Definitions files can be added to the struts-config.xml file through... fail errors on jsp page? A: Following tag displays all the errors: <html Struts 1 Tutorial and example programs struts ActionFrom class and jsp page. Using Struts HTML Tags Section shows you the different types of Struts HTML... DynaActionForm. - Struts File Upload struts struts I have no.of checkboxes in jsp.those checkboxes values came from the databases.we don't know howmany checkbox values are came from... the checkbox.i want code in struts Struts Book - Popular Struts Books the appetite of avid Struts reader including the two famous books from O'Reilly... you from needless grief. This book introduces you to Struts best practices so... established. Struts-based web sites are built from the ground up namespace in struts.xml file - Struts in struts.xml file Struts Problem Report Struts has detected an unhandled... this page because development mode is enabled. Development mode, or devMode.../struts.properties file. this error i got when i run program please help Format Examples . Struts 2 in-built formatting functionality can save you from above problem. You can... the formatting in properties file In Struts 2 the formatting is defined... Struts 2 Format Examples   Struts Html Date value - Struts Struts Html Date value How to fill date value using JavaScript Calender automatically without typing in Struts Html Text field Hi friend, Creating MS Word document in java - Struts the doc file , do some changes , adding header footer and creating new doc file.Can...Creating MS Word document in java I have one template in MS Word which has some content. Now i want to read this doc file and wants to add some struts struts how to make one jsp page with two actions..ie i need to provide two buttons in one jsp page with two different actions without redirecting to any other page HTML is a HyperTextMarkupLanguage.The HTML uses a hyperlink to connect from one page... how to send email from HTML page. Horizontal... in an HTML (web page) contain an input element with type=
http://www.roseindia.net/tutorialhelp/comment/61007
CC-MAIN-2015-14
refinedweb
2,206
68.77
Content-type: text/html audgen - generate an audit record #include <sys/audit.h> audgen( int event, char *tokenp, char *argv[], char *userbuff, long *size); The system call generates an audit record. The argument event is an integer indicating the event type of the operation being audited (see The value of event must be between one of the following values: MIN_TRUSTED_EVENT and MIN_TRUSTED_EVENT + N_TRUSTED_EVENTS -1 MIN_SITE_EVENT and MIN_SITE_EVENT + n_site_events -1 The number of site-defined events, n_site_events, is determined by the sysconfig sec parameter audit_site_events. Use sysconfig -q sec to view the security configuration controlled by /etc/sysconfigtab. See aud_sitevent(3) and aud_sitevent_num(3) for information on mapping site-defined event names and event numbers. The tokenp argument is a null-terminated array of token_type (see each of which represents the type of argument referenced by the corresponding *argv argument. The argv argument is a pointer to an array containing either the actual arguments or pointers to those arguments that are to be recorded in the audit record. A pointer to the actual argument is placed in that array when the argument is a string, array, or other variable length structure. Arguments represented as an int or a long are placed directly in that array. The available public tokens are listed in the audit.h file. If size is nonzero, *size is the size of userbuff provided to audgen, and the audit record created is not passed into the system audit data stream, but is copied out to userbuff. On return, *size is updated to the number of bytes of data placed into userbuff. If the size of the audit record exceeds *size, then errno is set to E2BIG. Applications can use this feature to create their own audit records. The call is a privileged system call. No record is generated for the system audit data stream if the specified event is not being audited for the current process. The maximum number of arguments referenced by argv is AUD_NPARAM (128) with no more than 8 of any one token_type. Upon successful completion, returns a value of 0. Otherwise, it returns a value of -1 and sets the global integer variable errno to indicate the error. The system call fails under the following conditions: Functions: audgenl(3), aud_sitevent(3), aud_sitevent_num(3) Commands: audgen(8) Security delim off
http://backdrift.org/man/tru64/man2/audgen.2.html
CC-MAIN-2017-04
refinedweb
385
52.7
I event of the Base application to load a form without a problem. Maybe a bit of the code you are using or exactly what you are wanting to do or both. Also, where are your scripts located? Mine are currently embedded in the document. First I have the global objects: desktop = XSCRIPTCONTEXT.getDesktop() oComponent = desktop.getCurrentComponent() Now for the Custom Events: “Start Application” is ignored completely so I do not get any errors. Event (Start Application) → Assigned Action ( macro.py$foo() ) def foo(*argv): print("Starting Application...) # Nothing printed to Console oController = oComponent.getCurrentController() oController.Frame.ContainerWindow.IsMaximized = True # No error and not maximized “Open Document” runs and XSCRIPTCONTEXT is “NoneType” Event (Open Document) → Assigned Action ( macro.py$bar() ) def bar(*argv): oController = oComponent.getCurrentController() oController.Frame.Title = "Hello World" Gets the error: (<class 'AttributeError'>: 'NoneType' object has no attribute 'getCurrentController' macro.py is in user space ~/.config/libreoffice/4/user/Scripts/python/macro.py One item still not clear - what/where is Start Application event?: - Edit the macro in user space - Change all of the items from (user, python) to (document, python) - Unzip the .ods - Replace the py file - zip the directory. Hello, After much testing here are some of the things I find. With your settings/code Start Application event seems to work from LO Start Up screen when you create a new Writer, Calc, etc document. Open Document event also works. HOWEVER, it only worked the first time and then the screen needed to be closed & reopened for it to work again. Now the Open Document event will work consistently if you move the two global items into the routine. View Created event also seemed to work with that change. As for debugging & packaging. In my current Python testing I use primarily two tools - MRI & APSO. Mri (also a similar tool is XRay) lets you examine much of the internals of LO - Properties, Methods, Interfaces and Services. If you are unfamiliar with either tool, see this post → To learn LibreOffice Base are there introductions or tutorials?. Make sure to click ‘more’ at answer bottom to see MRI & XRay stuff. APSO is a tool for organizing Python Scripts. It also has a feature to embed a script in a document making it easier than your zipping. It still requires you to delete & replace but is pretty quick. In light of that, most testing is from ~/.config/libreoffice/4/user/Scripts/python/ and when working can be moved into the document. APSO also is handy here at times since you can run the script from there. Some APSO links: Did you know that you could also use APSO to Organize your Python scripts within LibreOffice? Can I embed python script and integrate with basic? (solved) Last one has brief document on how to use APSO to embed script in document. Now one other item which I find handy and use often is this template → unostarter which also provides (among a multitude of other items) easy access to MRI or XRay from within your script. Almost forgot. This page may be of interest → Designing & Developing Python Applications Also just noted your comment on interactive testing. That would be your link in the question on ‘using a socket’. Have tried it and works. Not so good for Base where I do most things. @Ratslinger adding the globals “Open Document” worked. Not entirely sure why though. The globals should be loaded before the function is available. Other globals (“constants” I have defined) work fine in “Open Document”. I will look into the debugging tools; they look much better than my current methods. Thank you for always taking the time to write detailed answers and provide lots of other support links. It’s a huge help! Certainly glad you have something which works. I am certainly not proficient in Python. There are some things yet, as you mention, which still raise the “I’m not sure why” question. Have answered some other Python questions which I and others still are not able to explain completely (mainly dealing with needing threading). With LibreOffice 5.4+ I get an available & active Python environment inside LibreOffice launcher/desktop, that is without requiring to open a document. See how to run Python interpreter “Application Start” either with a Basic macro either with a Python macro. However I suffer from similar symptoms when trying to grab the Desktop. May I suggest you drop IDE_utils.py file into your INSTALL\Program directory and add the following line on top of “Start Application”-like Python macros: from IDE_utils import XSCRIPTCONTEXT Although I initially built IDE_utils.py for a different purpose, It does operate in this context. Therefore I’d be glad you let me know the outcome of your attempts. Cordially More information in Python IDE Basics
https://ask.libreoffice.org/t/how-to-execute-a-python-function-before-xscriptcontext-is-available/37669/8
CC-MAIN-2021-49
refinedweb
798
67.55
There's a GR_REQUIRED_COMPONENTS CMake variable[e.g. 1]; add FILTER. Best regards, Marcus [1] 15. Mai 2015 11:47:51 MESZ, schrieb Su Li <address@hidden>:Hi all,I found the problem.In my OOT block, I try to use mmse_fir_interpolator. Thus, in the my_block_impl.h file I use the following code to include the fir interpolator:#include <gnuradio/filter/mmse_fir_interpolator_ff.h>But when I run ctest for my block, I got the following error:ImportError: /home/suli/gr-ctia802_15_4/build/lib/libgnuradio-ctia802_15_4.so: undefined symbol: _ZN2gr6filter24mmse_fir_interpolator_ffC1Evwhere ctia802_15_4 is my OOT module name. It seems that this fir filter is not correctly included.Anyone can tell me how to fix it? Thanks in advance.Best regards,Su Li2015-05-14 14:33 GMT+02:00 Su Li <address@hidden>:Hi've had a similar problem when I generated files for my own module using the gr_modtool and then copied some existing code by replacing the file(s) that gr_modtool generates. It turns out I had overlooked that the new "my_block" name needs to be changed in several places, like the namespace declaration, the #include compiler directive, and the conditional #ifndef INCLUDED ... directives. Once I updated that correctly the AttributeError got resolved. -Peter- On 5/13/2015 10:38 AM, Su Li wrote: Dear All, I am trying to make an out of tree module by following the tutorial on Gnu radio website. I can write simple blocks in C++, compile it and install it to it usable in Gnuradio company. But for some complex block, I want to implement them based on the gnuradio build-in blocks, for example, clock_recovery_mm_ff. So I make a new block in my out-of-tree module and try to first "copy" the build-in block into my out-of-tree module. I changed the following 4 files in my OOT module to match the corresponding files of the build-in block: lib/my_block_impl.cclib/my_block_impl.hinclude/my_block.hgrc/my_block.xml In each file, I changed all the "clock_recovery_mm_ff" into "my_block". I can successfully make and install the block without error and warring. But when I try to run the grc graph, an error happens. AttributeError: 'module' object has no attribute 'my_block'. Anyone can tell me what I should do to correct this error? Is there any other files I should change? When I make simple blocks by myself, I only change this 4 files and it works. Best regards, Su Li _______________________________________________ Discuss-gnuradio mailing list address@hidden _______________________________________________ Discuss-gnuradio mailing list address@hidden Sent from my Android device with K-9 Mail. Please excuse my brevity.
https://lists.gnu.org/archive/html/discuss-gnuradio/2015-05/msg00171.html
CC-MAIN-2020-05
refinedweb
436
58.28
: August 2, 2007:00133 GLADES COUNTY EMOCT I Am Moore Haven, Fla. Thursday, August 2, 2007 vuiume 83, Number 6 At a Glance The 2008 election is just around the corner. All Glades County registered Democrats are encouraged to attend. The Glades DEC meets every month on second Tuesday at the library at 5:30 p.m. For more information contact El- len Hawk Geake at (863) 983- 2962 or (863) 946-1963.! Alzheimer's group meets The Alzheimer's support group will meet regularly on the first and third Tuesday of e3ch month For -more information, please call Palm Terrace of Clewiston at (863) 983-5123. Are you a blogger? Get a newszap link! The Glades County Demo- crat infor- mation, call Roy Stewart at: (863) 632-0914. Lions plan giant yard sale Lions Club recruits new members By Nena Bolan Glades County Democrat MOORE HAVEN On Au- gust 18, the Lions Club has planned for Moore Haven's largest yard sale ever by the old Goodwill store on U.S. 27 between Joey's pizza and the Marathon station. Members like Kirby Sullivan and L.C. Roundtree would like for everyone to donate items which will generate funds for charitable causes. It is fund rais- ers like this that support guide dogs for. the blind and deaf, Ronald McDonald House, camp for children with severe vision problems and contributes to an Moore Haven High School scholarship fund Jeffrey Davis, Lions Club pres- ident, will be happy to tell you more about the mission of the Moore Haven chapter of Lions Club International. Foremost on the list of goals is membership recruitment. Now that the club sees the graying of many mem- bers it wants to invite younger adults to contribute their energy to helping the community, and putting a few smiles on those in need. Mr. Davis has been the Lions Club president for over a year and he believes the other chari- table causes they practice are worthwhile, such as collecting used postage stamps for retired veteran hobbyists, assisting with hearing aides, and collecting eyeglasses for overseas distribu- tion. The Lions fund eye exams, eyeglasses, clothing, surgery and cornea transplants. Last spring the Lions spon- sored a poker run called Run Around the Lake and they raised about $1,400, and Walmart has pledged to match those funds. Every Easter Sunday they put on a Sunrise Pancake Breakfast at the high school cafeteria. Mc- Donald's supplies the pancake batter. Last Easter they almost filled up the cafeteria. The Lions Club has also done car washes and boot stops at city intersections. This kind of activity is where younger mem- bers could be helpful. They need assistance with the up- coming yard sale, and fall fund drives. Visitors are welcome to all the meetings. Just call Mr. Davis and let him know you See Lions Page 12 Luckey to be principal at Upthegrove By Barbara Oehlbeck Special to Glades County Democrat "One man's gain is another man's loss," says a quote from Bartlett's Familiar Quotations. In this case, the saying holds true. Hendry County's gain is Glades County's loss. in the matter of Larry Russell Luckey II, who is moving "across the river" leaving West Glades School in western Glades County to become the princi- pal of Upthegrove School in Hendry County. Mr. Luckey leaves a record of the highest merit. He be- came principal of West Glades Elementary School when it first opened in 2004. During these years, the school and the students have excelled under his leadership. For ex- ample: In 2005-200, West Glades Larry School was Luckey honored as . being one of the top 50 com-. bination schools (elementary See Luckey Page 12 By Nena Bolan Glades County Democrat PORT LABELLE A villa was destroyed on Marina Drive in Port LaBelle early in the morning on July 22. A second villa was spared the flames, but will have to be dried out. LaBelle Volunteer Fire Depart- ment was the first responder, and they were later joined by fire departments from Moore Haven, Muse, and Palmdale According to Jeff Harrod, Palmdale fire chief, the first page was about 4:21 a.m. The occupant was not home in unit-9 at the time the.fire.be- gan. The unit was' completely destroyed and the cause of the fire is still under investigation. Mr. Harrod said Palmdale fire fighters were some of the last to leave around 1:30 p.m. Scott Perry lived in unit 19, and when he received notifica- tion that his home was on fire "I was asleep in my home. An explosion woke me up, and I ran and'opened the front door. The place next door was burning big time." Lucy Heflin he returned to see that it was destroyed. "I knew by the time I got there that everything was gone," said Mr. Perry. Scott Perry believes the fire fighters did a good job, and he is thankful he was not harmed. Fire fighters were able to spare unit 20 though it got a thorough soaking. Lucy Heflin was grateful her home was saved along with its contents. She said water clean up had begun the next day and the carpets were drying out. How- ever, it was an alarming expe- rience because she was home when the fire started. "I was asleep -in my home. An explosion woke me up, and I ran and opened the front door. The place next door was burning big time," said Lucy Heflin. Ms. Heflin mentioned that she gathered some items and put them in her car, then moved it to the other side of the parking lot. She grabbed the water hose while others nearby knocked on doors. Her unit has an aluminum roof while some of the other units do not, and she believes this helped reduce the spread of the fire. Staff writer Nena Bolan can be reached at nenabolan@yahoo.com By Nena Bolan Glades County Democrat MOORE HAVEN The Glades County Emergency Man- agement worked in coordina- tion with the National Weather Service to hold a storm spot- ters class at the Doyle Conner Building on July 26. The class is called Skywarn and the Nation- al Weather Service provided an instructor from the Miami of- fice. About 22 volunteers took both the basic spotters class and the advanced spotters' class in order to be trained to call in reports of severe weath- er conditions. Many who attended class were employees and volunteers with fire and rescue, emergen- cy management, the Red Cross and local government; as well as amateur radio operators and teachers. Some people drove in from Buckhead Ridge, LaBelle, Clewiston and Belle Glade. Robert Molleda, warning coordination meteorologist, instructed the class on correct definitions and terminology used by the National Weather Service. Many photos and short videos were used to give a vivid depiction of actual weather events so the class can identify specific severe indicators and See Storm Page 12 Lake Level 9.19 Feet above sea level Index Classifieds ....... 16-20 Opinion........ . . . 4 School ......... . . 9 Sports ......... .... 6 See Page 4 for information about how to contact the newspaper. newszap.com Community Links. Individual Voices. 8 16510 00022 1 Sally Settle Barrow looks for inspiration A community profile By Nena Bolan Glades County Democrat MOORE HAVEN Sally Set- tle Barrow has already written one book with a setting in Moore Haven where she grew up. It is called "In the Shadow of the Lone Cypress," and a new ad- dition is due out soon. She was in the history room at the public library on July 25 doing research on ideas for new stories. Question: Where were you born and raised? Answer: I was born in Moore Haven and lived about three blocks from here until I was 11. Then my family moved to Monticello, but we kept ties down here and came back of- ten. We would visit friends in the summer. I'm staying with a friend right now. Question: What do you do? Answer: I am retired as of May 30 with 36 years in educa- tion. I was an elementary school librarian in Jacksonville. I have 15 years teaching special edu- cation and 21 years as a media specialist. Question: What are you do- ing in the library today? Answer: I am reading through newspaper stories from 1926 to the 1950's. My dad was the editor and publisher of the Glades County Democrat, Hen- dry County News and the Clew- iston News. He was editor from 1933 to 1959. I am reading the See Sally Page 12 iil/irena Dolan For some there is no better place to be than in the library. Sally Settle Barrow researches ideas about her next stories. She is in the history room which is a new addition to the library. I.kf 50o Fire: Blaze destroys Port LaBelle Villa Submitted to INI A Fire devastated a villa in Port LaBelle on Marina Drive in the early morning of July 22. The flames threatened the unit next door, but it was saved. LaBelle Fire Department, and three volunteer fire departments from Glades County responded to the fire. Cause is under investigation Area volunteers spot storms 9-#~i~le~;sarp~ Thursday, August 2, 2007 2 LIFESTYLES Serving the communities south of Lake Okeechobee Area relay radio operators attend regional forum By Samuel S. Thomas W3ALE PIO Big Lake Amateur Radio Club On Saturday, July 21, a region- al meeting of the Amateur Radio Emergency Service was held at the Emergency Operations Center in West Palm Beach. This secure "nerve center" for Palm Beach County hosted the radio com- munity from Brevard to Monroe Counties and included Hendry and Glades County Emergency Coordinators and staff. Representing Hendry County was Jim Sparks, AA4BN, the Emer- gency Coordinator for the county; and Sam Thomas, W3ALE, Assis- tant Emergency Coordinator and Public Information Officer for the local radio group at the southern end of Lake Okeechobee. Both of these persons are also designated as "Official Emergency Stations" by the American Radio Relay League; indicating that they have a capacity to stay "on the air" in the event of major disasters, hur- ricanes, power outages, or other situations where the usual power and communications sources would not be in service. Attending from Glades County was their Emergency Coordinator, Thom Street, N5KFR, who over- sees emergency communications in the Glades County area. The meeting included approxi- mately 50 persons who received updates on communications pro- tocols and techniques, reports of regional activities throughout the southern Florida region, establish- ing information-sharing networks, and our place in the larger, state- wide and national emergency preparedness efforts. During the past several years, requirements for becoming a licensed radio amateur operator have been sig- nificantly relaxed. The Federal Communications Commission, which regulates all radio transmissions in the U.S. (including amateur radio licens- ing), has eliminated Morse Code requirements from the licensure testing. The examination ques- tions are now in the public do- main and materials have been prepared to assist persons in get- ting ready for licensure tests with- out the same broad-spectrum knowledge requirements that were needed in the past. Additionally, the testing for li- censure today is provided through a national program of volunteer examiners rather than having to travel to a local FCC administrative site for testing. As a result, it is now possible to take licensing tests in almost any area of the country. Hendry and Glades County have sufficient volunteer examiners available to make it easy for per- sons interested in preparing for radio licenses to be tested. Persons who are interested in learning more or preparing to Engagements Luke 18:16 share in this means of contribut- ing to their county emergency preparedness are invited to get in touch with the local EC's or Assis- tants. Perhaps more importantly - entering into an exciting way of making friends around the world, enjoying a new and fascinating pastime, and learning about a science at the roots of our society - is also something to be gained. For more information, contact the Big Lake Amateur Radio Club, through Sam Thomas at (863) 983-7960 or one of the local Emer- gency Coordinators. They will be happy to answer questions and provide additional information. I II V:B'111 ENROLL NOW FOR THE 2007-2008 SCHOOL YEAR 5 Day Program 4 & 5 year olds Monday Friday Hours: 8:30 12:00 For More Information Call 983-5555 License #087466 INI/Katrina Elsken Cowboy Day cattle drive The Seminole Tribe of Florida provided Spanish-type cat- tle for a ceremonial cattle drive in Okeechobee on Satur- day, to honor National Cowboy Day. Representatives from the tribe also rode in the cattle drive, which traveled ap- proximately 3.5 miles from Flagler Park to the Okeech6bee Agri-Civic Center. Kendall Miller and Gary Moore Submitted photo Miller-Moore Deborah Miller and Charles Miller of Clewiston are proud to ,announce the engagement of ,their daughter, Kendall Miller, to :Gary Moore, of Clewiston. The prospective groom is the son of Gary Lee Moore and Linda Joyce Moore. The prospective groom is sta- tioned at Ft. Campbell, Ky., in the 5th Special Forces Group (Air- borne) Unit. He will have another tour in Iraq this coming October. The bride-to-be is currently enrolled at UNA, in AL., where she is playing softball on a schol- arship and working toward a double major in Criminology and Sociology. Both- are Clewiston High School graduates. INI/Katrina Elsken Old-fashioned paddy wagon The Seminole Tribe of Florida's historic jail wagon was featured in the National Day of the Cowboy celebrations in Okeechobee on July 28. SMemorial Tribute S- Remember a loved one S- ho has departed with a special Memorial Tribute in this newspaper. qw i>, ta% <&-. -r-- -----~Y---~-s- T - INI/Katrina Elsken Stagecoach The Seminole Tribe of Florida's historic stage coach was featured in the National Day of the Cowboy celebrations in Okeechobee on July 28. Cattle drive: Move 'em out The Seminole Tribe of Florida provided the cattle for the National Day of the Cowboy cattle drive and cele- bration in Okeechobee County on July 28. The celebra- tion started with a 3.5 mile cattle drive from downtown Okeechobee to the Agri-Civic Center on State Road 70. The cattle are descended from the cattle left in Florida by Spanish explorers. Obituaries Cristino Perez Cristino Perez, age 87, of Clew- iston, passed away July 23, 2007 in Clewiston. He was born Aug. 6, 1919 in Agua Buenas Sumidero, Puerto STA .ONN MOBILE HOMES Quality Homes at Discounted Prices! Homes From the Low $50's. Tum Key Packages Available. Family Owned Since 1981. "- JACOBSEN ScotBilt i HOMES. INC. licknm #: DH718 Clewiston LaBelle 1312W. Sugaand Hwy. 231W, H eeAwve. 863.983-8106 863-675-6266 Okeechobee 4925 Hwy 441 S. 863.467.6622 Rico to Jose and Maria (Fontanez) Perez. He is survived by his wife, Ma- ria (Santana) Perez of Clewiston; his daughter, Rosa Maria Perez of Clewiston; two others, Artemio Perez and Juan Perez, both of Puerto Rico. Funeral services were held Thursday, July 26, at Akin-Davis Funeral Home in Clewiston with Reverend Tranquilino Hernandez, officiating. Interment followed at Ridgelawn Cemetery, Clewiston. All arrangements were under the direction of Akin-Davis Funer- al Home, Clewiston. Since /1929 Royal's FURNITURE APPL IANCES & BEDDING M-fWff ff Peyton Burgandy" G 14 9 Wob a cb vilmant colo and an cmhg contemlomy Upholty coWe adds a ':~t~l I( L~pq~?,pl~gyreftesb in g~ style with a hint of sophismiaton toany homckmco 7-JFiecc Rcocm Iac~k3.g $1 199.95 Bele Glauile 561~60 T4u Clewistoin 863-498 1 & ASNeY MJinuure 119nOMw e Eu Inunoatee 239487-6 eLeeMODee aw s Sa rw 4k '16P6H6 SQfades cu.cademy o uLAgxtcuftuse Scofogtca S9tudtie 1200 8. ain Stheet. cPahokhe e g99476 CaaKtehl/ubQ0 Schoo Qads 9Xg-sth qPhone (5610924-9402 Dear Parents, We are currently excepting registration forms for the 2007-2008 Serving the communities south of Lake Okeechobee LIFESTYLES a Summit demonstrates challenges of water control By MaryAnn Morris INI Florida On Monday July 30, South Florida Water Management Dis- trict (SFWMD) called together representatives of stakeholders: agriculture, representatives from the east and west coasts of the state, environmental interests, recreation and government inter- ests to engage in a Water Summit. The 2007 Water Summit hopes to explain the challenges faced any given year to manage the system, heighten stakeholders' awareness of water management's decision- making process and demonstrate the tools they have available to manage the system. "Pre-drainage (no canals, no dike, etc.) when the wet season came, the lake spread out in all di- rections and drained mainly south then east through the Everglades and the Florida Keys," said Carol Wehle, executive director of SF- WMD. "In those days, water qual- ity was not even on the table." "Then drainage canals were dug and the Herbert Hoover Dike was built," she continued. "The dike reduced the size of the lake by two thirds. Much of the Ev- erglades had been drained for farms. The Everglades that is left was much smaller than before. The Kissimmee River was chan- nelized which brought more wa- ter to Lake Okeechobee faster. The river had been 103 miles of twists and turns that slowed the water which drained all the way south from Orlando. The chan- nel however, let the water rush straight down a distance of just 56 miles. The effect: more water coming into a smaller lake and smaller Everglades has changed things. Who would have though we would ever have had record hurricanes followed by record drought?" But the area has had similar periods of wet and dry seasons, she continued. "During the 1930s there was a severe drought. That was fol- lowed by the two disastrous hur- ricanes of the 1940s," said George Home, Deputy Executive Director of Operations and Maintenance for SFWMD. "After this, in 1949, the Central Florida Flood Control Project was authorized by the leg- islature and it was built.. Then in 1972, the legislature authorized the forming of five -water man- agement districts, their boundar- ies based on the hydrology (how the-water behaved) in each area, each district to be governed by a nine to 11 member board." Today, salinity in the estuaries can be judged by where certain aquatic grasses grow: some like fresh water, some like salty, he continued. Too much phospho- rus and many native plants die out and less desirable plants take over. Birds and wildlife depend on certain plants for food and nest- ing sites, he said. But, water managers pointed out, the water management sys- tem, which was designed when there were about 2 million people living here, now had to operate with over 7 million people living in Florida. "Florida is a climate of ex- tremes either very wet or very dry," said Mr. Home. "I've heard it called a wet desert." The water management's regulation schedule that water managers talk about can be com- pared to driving a car, says Cal Niedrauer, an engineer with SF- WMD. The speed limit on 1-95 will vary from 50 mph in some areas to 70 mph in other, safer areas. In school zones, don't be caught ex- ceeding the 15 mph limit during school hours! The regulation schedule pro- vides water managers with guide- lines for how much water to hold or release from Lake Okeechobee. When water levels in the lake are in the normal range, the lake serves as water supply and littleif any water will be released. When the lake rises too much, water is discharged for flood control. However, said Mr. Niedrauer, rivers and canals can be filled to capacity by local rains without any discharge from the lake. That can impede releases from the lake. Because of the range of vari- ables modern developments have made, water managers have developed a computer simula- tor with input from scientists of various disciplines into its devel- opment. That way, the effect of many variables on the system can be tested very quickly. Mr. Nie- drauer demonstrated the model for the panel. "For instance, the model shows here, that discharge from rains over the City of Stuart and the north fork of the St. Lucie Riv- er took the model over the safety envelope. Water managers get penalized for that, at least in the press," he joked. Ray Judah commented that more water should go south. Mr. Niedrauer commented .that the summit was about today's sys- tem, not the future system. "The purpose of today's meet- ing is to really, really understand the tools water management has available, not what might be available later on," said modera- tor Janice Fleischer. There are constraints to the south. The operating guidelines require that there be room in the water management areas and in the canals to the south. Earlier in the summit, the point was made that.only 14 percent of the drain- age capacity is to the south, while 86 percent goes east and west. Then the panel members had the opportunity to make decisions in a hypothetical situation shown on the computer model and to actually see how decisions affect the parts of the water manage- ment system "I wondered where you guys keep the dice," cracked J.P. Sasser, mayor of Pahokee, representing the lakeside towns. "When the crystal ball is out being polished, we get out the dice," joked back Mr. Neidrauer. It went around the table, one member at a time, decision upon decision. Each decision affecting the next and compared with the regulation schedule, right there on an ever-changing colored graph.. This group will continue to meet to give a heightened aware- ness of where the area is, how de- cisions are being made and how one small decision may affect a huge portion of the region. Each panel member gave comments about the summit and future meetings. "I think we will bring this pan- el together a minimum of once Back-to-school tax holiday to begin TALLAHASSEE The Florida Retail Federation (FRF) is predict- irig strong sales during Florida's eighth back-to-school sales tax holiday from Aug. 4-13, an annual tradition that helps save Florida families District of Columbia that observe a back- to-school sales tax.holiday and the only state whose holiday spans two weekends. "FRF encourages all Floridians to take advantage, of the savings available during the sales tax holi- day. Families looking for a way to make their dollars go further should make the most of this op- portunity," said Rick McAllister, FRF president and CEO. Nationwide, spending on elec- tronics is expected to be one of the fastest growing categories of back- to-school sales. Rep. Marti Coley, .R-Marianna, a sponsor of previous sales tax holiday bills, said she would like to see the Legislature consider adding some computers and accessories to future sales tax holidays as a way to help lower in- come families purchase computers for their children and bridge the "digital divide." If the Florida Legislature were to expand the tax exemption dur- ing the 2008 Legislative Session, Florida would follow eight other states that already exempt comput- ers and related supplies during the back-to-school sales tax holiday. a year to see where we are and what we have learned," said Ms. Wehle. "Soon we will be looking for input into a year-round water conservation, rule. This will be vastly different from water restric- tions. This rule will let us report to Governor Crist that we met his challenge successfully." The information presented at the 2007 Water Summit is avail- able at. MaryAnn Morris can be contacted at mmorris@newszap.com. SI S IC IL TI Agency Independently Owned and Operated 4 *Medicdre Supplements *Prescription Savings *Hospitalization *Life Insurance *Universal Life *Home Healthcare *Major Medical *Long-Term Care *Annuities AMERI-LIFE AND HEALTH SERVICES OF LEE COUNT, L.L.C. 1943 Colonial Boulevard Regency Square Shopping Center Ft. Myers, Florida 33907 (239)936-8667 (239)936-8678 General Manager Don Halstead Glades General Hospital is pleased to announce that G DEs Patricia Masse, M.D. GENERAL HOSPITAL. L4330 GST With Quick Attach Front End Loader and Backhoe Southern Turf & Tractor SAVINGS PRICE EE l S3Owa"I L3830 GST With Quick Attach Front End Loader and Backhoe Switch Thumb W Attachment Southern Turf & Tractor SAVINGS PRICE $3 ,"56 EVERYTHING YOU VALUE Full Factory ^ Parts and Service! ^ TT u. f' 549 East Sugarland Hwy. We Service Al Makes. u Clewiston, FL 33440 We make hydraulic hoses. i TractO 863-983-4484 WE SERVICE WHAT WE SELL! Financing is available through Kubota Credit Corporation, U.S.A., subject to credit approval. Some exceptions apply. See your local Kuboto dealer for details on these and other low-rate options or go to for moreinformation. Serving the communities south of Lake Okeechobee ThursdaV, August 2, 2007 OPNO evn h omntissuho aeOecoeeTusaAgs ,20 Speak Out Have an opinion or a question about a public issue? Post it anytime at the MooreHaven/Glades issues forum at http://. pub- lished." Submitted photo Local Eastern Star members, (from left to right) Mrs. Ma- rybelle Wilson, Mrs. Doris Benoit, Mrs. Annie P Espinosa, worthy matron of Moore haven and granddaughter, Jessie gather books donated to help promote literacy. Accepting the chapter's contributions is Mrs. Mary Booher, librarian of the Glades County Library in Moore haven. Eastern Star gives books to library Moore Haven Chapter 116, Or- der of the Eastern Star presented approximately 150 books to the Glades County Library to help promote literacy. The chapter is participating in the great Florida book-in/reading with the stars. The state public awareness proj- ect for 2007-2008. the goal for the state is to make a contribution this year of 1,000 books. Where have all the wild grapes gone? Barbara Oehlbeck Special to the Glades County Democrat The wild grapes of Glades County grow in every direction including up and down. Miles and miles of their pliable vines cling tenaciously to everything within their reach, fences of every age and description, power poles, palms, pines and oak trees. It is their nature to climb, however when there's nothing for them to climb on they grow outward from their multi-trunks on the ground - a fine ground cover, that is, if you want the coverage as thick as a blanket and un-giving. Joints of the laterals root eas- ily and quickly with no help from those who would rather they didn't. After Mother's Day every few days, various areas of vines were checked and re-checked nary a grape. Not even the tiny droops of pea-green ones about the size of BBs that, of course, precede the ripe fruit. Up until last year, like clock work between the first and fourth of July, with clippers in hand and a light weight bucket, off I'd go up and down the well-trodden trail of the cows and us, clipping the purple droops so they'd fall directly into the bucket. Their fra- grance floated all about and even though using clippers it didn't take long for hands and arms to turn purply-blue. Always by the Fourth of July there'd be at least two gallons of soft ripe grapes one simmering on the stove for jelly, the other waiting its turn. Not so last year, nor this year and here we are in mid-summer. Where have all the wild grapes gone? No dark purple jelly in little jars to last through the seasons until next summer and none to give away at Christmastime. One grape-less year is one thing, but two in a row ... why? Dallas Townsend, Hendry County Extension Agent Emeri- tus, says it has to do with ex- tended dryness the year 'round resulting in reduced grape crops, not just in what is thought of as a Florida winter. Wild grapes. Last year's days and weeks and months were not nearly as severely dry as this one, but they were dry. Now, here we are two years down the road with mini- mal rain, without which much of nature cannot survive for long, two of them being the native da- hoor/llex cassine holly and red bay/Persea borbonia which have already given up and died. Our pond looks as if it's sink- ing day by day. Wild creatures are coming more and more as their own private water holes in hide- away places no longer exist. The turkeys tip-toe across the long sandbar at the south end to the edge of the water that's left, drink- ing as they go here and there. And then, as if to cool their bot- toms, they squat in the soft wet sand paying no attention to doz- ens of kingfishers above them, so many it seems impossible that they don't bump into each other! But then we're told that almost all wild birds have built-in radar systems that are guaranteed fault- less. What will it take to restore this good earth to what we think of as normal? Who knows just wait and INI/Barbara Oehlbeck. watch. In the meantime, less than three inches of rain restored the green to the bamboo leaves which had turned a burnished gold and fallen to the ground in soft layers, leaving the long trunk- like canes smooth and bare. Al- most overnight, after those three inches, or so it seemed, where each leaf had sloughed there emerged a delicate, new leaf that looked as if had been cut from spun silk. From the ground up, those trunks were cloaked in fresh new lemon-green foliage, and they still are in spite of noth- ing more than sporadic showers so far in what is normally South Florida's "rainy season." Some natives turn a blind eye to soaring temperatures and lack of rain. Serenoa repens/saw pal- metto retains its green fronds and produces its long arching arms of sweet-scented ivory-white blooms that will develop into berries almost regardless of heat and moisture, or lack of either or both. Later its lower fronds begin to brown and eventually slough as the plant gets busy and sends up new spears straight up from the crown. Although they share no kin- ship, hog (mostly pronounced as hawg) plums, Prunus umbel- lata Elliott, seemingly react the same way to heat and moisture. Paying no attention to too much water or too little, these native plums resemble small, smooth lemons in appearance; however the good edible part of the fruit is only about 15 percent of the plum itself, therefore it takes a lot of plums to make even a small batch of jam. Soft and sweet-tart, when the plums are fully ripe, the peeling almost slips off and it's not unusual to see the ground be- neath the many-trunked bush-like trees literally covered with these small golden oblong plums tradi- tionally in late July into August. A word of caution about cooking hog plums: Never use anything aluminum. Not a pot to cook them in, not a strainer or colander, not even a spoon. When coming in contact with anything aluminum, the acidic ingredient in the plums will in- evitably turn.the plums and juice an unpleasant black with a sharp astringent taste. Community Events SNewszap keeps fami- S ". lies, friends connected -- Are you in touch with a military service person currently stationed % w abroad? Newszap.com can help -r- them stay connected with family, p gl1ed- l later I friends and loved ones in the local Community. Anyone can log onto ii Newszap.com community pages, -^S~ fl fltM W Iaf go to your local community link -a *Uil LU VV I LVCIoLt e and click on "post your opinions." * Encourage those in the service to I *'4 put a note on the forum and oth- ers in the community can respond to it. The "forum" will allow de- * -r e. - r- - - - - 'GladesmCoyn Democat Our Purpose.. The Glades County Democrat is published b',, Independent Newspapers Florida. Independent is owned by a unique trust that e nable- this news per to pursue a mission ofj,:.urnalistic serce to the citizens of the comm nity. Since no dividends are paid. the company is able to thrive on pro margins below industry standards. All after-tax surpluses are reinvested Independent's mission ofjournalistic erce. commitment to the ideals the First Amendment of the U.S. Cnrsutuic.n, and support of .the comes munity's deliberation of public issues We Pledge... * To operate this newspaper as a public trust. * To help our community become a better place to live and work, through our dedication to conscientious journalism. STlb provide the information citizens need to make their own intelligent decisions about public issues, * To report the news with honesty, accuracy, t. u ..-, -4- l.M ..l ,- ,hnm .1:-:,m0.ljT n * I. r I. : ll ..ii .:o fiA n i.. T''li,'ii .faffiiruur', i.b.s o .r m O. I smiruji I ilh .,ui iWn 'rcpl rl.ro. T..nnr: r1 * i,-, 1 .i..|'. 1 '.-. .. .:. 1,rl ,, ri,l ,ti i potential conflicts to our readers. * To correctour jrl., i. L.- J..l'- i.:.' [ :u,:,n to the prominer,.- ,; a'.1 . * Ib provide a right to reply to those we write about. * Tb treat people with courtesy, respect and compassion. .. ... .... .. . .. ... .- V played servicemen and women to stay in touch with hometown issues; read local happenings on the Newszap Web site; and also comment on current issues. Newszap.com also hosts a "post S your photos page." Photos can be - uploaded and seen by family and friends at home or overseas. -- *, of along with concerned individu- Pa- als and businesses, formed to' u- address the physical, emotional, i and spiritual needs of the com- of munity in the restoration and re- Editonal: FE lri I,, .i : ~i;, a. F". .*,, i, : ,.' r p'.TL l ,, F .7 i.. n-- rB Lar, F,;,,.n..,'\,,, IT.t1,1 Advertising emm uaiddnlawaifolfim * di, rln,,.- D .(,.]it i, jl ;i' i , G- I,,. ,I ,,',.,u I .i. ,, 1 rr, h, Independent Newspapers, Inc. Chairman: Joe Smyth President: Ed Dulin Vice President of Florida Operations: Tom Byrd Executive Editor: Katrina Elsken Member: ' Florida Press Associatron the At Your Service Box on page 4. Cen- tral Ave. rear entrance or email CREWheadquarters@aol.com or phone (863) 983 2390. deduct- ible. For more information, come by our office at 121 Central Ave. rear entrance or email CREW- headquarters@aol.com or phone (863) 983-2390. Economic Council to meet The Glades County Economic Development Council normally meets the first Monday of the month at (863) 467-2882. VFW Post #10539 hours posted The VFW will be open Mon- day through Wednesday 10 a.m.- 8 p.m.; Thursday, 10 a.m. until 10 p.m.; Friday and Saturday, 10 a.m. until 11 p.m., or later and Sunday, 1 until 8 p.m. Happy hour is from 4 until 6 p.m., Monday through Thursday. Dinner is served at 5 p.m. Tuesday evenings. Bar bingo starts at 12:45 p.m. Wednesday. Lunch will be available. Singles darts every Wednesday, 7 p.m. Cafeteria is open from 5 until 8 p.m., Thursday nights. Friday at 7 p.m. there will be live music and dancing. On Saturday, hotdogs with kraut are served at noon. Saturday dart doubles at 7 p.m. Addiction recovery help available. To Reach Us Address: PC B:. 1I3., Clevsrinr, Fla 3344-1: Website: ...,e.. ne.. :p cn-r' To Submit News 7Fh (G1l C.-:.rr:, D n.:,:r ,.ir t . C,:mer.i Subm r i;i.:,rn, lf'r:,om it r jaderj" Opirn:'n., c3jlndaif !m.m I[s.:.ri.i. i a-. j nd ..l .t.:.fcrTaph; ar %' k.ilm.- C ll r '66.399.5 253 t.:. r c.: h .:..ur neci - r:.:nrn i m.:r: rr, ,' be rinjl-'d, 'i orr e.rr, 'm ld Th.- dijdli'-e ir jll ne.'.. i-em- i I 2 F. mi MR.:nd. pr..:.f t,:. he f:.ll iri~ Thurid :,"' publi,:ation E-mail: d,-oev. ,' nc.-.:'F.p ,-.m To Place A Classified Ad C all ri 7'i53.'' -424 r.:, pl. .:e l i - fed ,J '..nert.ert Itrmr. honie. The Cdedline for all advertising 13 12 p.mi l.:,r,.a, I.:r thle following Thursda', s -.ubhcation F.x: 1.877-354-2424 E-mail classads(Oirewszap com To Place A Display Ad C All 'nr,.39-5:''53, sJadline for all ad. rurln ii 12p F' ni Mnrdy IVor the f:ll:,., ir.g Thi.,r sdj'; public : t uon F.i 1 .- 3."35- 53 E.n ai .:.uthl.l:e d.'.,-tnei r :.p ..o:ni Advertising Billing Department E-mail: billteam@newszap.com To Start or Stop A Paper Phone: (877)353-2424 E-mail: r-ader r.i-i,'irine..z'p .--m Thl- G 6jl.: Coumr, DIrnocrl i.dJllVtrid t., miill I.' abscrint" :n Thurdli, ind i, .:.1 In ia,:: and ~t....- location in tLh GI .J- C.:,urity area C ill i :1.5 -24124 i,:, rLprt n" ied n C p.al:j r poor .JIlwery cGl. Co.:.unity Demr.:rat i.'SPS `190 :60 ut, h.i-, Wetkl., by Ind-ipndenl 1N, papers, rIn.: Clv iiL L,FL 3,440 I.,r ."4 61 pei year mcludJ1i' tax Se,.:,rid C I r pc.'tge pid at ClIaistBn Flni-da. Pouirlteir .'.rd jddresr ,.Iurje to lthi' GlCdi Cn'.r,r' D.rrl:. rji C. Iri. uIl nr l ,rtlnii, mril I l,.,n F', B' "fill C,,.- DE lw"ll Printng Prir. dlt Sui hir Pnr tnnr g i ut.,.ldur, of ii-,lcpi, l ri] r ..e, pi' r. E 'In F -ri[.Liii ,, ri].i ,r Newszap! Online News & Information Get the latest news at I -* - Glades County Democrat Published by Independent Newspaper, Inc. Serving Glades County Since 1923 Serving the communities south of Lake Okeechobee Thursday, August 2, 2007 * -L ~ OPINION Thursday. Auaust 2. 2007 Serving the communities south of Lake Okeechobee Breastfeeding advocacy embraced by Wellington Regional PALM BEACH COUNTY Im- mediate initiation of breastfeed- ing following delivery and exclu- sive breastfeeding for the next six months can save more than one million babies annually world- wide. This is the theme chosen by the World Alliance for Breastfeed- ing Action (WABA) in recognition of 2007 World Breastfeeding Week. The theme highlights the impor- tance of promoting conditions conducive to breastfeeding begin- ning with the first hour of birth. "In a world where more than 10 million children die before their first birthday due to prevent- able causes and where malnutri- tion is still rampant and associat- ed with over half of all childhood deaths, there is simply no time to waste. Let's start with the first hour," said Dr. Margaret Chan, Director General of World Health Organization. Immediate skin-to-skin con- tact of mother and baby is an important factor for successful initiation of breastfeeding, as it re- stores their connection following birth. This keeps the baby appro- priately warm, induces maternal oxytocin release and ensures that baby receives colostrum during the first feedings. "We are proud to support World Breastfeeding Week at Wel- lington Regional Medical Center," said Barbara Nash-Glassman, RN, Director of the Centre for Fam- ily Beginnings. We believe in the healthy advantages that breast- feeding offers to mothers as well as babies. This is an opportunity to continue educating the com- munity and staff about the impor- tance of breastfeeding". Wellington Regional Medi- cal Center will celebrate World Breastfeeding Week with educa- tional exhibits placed throughout the hospital. Special gift bags will be presented to moms delivering this week along with the chance to win a breast pump for one mom each day. The Centre for Family Begin- hings provides encouragement and support to help new moms reach their breastfeeding goals. The Lactation Center at Wel- lington is staffed by three Inter- national Board Certified Lacta- tion Consultants (IBCLCs) who visit mothers during their hospital stay. They also provide outpatient consultation and offer a variety of manual and electric breast pumps for purchase or rent and will gladly assist in choosing a pump suitable for your needs. In addition, the Lactation Center of- fers an array of information and breastfeeding supplies. A monthly group meeting at the hospital, The Lactation Tea and Support Group, provides on- going support to breastfeeding moms. Another support group, La Leche League of Palm Beach County also meets at the facility. For an appointment or more information, please call (561) 798-8664 or visit 'our website at p2217.html. Is aglig aIai i Grant to help build detoxification center The Claiborne and Ned Foulds While the population at risk dental programs for both adults For more information about Foundation has awarded a has nearly tripled in the past 20 and youngsters from eight loca- the SWFAS capital campaign or to r $50,000 grant to Southwest Flori- years, Mr. Lewis said the number tions in Southwest Florida. Fees make a gift to SWFAS, call Lewis Sda Addiction Services (SWFAS) in of detox beds has decreased from are charged on a sliding scale, at 278-7595, ext. 700. For more Support of its capital campaign to 28 beds. in 1984 to 25 beds in based on family income. In many ation a t the Claiborne > build a new Detoxification Center 2007, due to the lack of resources cases, private insurance is ac- informaionabout the Claiborn Sand Outpatient Treatment Facility to treat this chronic disease. cepted. SWFAS is a United Way and Ned Foulds Foundation, call agency.l - Co %- %M that will serve Glades, Hendry, S Lee and Charlotte counties. The grant will be used to help equip the facility's new kitchen, which will be named in honor of Claiborne and Ned Foulds. "We are very grateful to the Advisory Board of the Foulds Foundation for recognizing the importance of providing treat- ment for residents with the chronic disease of addiction, which impacts one in five people in our community," said SWFAS CEO Kevin B. Lewis. SWFAS now has raised more than $5.3 million toward the $9.5 million cost of the new facil- ity. Other major gifts have been S received from the Lee County Commission, State Housing Ini- . tiatives Program (SHIP), U. S. Department of Health & Human Services, Southwest Florida Com- munity Foundation, Lee Memo- rial Health System,. and Gannett - Foundation. "There isn't a day that passes that we aren't forced to turn away people in need of immediate de- toxification because there are no beds available," Mr. Lewis said. "Each day the headlines tell the stories of tragedies associated with untreated substance use dis- orders, and these consequences will continue until we can re- spond to this unmet need.".. .. "Families need a place to turn in times of crisis," Mr. Lewis said. "The Board of Directors is acutely aware of this need and is commit- ted to raising the money needed to build a new facility." The new 40-bed Detoxification Center will be built on land in Fort Myers on Evans Avenue donated by the City of Fort Myers under a long-term lease. The four-acre parcel formerly was the home of the Fort Myers Recreation Center adjacent to Southwest Regional Medical Center. The planned 44,000 square foot facility also will include room for outpatient counseling and prevention offices now located on McGregor Boulevard as well as administrative staff. The SWFAS Board of Directors and Capital Campaign Cabinet currently are requesting funding from local individuals, business- es, and foundations to help with the project. SWFAS hopes to break ground later this year with completion one year later. SWFAS is the largest and old- est comprehensive substance abuse treatment and prevention program in Southwest Florida, serving 6,000 people per year from ages 9 to 90 in Glades, Hen- dry, Lee and Charlotte counties. SW\TAS offers outpatient and resi- Submitted photo Safe sitters On Friday, July 13, David McClusky and Annabelle Ro- driguez (R.N.), from Hendry Regional Medical Center, instructed a Safe Sitter Class in the hospital conference room. A total of 15 students, ranging in age from 11-13, joined the class. The comprehensive, educational session included topics such as clearing obstructed airways of children (and other emergency situations), learning toi- letry skills, stranger/outside intruder awareness, dealing with unruly kids, babysitting professionalism, conducting interviews with parents/guardians, and more. Thanks to David and Annabelle, the students left with new perspec- tives of babysitting. I . O - I - s. - c-> ~w~w 0) C-) 0) cn- cc - u,, .E cc - - a- $ A.9S 24,. /MO FOR AS LONG AS YOU HAVETHESERVICE. HIGH-SPEED INTERNET. AND, UNLIKE SOME CABLE COMPANIES, YOUR PRICE WON'T GO UP AFTER FEW MONTHS. (Excludes taxes, fees and surcharges. Applies to up to 1.5 Mbps speed. Qualifying services and $15 activation fee apply. Free mpdem available for $14.95 shipping and handling fee.) I,' - FREE SECURITY TOOLS 1S79 VALUE) , AWARD WINNING ANTI SPYWARE AND ADVANCED VIRUS PROTECTION Harvest Academy Christian School Classes for Pre-K 4 Monday-Friday 7:30-2:30 ABeka Curriculum classes held at New Harvest Church 360 Holiday Isle Blvd + Clewiston "A school preparing today's child for tomorrow's world." call 863.983.3181 Voice Data Internet Wireless Entertainment 866-2EMBARQ (236-2277) embarq.com/highspeed EMBARQQT calling plan and remains in good standing in a service area. Taxes, fees and surcharges are additional, subject to change without notice and based on non-promotional, standard monthly rate. EMBARQ757 c c -, I-> rE ~-0 C;) 'I- CuJ Ur - With EMBARQ, your price is permanent. Serving the communities, south of Lake Okeechobee Thursday, Auqust 2, 2007 agency. 433-6255. it 11 SHorse owners should update vaccinations TALLHASSEE Florida Agri- culture and Consumer Services Commissioner Charles H. Bron- son is urging horse owners to remember to vaccinate their ani- mals against Eastern Equine En- cephalitis and West Nile Virus in the wake of Centers for Disease Control warnings about a poten- tial West Nile epidemic. He is also reminding people to take precau- tions against mosquito bites. The Centers for Disease Con-. trol says the number of human West Nile Virus (WNV) cases in the United States is nearly four times higher than what it was this time last year. The virus, carried by mosquitoes, can cause flu-like symptoms in people and in hors- es and can be fatal in the equine population. Eastern Equine En- cephalitis (EEE) is also often fatal in horses. So far, Florida has not been im- pacted by the rise in arbovirus ac- tivity seen elsewhere. In fact, there have been no reported cases of West Nile Virus in horses and only 13 Eastern Equine Encephalitis cases in horses. No people have been infected at all in Florida. Commissioner Bronson wants that trend to continue. "I believe people are heeding the warnings to protect them- selves from mosquito bites and that diligence among horse own- ers to get their animals vaccinated has resulted in Florida's low num- bers," Mr. Bronson said. "Florida also has some very effective mos- quito control districts to keep the, mosquito populations down. But it's important that people not get complacent considering what we are seeing elsewhere in the na- tion." Horse owners are urged to check with their veterinarian to make sure their animals have re- ceived current vaccinations and booster shots against WNV and EEE, and that these shots are kept up to date. Mr. Bronson says Floridians and visitors can protect them- selves against mosquito-borne disease by following a few simple steps: Limit time outside during dusk and dawn when mosquitoes are most active. Wear light-colored, long- sleeved shirts and long pants to cover skin and reduce the chance of being bitten when outside be- tween dusk and dawn; Eliminate standing water in yards, such as in birdbaths, kid- die pools, qld tires and other re- ceptacles, as stagnant water is an excellent breeding ground for mosquitoes; Use insect repellent that con- tains DEET, which is an effective repellent; Keep window screens in good repair; and, Clean out rain gutters and keep them unclogged to avoid pockets of standing water. Quarter Horse event to be held in Okeechobee Submitted photo/Sonia Crawford Hendry County 4-H member, Carter Butler went a long way to take his shooting skills to the top. He and his dad, Steve But- ler attended the National 4-H Shooting Sports Competition in South Dakota. Carter represented Hendry County competing in a number of events along with other Florida 4-H members. Straight-shooter goes to national event HENDRY COUNTY Hendry County Shooting Sports 4-H Club member, Carter Butler of Felda, attended the National 4-H Shoot- ing Sports Competition in Rapid City, S.D., accompanied by his dad, Steve Butler. He was among many members from Florida to attend the event. Florida had in- dividuals/teams competing in the disciplines of air rifle, shotgun, archery (recurve and compound), .22 rifle, and hunting. Carter com- peted on Florida's 4-H Air Rifle team consisting of four 4-H mem- bers across the state. Each indi- vidual had to qualify to attend the national event at the state compe- tition held in March and April. The team competed in the National Standard Three-Position Sporter Air Rifle Division consist- ing of the prone, standing, and kneeling positions. Each of the team members were given 60 pellets shooting 20 pellets in each position in a given time allotment. The time limit '.\as c.ne minute pre record shot prone, two min- utes per record shot standing, and 1.5 minutes per record shot kneeling. The team placed eighth out of 21 states. Furthermore, the team com- peted in the National Sporter Air Rifle Silhouette Division consist- ing of shooting at a 1/10 scale, metallic silhouette: rams, turkeys, pigs and chickens. Each silhou- ette was shot at a different course of fire: 10 chickens at 20 yards, 10 pigs at 30 yards, 10 turkeys at 36 yards, 10 rams at 45 yards in banks of 5 targets and shooting from left to right on the bank of targets with a 15 second ready time and 2.5 minutes firing time for each bank of 5 targets. The team took 1.6th out of 21 states. Congratulations Carter for your achievement at the National Competition. Carter made many new friends from many states, and was proud to represent Hen- dry County 4-H and Florida 4-H at this event. Carter states "that he is grateful for all the support received from the Hendry County Shooting Sports 4-H Club, family and friends." Carter has' already' begun planning for next year's state competition to win a spot at the 2008 National Competition to be held in Nebraska. OKEECHOBEE The Sun N Fun summer show, an Ameri- can Quarter Horse Association - approved special event will be held August 3 through 5 at the Okeechobee County Agri- Civic Center on State Road 70 in Okeechobee. American Quarter Horse shows test horses abilities in dozens of different classes. This special event is just for barrel rac- ing, pole bending and stake race Sports Brief Fishing club seeks volunteers Big O membership. We meet once a month on a Monday night at the library meeting room in Moore Haven with an inter club fishing tournament on the following Sun- day. For more information, please contact David at: (863) 946-3100. HT3 Outdoors returns to Clewiston in '07 The Wave Worms HT3 Profes- sional Bass Tour will be returning to Roland and Mary Ann Martins Marina and Resort in 2007. Among , one day series events and the' Executive Tour Two-Day events, Clewiston has been awarded the HT3 2007 Bass Classic Champion- ship Dec. 2 and 3. enthusiasts. People who exhibit at an American Quarter Horse Show earn points that turn into awards or cash at the end of the year. By competing at a AQHA Show, exhibitors and horses also can qualify for the AQHA or American Quarter Horse Youth Associa- tion at- tend." Each year, AQHA approves more than 2,700 shows and spe- cial events across the globe. For more information please contact Renee Burks,' 863-634-7385 For additional information about AQHA, including show- ing, racing or recreational riding programs, contact AQHA at 806- 376-4811 or visit AQHAs website at VISIT US ON THE WEB AT PROPERTY MANAGEMENT RENTALS SALES CINDY L, ALEXANDER LIC. REAL ESTATE BROKER ASSOCIATES: EDITH HACKMANN AND DON BURDICK 675-0500 REALTY 233 N. BRIDGE ST T BRIDGE ST & WASHINGTON AKs. NC E RENTALS AVAILABLE (NO PETS) HOMES FOR SALE 1/1/1 PROW TERR. For Sale Also $600/M ON PROW TERRACE 1BR/IBA/1 Car Asking 2/1 DUPLEX (Moore Haven)-Avenue H $99,900 $550M& $600/MON N. COLLEGE ST 2 BR/BA Asking $125,000 3/2/1 N. EDGEWATER- Port LaBelle $750/M ON M. L. K., JR. BLVD 3BR/1BA Asking 2/2/1+DEN (DUPLEX)-on Edgerton Ave.- $129,900 $795/M ON TEAK LN 2 B/2 BA Asking $139,900 3/1 MLK IR., BLVD. For Sale Also $800/M ON E. PAOMAR 3 BR/2 BA/1 Car Asking $159,900 2 DUPLEX 3rd Ave. In town $850/M ON HENRY ISLES BLVD. 3 BR/2 BA Mobile 3/2 MOBILE- Ft. Adauns 2.5 acres $895/M Reduced! $165,000 3/3/1 E. FT. MYERS For Sale Also $1,000/M ON GIBSON ST- 3BR/3BA/1 Car E. Ft. Myers - Reduced! $165,000 3/2/2 BUTTERCUP CIR. Pt. LaBelle Reduced! $165,000 ON 6TH AVE. 3BR/2BA- Belmont area Asking $1,100/M $169,900 3/2/2 GALILEO Lehigh Acre $1,100/M ON S. MISSOURI ST 3 BR/1.5 BA Reduced! 2/2 DOLPHIN LN.(Furn)- $1,500/M (w/ utili $169,900 ties)ON E. SUNFLOWER- 3 BR/2 BA/1 Car Asking ties) $189,900 1/1 OXBOW DR. -Pt. LaBelle $750/M (Avail. ON E 21S LN .i: .:.jl-3BR2BA-Asking n 210,000 2029 N. Montana Cir. 3/212 New CBS Home Upgraded Tile Near Elementary School 7036 Gre CHL Home Mortgage, LLC. Providing Free On-Site Approvals 863-612-0012 An Affiliate of Wells Fargo Home Mortgage Rentals Available July 17,2007 QB39922 3045 June Cir. 4/2/2 New CBS Home Comer Lot i Beaver Cir. 3/212 New CBS Home eenbelt Behind Home ...f ,.- ,- .,,, 9016 Lamkin Cir. 3/2/2 New CBS Home Walking Distance to Middle School Visit Our Model Center: 2480 E. State Road 80 Open Everyday 8 5:00pm After 5pm by Appointment Land Available Owner Financing NO CREDIT CHECKS ," ',, ;', ,-'l:h: It \ q .tL : ,, 238 BigeS. aef F 395*86-7586 Lia ndew U. ea Etae.roe Asaims Smi' lex idrLi a elDms Roama ineos evn elo, os tsnLar Sene Dwgh ILifild fiun KnnyStc Ptc Dst Pt ww .sotw stfoidteat-ouU S al spa Iiol COMMERCIAL: * $295,000 -JUST REDUCED 2+/- ACRES OF INDUSTRIAL ZONED PROPERTY. Owner will split into 1 acre tracts for $160,000 per acre. Please call for more info, HOMES: * $84,900 This 2BD/1BA home is located in a peaceful rural community. S$159,900 Price Reduced New 3BD/2BA home. This home features a split floor plan and the kitchen has a morning room. S! Immaculate 2005 CBS 3BD/2BA home with many upgrades. This is a great starter or retirement home. Call today for your viewing appointment. S$189,000 3BD/2BA Well constructed CBS home on a corner lot, screened in front and back porches. Don't miss this one a npo hnluP withnll the n newri.C rtd11 v rne fo r vn r smh. n * $189,900 New 3BD/BA home on a beautiful lot. This home features a split floor plan. The kitchen has an island with an extra sink and more. Don t let this one slip by! * $199,900 Brand new 3BD/2BA o be completed Sept. 2007. This new home will be equipped w/new appliances, valulted ceil- ings, walk-in closets and more. Call today for more information. * $238,000 -JUST REDUCEDI Like new 3BD/2BA home on a Cul-de-sac throughout. This isa must see! * $299,000 -JUST REDUCEDI 3BD/2BA home in the city on .45+/- acres, detached 2 car garage, fenced back yard, landscap- ing and more. Call today. * $399,000 JUST REDUCED! New Hickory kitchen cabinets 111i ,,,,l," ,,1.', ,,",,', i T i ,. ,1 I ,- i,.. I' I, I . riverfront subdivision. * $775,000 Custom 2005 3BD/2BA home on 3.71+/- acres in Alva. Home has many upgrades & property is filled w/mature oaks and much more. A must see! Call today , ! Staring bustle of city living. Come see this 3BD/2BA mobile home on 1.86+/- acres. $149,900 JUST REDUCED!- Price Reduced 3BD/2BA Manufactured home on 1.88+/- acres in Muse. Home features a split floor plan. The living area has a fire place. 1ll and septic tank are new. * $175,000 3BD/2BA Homes of Merit w/miny upgrades, LaBelle. * $187,900 Immaculate 4BD/2BA manufactured home across form the river and boat ramps, many, many upgrades. A shed and irrigation. Call for info. * $200,000! Mini Horse Farm on 10+/- acres, 4BD/3Ba mobile home, 9 small barn with concrete pass thru, lack room, roping arena and a pond. Motivated seller! * $775,000 Commercial zoned! 5+/- acre property features a 3BD/3Ba mobile home, pool, 2 barns, 2 sheds and much more. HOMESITES * Port LaBelle Lots starting at $17,600 I* ehilh LOs starting at $46,900 * Monra Lots starting at $32,000 * Moore Haven L.os starting at $20,000 * Clewision lots staring at $21,500 RENTALS * Riverfront: 2 master suites with a pool. $1,200/month. ($1,200 deposit) * 4BD/3BA manufactured home located on a 10+/- acre mini horse farm. $1,500/month. S3BD/2BA P. LaBelle home. $950/month. ($1,000 deposit) * 2BD/IBA Duplex $700/month. Montura Ranch Developers, LLC More House For The Money! -3 ..... .... - -- --- - . DOM, T8w 6'0" ..H The Bonaire 10'4" x V11'O" L- E SIROO MASTER Only I 11'8"x 90" BEDROOM a / 1510" x 12'8" KTCHEN $171,900 BEDROOM .- Lot Not Included 54' THREE : -- DENI |0t4"ix13'0" mliTiT 7^ DEN/ '4" 13'" uOFFICE ^ ^ 10'4" x 11'O" ..l.l Call GARAGE GREAT S20'0" 22 ROO 561-536-0538 ,In, R20'0" x 22"4"" ROOM 1 i ioI. 14'S" x 16'4" Se Habla Espanol PO~i-----a *--'^ We Make It Easy For You To Share The American Dream! Many nlodelk trom which to chloosc tarring at $142.500) Our preferred hludder tor Monturd Rdill Estdtcs. Carter constructionn & Dcveloipment. Inc. CGC I)60ll150 SPORTS ([-, Home .. Builders Call Now! Call 863-612-0551 Toll Free 866-244-8392! Serving the communities south of Lake Okeechobee Thursday, August 2, 2007 Thursday. Auaust 2. 2007 Serving the communities south of Lake Okeechobee Airlift helps to restore Everglades SOUTH FLORIDA -- During a three-day airlift, the South Florida Water Management District this week began transplanting 23 tons of water-loving plants to revitalize Florida's stormwater treatment areas (STAs). The constructed treatment wetlands use 'green technology' to absorb harmful nutrients and improve the quality of water flowing into America's Everglades. The large-scale transplant- ing is revitalizing specific areas within the 6,700-acre STA 1-west, the 9,000-acre STA 2 and STA 3/4, which at nearly 17,000 acres is the largest constructed wetland in the world. As part of the $30,000 op- eration, water managers are har- vesting healthy batches of South- ern Naiad, commonly referred to as pondweed, from within the STAs and moving the plants to ar- eas where old plant life has died, or construction and maintenance work was recently finished. After the pondweed is harvest- ed, it is loaded into a large cargo net and carried by helicopter to a drop spot targeted with global positioning system technology. Hovering at about 500 feet, the helicopter pilot releases the load into very shallow waters. Known as submerged aquatic vegeta- tion because it grows at or below the water's surface, pondweed quickly re-establishes itself and begins removing phosphorus from water flowing into the treat- ment areas. District scientists and engi- neers work constantly to main- tain the appropriate balance of plant life in the STAs, so the sys- tems can continue removing ex- cess nutrients from water found in stormwater runoff. These nutri- ents, including phosphorus, flow from farms, lawns, roadways and other developed areas. STAs help remove these nutrients by chan- neling water through a system of treatment cells filled with wetland vegetation. As part of its intensive sched- ule to improve water quality in the Everglades, the State of Florida is operating more than 41,000 acres of constructed wetlands. Last year, the STAs combined treated nearly 1.5 million acre-feet of wa- ter and prevented 176 metric tons of phosphorus from reaching the Everglades. Stormwater treatment areas have also become prime loca- tions for native wildlife. Their vast, shallow waters and rich plant life attract a wide variety of birds and fish, as well as alligators, wild hogs and deer. For more informa- tion on Everglades' restoration, visit. SFWMD to host public workshop SOUTH FLORIDA The South Florida Water Manage- ment District governing board will host a public workshop on water supply back-pumping. The workshop will bring to- gether environmentalists, the ag- ricultural community and other stakeholders to. seek input and openly address concerns about the practice. The staff of SFWMD will present information concerning the economic reasons for back- pumping, potential environmen- tal affects and parameters that would guide the decision mak- ing process. The workshop will be held on Wednesday, Aug. 8 at 1 p.m. at the SFWMD Office, Building 1 Auditorium, 3301 Gun Club Road, West Palm Beach. County to hold youth resource fair PALM BEACH COUNTY-The public is invited to attend the 10th Annual Resource Fair hosted by the Palm Beach County Division of Youth Affairs. This free event will be held Monday, Aug. 6, from 9 a.m. to 4 p.m. at the Highridge Family Center,. 4200 North Austra- lian Ave., West Palm Beach. This year's theme is "Stop Vio- lence Before It Stops You: Con- nect Our Youth to Community Resources." Participants' opportu- nities include engaging in on-site family activities and working with others as "Action Plan Designers" to find solutions to youth violence (such as sharing information on existing community resources, vi- sions of needed services, how to enhance the utilization of existing services and removing obstacles to reach those who need the ser- vice). Keynote Speakers 9:05 to 9:55 a.m. State Rep. Priscilla Taylor, Dis- trict 84, will speak at 9:05 a.m. and State Rep. Maria Sachs, Dis- trict 86, will speak 9:35 a.m. Action Plan Designers Groups Groups will have participants from the community (organiza- tions, leaders, citizens, families, etc.) meet to design Action Plans related to connecting Palm Beach County youth to existing regourc- es in an effort to reduce gang membership, school drop-out, violence, etc. Morning Action Plan Design- ers 10 until 11:30 a.m. Topics include: bullying, rac- ism and discrimination, develop- ing social skills and addressing emotional problems, addressing behavioral problems, female vio- lence and drug/ETOH/prevention and intervention programs. Evening Action Plan Designers - 1 until 2:30 p.m. Topics include: faith-based programs, academic enrichment programs, development of self and respect (authority/discipline), out-of-school activities (work, sports, etc), basic needs organiza- tions and mentoring and coach- ing programs. Reports/Implementation 2:45 until 4 p.m. Participants will receive Action Plan reports from each group. There will also be many exhib- its and displays presented by com- munity organizations and family activities such as face painting, fingerprinting for children and vis- its by McGruff the Crime Dog and Sparky the Fire Dog. Break-fast and lunch will be provided. The Palm Beach County Health De- partment will provide free immu- nizations for children ages 18 and under from 9 a.m. until 2 p.m. Renewable development encouraged by PSC TALLAHASSEE The Florida Public Service Commission (PSC) recently hosted an informational workshop to gain more informa- tion about establishing a renew- able portfolio standard (RPS). Government, utility and industry representatives also identified some of the likely impacts on Florida's economy and consum- ers from implementing an RPS. A renewable portfolio stan- dard is a public policy approach aimed at encouraging renewable development through the gen- eration of a certain amount of power from renewable sources. Currently, Florida uses renewable resources like solar, municipal waste, biomass and landfill gas for two to three percent of its total energy supply. "Increasing the use of renew- able sources will further diversify Florida's generation mix," said PSC Chairman Lisa Polak Edgar. "Establishing a renewable port- folio standard will help advance the development of alternative energy sources in Florida." Discussion revolved around defining a renewable portfo- lio standard and the renewable, generation resources that should qualify toward meeting a state RPS. Several speakers also ad- dressed possible impacts on Flor- ida's economy and consumers from an RPS. In his recent executive order, Governor Crist requested that the PSC initiate rulemaking, by Sept. 1, to require utilities to produce at least 20 percent of their electric- ity from renewable sources. The governor's order placed an em- phasis on solar and wind energy. monitoring of safety, reliability and service. V A/C & Heating Services LLC Do you need a part to repair sales your own A/C system? Services Installation If so we have all the parts you'll need to do it yourself Pool Heaters 741 S. Bridge St LaBelle 24/7 Emergency Service Refrigeration Financing Available to Qualified 863-675-2878 Lic. Customers All Major Credit Cards 863-675-2878 CAC1815266 Accepted Ask about our heService th othersare scratch and dent A/C MEASURED BY! egg Ia .. W REIC 9MANCINI Se Hahla Espaiol Offices in Poat StLucde The hiring of an attorney is an important decision and should not be based solely on advertisements. Before you decide, ask us to provide you with written information about our qualification and experience. JTTOWN COUNTRY i ". HOI'M E IMPROVEMENT CENTER Mobile Home, Home Supplies & Hardware Doors Windows Vanities Siding Skirting Shutters Tools Building Supplies Plumbing Electrical - Jack N. Estes Owner 111 S. San Benito St, Clewiston 863-983-3000 Cell: 228-6916 Rare century-old $20 gold coin returned TALLAHASSEE Florida Chief Financial Officer Alex Sink announced today the return of a 1907 gold coin with an estimat- ed value between $25,000 and $90,000 to the daughter of the late Tere Claiborne. Representa- tives of the state's Unclaimed Property program presented the coin Thursday to Phyllis Childers of Palm Beach County. "I am pleased to be able to re- unite this family with this beauti- ful historical heirloom," said CFO Sink who oversees the Depart- ment of Financial Services and the Bureau of Unclaimed Prop- erty (Bureau). The early twentieth century collectible is a 1907 Saint Gaud- ens Double Eagle "High-Relief" $20 gold coin. The term "High-Re- lief" refers to the extreme height that images are raised above the background of the coin, and only 12,367 coins were made due to the extreme difficulty of produc- tion. One of the five most sought- after coins in America, President Theodore Roosevelt commis- sioned sculptor Augustus Saint- Gaudens'for the design in 1906. The gold coin belonged to Phyllis Childers' mother, Tere Clai- borne, who passed away in 2000. The family searched for years, but was unable to find the coin, which Mrs. Claiborne had placed in a safe deposit box on her way to a bridge game. Phyllis Childers called the coin the "cornerstone of the family," as it is believed that President Theodore Roosevelt personally gave the coin to Phyl- lis' great-great-grandfather, Man- uel Amador Guerrero, who was the first president of Panama from February 1904 to October 1908. The Bureau of Unclaimed Prop- erty currently holds unclaimed property accounts valued at more than $1 billion, mostly from dor- mant accounts in financial in- stitutions, insurance and utility companies, securities and trust holdings. Since the program's in- ception 46 years ago, the Bureau has successfully reunited owners with more than $1 billion in un- claimed property. Currently there are 405,415 Unclaimed Property accounts in Palm Beach County totaling $72,060,579.80 Unclaimed prop- erty can be claimed for free at any time by the rightful owners or heirs by logging on to www. fltreasurehunt.org or by calling the Bureau at 1-88-VALUABLE. Until claimed, the unclaimed funds are transferred to the state's School Trust Fund to benefit pub- lic schools. Since the program's inception in 1961, more than $1.5 billion has been transferred to the fund. The Bureau also receives items that have been abandoned in safe deposit boxes for at least three years and spends up to two years searching for the rightful own- ers or heirs. The Bureau has had tremendous success in finding owners. In the past year alone, the Bureau returned a record 255,000 accounts valued at more than $171 million. But when owners or heirs cannot be found, the safe deposit box contents are auctioned While the proceeds from the auctioned items are *transferred to the state's Public School Trust Fund, the money is held in the original owner's name and can be claimed for free at any time. CFO Sink announced that the Bureau will hold an auction this year in Orlando on Saturday, Au- gust 4, in the Florida Hotel and Conference Center at the Florida Mall. The auction will offer more than 40,000 items including col- lectibles, jewelry, and historic coins. A preview of auction items will be held on Friday, August 3, 2007, from 10 a.m. until 7 p.m. The auction will be held on Satur- day, August 4, from 10 a.m. until all items are sold. Specific items up for sale include an un-circu- lated 1882 silver dollar, baseballs autographed by Hank Aaron and Don Larsen, diamond jewelry, Spanish colonial silver coins, a $500 bill and a platinum ring with a 17 ct. natural sapphire. Participation is open to all Flo- ridians. To participate in the pre- view and auction, potential bid- Oers will be required to register with the auctioneer and provide a valid ID with current address and refundable $100 cash deposit that can also be applied to any pur- chases. Most bank debit cards are permitted for payment of the $100 deposit. Payments for purchases must be made with cash, travel- er's check, most bank debit cards, or cashiers check made payable to Fisher Auction Co. For addition- al information on terms for par- ticipating, please visit. fltreasurehunt.org/ and click on "upcoming auction." Orders issued to combat climate change ALTAMONTE SPRINGS Gov. Crist has signed three executive orders to combat the threat of global climate change. The or- ders call for actions to reduce greenhouse gas emissions within Florida, reduce emissions within Florida state government and to appoint a governor's action team on energy and climate change. Gov. Crist signed the orders at the conclusion of the Serve to Pre- serve Florida Summit on Global Climate Change held in Miami July 12-13. The Nature Conser- vancy helped sponsor the summit which brought together policy makers, scientists and business leaders to help Florida develop policies to reduce carbon emis- sions. Speaker after speaker at the summit emphasized that we have to save nature to save ourselves. "The emission cuts and effi- ciency standards set forth in the governor's executive orders are welcome for the long term and must be combined with the pro- tection of natural areas we cur- rently have, which Florida has a great history of doing through the Florida Forever program." said Jeff Danter, director of the Nature Conservancy's Florida Chapter. "We look forward to helping implement the actions set forth in the governor's executive orders and to developing a successor program to Florida Forever to pro- tect natural areas, our water sup- ply and our Florida way of life." The Serve to Preserve Flor- ida Summit on Global Climate Change brought together policy makers, academics, scientists, en- vironmentalists and the business community to discuss the im- pact of climate change in Florida. These experts will help develop best practices related to alterna- tive fuels and emission standards. The group's strongest recom- mendations will help shape pro- cedures for state agencies and future legislation. For more infor- mation, visit- daclimate.com/ or. flgov.com/. For more information about the Nature Conservancy visit on the web at nature.org/florida I Go to newszap.com to download and print I I coupons online! L ..--.....J Sb Clewiston Christian School S o V . Family Fun Day & BBQ Saturday, August llth 11:30-3:00 p.m. t TICKETS $8 FREE ADMISSION S1/2 BBQ Chicken, Pony Rides, Waterslide, Coleslaw, Baked Beans, Bounce House, Arts & Rolls, Tea & Dessert Crafts, Games & More! c, TICET RlOSPICfTj M ENTIRDBANG TO WIN A FULL TUITI1ONSCHOLARSHIP (Rules & Regulations Shall Apply See Campus Office On Day Of Event For Details.) COME TOUR THE CCS CAMPUS 601 CARIBBEAN AVE. 863-983-5388 Offering Full Day Academics Grades PK3-7th Degreed, Certified & Christian Teachers Stanford 10 National Testing Small Class Sizes & Family Atmosphere Bus Transportation Available & After School Programs Registration Information Available At The BBQ educa- tional policies, admission policies, financial aid programs, and athletic and other school administered programs. Serving the communities south of Lake Okeechobee Thursday, August 2, 2007 .........j ......... i --- Serving the communities south of Lake Okeechobee Thursday, August 2, 2007 SKevin Smith, 29, of South- west Third Street, Belle Glade, was arrested on July 24, by PBSO and charged with resisting an of- ficer without violence and pos- session of marijuana. He was later released. Marvin Thomas, 56, of Southwest Eleventh Street, Belle Glade, was arrested on July 24, by PBSO on an active Madison coun- ty warrant. No bond was'set. Michael Young, 35, of South- east Second Street, Belle Glade, was arrested on July 25, by PBSO and charged with nine counts of aggravated assault with a deadly weapon and two counts of weap- on offense missile into an occu- pied vehicle with a firearm. No bond was set. Antonio Washington, 29, of Southwest Fifth Street, Belle Glade, was arrested on July 25, by PBSO on a warrant charging him with battery. He was released un- der supervision. David Pace, 31, of Northwest Eleventh Street, Belle Glade, was arrested on July 25, by PBSO on a warrant charging him with bat- tery. No bond was set. Tom Kinney, 28, of North- west 14 Street, Belle Glade, was arrested on July 26, by PBSO on a warrant charging him with ag- gravated battery on a pregnant person. No bond was set. Adrian Davis, 18, of South- west Avenue C Place, Belle Glade, was arrested on July 26, by PBSO and charged with burglary with assault or battery, battery and ag- gravated stalking. No bond was set. Michael, Key, 19, of South- west Fifth Street, Belle Glade, was arrested on July 26, by PBSO on a warrant charging him with rob- bery with a firearm, possession of a weapon or ammo by a felon and felony act could cause death. No bond was set. Nathaniel Lawrence, 33, of Northwest 15 Street, Belle Glade, was arrested on July 26 on a war- rant charging him with battery. No bond was set. Dernisha Brown, 18, of Southwest Avenue E, Belle Glade, was arrested on July 27, by PBSO and charged with aggravated bat- tery with a deadly weapon, carry- ing a concealed firearm, resisting an officer and disorderly conduct. No bond was set. Gabriel Hernandez, 25, of Runyon Village, Belle Glade, was arrested on July 27, by PBSO and charged with two counts of fraud and operating a vehicle without a valid license. No bond was set. Jimmy Lamar, 55, of South D Street, Belle Glade, was ar- rested on July 28, by PBSO on a warrant charging him with grand vehicular theft and dealing in sto- len property. No bond was set. Orlando Vallejo, 56, of Southwest Avenue E, Belle Glade, was arrested on July 29, by PBSO and charged with hit and run and two counts of aggravated assault with a deadly weapon. He was released on a surety bond. Orbelin Gomez, 25, of South- east, Third Street, Belle Glade, was arrested on July 29, by PBSO and charged with battery. No bond was set. Pahokee Jonathan Anderson, 20, of Glades Drive, Pahokee,, was ar- rested on July 24, by PBSO on a warrant charging him with rob- bery w/o a firearm or weapon. No bond was set. Loni Powell, 21, of Pope Court Pahokee, was arrested on July 24, by PBSO on a warrant charging him with aggravated as- sault with a deadly weapon. No bond was set. Dante Thompson, 25, of Doveland Drive, Pahokee, was arrested on July 24, by PBSO on a warrant charging him with two counts of resisting an officer and battery on a police officer. No bond was set. Rashadd, Bell, of Pelican Lake, Pahokee, was arrested on July 25, by PBSO on a warrant charging him with probation vio- lation-burglary possession of co- caine with intent to sell and grand theft. No bond was set. Jesse Smith, 24, of Padgett Circle, Pahokee, was arrested on July 25, by PBSO and charges with battery, contempt of court, aggravated stalking and proba- tion violation-burglary. No bond was set. Terry Jones, 43, of Dobrow Court, Pahokee, was arrested on July 27, by PBSO and charged with possession of cocaine and paraphernalia. No bond was set. Nathaniel Alien, 22, of Cy- press Avenue, Pahokee, was ar- rested on July 27, by PBSO and charged with contempt of court and probation violation-posses- sion of cocaine, marijuana and resisting an officer. No bond was set. Terry Jones, 43, of Dobrow Court, Pahokee, was arrested on July 27, by PBSO and charged with possession of cocaine and possession of paraphernalia. No Bond was set. Nathaniel Allen, 22, of Cy- press Avenue, Pahokee, was ar- rested on July 27, by PBSO and charged with contempt of court- possession of marijuana and co- caine and resisting arrest. South Bay Lavinski Johnson, 19, of Northwest Third Street, South Bay, was arrested on July 26, by PBSO and charged with aggravat- ed assault with a deadly weapon and possession of weapon or ammo by a convicted felon, pro- bation violation-burglary and bat- tery. No bond was set. Terrance Davis, 30, of Jimmy Lou Court, South Bay, was arrest- ed on July 27, by PBSO on a war- rant charging him with larceny $300-$5,000 and fraud. He was released on a surety bond. Jerry Logan, 28, of South- Roadwatch ,.'Prepared by Florida Depart- ment of Transportation, District 1 Office, Bartow ..,,...... SFor Crossover. Motorists should expect intermittent lane closures, slow moving traffic, and possible delays. Flagmen will be on site to assist with traffic. S.R. 78: From Indian Prairie Canal to Buckhead Ridge: Mainte- Commu nance project -- For the next few weeks, crews will be spraying constructing a right turn lane into the devel- opment. Motorists should expect right lane closures for the next few weeks, as well as slow mov- ing traffic and possible delays. U.S. 27: At Lewis Boulevard: Maintenance contract project -- Crews are replacing and repairing street lights. Motorists should ex- pect intermittent southbound lane closures, as well as slow moving traffic and possible delays. U.S. 27: At the intersection of S.R. 80: Maintenance contract project -- Crews are replacing and repairing street lights. Motorists should expect intermittent south- bound lane closures, as well as slow moving traffic and possible forming sod and shoulder work along the side of the roadway. No lane closures are anticipated, but motorists should expect possible slow moving traffic and delays. S.R. 80: From east of the Lee County line to west of Grandma's Grove RV Park: Construction proj- ect -- Work is underway to make drainage improvements at the edge of the roadway. Crews are excavating, placing concrete, and working in the shoulders. No lane closures are anticipated, but mo- torists should use caution and ex- pect truck traffic entering and exit- ing the work zone. The contractor is Community Asphalt Corp. S.R. 29: From Greentree South to G Road: Maintenance contract project -- Crews will be perform- ing sod and shoulder work along the side of the roadway. No lane closures are anticipated, but mo- torists should:expect possible slow moving traffic and delays. S.R. 29: Southbound in the area of Citrus Belle: Maintenance contract project -- Crews will be removing and replacing pipe in the area. No lane closures are anticipated, but motorists should west Twelfth Avenue, South Bay, was arrested on July 29, by PBSO and charged battery, resisting an officer with violence and assault on an officer. No bond was set. Robnesha Williams, 19, of Southwest Fifth Avenue, South Bay, was arrested on July 31, by PBSO and charged with larceny over $1,000, fleeing and elud- ing the police, driving without a license and resisting an officer without violence. Clewiston Garrett Marshall Hilb, 28, of Clewiston, was arrested July 25 and charged with possession of cocaine and possession of drugs with intent to sell etc. other sched- ule III or IV. Steven Robertson of the Hendry County Sheriff's Of- fice was the arresting officer. Pablo Moise Blanco, 27, of Clewiston, was arrested July 25 and charged with probation violation. Pamela Capling of the Hendry County Sheriff's Office was the arresting officer. Zitavious Demikious Strawder, 23, of Belle Glade, was arrested July 25 and charged with failure to appear. Pamela Capling of the Hendry County Sheriff's Office was the arresting officer. James Ramie Walker, 18, of Lake Placid, was arrested July 24 and charged with burglary- dwelling structure or conveyance armed and larceny grand of fire- arm. Greg Henderson of the Hen- dry County Sheriff's Office was the arresting officer. Rafael P. Sanchez, 57, of Clew- iston, was arrested July 24 and charged with possession of co- caine. Detective M. Short of the Seminole Police Department was the arresting officer. Francisco Olvera, 36, of Clew- iston, was arrested July 27 and charged with resisting an officer- flee attempt to elude law enforce- ment. Timothy Neidert of the Hendry County Sheriff's Office was the arresting officer. Jared Franklin Woodward, 28, of Moore Haven, was arrested July 26 and charged with public order crimes-criminal attempt solicit conspire, aggravated assault with intent to commit a felony, second Crime Stoppers The Palm Beach County Sher- iff's Department is seeking assis- tance from the public in locating the following wanted fugitive. Bridgette Neal, age 28, is a black female with black hair and brown eyes. She is 5 feet, 6 inches tall and weighs ap- proximately 300 pounds. Her last known address was on South- Bridgette west Fifth Street Neal in Belle Glade. She is wanted for felony grand theft. Anyone with information on the whereabouts of this wanted fugitive is asked to contact the Crime Stoppers at 1-800-458- "TIPS" (8477) or online at www. crimestopperspbc.com delays. expect slow moving traffic and Save money on your I S.R. 82: In various locations in possible delays, as well as trucks I favorite grocery items. I Hendry County: Maintenance con- entering and exiting the work I Go to newszap.com to I tract project -- Crews will be per- zone. download and print coupons I wsz coI online! W 8Z pwcomp I O.com , i LCd I community Links. nity Links. Individual Voices. Individual Voices L - - - - degree arson and burglary with assault or battery. Chad Pelham of the Clewiston Police Depart- ment was the arresting officer. Bond was set at $50,000 surety. Thaylia Leeann Fobb, 25, of Clewiston, was arrested July 28 and charged with aggravated bat- tery-person uses a deadly weap- on. Justin Spence of the Clewis- ton Police Department was the arresting officer. TRU E B LOO-w LAW GROUP ATTORNEYS & COUNSELORS AT-LAW Travis W Trueblood,LL.M. Attorney & Counselor-at-Law 691 Hwy. 27 N.W PH. (863) 946-9160 Ste. x 1270 Fax (863) 946-9162 PO. Box 1270 Moore Haven, Florida 33471 Real Estate Criminal Law Civil Litigation h&lAass He The Glades County School Board Will Hold A Public Hearing On August 23, 2007 At 11:00 a NOBILITY HOMES NOBILITY HOMES NOBILITY HOMES ! I o NO FURTHER... $ -*We Build Our Own Homes! * We Sell Our Own Homes! |*We Service Our Own Homes! | We Own The Mortgage Company! *We Own The Insurance Company! o Land Home Pkgs. ,DeliveredaSet, SAV/ Ct& COX AIR CONDITIONING AND ELECTRIC, INC. In Business since 1960 We have all your air conditioning needs available. New Air Conditioning brands include, Carrier, Goodman, Amana, Tempstar and many more. Commercial and Residential Sales and Service l" 'NEW" Easy financing available for all brands. Electrical service, Full sheet metal shop, Refrigeration and Ice machine Sales and Service. Also duct cleaning and sanitizing now available. CALL 863-675-0022 SERVICE AREAS ARE LABELLE, CLEWISTON AND SURROUNDING AREAS State certified #CAC1815066 A/C State registered #ER00001347 Electric. a' ", S"Working Together for Healthier Communities" Spanish and Creole interpretation services are available -- -I~~e Serving the communities south of Lake Okeechobee Thursday, August 2, 2007 w Thrsay Auut2 07Srigtecmuiissuho aeOecoe DCTO Terriers ready to kickoff season Special to INI Florida MOORE HAVEN Football season is quickly approaching and the Moore Haven coaches are getting ready for the start of the season. Football practice of- ficially begins on Monday, Aug. 6 and coaches are already getting the final preparations under way. At Moore Haven High School, physical exams are being con- ducted today at 4 p.m. for all fall sports athletes. Local physicians Dr. Forbes and Dr. Geeke are performing the physical free of charge. "We are very thankful that Dr. Forbes and Dr. Geeke are volun- teering their time and services to our youth," said Coach Jason Bond. "This helps the kids that may not be able to get a ride to a doctor's office or be able to pay for the physical." The Terriers are also welcom- ing a new assistant coach to the staff this year. Josh Harris is join- ing the program after graduat- ing from Huntingdon College in Alabama. Coach Harris will be teaching Biology at Moore Haven High School and coaching the de- fensive line. Football practice will begin at 5 p.m. on Monday, Aug. 6, for all Varsity and Jr. High athletes. Play- ers should have a current physi- cal exam and a parent permission form in order to participate. INI/Nena Bolan Avenue M construction Construction of new buildings and renovations of older ones are projects that many resi- dents have taken up during summer. This photo was taken on Avenue M in Moore Haven. School News in Brief INI/Nena Bolan Time on the river A pontoon boat is launched In the afternoon. This ramp is at Fisherman's Village in Moore Haven which is located in Glades County by the Caloosahatchee River. 1 Ulm c .. .".' " .- I: '" "' "I INI/Nena Bolan East Moore Haven This photo is taken from the road to the Alvin Ward Sr. Boat Ramp near the Moore Haven Locks. The water tower and Mamie Langdale Memorial Bridge are in the background. Free Football physical offered Free Football physical will be given on Thursday, Aug. 2, at 4 p.m. at MHHS. For more infor- mation, please contact Football Coach, Jason Bond at (863) 227- 1979. All players must have a current physical exam and parent permis- sion form in order to practice. Fall practice starts on Monday, Aug. 6, at 5 p.m. for all Varsity and Jr. High football players. All student athletes participat- ing in fall athletics are encouragedgar- ten program began in May 2006 children beginning at that time are now 'this-y-'I:'es gradutfing Kindergarten students. At the on- set of the school year, the students were screened for Kindergarten readiness on several measures and The GCCDC scored a 300, which is what the state was look- ing for to show success in the Pre- K program. Funds for MHHS What if Moore Haven Junior Senior High School earned a pen- ny. cornenta Crop. Protection, Schol- trship;eTh':$liO000 scholarship w~ill ob- tain their GED. Classes are Tues- day and Thursday nights from 6 until ser- vice agencies and the community. No special educational degree is required. Guardians need to be someone with common sense, good, judgment and a commit- ment to helping a child. Atten- -dance at three training, sessions held in Fort Myers is required. Please contact Kelie Hedricki at (;2.:9) 461--1361:1 r F(800) 269-6210 for more information, and to r"- serve your space for training. INI/Nena Bolan The library is a comfortable place Kane and Rosemary Aragus escape from the heat and enjoy adventure in books at the public library. The library is in the downtown section of Moore Haven and located on Riv- erside Drive. We report, but YOU decide. eD "dClewiston TheSun -Citylooksatwate 1- NewcemeteryI i M C YvapprovYs ptan frieMta OL PIS *t s' l. i sr ; i-V f "..' I .' .. . :.. ,. (. GLADES COUNTY DEMOCRAT -The S un Community Service Through Journalism Serving the communities south of Lake Okeechobee Thursday, August 2, 2007 .o v - EDUCATION A Cracker History-more than one-third century ago By Barbara Oehlbeck Special to the Glades County Democrat Lawrence Will has gone down in Florida history for his writings on the state's history in various areas. It could be up for bets as to which book of his has garnered the most attention and admira- tion, The "Cracker History" of Okeechobee or Okeechobee "Hurricane." For those who care about Flor- ida, both these books are a must. Cracker History was first pub- lished a third of a century ago, or in 1964, and still there are those who are hungry for his "cracker" style of writing and the fact that he "lived" what he has written about. In his acknowledgements, Mr. Will wrote: "Much of the infor- mation in this book was obtained from the people themselves who lived around the lake. For a considerable period of time, the author operated freight, passenger and tow boats, as well as floating dredges, in all parts of the lake and the Everglades, thus enabling him to gain a first hand knowledge of the people and the development during those early days." His first chapter is titled "A Heck Of A Frontier," ip which he writes, "If you can pull your- self away from that dad blamed television, maybe I can spin you some yarns as good as what you are seeing between commer- cials, except that what I'm fixing to tell you really happened. Folks have said that the Everglades and Lake Okeechobee were the last frontier in the United States, and I reckon that may be true, but it was the dad blamdest frontier you ever heard tell of. It was a heap different from what my old grand daddy ran into out west. Instead of mountains and prai- ries it was a water frontier with boats and dredges, gator hunting and catfishing. Instead of prairie schooners we had steam boats, and in place of herds of cattle we had schools of catfish. But we had our share of wild Indians and outlaws, eastern city dudes and squatters, too. Our pony express was a six-mile-an-hour mail boat and our buffalo looked a heap like scaly backed alligators. This Glades country now is mostly one big farm and cattle ranch and cane field, with towns and cities and all the discomforts of civiliza- tion, such as traffic cops and tax collectors and other modern in- conveniences. But it wasn't many years ago when it was about the wildest and most inaccessible re- gion in the whole United States of America!" If you've ever wondered where towns or small settlements are - or were around the lake, you have only to turn to the inside cover and first page of Cracker History where there is an excellent and easy-to-read map. In the opening pages there is also a full page of Cracker Dia- lect Translations. For instance: "heap" means a great deal," tote" to carry, "rile" means to anger, "ary" means ever, "plumb" means all the way, and "passel" means a group, or a collection. And so goes Lawrence Wills' Cracker History, a book about America's last frontier, its people, their hopes and frustrations, carv- ing out a civilization on the shore of the largest lake within the bor- ders of the United States. It's his- tory, true and authentic, written in Okeechobee dialect by a man who lived through half a century of taming the wilderness and Enjoy 'the good ole summertime' who at the time of the writing could recall most of the pioneers of that time. Then men came in ever-in- creasing numbers and gradually the lake was subdued, but not without momentous battles. Na- ture fought back, and one natural event cost over 2,000 lives, a stunning upset for the forces of man, one of many vio- lent battles. The white man won this war eventually and set up his cities as monuments of victory. How all this was accomplished is fabulous reading. "Cracker History" is over 325 pages, "antique" pictures, soft- back. For more information and availability, call, write, or e-mail Barbara Oehlbeck. Address: 25075 Grassy Run, LaBelle, Fla. 33935, phone/fax same: at 863- 675-2771, e-mail: doco@strato. net. Aquatan Pools Resurfacing, Remodeling, Replastering and Building the Finest Pools Henry Bauer 561-722-8160 1l, (. 1 ." i m..i I P 'r ,,l ,,,' ',,rl U(i I .1,,- .t ' By Barbara Oehlbeck Special to the Glades County Democrat The first full month of sum- mer is July. It is a bold and bril- liant slice of summertime when the sun is highest in the Northern Hemisphere. When Julius Caesar readjust- ed the calendar, moving the first of the year from March 1 to Jan. 1, he named this seventh month (Julius) for himself and gave it 31 days. Although July is considered one of the hottest months in the year, it is also one of the most col- orful, from extraordinary splashes of glamorous color in saucer-size hibiscus to the shining golden shower trees whose graceful lac- ey limbs shimmer all about even without a breeze. And crape myrtle, both va- rieties the one that's simply known as the old-fashioned kind (Lagersroemia indica) and the exotic Queen Crape Myrtle (La- gerstroemia speciosa) whose clusters of blooms are enormous. While both plants belong to the family of Lythraceae they hale from different parts of the world. Lagersroemia indica, in striking shades of red, pink, purple and ,white, is native to Southern Asia and Australia, while Lagerstro- emia speciosa calls India and the East Indies home and boasts all sorts of shades of pink to purple and red and white. Both varieties stay in bloom for weeks and weeks requiring no care whatsoever once they become established in the land- scape. While the Queen Myrtle has by far the biggest clusters of curly blossoms, it is somewhat tender as regards cold tempera- tures, consequently as a safety precaution, try to find a spot that's protected for the Queen. Almost any location that won't be subjected to harsh cold winds in case of a freeze will do. Generally the south side of a building or the south side of a hedge row is good. In other words, almost anything that will serve as a blocking agent to pre- the plant can save as a cold pro- tector or at least minimize cold damage. And, in case the limbs do fall prey to a freeze, wait until new growth begins to show on lower parts, then prune back to healthy, green wood. The older the plant, that is, the more es- tablished it is, the less likely it is to freeze. Although crape myrtle (both varieties) is not generally listed as a Xeric plant, there are those who believe it should be and I agree. This high summer bloomer is highly drought toler- ant, it's happy in a wide variety of soils, however its salt tolerance is considered low, it has no environ- mental problems, and its rate of growth is medium thus the plants will not outgrow their allotted space quickly. Zones 7-10B are recommended for Lagerstroemia indica, while Zones 10B-11 are recommended for Lagerstroemia speciosa. There's another extraordinary beauty this time of year that just happens to be the chosen flower of Muse in Glades County. One :upward look along many roads in the I(jnd of flowers, will inslantly reveal that the lorlll bay is now heralding this warm, sunny sev- enth month with glistening white blooms nestled in waxy evergreen leaves on trees-as-tall as forty-five feet. This regal, handsome mem- ber of the Theaceae family, a na- tive of Southeastern United States, grows most happily in acid soils near wet areas. Since the loblolly's light re- quirement is high, if planted in shade it will bloom only spar- ingly if at all. Because their toler- ance to drought is low, the most specimen loblolly bays are found growing alongside wetlands and swamps, almost as a frame, where they have ample water but do not actually grow in wa- ter. And being on the perimeter of these naturally wet areas they get the bright light they must have to thrive and bloom. Loblolly bays are medium to slow grow- ing, thus fully mature trees, some 35 to 45 feet in height are usually of considerable age. Their nutri- or average. With no human or environmental hazards, loblolly bays are highly desirable for wet areas in zones 8-10A. However, to plant them away from wet areas is usually an exercise in futility as well as the waste of a prized na- tive tree. Not only do these trees take to wet conditions, to grow and thrive, they must have the nutrients, etc. from layers and lay- ers of leaf mold and natural com- post to sustain a desirable state of health. Probably- the most satisfac- tory way of acquiring a loblolly bay for your own landscape is to find a nursery that has small seed- lings as these trees are difficult to move. Even when sold as B&B plant material or even in contain- ers, unless they are planted in an ideal location, they probably will not live very long. From the ground looking up, the pristine white loblolly flow- ers are a striking contrast to the waxy, leather-like leaves that grow so thick that sky cannot be seen through them. The petals are slightly fringed with broadly rounded tips turned up; the clus- tered stamens are golden yellow. Seldom are loblolly bays seen growing singly, yet again, maybe it's the exception that makes the rule. Only this week, alongside a young citrus grove, which of course is framed with a retention ditch, which is actually too big to rightly be called a ditch, yet too little to be called a canal, there is one purely lovely, lone loblolly bay, perfectly symmetrical with its arms reaching high above the grove within arm's length of the orange trees. It seemed as though the shin- ing star-like blossoms all opened at one time which, of course, is not the case. And upon lean- ing over the fence, since I could hardly straddle the ditch-canal, I could see as many buds, perfectly round like miniature golf balls, as blossoms. But then, as I kept looking, there was something else or was I1 seeing things. In the top two or three feet the blossoms were as ing, shimmering white in the early hours just after first light. After several minutes of lean- ing even farther over the fence and straining my eyes, I "came to the party!" Those huge blossoms were moonflowers, the vines hav- ing climbed and wound around the trunk of the tree to find the light at the top. What a grand sight at first light! Plus a fragrance we'd give a lot to bottle: Moonflowers and loblolly bay blossoms on one tree at the same time. Sometimes the line is fine between various zone maps for Florida, much more so for this southern most state than others. Therefore, at times there is what seems to be conflicting informa- tion regarding where zones begin and end. The most finely detailed zone and climate map I have seen is in Xeric Landscaping with Florida Native Plants, edited by Michael Jameson and Richard Moyroud, published by Betrock Information Systems, Inc., in cooperation with the Association of Florida Native Nurseries, Inc. The two maps are. in full color with generalized ren- dering of plant associations over the entire state as well as eigh- teen geographical areas ranging from Coastal Uplands to Scrub Forests to Prairies, to Fresh Water Marshes to Wet and Dry Prairie- Marshes on Marl and Rockland plus thirteen others. It is a highly informative General Map of Natu- ral Vegetation of Florida. The cli- mate map is based on the last 40 years of USDA weather data. According to Trees of Central Florida by Olga Lakela and Rich- ard P. Wunderlin/Banyan Books, Miami, Florida/1980, Loblolly Bays grow from Glades County northward, Florida to Louisiana and North Carolina. According to Betrock's Reference Guide to Florida Landscape Plants by Timothy K. Broschat and Alan W Meerow/Betrock Information Systems, Inc./1991, Loblolly Bays grow over all of Florida except zone 10b, which is considerably The donation is tax deductible. St- Hci Pick-up is free. f 0r I "hc O *l We take care of all the paperwork. : * A*A fi3 cs.e. d' f ?A ixSior Co', ,. :i Rrtox n wfih, n:e id Ctorndo Broaet lBr.;er!R4OO .?2S43 YOU'VE ONLY GOT ONE PAIR WE -P FAMILY EYE CARE (863) 675-0761 STOP LEG CRAMPS fa%| BEFORE THEY STOP YOU. Clcet S. I TrInple Calcium MmXo. C A 6 0 o i 1 0 0 i 0 6 W c h ii u l C lp y l g t i r ., vent cold winds from getting to tional requirements are medium big as saucers! They were gleam- farther south than Glades County. Infinity Air Duct Cleaning How do you figure room the animals need? ChrisMusgrave & ons By MaryAnn Morris h r & INI Florida Electrostatic Filters & Sanitizing Many owners of a patch of ru- Call Today and Reduce Indoor Air Polluntants ral land or "ranchette" or acreage such as are new to farming (not to men- Dust Mites, Mold, Mildew, Animal Dander & Cigarette Smoke tion life without city amenities) and if you want too raise crops or' Phone:863-983-8536 Cell: 863-228-2902 a rsall herd of livestock for nrof- .... it, this probably won't help you. Go straight to the Agricultural Ex- tension Service and- farms.ifas.ufl.edu/. They have what you need. If you want to raise a few animals as a hobby or for family consumption, read on! The best thing you can do is educate your- self! Educated owners mean bet- ter rural living, better production, healthier animals and a cleaner environment. Reach out to your county Agri- cultural Extension Service. SWe have a few tips to help your thoughts about having your own farm animals and we reach out to the Ag Extension folks, too. How much space will you need here in Florida? Florida is different than anywhere. Heat and sun are problems. Cold and snow are not. All pastures/pens need a constant, repeat constant and adequate supply of fresh water, not buckets. "Plan for rotational grazing," says Pat Hogue, Okeechobee County Extension Agent. "This means cross-fencing to allow your animals to graze sev- eral areas in turn Ha~e an orga- nized ssltem \\ heher \ i:u change pastures by eye, \\hen it looks INi/MaryAnn Morris An extreme example of inadequate feed and pasture, this unhappy are and her half-grown foal were confiscated by Okeechobee Animal Control. The owner was only too happy to give them up to avoid prosecution. How animals are pastured makes all the difference. Backyard Barnyard like its getting eaten down or on a regular schedule, you must move your animals regularly," said Agent Hogue. "The frequency in any case, depends on the kind of grasses, the amount of weeds in the grass and the general condi- tion. Improved pasture planted in Bahia or Bermuda grass, fertilized on schedule, rotated on schedule will feed more animals than a pasture with native grasses, or a weedy one or one that has not had soil testing to check Ph and fertility and any needed lime and fertilizer spread." "If weeds aren't too bad, you can weed-eat a small place. If they are thick, you may need to spray with a herbicide that won't harm your animal." That is the basis for the num- ber of acres per animal. Remem- ber, supplemental feeding with purchased feed and hay will be necessary on most small places. More in winter when the grass doesn't grow. 1HENDRY REGIONAL MEDICAL CENTER "". ,'here It'sAfrfout getting Better" Hendry Regional Medical Center has an opening for a full time Medical Office Manager to oversee a medical office practice in LaBelle. Candidate should have a minimum of three years of medical office management experience in a physician's office. This position. requires skill in developing and maintaining effective relationships with medical and administrative staff, patients, and the public. For questions, please contact human resources at 863-902-3016. Please forward resume to aali@hendryregional.org or fax to 863-983-0805. Drug Free Workplace EOE Thursday, August 2, 2007 Serving the communities south of Lake Okeechobee ,ThIULsAN Uy. uut2 07Srigtecm unte ot fLk kehbe '0A ps imas ~~YP hr A~'i -ruu~ul;r~ru iI4u i~rY~~liI lii =1l[Wpr'DEo J - ^ -E [prTias~v fl^ W^~aJG^ The Chrysler Lifetime Powe Warranty is the first to be any automaker. Ever. Beca warranty, you're covered, for as long as you own yo " ' The big news is that this limited warranty applies t majority of our great new ( and Dodge vehicles.* So if wanted to leave civilization explore the great outdoor Wrangler or a Patriot, our ............ ......... ......... ....... " trainn Limited warranty goes offered by dreamed about iuse with this in the unmistak and it lasts You won't be I ur vehicle, short-term pow( tough Dodge Ra S You've got the p that our power powertrain there to keep yc :o the vast Chrysler, Jeep., F you always n behind and you have to mat -s in a Jeep vehicle you war Powertrain visit your local c with you. Or if you ever cruising around town (able Chrysler 300, relax. eft stranded by a ertrain warranty. Need a am truck for your job? peace of mind of knowing rain warranty is always ,u working. .. ,^ ,- ; , Y. The only difficult decision ke is picking which great nt. For more information, dealer. 300 WRANGLER RAM C HW RYS L-E=R Jeep 3D O caEs chrysler.com jeep.com dodge.com 7 Here Is A Nice Onel Only Nice Economical 4Cy, 52,000 Miles, Autlmatic With Automati P1W Aluminum All The Goodies, Comfortable .Wheels. Ora- Ne -i .._ 77-- ..A.. . .A.. .. . .T 4 2 2 2 A .0 95.--..,.... .. .-_ , ., _ .-. -. ...: _.9.8 A Beautr Nicely Equipped! wOnly .N Powier r 6Cly, Auto, PIWP/L. There's , There's Room For 71 AT Bd -. 77., ,.. -.T4295A777 I. -.4 Laredo Package, 4x2, 6Cly. Engine, P/W, P/L, Cruise Control, Tilt, CDr 442A .. IMF 49t w -*or 1 l T4222A C Ice i- E f-e I.w ,D95 ift I-w r- -h E RwJ e e p .~; '' ,a:., , L -- _.- ,. -.:,_ = __ _. '- ., . . . ." .. . _-_ '- . = : = = -- = = = . .,-.= . EI2PIIOP I ....RYLE "7~~i JF" "I V r :- -,. "i i ar sa 9 ;; el :5 e rr' -'-*" e' csJ:r-""~~re;z e" '" FIVE E -',.:t; ..... -'f "~ --*. '. ,,:.-,' "': C442A : CIZl,,Asnmrnm~~C~u H IB' YS LE __- J !leep 'Prices Plus Tax, Tag, License. Valid Thru 8/4/07. All Vehicles Available AI Times 01 Press. Dealer Not Responsible For Typogiaphical Errors. 11 11 Serving the communities south of Lake Okeechobee Thursday, August 2, 2007 ~" , o . i. . - A II I )I Ii t. ii 1 Serin th omnte ot fLk kehbeTusaAgs ,20 Luckey Continued From Page 1 and riddle) in the state of Florida that made the most year-to-year progress in school grades. In his letter to Principal Luckey at that time, Governor Jeb Bush wrote: "You and your staff have done a remarkable job helping your students improve their core academic skills by continuing to set high standards. Additionally you have continued to provide and set high standards for the students, giving them the support they need to exceed expectation." And the letter was signed by the Governor and by Education Com- missioner John Winn. About his work at West Glades, Donna Britton, Confiden- tial Secretary/Bookkeeper said, "Mr. Luckey developed a faculty that's compatible and worked to- gether for the students and their needs. He worked closely with parent-teacher organizations and because of this the school got a lot of mentors and volunteers. The community support of West Glades is exceptional. "Larry Luckey did a fabulous job of hiring a faculty that cares about the students. At one time," Ms. Britton said, "students don't care about what you know un- til they know you care about them. He put together a group of people who cared about the children, what they were doing, what they were learning. He had a very unique ability for seeing someone's potential. I personally learned so much under his lead- ership." During his tenure, a "Positive Behavior Awards" system was started which meant that children were being awarded for good, positive behavior rather than be- ing disciplined for poor behavior. Ms. Britton added, "So for everything there is a season. I'm looking forward to working with Debra Davis, the new principal of West Glades. Her and all of us know that Larry started this school, put this faculty together and the foundation that he set is going to make this school grow because it has such a solid-rock foundation:" Wayne Aldrich, Superinten- dent of Glades County Schools: "Larry Russell, II, was a perfect fit for that school and the commu- nity. He was greatly successful at that school and he'll be success- ful wherever he goes. We will miss him. It's going to take a lot to replace the daily and after school activities in which he excelled. "In my experience I have not met anyone who is as dedicated to education as he is. He was one wonderful principal! He really ex- cited the staff and students alike. He put in as much of his time in the school, if not more, than he did at his home." Storm Continued From Page 1 accurately describe them when contacting authorities. Terms like rotating wall cloud, funnel cloud, shelf cloud and downburst take on a whole new meaning when helping authorities so far away in Miami. Many times these specific features can lead to the forma- tion of tornadoes, damaging hail, strong wind and heavy rain. The National Weather Service considers local storm spotters to be their ground troops who report severe weather events. It seems that technology has its lim- its in practical use since the farther away Doppler radar is the less likely it is to pick up storm events that happen near the ground level atmosphere. Calling in a report will verify what radar is indicating miles away in Miami. According to Robert Molleda, typical spotter groups are people in the fields of fire rescue, law enforcement, dispatch, forestry, county emergency management, radio operators, media and avia- tion. Professional and amateur storm chasers also call in reports and so do private citizens who are always curious about the weath- er. Statistics brought up in class showed that most severe storm reports come from urban and suburban areas, but that does not mean that these areas have more Sally Continued From Page 1 Democrat thrl.ui.l tI:, the ar:ts arid I'll see what comes from that. Question: Are you planning to write another book? Answer: I have a children's book and am looking for a pub- lisher. There is another story in me about Monticello, too. Question: How did you get involved with teaching and writ- ing? Answer: I have had students ask me this same question. There was a women's. club in Moore Haven and they held meetings. They had book collections with a children's section. 1. liked that. When I got money I would go to Parkenson's store here in the downtown section and buy a book. It was my first taste. I also became librarian assistant. I went to a conference for li- INI/Nena Bolan Jeffrey Davis and other Lions Club members are planning a giant yard sale for August 18. Volunteers, donations and new members are welcome. INI/Nena Bolan Local residents, volunteers, county officials and employees attended the Skywarn Storm Spotters class on July 26 in Moore Haven. They were trained to make real-time observations of tornadoes, hail, wind and specific cloud formations. Their reports can provide reliable in- formation which NWS staff uses for detection and making warning decisions. violentweather. It means that rural areas can have significant storm or tornado activity, only there are fewer people as eyewitnesses. This is where the local spotters can help warn local residents by calling in a severe event even after it is has passed, because it could be headed straight toward a neighboring community. Anyone of course can call lo- cal authorities about dangerous weather. However, the trained spotter will have an identifica- tion number and a specific phone brarian assistants and met a dean of library science. He interested me because he was just an every- day person, but he still impressed mrr-. Tht-n I4-r,%fw- I--vatiei j a-de- gree in history and science, and I wanted to work at the Smith- sonian or Library of Congress. I forried a library club, and have loved Florida history from the get- go. I grew up with stories. When I was 9 1 went with my dad to col- lect stories for the newspaper and I would listen to them talk. Question: What challenges' you? Answer: My challenge is deal- ing with niy cerebral palseywhich has motivated me. It is because of CP that my first book was writ- ten. At age 50 1 started to come to terms with it and I started to write about my life with CP. 1 ended up writing "In the Shadow of the Lone Cypress" which has a counr- try doctor as the main character. Duncan Draughn was our doctor number to call when verifying weather phenomenon. Ideally, a storm spotting procedure can involve a network of spotters, law enforcement, fire rescue, dispatchers and radio opera- tors. Spotters in various locations within the county can stay in con- tact with each other and report a storm's direction in order to warn other communities. Recently, on July 9, there was a funnel cloud spotted in the Buck- head Ridge area. A local resident took photos and sent them to the a long time ago but he was the model and inspiration for the book. It is not about him. Question: What brings a -srmilk h ,-,'our face- . Answer: My grandson who is in Ireland. He is six. Where do you live now and what will you be doing in the near future? - I sold my house and am stay- ing with a friend. I will do my re- search here until November, then I will go see my daughter in Ire- land where she has a book store. Question: Is there anything you would like to say to folks in Glades County? Answer: Yes, If anyone has written memoirs of the Depres- sion years through World War II I would like to know about it. If anyone has memories of their childhood or parents from 1927 through the 1950's please contact me at (907) 206-3007, or at (863) 946-0944. My email is sallybar- media and a fire rescue worker called it in to authorities. The county's emergency management team would like for residents to send in photos of weather events so they can create an album for future generations to learn from and to marvel at. For more information contact Angela Snow, Glades County emergency management director at (863) 946-6020. Staff writer Nena Bolan can be reached at nenabolan@yahoo.com row@yahoo.com For more information go to Ms. Barrow's website at sallyset- tie.homestead.com. Staff-writer Nena Bolan can be reached at nenabolan@yahoo.com Lions Continued From Page 1 will be present so they can make plans for your dinner. There is no charge for a visit. They meet every second and fourth Tuesday at the Moore Haven Yacht Club. The big yard sale could be fun and help the community too. Par- ticipants may get a booth space for $20, or you may just drop off items. Y6ur donations will be stored by Mr. Davis at his place of business, Everglades Realty on U.S. 27. Many volunteers are wel- come. Help with pricing the items is needed as well as set up on August 18. Call Mr. Davis at (863) "We absolutely need more members to help others in need." -Jeffrey Davis, 946-3900. The Lions Club accepts letters of request from the needy, and letters may be sent to P.O. Box 815, Moore Haven, Florida 33471. Cash donations are accepted, and used eyglasses may be dropped off at local banks. "We absolutely need more members to help others in need," said Jeffrey Davis. Staff writer Nena Bolan may be reached at nenabolan@yahoo.com I Save money on your favorite grocery items. I Go to newszap.com to download and print coupons online! a I -,-~ /-s-y-sLy-sLy-sZy- s sy ^ I I eWSZap.COmi Community Links. Individual Voices. I LComm---niy-----s---I-----v-a---V---e- newszap.cem Community Links. Individual Voices.41 HENDRY COUNTY SCHOOL BOARD Announces its policy for Free and Reduced Price Meals for students under the NATIONAL SCHOOL LUNCH AND BREAKFAST PROGRAMS. Any interested person may review a copy of the policy by contacting CHARLES D. DAVIS Household size and income criteria will be used to determine eligibility. These criteria can be found listed below Children from families whose income is at or below the levels shown may be eligible for Free or Reduced Price Meals. applica- tion and return it to school. Additional copies are available at the principal's office in e. i r ..... I .. .i.. ,.. Ii.: r.i.i. .:.. il i:.used for the purpose of determining eligibility and may be veified at any time during the school year. Applications may be submitted at any time during the year. Households that receive Food Stamps or TANF (Temporary Assistance to '.., i ':. ii,. I, Jodi Bell at 863-6744108. For the purpose of determining household size, deployed service members are considered a part of the household. Families should include the names of the deployed service members on their application. Report only the portion of the deployed service member's income made available to them or on their behalf to the family. Additionally, a housing allowance that is part of the Military Fi i.;, i. It h ,i. ,i." i,1; ; .. ; . I I I. 1 I ..,- .- All other households must provide the following information listed on the application: * Totalhousehold incomelistedbya ,.,-i" i.. ., ... jia, f :,, ...:,.. ,,, Ii .,,. ,,i .. .... ,I...,. i.i ,11 ,..,i ... 1..: ..i ,.,I each house- holdschool should be contacted. Children of parents or guardians who become unem- ployed should also contact the school. I.1,.I I,_rt 1 1 1J 1 i l I -L i i h. h.dI,,I, 1,i,- -.j. .... .. ...-II.. j11 1 / 1 1 .. . i l i j l ,, i..i,, l -. i hl ,jb -."l. ' Under the provisions of the Free and Reduced Price meal policy Charles D. Davis, will review applications and determine eligibility If a parent or guardian is dis- satisfied with the ruling of the official, he or she may wish to discuss the decision with the determining official on an informal basis. If the parent wishes to make a for- mal appeal, he or she may make a request either orally or in writing to: SCOTT COOPER Post Office Box 1980 LaBelle, Florida 33975 863-674-4113 Unless indicated otherwise on the application; the information on the Free and Reduced Price Meal application may be used by the school system in determining eli- gibility for other educational programs. FLORIDA INCOME ELIGIBILITY GUIDELINES FOR FREE AND REDUCED PRICE MEALS Effective from July 1, 2007 to June 30, 2008 Free Meal Scale is 130% of Federal Poverty Level Setting up the Chuck Wagon Cowboys set up the Chuck Wagon as part of the displays at the celebration honoring the National Day of the Cowboy on July 28 at the Okeechobee Agri-Civic Center. The Seminole Tribe of Florida provided the covered wagon, as well as the cattle for the cattle drive. Household Annual Monthly Twice Per Every Two Weekly size Month Weeks 1 13,273 1,107 554 511 256 2 17,797 >1,484 742 685 343 3 22,321 1,861 931 859 430 4 26,845 2,238 119 1,033 517 5 31,369 2,615 1,308 1,207 604 6 35,893 2,992 1,496 1,381 691 7 40,417 3,369 1,685 1,555 778 8 44,941 3,746 1,873 1,729 865 Each additional 4,524 377 189 174' 87 family member, add Reduced Meal Scale is 185% of Federal Poverty Level Household Annual Monthly Twice Per Every Two Weekly size Month Weeks Each additional 6,438 537 269 248 124 family member, add To determine monthly income: * If you receive the income every week, multiply the total gross income by 52. * If you receive the income every two weeks, multiply die total gross income by 26. * If you receive the income twice a month, multiply the total gross income by 2i. * If you receive the income monthly, multiply the total gross income by 12. Remember: The total income before taxes, social security, health benefits, union dues, or other deductions must be reported. In accordance with Federal law and the U.S. Department of Agriculture policy, this institution is prollibited frm discriminnation on ire basis of nice, color, national origin, sex, age, ordisability. To file a complaint ofiscrimination, write'USDA, Director, Office ofCivil Rights, 1i400 Independence Avenue S.,I i...... I :. .. 'i... ii 800-795-3272 or (202) 720-6382 CTY). USDA is an equal opportunity provider and employer I II Thursday, August 2, 2007 Serving the communities south of Lake Okeechobee I Thursday. Auvust 2 200 S t I ,IH ,I , -I,, 1112 o " " I A Pu I II 5 IWA iPiCL ~r T~;~Vp~I' - 13 Brand New 2007 odge RAM 1500oo MEGA CAB SLT - AUTO POWER IWNDOWS l POF ER LOCKS TRAILER TOW PCKG SIRIIS R40Lo AN~!-SfPhI REAR AYE 30 TO CHOOSE' ie:r $O~i"7 F Id I-A I-02LB Brand New 2007 Dodge RAM 15oo Reg. Cab SLT AUTO, P/W P/L, TILT CRUISE, 4.7L ENGINE. 150 TO CHOOSE! Brand New 2007 dodge RAM 2500 DIESEL 20 TO CHOOSE! "J S NIROa N s5 OOSE! AVAILABLE FOR IMMEDIATE DELIVERY! Brand New 2007 DO;dge DAKOTA _ CLUB CAB , 2 TO CHOOSE! JiW) ea1 f | w~ls.y~~~d! ZERO PLUS SE HA ESPANOL PARLEZ VOUS FRANCAIS & CREOLE Palm Beach A ,VERIGtS OL(IfER[R v LIll' lSEL~ Ci irj.STOCK VEHI( LE ONI r lFFER' IiJOT I l :.iJ';U rJC T f' INIMI M 7 L, l 'i icr' '.L ri E QF,. l 'ii.0 ,' ;.I.L' I. L UI U H.lI I A' P rtTAhISAJ ll. REPATE.E ,', rJ.L[ II'Ei. rINCLuDrjIG CHRi lE OW f ER I. ,T EBATE. PRICES INCLUDEALL REBATES. PRICES PLUS TAX, TAG ;ilT F FE' [ 'iELE R I':rl. ALI.ED OPTIONS REBATf' VRi OH ELEF1 MCOL, LS lH APPFiOO CREDIT. O .i !. 'F F r' r Ifr l I 'L'| i *I' .; 1 Iir Ei r,1a, n r I: t .ji.l..FD o A Iri, r I li,,E vWaI'I W Ill- Ol r l D rtlER rJOF l Rfr Ulr S lr LE FR T~ rii r A' ERRORS OR OMISSIONS. VEHICLE ART FOR ILLUSTRATION ONLY. i. JriLi :r IEFRM,' !iAH rJ ELELT IJEW MODELS WITH Af-PROD/E D CREDIT Sit DLFR FL R RIE141' "DURANGO LEASE PAYMENT IS 27 MONTH LEASE.10,500 MILES PER YEAR, S3000 CASH OR TRADE EQUITY PLUS TAX TAG TITLE FEES AND DEALER INSTALLED OPTIONS AND FIRST MONTHS PAYMENT, SECURITY DEPOSIT DUE AT'T.IGINJrj, MiNIMIJ' I 50 BEACOIJ SCORE REQUIRED POWERTRAIN WARRANTY NOT AVAILABLE ON SRT, DIESEL, SPRINTER & RAM CHASSIS, OR FLEET VEHICLES. RESTRICTIONS APPLY. SEE DEALER FOR A COPY OF LIMITED WARRANTY AND COMPLETE DETAILS. 2007 CARRERA ADV. Serving the communities south of Lake Okeechobee Thursday, August 2, 2007 \k 5 7 I~li~T I W I~a B I j Iri ii Itadis~z IScseTu i11ii:1 lll: HIMI 4,10000UUU00,U EED!t fin C4VL.E Jeep tuere Rn mAR I I - a a STK#71195A STK#73212A ONLY M.U ONLY STK#72713A ONL - s-?fffjtLU4, __________________________IFN______ '96 FORD CONTOUR 29 STK*7511A 10 '00 PONTIAC SUNFIRE s2 STK#71712A .. '97 HONDA ACCORD s 9 STK"725t7B. .4990 '01 FORD FOCUS 490 '99 VOLVO V70 S5 STKt,71155A. .. 5990 '03 CHEVY IMPALA '9090 ST#7'434A O999 '05 DODGE NEON s1990 STK 7 .?664AA ... ..9 '04 CHRYSLER PT CRUISER 610,990 STK97311A 11,990 '05 DODGE NEON SXT 1 t1 0c STK#P8002 il '03 HONDA ACCORD 12,990 ST0K71055A J12 '06 CHRYSLER PT CRUISER ST K73158A ss12 0 '04 CHRYSLER SEBRING CONV. l 8 90 STK 8044/ 1.0 '03 MINI COOPER , STK#73077A- l14s990: '06 FORD FUSION 4 .0 STK#73262A 14'.990 '05 BUICK LACROSSE .15 STK7616A ..... ... 1 ,8 0 '04 MAZDA MIATAr ' STK 71589A ..... ... ...... 1 5. '05 SUBARU IMPREZA STK72860A I .i990. '05 FORD MUSTANG GT 1.9 STK#72871A " '05 CHRYSLER CROSSFIRE CON. I STK. 73 .................. ... ,9E 0 '06 FORD MUSTANG GT 2499 s STK 709A. .............. .... 4,990 '07 VOLKSWAGEN EOS CONV. ST#O73200A 133.990 2004 CHRYSLER STK#?411A ONLY : '01 FORD ESCAPE STK#PL7096A '7990 'O0 NISSAN XTERRA ' STK#72672B 7980 '03 DODGE DURANGO STK#PLO093A ........ ... ..19990 '04 JEEP WRANGLER STK#72907A 11.896 '04 HYUNDAI SANTE FE STK#7268A '03 FORD EXPEDITION STK-771920B .. '11,990 '05 JEEP GRAND CHEROKEE 14 0 STKO72643A... ........ ...... 4 ,9 '05 HONDA ELEMENT 8 STK#7720A 11589 '05 HYUNDAI SANTA FE ST 7613A ........... 15,99 '04 JEEP GRAND CHEROKEE STKPL07 .... ... 1 5,990 '06 JEEP GRAND CHEROKEE STK 73345A ............... .... ..... 11 7 9 0 '06 SATURN VUE STK70157A... 117,990 '06 JEEP COMMANDER 18,0 STK#712A ...... ..... .18,980 '07 DODGE NITRO STKPPL7D09 ..... .. ......19,990 '06 DODGE DURANGO ' STK#P7072..... ......... .. ... .. 2 1.0. '04 BMW X5 STK#72637A A29,890 '06 JEEP GRAND CHEROKEE OVERLAND 4X4 STKO07 .. .. 9,S90 '05 CHEVY TAHOE Z71 4X4 2 STK#702878 1i29,90 2005HONDA ELEMENT A '05 GMC 1500 STK#T71096.............. ........ 11. '06 GMC SILVERADO STK#7330A .............. ....... ..... 1 , '05 CHEVY SILVERADO .l STK#70108A ....... .. ....... ... ..... '03 DODGE RAM 1500 ; STK* 72077A "' '06 TOYOTA TUNDRA SR5 QUAD CAB STK#71754B . ...... ......... .... ...... .. .99 '03 CHEVY SILVERADO STK#70168B ,13,O99 '04 DODGE RAM STK#8019A 13.l 90 '04 DODGE RAM 1500 SLT 9 STK#73050A.................. ......... 14 0S '04 DODGE RAM 2500 149 STK#72116A '05 DODGE RAM 1500 469 STK#7668A..... .... .... .1 .9. '07 DODGE RAM 1500 SLT STK*7743B ..... ... .. ........ , '07 DODGE RAM 1500 4X4 STK73274A . ... 18, '06 DODGE RAM 1500 9 STKf707738 1 .8 '04 FORD F-150 EXT CAB XT 4X4 STK0227A. ........ .. .20,990 '04 FORD F-250 4X4 STK71997A ...... .............. 20,U0U '05 TOYOTA TUNDRA STK#T73024 e '04 FORD F150 XLT 4X4 STK7513A.... ............. ....... 2 .9 0 '06 NISSAN TITAN STK#73013A .... .....2... 5.890 '07 CHEVY AVALANCHE LS STK#63573A .. .. 7.99, '06 FORD F350 DIESEL 29,90 STo7O68 5A ,E 2005 DODGE '00 DODGE CARAVAN90 STK#72695A. .............. .. ...... 9 0 '04 DODGE CARAVAN sTK#78170A 8990 '03 DODGE GRAND CARAVAN STK72-70A .... '03 MITSUBISHI OUTLANDER STK#72409A... .......... 0,990 '05 DODGE CARAVAN STK72676A 13,990 '05 DODGE CARAVAN STK#7274A. .14,980 '06 CHRYSLER TOWN & COUNTRY 5 STK#728768A 1,990 '04 TOYOTA SIENNA 1890 STK8029B. ......... .. ............. 19;99 '06 DODGE GRAND CARAVAN STK#70249A .. .. .... 1 0 '07 CHRYSLER TOWN & COUNTRY STK#70792A... .............. 1 7:990 '06 DODGE CARAVAN18 STK473334A ........... ............ 1 8 0 '07 DODGE GRAND CARAVAN STK*PL7080 .. .. ..... ...... 18780 '07 DODGE GRAND CARAVAN STK#PL7076 10,890 '07 DODGE GRAND CARAVAN STK#PL7090 "19,990 '06 DODGE GRAND CARAVAN STK#71852A. ... 1. 8,90 '06 DODGE SPRINTER STI#72997A ,990 STK#7720A ONLY gUp Plr I iT MI Thursday, August 2, 2007 Serving the communities south of Lake Okeechobee Ilillmillf-ilINIMI ITIhUrOUdav .M Auaus 0tc Thiw ran ut arc II r Fpluat S AM, t "Copyrighted Material S-Syndicated Content - Available froni Commercial News Providers" "a 0M n ow I Save money on your favorite grocery items. I I Go to newszap.com to download and print coupons online! I I neWSZap.com Community Links. Individual Voices. I L J----------------------- - - 0 - Q 10e-Hy.Clw istonFlori SO 3-983- 0 @ Ag commissioner praises farm bill TALLAHASSEE Florida Ag- riculture and Consumer Services Commissioner Charles Bronson and state agriculture industry leaders are praising Florida's con- gressional delegation for their hard work on the 2007 Farm Bill, which they say will benefit Flori- da's agriculture industry and con- sumers alike. The U.S. House of Represen- tatives passed the Farm, Nutri- tion and Bioenergy Act of 2007, referred to as the Farm Bill after several days of debate. Commis- sioner Bronson says the bill in- Sludes provisions that will help ensure Florida agriculture has the tools it needs to remain a vibrant contributor to the state's economy and provides school children with healthy, nutritious fruits and veg- etables. The bill will be taken up by the U.S. Senate in September. "Congress has recognized the importance to our economy of specialty crops which make up 50 percent of all cash receipts," Mr. Bronson said. "Given that Florida is the second largest producer of specialty crops in the country, clearly we are extremely pleased with the results." Representatives of Florida's agriculture industry joined Bron- son in expressing support for the bill. "We're very pleased that the House of Representative has rec- ognized the importance of spe- cialty crops and have designated $1.7 billion in mandatory fund- ing for important nutrition and other programs that will benefit not only our producers, but the health and well-being of Ameri- cans," said Mike Stuart, President of the Florida Fruit and Vegetable Association. Michael W. Sparks, Executive Vice President/CEO of Florida Citrus Mutual said, "Florida citrus growers salute the U.S. House of Representatives for passing the 2007 Farm Bill. The funding boost this Farm Bill will give cit- rus greening research programs "This is a great day for Florida agriculture. Never before has a farm bill been as beneficial to our state. Not only does the House passed farm bill maintain a safety net for program crops but includes an unprecedented, amount of support for fruit, vegetable and specialty crop production. I am pleased the bill also strengthens our commitment to conservation programs and encourages renewable energy initiatives." John Hoblick, President of the Florida Farm Bureau offers hope that we can unearth a scientific solution to the insidi- ous disease which is threatening the very foundation of our $9 bil- lion industry. Research is already in the pipeline and it is essential that it continues unabated. We will continue to work hard in the coming months to ensure the U.S. Senate passes a similar ver- sion of this bill." "This is a great day for Florida agriculture. Never before has a farm bill been as beneficial to our state. Not only does the House passed farm bill maintain a safety net for program crops but in- cludes an unprecedented amount of support for fruit, vegetable and specialty crop production. I am pleased the bill also strengthens our commitment to conservation programs and encourages renew- able energy initiatives," said John Hoblick, President of the Florida Farm Bureau. Executive Vice President of The Florida Nursery, Growers and Landscape Association (FNGLA), Ben Bolusky, also praised the bill saying, "We applaud the U.S. House of Representatives for its passage of the Farm Bill. It gives long overdue recognition to the major economic role played by nursery and other leading spe- cialty crops in American agricul- ture. What is most meaningful to Florida's nursery industry is the Farm Bill's landmark and wel- come emphasis on specialty crop research, pests and diseases, risk management and conservation. FNGLA looks forward to working with the U.S. Senate to ensure the very best Farm Bill for Florida's specialty crop industries." Executive Vice President of the Florida Sugar Cane League, Dalton Yancey remarked, "Flori- da's citizens will benefit from the passage of this Farm Bill which creates billions of dollars of eco- nomic impact to the State from the sale of agricultural products. Agriculture is an important con- tributor to Florida's economy. Now, onto the Senate for the completion of a good bill." Unlike the 2002 Farm Bill, this bill for the first time provides sub- stantial funding for the fruit and vegetable industry. These spe- cialty crops make up a significant portion of Florida's agriculture industry. The bill provides $1.6 billion for specialty crops com- pared with $200 million dollars allocated in the 2002 Farm bill, not in the form of subsidies but for research, marketing and pest management. This includes fund- ing for research to develop more resilient crops and combat pests and diseases which constantly threaten Florida farmers. The bill also helps U.S. farmers compete more effectively in the global marketplace. "Florida knows all too well the 1 ; J < costs associated with a devastat- ing agricultural pest or disease," Mr. Bronson said, "From MedFly to Citrus Canker, our experience showed us that there were statu- tory roadblocks that prevented federal and state agencies from effectively reducing pest and dis- ease threats. That includes sur- veying for pests and diseases to catch outbreaks early and quickly accessing federal funds to deal with outbreaks when they do occur. This bill removes those roadblocks and creates a system to more efficiently protect agri- culture." The Farm Bill also expands the Fresh Fruit and Vegetable Snack Program which provides a variety of fresh produce for schools and increases purchasing of fruits and vegetables for all federal nutrition programs. It expands popular conservation and environmental protection programs including the nation's forest resources. The bill also makes new investments in renewable energy research, development and production in rural America. BREAKFAST SPECIALS LUNCH SPECIALS MONDAY FRIDAY MONDAY FRIDAY TOUCHDOWN....................$4.69 HAMBURGER PLATTER.......$4.99 Charbroiled beef patty cooked to 2 large pancakes, 2 large eggs, order and layered with swiss cheese 2 strips of Bacon & 2 link sausages and sauteed onions & mushrooms. FRENCH TOAST COMBO...$4.69 Served with french fries, cole slaw or 2 wedges of golden french toast, 2 onion rings large eggs, 2 strips of bacon & SLIM & TRIM..............$4.99 2 link sausages Charbroiled beef patty cooked to order and served with cottage BREAKFAST CROISSANT.....$4.69 cheese & sliced peaches 2 scrambled eggs topped with ROAST BEEF FRENCH DIPS..$5.99 cheese & 2 slices of bacon & served Tender slices of rost beef on a with home fries, hashbrowns or grits hoagie roll. Served with french fries BREAKFAST SKILLET..........$4.69 and au jaus sauce Scrambled eggs with bacon,sausage, TACO SALAD................$6.59 onions, tomatoes, pepper, & potatoes, Crisp salad greens in edible tortilla topped with cheddar cheese. Severed bowl, topped with delicious chilli, with hashbrowns, home fries or grits, shredded cheese & diced tomatoes toast & jellies and sour cream & chucky salsa WEEKEND SPECIALS ANY OMELETTE FROM OUR MENU OR COUNTRY FRIED STEAK & EGGS ...................... $6.19 Served with home fries, hash browns or grits & toast with jellies DINNER SPECIALS 2 SENIOR DINNERS FROM OUR SENIOR MENU INCLUDING SCOOP OF ICE CREAM OR PUDDING........$11.59 ALL You CAN EAT FISH OR SHRIMP 4-11 P.M. FRIDAY & SATURDAY SERVED WITH FRENCH FRIES & COLE SLAW ..........$10.99 The patient ald any olher person responsible for payments has a right to refuse to pay, cancel payment or be reimbursed or payment for any ollher service, examination or treatmlen that ispetrlrmer as a rasu tof and within 72 hours of responding to the adverlitsmenrt or the free, discounted tee orreduced fee service, examination or treatm nt. newszap.com CommunityLinks. Individual Voices. S ALFORD AIR CONDITIONING INC. 65 Diagnostic Fee jo -etel Sewice o.S. Fire Marshall Statistics show 11% of all house fires re used by lock of moinltenance on healing equipment. 15%on aloil air condition equipment. 9m hamnit (Ctimed (9pei ted fd1pt 4 30 e' 80 DON'T BE A STATISTIC TB ETI Residential Commercial Marine 863-946-0025 alar 25400 State Road 78 Lakeport, FL 33471 I"......... > CAC7874077 Statewide A Serving the communities south of Lake Okeechobee Thrrsdlav, Auqust 2, 2007 I -* - M oe . 'W o o O . - - Sevn h omnte suho aeOecoe TusaAgs ,20 s sfi ed S877-353 2424 iM. ABSO.5 for any personal items for sale under $2,500 Merchandise Mobile Homes jiI HjIiing F:~~ii. III1 Financial j Rentals IR Automobiles kliig. pii s. r .i ,ii -':a a- More Papers Mean More Readers! J -Reach more readers when you run your ad in several papers in our newspaper network. W NOur newspaper network consists of eight papers one daily and seven weeklies. An ad run in all these newspapers will reach more than 164,000 readers*! Call Today For Details! * Sources: Pulse Research Market Survey; Simmons Market Research; INI Market Research Center SRules for placing FREE ads! AIII A To qualify, your ad . be for a personal item. (No commercial items, pets or animals) Must fit into 1 2 inch (that's 4 lines, approximately 23 characters per line) Must include only one item and its price S (remember it must be S2,500 or less) No Fee, No Call us! Catch, No Problem! Announcemelts Importari Irformal.:.n Pleas;e read your ad carefully the first day it appears. In case of an inadvertent error, please noti- Sus pnor ic the ia,,dhIne iril ed We "ill not be re .p.On.sble for more than I incorrect insertion, or for more than the extent of the ad rendered val- ueless by such errors. Advertiser assumes response. ability for all statements, names and content of an ad, and assumes responsibility for any claims against independent Newspapers. All .ade'rnsrin, is subject to aublisher ie.er Iri'irvg ucc pMl r., advlimerrert hal ~ ll-gal o, i.n deredd tTaudulti,,l Ir r 11 cases of questionable value, such as promises of guaran- teed income from work-at- home programs or other offers to send money in advance for a product or service we advise you to check with the Attorney General's Consumer Fraud Lne at 800i) 2 5424? and/or The Betior EBus'r.5l- Bureau, 800-464-6331 for pre- vious complaints. Auctions 105 Car Pool 110 SShar a rids 115 Card of Thanka 120 InlMemorlam 125 Found 130 Last 135 Give Away 140 Garage/Yard Sale 145 PIeromas 150 special Notices 155 900 Numbers 160 24/7 Online Auction City of Miami, FL Closes August 9 Boats: '97 Larson 25ft., '94 Bayliner 24ft. & more. 7% BR. Online Auction! Foreclosed, bank ordered. Construction equipment, drum roller, sweeper, forklift, air com- pressor, more. Bidding ends August 28, 2pm. 10%BP AU479, AB296, (800)323-8388,- lauctions.com. CEMETERY LOTS (2) in Forest Lawn Central in Ft. Lauder- dale. $2000 for both, or best offer. (863)763-8790 DACHSHUND MIX, Small, Red, Male. Found in the vi- cinity of Out West Farms. (863)467-6122 CAT, Neutered, Orange/Cream w/white markings. Missing from Shenanigans. Reward. Nds meds. 863-357-3697 DOG: Big, Brown, Brindle, Fe- male in Ft. Denaud area. Re- ward. (863)674-0321 DOG, Small, Norwich Terrier, Light brown. Male. Taylor Greek Isles on 7/20th. Dearly missed. (863)763-6646 MALTESE'S- (2) 6 & 7 lbs, vic of 100 Block of NE 3rd St, Belle Glade, Children's pets. Call Ines (561)985-7570 UI a.ge YajrdSl^Bes iri.p a Notice U..arage/ *~eca Noi CANNON HAMMOCK CONTRACT/LEASE AGREEMENT Applications are being accepted for a Con- tract position for Caretaker & Security, combined with an On Site Residential Lease Agreement, for Cannon Hammock Park. Park is located on Dooley Grade off of CR.#835, South of Clewiston. Applica- tions will be accepted by the Special Dis- tricts Department, where site visits & interviews will be scheduled. Position open until filled. (863)675-5252.. Emlymn FullTim Emloyment FullTim e: 020I Driver Have The "Drive" For Success? Then bring your experience as a Driver to the Clewiston loca- tion of PRAXAIR, an industrial gas distribution leader! Must have customer service skills and current Class B CDL with HazMat. To explore Great benefits including Excellent Starting Pay, 401 (k), and Bonus Program, please apply online at: referencing job # 0701027. Mandatory background check and drug screen. EOE m/f/d/v PRAXAIR. PAPILLON PUPPY- 9 wks old, 36 Terrace SE near Ever- glades Elem. 7/16. Wh/br w/bl ears. Reward (850)758-7103 KITTENS- to good homes, lit- ter trained, about 7wks old, (863467-6839 or (863)634-7719 MERCURY OUTBOARD, V6, 150, power head, other parts. (863)674-0375 PUSH MOWER- Murphy Se- lect, 20", mulcher, good f or parts (863)675-7878 WINNEBAGO- Free, As is. You pick up. (863)634-2684 SHORT HAIRED CAT- Beauti- ful, Spayed female. In/Out- door. Free To Good Home. Please call (863)357-3325 AMERICA'S DRIVING ACADE- MY!! Start your driving ca- reer today! Offering courses in CDL A! Low tuition fee! Many payment options! No registration fee! (888)899-5910 info@ameri- casdrivingacademy.com. Eimpoyen Full Tim Become Dietary Manager (av- erage annual salary $40,374) in eight months in online training program of- fered by Tennessee Tech- nology Center. Details, (888)986-2368 or e-mail pa- tricia.roark@ttcelizabeth- ton.edu. Learn Tax Preparation And possibly earn extra money doing taxes.* H&R Block Income Tax Course Enroll Now!, For information and locations call 1-800-HRBLOCK or 1-863-385-1052 or hrblock.com/taxcourses or visit your local H&R Block office in Okeechobee, Clewiston & Belle Glade READING A NEWSPAPER HELPS YOU GET INVOLVED IN THE COMMUNITY Wonder newspaper readers hove more funl Emplomient Full Time t Employment Full Tim * Cage Supervisor * Computer Operations Manager * Dishwasher * Line Cook * Maintenance Worker * Players Club Representative * Prep Cook * Public Space- Floor Attendant * Restaurant Server * Sous Chef * Steward Supervisor * TAD Floor Supervisor * TAD Machine Technician SHENDRY REGIONAL MEDICAL CENTER "'wiere It'sAaJTbout getting Better" LPN orI (FT, ,Pcrdtem) FL LPN Lic. & IV Certi. Willing to work flexible schedule. Full time-ERRNImSta~LSupeisor Valid FL lie. Min 3yrs exp., ACLS, PALS reQ. Pedlem RN Nursing Superisor Valid FL RN lic. 5 + yrs. clinical exp. Must have 3 yrs charge or supervisory status. ACLS PALS req. Per Diem- C.NA or CNA Monitor Tech Must possess a valid C.N.A Cert. and exp. monitoring rhythm recognition. ull time Registered Nurse Must possess a valid FL license w/at least I r. exp in area of expertise. Full time- CT/Radlologc Technologist Attended a IRCERT school, must be ARRT registered with a valid FL License to practice Radiologic Technology Must have 2 years CT exp. Full time Oftce Manager (LaBelle Clinic) Candidate should have a minimum of 3 yrs medical office manage- ment exp In a physician's office, Position reQuires skill in developing and maintaining effective relationships with medical and administrative staff, patients, and public. Full time Outpatient Registration Clerk 2yrs exp In a healthcare related field pref. Must have strong customer service and computer skills. Part time- Insurance Biller 3 plusyrs in a hospital or medical office setting pref with at least I yr each of electronic billing and collections. Must be knowledgeable of third party re-imbursements, co-pays, medical terminology, and UB- 92 and 1500 claim forms. Full time Patient Coordinator (HFCC) Previous exp in a med office setting and bl-lingual pref. Knowledge of medical terminology is a plus. Full time- Medical Assistant (HFCC) Must have a medical assistant certification and medical/ clinical back- ground to assist physician practice.'regionaLorg Phone: 863-902-3079 or Fax resume to: 863-983-0805 Drug Free Workplace EOE Perform & direct maintenance & repair task for equipment including pumps, piping & structures in water distribution system. 3 years of full time experience in Water/Waste Water plant operations. Distribution System operator license required. Ability to read & understand Engineering drawings & instructional manuals. H/S diploma or GED. Able to be on call 24hrs /7 days per week. Valid FL drivers license. Fax resume to (239)658-1813 Emliymn Full Tim ASSISTANT DIRECTOR OF FINANCE $53,706 $78,227 DOQ/NEGOTIABLE Open Until Filled BA min 5 yrs exp govmnt acctng and financial, valid DL. ACCOUNTANT $35,207 AA; 5 yrs exp govmnt acctng. ACCOUNTING SPECIALIST I $10.82 hrly 1 yr. college/1 hr. exp. ACCOUNTING SPECIALIST II $12.09 hrly 1 yr. college/1 hr. exp. DIRECTOR OF PUBLIC SERVICES $60,729 ann/Exmpt Engineer/5 yrs. exp.; valid DL MECHANIC II $14.24 rly HS/GED, ASE Refrigerant Cert. B-CDL SERVICE TECHNICIAN II $9.56 hrly -B CDL GROUNDSKEEPER $8.71 hrly Valid DL PLANNING AND BUILDING MANAGER $47,989.76 ann./Exmpt BA; construction, or related field; valid DL PLANNER $41,862 ann. $21.12 hourly BA Planning or related field; 4 yrs. exp.; valid DL BUILDING INSPECTOR $20.12 hourly Certified; valid DL PRO SHOP ATTENDANT $9.13 hrly; HS/GED; exp. 6-mths. CASHIER $9.98 hrly F/T & P/T HS/GED; Exp. 1 yr. ********************************************************** Valid Employment Applications accepted at: City of Belle Glade Human Resources Department 110 Dr. Martin Luther King Jr., Blvd. West Belle Glade, FL 33430-3900 8 am to 5 pm weekdays Equal Opportunity Employer Em loy $10 IS ALL THAT STANDS BETWEEN YOU AND A GREAT JOB WITH AVON!! Call Gwen (863)228-5099 BELLE GLADE BEACON DIRECTOR Responsible for develop- ment and coordination of youth, family & community programming. Bachelors degree, 2 yrs supervisory exp, knowledge of commu- nity resources & strong or- ganizational/management skills required. Submit resume to: pbremekamp(5aoco(.org or fax 561-841-3555. CERTIFIED WELDERS & PIPE FITTERS Needed for a project in Belle Glade. Work starts in mid August. Call Altman A/C (561)863-8663 DFWP DREDGE OPERATOR Now being hired at Ortona Sand Company Call (863)675-1454 EVERGLADES FEDERAL CREDIT UNION Now accepting applications for: Two Full Time Positions. Must be proficient in Word & Excel. 8i-lingual a +. May apply in person or mail resume to: 1099 W.Ventura Ave., Clewiston, FL 33440, Attn: Marta or e-mail resume to: morales2(earthlink.net i eAlle Employmen PTwvss~~ - Services Epomn Place Your YARD SALE ad today! Get FREE signs and inventory sheets! Call Classifieds 877-353-2424 Benefits provided for ALL employees Apply in person TODAY! 506 S. 1st St. Immokalee, FL 1-800-218-0007 The Seminole Casino is a Drug-free Workplace FIND IT FAST DIRECTORY! I Serving the communities south of Lake Okeechobee Thursday, August 2, 2007 ME - Employment Thlrcrlel Aurninet 9 9007 UNITED STATES UNITED STATES SUGAR SUGAR CORPORATION CORPORATION Administrative Assistant -Excel Skills Important MULTICRAFT-- MECHANIC/ WELDERS Position Purpose 10 OPENINGS Provide administrative, secretarial, and clerical support to the Sugar Manufacturing and Refinery management team. Hourly Rate $20.06- $21.19 Major Tasks and Responsibilities MECHANICS Assists managers, supervisors, Safety, and Human Resourc- es with day to day issues. Resolves hourly personnel sen- *Safely fabricate, install, inspect, maintain, troubleshoot and iority, vacation, and payroll issues. Processes shift rosters, repair conveyors, hydraulic systems, gear boxes, pumps, tur- job postings, and job changes. Greets and coordinates visi- bines, steel structures, chutes, fans, pipelines, valves, vessels, tors, vendors, and other customers to Sugar Manufacturing. pressure vessels. ABOUT US SUGAR CORPORATION WELDING United States Sugar Corporation is one of America's largest Utilize miscellaneous metal working equipment and process- diversified, privately held agribusiness firms. We are em- es such as arc welding, oxygen/acetylene, MIG, TIG and plas- ployee owned and have great benefits including outstanding ma methods to perform welding functions. medical, 401K, retirement income and employee stock own- ership. The Company is headquartered on the southern United States Sugar Corporation is one of America's largest di- shore of Florida's Lake Okeechobee between Fort Myers and versified, privately held agribusiness firms. Employee owned West Palm. with great benefits including outstanding medical, 401K, and retirement income and employee stock ownership. Headquar- Email your resume to Jdooley@ussugar.com tered in Clewiston on the southern shore of Florida's Lake Okeechobee. o ffi i MSend resume or brief paragraph of experience to Fax 863-902-2889 The Seminole Tribe of Florida Email Jdooleytussuaar.com Stop at the Employment Center on WC Owen Drive. has an opening at our Big AskforJohn. Cypress Reservation Health Clinic ...... .... for a Community Health Rep.: Driver Wanted! Home Health for patients., We are looking for a minimum CDL transport, assist in clinic, vitals, "B" with Hazmat who is looking for draw blood. HS dip. & previous a better opportunity. Our starting health care experience required. better oppo nimum of $13.0 par pay is a minimum of $13.50 per SLic: hour and we guarantee a minimum Valid FLDriver's Lc. required. of 45 hours per week, plus quarterly: esume to: cash bonuses. In addition, we offer galtman semtribe.com or a benefit package that includes fax 954-967-3477. Details @ Health Care, fully paid short and long term disability, life insurance and a 401K retirement program with: : matching employer contributions. : S Cut out the long commutes and A call this LaBelle company today. 800-330-1369. Home visitor position with Healthy ... 8003301369. Families Program at Hendry County I Health Department in Clewiston; MAINTENANCE TECHNICIAN knowledge of child development & For Clewiston apartment complex. cultural diversity; must have valid Florida Must have knowledge of painting, driver's license, reliable transportation, sheetrock, carpentry, plumbing, & ability to travel; Background screening electrical, HVAC repairs. &fingerprinting required. EEO/AA Send Resumes to: Apply on line: Greentree East or P shearwater FL.Box Call Jeannie @ 863-983-1408 FAX 727-447-2252 x 532 for more details Equal Employment Opportunity !Hus--Sl 1 :o e S -Sa le 1n The GEO Group, Inc. The GEO Group, Inc. A worldwide leader in privatized corrections BENEFITS INCLUDE: HEALTH, DENTAL, VISION, LIFE, DEPENDENT LIFE INSURANCE & 401K RETIREMENT NOW HIRING For Facility Expansion Correctional Officers .Sergeants Lieutenants Production Supervisor Assistant Business Manager Dentist RNs MOORE HAVEN CORRECTIONAL FACILITY 1990 East SR 78NW Moore Haven, FL 33471 Phone 868-946-2420 Fax 863-946-2487 Equal Opportunity Employer M/F/D/V Ii.fi m I OpertrM ant HS diploma or GED equivalent, FL Drivers License. Operate heavy equipment. Semi-technical maintenance preferred. Good record keeping skills. Water/Waste Water experience preferred. Fax resume/applications to (239)-658-1813 rcpe les Teresa Sullivan :.. 4:"*; ^^E^^I vSEsiK Your Realtor For L Rf 100 e..... a, aZ....,, 11F17111 -- 'h- 4 I".. as;. ~si 561-795-8533 TeresaSullivan-Remaxcom 1 L! 2007 3/2, 1 car garage, circular driveway on paved road in Montura Only $249K 4)2Die l -. 1 i.,,. . could want. Land & 4BD house $24.1,001) 5) Inwcstntt Oppwttifno ty 2 1 2 B a,1 3 ,I near O ......, $145K ,. ,I '.ii. , 6) 42 $19,9IX) Absolutely the best value for your S$ Nortlsidec New Everything 7) Reduced Again Bank Fomreltmr Investor's Dream! 3/2 -426 'linidad $119.9 Bring All Offers! Call Sam or Ashley 8) Fire Sale! Cash only Nortlside under 9) 2.5 acres Piotnec week- end get away Reduced to $188.9K Call Enrique 10) A Uv .IO 3/2 on 1+ acr-.W4i $S110K MLS# 200718617 11)RE'DUCED AGAIN Sugarland Etates 3/2/1 CBS (2005) Tiled thru, out. $235.9K 12) Lakeport 2/2/1 CIS Ilome on 25+ acres -2 acres planted wi oak trees. Perfect for mirsery 13) Hlanlyman Special Fixer upper located on 2.5 acres in Fiighole. Very Secluded $219K Call Litan 14)Ventura Ave. 2/1, would make a great starter horne $109,900 Call Enriqne 15) NEI NEW\' NEW CBS Ilome almost $S~EPENDINCG 16) Brick Ilome w/ pool. Come & Get It! Perfect in every way @" $299K 17)Supnrl.id Estates C13S ,.i SOLD k.. . I.: '-NS 11 , 18) 3/1 CBS Home in Harlem., lI Maintained, large yard only $119.9K N~Jw Construction 1)Wlhoire "R" The Buyers? CBS 3/2/1 Models available call us today! Waterfront Homes 1) Calosahallclrhe River 3/2, boat lift & dock, hasemlentilnimnaculae and prisrile for $540K MLS #200712337 Mobtila H omA 1) Art Lawrence 3/2 MH on 3.13 Acres just outside out of town! MLS # 2(X)68X788 2)lFbutlos 55+ (oni,,nuitt)' in Mxoore I laven. Many amenities Furnished only $145K Cill Ashley 3) Ladeca-liome on 10 ac with pond, only $289.9K, Call Samt 4)Reifrc'd 31R, 2 114 on a 1/3 acre very nice .nd clean fenced yard. )>3KC9$74.9K 5)Baek on dhe Market & Reduced Your .Dream Yardl 3/2 DWMH on 1.25 acres, lots Oak Tree next to Canal only $100K 6)Ladeca! 5 ac. zoned A-2. prop. incl. 1990 2/1 MH asking $135K Call Sam 7) Sportsman \ ll ,' Call AsB -y ii.tf1 Mainttiaoimd DWMIH w/ tmetal .... ;SOLD! .. e, sheds, irrigation, pool, too many extras @ $120.9K 9) Huge 4/2 DWMH in Moore Haven, tons of upgrades, DBLLot only $145K Call Ashley 10) Mini Ranch on 10 +/- Acres with Manufactured Home on Al Don Farming Road $489K l l)Beautiful 3/2 Mil name $89.9K Vacant Lawn 1)Buy 5 or 20ac .5ac parces in Ladeca, asking $95K each Call San 2) Monuitm Lots starting at $23,500 Cll Enrkilte 3)2 Ac. Cteared on Davidson Rd. $140K MLS# 20)0693222 4) CR833 2.5 acres possible commercial $89K 5) Great Deals in Montura! Call Sam 6)10 ac in Ladeca with pond ,239.9K, call Sam 7)Port LaBelle Lots starting at $26.6K call l)Net' Condos 2/11/2 2)836 Tlhatcher Blvid. GarayS $1,150 month w/ Se HablaEspatol $1,150 Security 863-2284798 3)Smer Self Sitonge - units available. Call for more information. Commertcal 1) tl.vt.sr'niRt Opitusrity 3 Duplexs on 'liinklad Ave only $385K MarIbel Gonzalez SeHabla Espalol 561-722-7347 537 Osceola Ave 4/2 $199,900 Absolutely the best value for your $$ Northside New Everything Acosta Se Habia Espatrol 305-5065876 Located Inui Cle >t Ci l.ntu st IldeSi(abl ,i.deiC..nBtr, H.en Fr, fev d Settar Thb neighborhoods. 4/3 CBS Custom Built Home 3/2 CBS home has cathedral ceilings, large master withnmrethan 3,200sq ft! CallTodayl $399,000 suite,plaground.&ne-! Prisdto Sel@$249,000 CLEWISTON *3/2.5 Ridgewood Subdivison, 4 car garage, large pMol, & more. $439,000 *4/2.5 CBS w/brick, Irg lot $249,900 S2/1 Home on Sagamore Ave. $130,000 *2/2 MH, Seminole Manor, carport, dbl garage, furnished. $125,000 *3/3 MH w/Lrg Screened Porch. Seminole Manor. $120K Make Offer *3/2 Log Sided MH, Waterfront w/ seawall, .48 acs, fenced. Priced to Sell @ $119,000 MOORE HAVEN / LAKEPORT 3/2 '05 CBS Home SHIP Eligiblc$159,000 *2/2 Palm Harbor, 55+ Community, upgrades & extras galore! $142,500 *Like New 2/2 MH w/irg sunroom. MH Yacht Club. Reduced to $118.5K * 2/1 MH-Lnkeport with direct Lake "O" Access. Reduced to $109,000 Owner Motivated *3/2 MH, fireplace, completely fenced. $92,500 PIONEER / LADECA / FLAOHOLE *.2 Brick Home,Oak St, +2000sq tonsof storage, hurricane shutters & more. $297,500 S * 33 ac lot in Port LaBelle Reduced to $59,000 *2 lots. Horseshoe Acres Only $59,000 * A Rare Find in Lakeport Community! 10 acs. Oak filled lots. $55K per ac. Owner Will Divide SHighlands Co. 10, 28, & 80 AC parcels starting at $23,500 per ac. S.22 ac MH lot in Clewiston $20,900 SBuildable lot located in harlem. $15,000 SMobile Home lot in Harlem $10,000 MONTURA S1.88 AC with MH for only $105.000 S1 0 r.nt. ,vnilahle Startino at $30.000 S ort-tga .e uroterU 11 t: wwAWSRALSMTE Luan B. Walker, CRB Lic. Real Estate Broker 863-67701010 Wood, GRI 863-228-1132 1 nurl~a yd IA ur LI L r-, 9 VV- Employment i 11 Full Time Employment Full Time 0205 YOUTH PROGRAM COORDINATOR S At Belle Glade Beacon Cen- ter. Must have degree, 2 years supv. exp & good computer skills. Submit resume to: The GEO Group, Inc. kengle@gocpg.org or fax 561-841-3555 EOE/DFWP The GEO Group, Inc.EODF A worldwide leader in privatized corrections E o BENEFITS INCLUDE: MATURE WOMAN SEEKS F/T HEALTH, DENTAL, VISION, LIFE, DEPENDENT General Office/Bookkeeping LIFE INSURANCE & 401K RETIREMENT position. Avail. to start im- mediately 863-763-7268 CORRECTIONAL OFFICERS I RN (2 available) CONTROVERSIAL FREE RE- PORT: The 7 Great Lies LIBRARIAN about Network Marketing They Don't want you to ACADEMIC INSTRUCTOR (2 available) know: Learn how they get people to come to them. DENTIST- PAYROLL CLERK ing.com. REAL PEOPLE Real Wealth: Quit contemplating change, reclaim your freedom! End- MOORE HAVEN CORRECTIONAL FACILITY less prosperity with our sys- 1990 East SR 78NW tem/training and your strong Moore Haven, FL 33471 desire.- Phone 868-946-2420 purpose.com. -Fax 863-946-2487 in cial Equal Opportunity Employer in i M/F/D/V Request for Applications Business The Barron Water Control District, a government independent Opportunities 305 agency, is now accepting applications for the position of Money Lenders 310 Clerk/Receptionist. Tax Preparation 315 Qualifications: (1) Experienced in Excel and Word, (2) Good Secretarial Skills, (3) Valid Driver License. Applications may be obtained at the office e theDistrict located at 3293 Dellwood Terrace, Port LaBelle, FL. Office hours are from 8:00 A.M. to 4:30 RM., Monday ACT NOW! Sign-On Bonus 36 through Friday. The phone number is 863-675-0346. to 45cpm/$1000+wlD y O Lease/$1.2Opm CDL-A + 3 Barron Water Control District is an equal opportunity employer mos OTR (800)635-8669. and qualified applicants are considered without regard to ALL CASH CANDY ROUTE Do race, color, religion, sex, age, marital or veteran status, you earn $800/day? 30 Ma- chines, Free Candy All for $9,995. (888)629-9968 8]02000033. CALL US: We w2000ill not be undersold! "Can You Dig It?" Heavy Senior Accountant for a large family owned Equipment School. 3wk group of agricultural businesses in Clewiston. training program. Backhoes, be responsible for overseeing of the Bulldozers, Trackhoes. Local Willbe responsible for overseeing oftheob placement asst. Start Accounting Dept. including financial reporting, digging dirt Now. Call budgeting, financial analysis, pension, payroll (866)362-6497 or taxes, bank reconciliations, etc. Must be able (888)707-6886. to handle tight deadlines, multiple tasks and Driver: DON'T JUST START maintain consistently accurate performance. YOUR CAREER, START IT 4 yr. degree in Accounting (CPA preferred) RGHT! Company Sponsored 3 CDL training in 3 weeks. with at least 5 yrs. exp. Please forward your Must be 21. Have CDL? Tui- resume & salary requirements to: tion reimbursement! CRST. jmh(hilliardbrothers.com orfax 863-983-5116 (866)917-2778. GREAT FIRST JOB!! 18-25 Coed. Must be able to travel. $500 sign-on! No Experience I tin INecessary. Will train. Ex- penses paid. Boys, Boys, Boys. Call (800)988-0650, DAILY WORK DAILY PAY (877)KAY-CREW ALL TYPES OF WORK AVAILABLE OTR drivers deserve more pay and more hometime! LA.BnR <4 FUNDE $.42/mile! Home weekends and during the week. Run 202E.Sugarlad Hwy.1A n on ClewistonIn) our Florida Region! Heartland (863) 902-9494 Express (800)441-4953. -usSe05 ossa -Hus -Sl12 I I_ _i_ ___ Serving the communities south of Lake Okeechobee Houes Sae 125 I Houses Sale~ i ICB ..... ..... C ~ International Cultural Ex- change Representative: Earn supplemental income placing and supervising high school exchange students. Volun- teer host families also need- ed. Promote world peace! (866)GO-AFICE or. International Cultural Ex- change Representative: Earn supplemental income placing and supervising high school exchange students. Volun- teer host families also need- ed. Promote world peace! (866)GO-AFICE. Notice: Post Office Positions Now Available. Avg. Pay $20/hour or $57K annually including Federal Benefits and OT. Get your exam guide materials now. S 866)713-4492 USWA Fee eq. TRUCK DRIVERS: CDL train- ing. Up to $20,000 bonus. Accelerate your career as a soldier. Drive out terrorism by keeping the Army National Guard supplied. 1-800-GO- GUARD.com/truck. I I^BBS OWNER OPERATOR SOLOS- NEW SELF STORAGE CHEST FREEZER, Like new. FLATBEDS. $1,000 Sign-On 46 units 7x15, 8x15, 10x15, $150 (863)675-1113 Bonus, Industry leading pay, 10X30, 12x30, 15x25. Full HOT WATER HEATER- 40 gal. $2500-$3000/Week! South- electric, secure on Commereio with pan. Electric. Brand new west Regional Runs, St. 350 ft. from Clewiston $150. (863)467-4497 2,500-3,000 Miles/Week Police Dept. 863-983-6663, Home Every Weekend! Top 863-983-2808, after hrs. KENMORE MICROHOOD- Industry CPMs! Excellent 863-983-8979 Brand new in box, white. Equipment, Top Benefits $100 or best offer. Package Available! FUEL @ (863)634-6396 $1.25/Gallon! Call Merhanlise MINI FRIDGE- $50. (888)714-0056.- r d3)447-81 linetransport.com. (863)447-5882 WORK FROM HOME, Ambi- I. I i STOVE, Kenmore, electric, tious Reps. Run Own Travel with new circuit board & Company. No Exp. Req'd. burners. $100 $1,000's Paid Weekly- In Air Conditioners 505 (863)467-2507 Commission, Bonuses & Antiques 510 Travel Perks. Appliances 515 WASHER & DRYER- Kenmore (877)767-3551, ask for Don. Appliance Parts 520 70/80 Series 1 year old. Like Beauty Supplies 525 New with 2 year warranty Bicycles 530 $600. 720-284-4018 Books & Magazines535 ,Sr s i Building Materials540 WASHERS & DRYERS Business Equipment 545 STACK UNITS $AVE MONEY ON GASOLINE! Carpets/Rugs 550 $95 & up, Upto 1 yr warranty MAKE MONEY ON GASO- Children's Items 555 REFRIGERATORS & STOVES LINE!! ASK ME HOW!!! China, Glassware, Etc. 560 (239)694-0778 Phone: (954)882-7629 Visit Clothing 565 Us on The Web:- Coins/Stamps 570 . bigoil.com. Collectibles 575 Computer/Video 580 Series Crafts/Supplies 585 Services Cruises 590 SHEDS (2). 1OX16, Very Drapes, Linens & Fabrics 595 clean. $1600 wil separate f__T_____ Fireplace Fixture 600 (863)228-2933 Firewood 605 Furniture 610 Furs 615 Babysitting 405 Health & Reducing Child Care Needed410 Equipment 620 All Steel Buildings. National Child Care Offered415 Heating Equipment/ Manufacturer. 40x60 to Instruction 420 Supplies 625 100x250 Factory direct to Services Offered 425 Household Items 630 contractor or customer. Insurance 430 Jewelry 635 (800)658-2885- Medical Services435 Lamps/Lights 640 building.com. Luggage 645 Medical Items 650 SMiscellaneous 655 Inrtn Musicallnstruments 660 M i Office Supplies/ DELIVER OUR Equipment 665 GLASS LAMINATED DOOR PRECIOUS CARGO: Pets/Supplies/ WINDOWS (2) 34x76, asking Be a Hendry County Services 670 $50 (863)635-3627 School Board Bus Photography 675 Driver. Contactthe Plumbing Supplies 680 METAL ROOFING. SAVE $$$ Transportation Dept. Pools & Supplies 685 buy direct from manufactur- at 863-674-4115 or Restaurant er. 20 colors in stock with all Cheryl Jameson at Equipment 690 accessories. Quick turn jamesonc@ Satellite 695 around Delivery Available.. hendry.k12.fl.us Sewing Machines 700 (352)498-0778 Toll free Sporting Goods 705 (888)393-0335 code 24. Stereo Equipment 710. Television/Radio 715 Tickets 720 PLYWOOD (50 sheets): $300 WANTED: 10 HOMES To Tools 725 for all. Call (561)762-4620 Show Off Our New Lifetime Toys & Games 730 Jupiter area. Exterior Paint. Call Now to VCRs 735 see if your home qualifies. Wanted to Buy 740 TEMPORARY SEPTIC TANK- 8 0 0) 9 6 1 8 5 4 7. Plastic, 18"Hx41"Wx 72"L. Lic.#CBC010111) $125. (863)288-8884 -ouse -l-Hm-H Hesae Sevn h omnte suho aeOecoe TusaAgs ,20 iV w S. --'. ..-. - -- : -',. 7!:- :":-.' .'- :;x -, r-~-" --.- -. '', ;. ; .L 2. __-4-.F =- .: .:. +. '`r"" SZi-c / r.r ... . ro perties .... ..... . ... Service. Excellence.Results Phone 063-946-3900 498 US Hwy 27. Moore Haven iEVERGLADES Jefftey A. Davis:, F !. .i.. 8REALTY, INC. ENTAL S, RE_ N TAL.S RE NTALS!!1 Wr I h ttASI OSiK). Ru.' ii t ', .Rf 1 N( ~ s'o r`f MflN(1 1C ~f OxS~u\N xBA I~ ItT'O5K SS~iNM C ',AI~vSN(. v t:,1f 000 i'va MflNCHIOA 2USII~uA1n N r dm W' li r A aretu font brN a a BuytOn bin 3 N IOIVIK A Inn la I I. I; id $129,000 ANEW' )'t f.' Prn'ic ;I N' Ap c ; ; I -n 1 ,., t$1 29,000-12 11 -1,-n W. u I,, II.. .I ,',s. I l$1;T 0 0 i. M. I o.1,4 'NI 1 T 11 41 TiuI)H F-{~m~f Nli farl' ib, j,3 I''~.'.'.~I .0, itOi. 0, 11 Thi, H mit Hal t All 1 w!Ui i ~ ~r Wit~r 11 I kepted B-AMoief Access. This Homie r hasml Cs iLh oIl CS and , .1 Til'et Coln-- Vaulted '.'.,' '. I . GREAT'Price f;-,t 'I. al n."'t I WaterFront Praoerty Gorgeons 3BR210A Mobile Home Partially Farutsl1d in an over ,--I c. h Conmiurorsmisanyl int w, o h'a 557 CoSmunity rw many Eastas to list, a73 Yacht :,d Park of Cle1 i: ... i" 1ew FOR RENT $1,200.00 OR RENT/OPTION TO BUY $175,0' BEAUTIFUL, READY TO MOV BASS CAPITAL TOWHOUS: 2 BEDROOMS 2 BATH, FURNITURED/UNFURNITUR Owner agent STANTON MOBILE HO Quality Homes at Discounted Pric Homes From the Low $50 s Turn Key Packages Available. Family Owned Since 1981. IttJACOBSEN N__ ScotBilt 00.00. E IN, E, ZED. TIMES cest MAN fsoa we g~l New Block Homes Three Bedroom Two Bath Home including Lot. Price starting at $135,500 Four Bedroom Two Bath Home including Lot. Price Starting at $168,500 Visit Out Website To Pick The Home Of Your Dreams Office Phone (863) 465-1371 Fax (863)465-7716 Cell (863)441-4202 RPitl. ul. .:l r h, 1Ia r l l. .,ll, er Il...1 > |I t ,l l, ,1 ,II l-.,ll.,.l .. |I PL ..,I ..,,L IlL L L .' <11 ,i ., ol-lP. 1 .. :. ,, , -Y' & . ., + .. ._. . ""' ,+- "+.' 4JI AIVNI V DYESS J5 LIC REAL ESTATE BROKER 420 E. SUGARLAND HWW (863) 983-6663 (863) 983-9770 WesGsnTE; DYESS ArcLTATECOM E.L.: ANNL(O DYVIEREALESTATE COM AFT-geR &OURS: ANN YDIESS LAURA SMITH TRAV7S DKEFSS ANGELICA GONZALE (863) 98.3-897 lt.rl ,,,. *...:a 863)228-2215 L i.-sBL EL' PINOL (863)599-1209 36j,228-0023 SRESIDENTIAL 4BR. 3BA 2-c.r Pr0... po.ol E-R. 'BA ., --. .,n Lik Condo Bass Capital $159,000 $375,000 $120K 2/2.5 T.%aril.Winme i rLlui $199,900 3.4BR 2 1 2iBA on lake $428,000 3PR, 2EA S'l,',lH M1,..murr, 1.25 4BR, 2BA New Home Reduced 4BR, 2BA nSQLDL., S Ou I.101: acres furnished $98,000 to $295,000 2 or 3BR, 1 1/2BA Hiiu. rear SWMH on 4 Lots (4.56 acres) in .BR, 2BA Ro'.l Palin $249,000 yard $239.000 or rent for Woodland S. T) $27S (0i 3BR, 2BA o P$1,200 p.m. 3BR, 2BA MH Harlem $80,000 3BR, iBA 2006 Modular in 3BR, 2BA Bric:. fenced back VACANT LAND Montura Reduced $169,900 yard $24u,00o MH Lot in Sh.er ', $24,900 3BR, 2BA with pool 52S19 0110 2BR 1BA Corkscrew Blvd. 1.37 Montura 1.25 acre lots avail. Call 2BR, ?BA RE.illy Cute $125K acre $175.iut).. for Listings. 3BR, 2BA with den $299,000 3BR, 2BA w/ mother-in-law Flhry.,i- 2.41 ac $110.000 3BR. 2BA above ground pool quarters (IBR, 1BA kitchen) W\\'nidlnd, S/D 2 lots reduced to $184,900 .395.000i $32,500 each 2BR, 1BA with fireplace $1 'K MOBILE HOMES Pioneer 7 lots i56 5uL) 4BR. ;BA~ ..4(a:-J Ri .,'246K 4BR, 2BA, DXWMH $134,900 Pioneer 11 kts tether $45Keach 4BR, 2BA Reduced to 24 K' Pinr-:ei SWMH on 2.5 acres Mobile Home Lot $19,500 JBR, 2BA R aeuce Flahto $ 4B135,000 4.70 acres Pioneer $109,900 3BR, 2BA 2 acres Flaih.,l. Pioneer 4BR, 3BA DnWMH 10 Reduced .24i.O0t.l .re, i325 lil0 COMMERCIA1. 3BR, 2BA pool Ridec~.P t l 3BR, 2BA Tower Lakes Cabinet Shop 4800 sq. ft. & Apt, $349,900 $119,900 $200,000 4BR, 2BA Fully Furnished 3BR, 2BA DWMIH Sherwood FOR RENT North-side $359,000 $79.u00 2/2.5 Townhomes near marina 4BR, 2BA with pool RiJg -i.w 3BR, 2BA DWMH screened $1,500 per month includes #2 2-79,W00 porch Ridgdi11 Rd. $120,000 utilities . 863-983414 PLAY PEN- Fold N Go, like XXX BELLY RINGS (3)- New, new, blue, used twice $40 VERTICAL BLINDS- custom -$10 Call Dawn at (863)528-3235 made, cream color, 110x62, ... (863)634-3783 (Bbj)^a-j5 for triple width window, $40 (863)357-1560 ,I* MEN'S CLOTHING- 12 pairs PAT SET- chairs, awning, Brand Name shorts 38 to 42.5 COUNTRY ACRES cr763-0039 Mine$ clean &goodcond.$40. Will FIREPLACE- Brand new $200 CLEWISTON COUNTRY ACRES glass top table, $60 sep (863)634-7765 Okee or best offer. (863)763-6747 HouseTurn Key. From $79,000 & up, 3/4/5BR, 863)763-0039 Maxine RAIN COAT- means or wom- Fr3 A eniture 2/3BA, acre & 1/4 available or use your land M cl ens, 2X, black, 3/4 length, as down payment. Financing available. washable, with pop out lin- 3 IN 1 GRACO BED- Converts as down Financing aONLINE PHARMACY Buy ing. $25 (863)357-1560 from crib to toddler bed ,, Soma Ultram Fioricet Prozac Comes w/Dora sheets & ac- Buspar, 90 Qty $51.99 180 -lt 05 cess. $130 (863)675-0273 Qty $84.99 PRICE IN- S CLUES PRESCRIPTION! BED, Queen size, clean, Select We will match any competi- COLOR STAMP IMAGES- Comfort, sleep on air with tor's price! (866)465-0796 US1-1943 in 68 frames. One control. $350 DOUBLE FUTON- Wooden SOFA, Leather, Like New & pharmakind.com. of a kind! $320 for all/will (772)370-0047 w/roll out drawer. Perfect Kitchen Island, Stainless steel separate. (863)763-8729 BEDROOM SET, 5 pc., King condition. $450. and solid wood. Great cond. sz. Includes mattress & 7pc. (863)675-1936 LaBelle $370. Will sep. 720-284-4018 FLAGS- collection, 10" to qIcudsatrs $ &I foaallc 132"FLAGS- collection, 10 to quilt set. $500 for all.. DR TABLE- with 4 chairs, met- TABLE- ak & 4 chairs. Good ABSOLUTE AUCTION Satur- 132"holiday, includes seasonaltc., $7 (561)755-0910 al and wood $60 TABLEOak & 4 chairs. Good ABSOLUTE AUCTION Satur- holiday, flowers etc., $750 61)3)76-422 wo Condition. $125. or best of- day, August, 11, 10 AM CST, NEG (863)675-6556 BEDROOM SET- Ash color, (863)763-4220fer. (863)467-4124 Mentone, Alabama, Beautiful Chest of drawers, dresser, DRESSER, 3 drawer & night Cabin on. 6+/- wooded t r Armoire & night stand. $250. stand Good condition. $80. WATERBED King Sz, 12 draw- acres, spring, out building. S ls or best offer (863)634-5891 Will separate. ers/storage w/bkcase hdbrd, (8 6 6) 7 89 5 1 69, BR SET Queen headboard, (863)467-4095 nt: stand & mirrored Ar-- triple dresser, chest, 2 nite ENTERTAINMENT CTR- Hutch moire. $200. (863)763-5876 eers.com, Keith Baldwin AL COMPUTER: DELL, Great for stands, $250 style, Oak, hold up to 36" TV, WHAT NOT SHELF- Corner, LIC1416. school. Window X Etc. $150om- (863)763-2601 Like new. $250. or best of- Can hang or placed on floor. AIRLINES ARE HIRING Train ,lete. Window XP, Etc. $150. (863)517-2782 Tony BUNKBED- Twin size, top & fer. (863)634-5891 Approx. 4' to 5' Exc cond. for high paying Aviation bottom, 2 x 4 frame w/one FUTON- Full size, Good condi- $15. (863)467-7659 Maintenance Career FAA ap- 9 COMPUTER XP Complete, mattress. $65 tion. $40. (863)634-8758 proved program. Financial with all in one printer, cus- (863)528-3235 aid if qualified Job place- tom built.. $150 athe B 6 GLIDER ROCKER & OTTO- ment assistance. CALL Avia- CHAIR, Leather, Burgundy, 6 MAN, Beige & peach, excel- tion Institute of Maintenance (863)763-7950months old, excellent condi- lent condion.ea $50 (888)349-5387. LAPTOP Del Windows X tion, paid$600, asking $400 (8636755737 EXERCISE BIKE- Weslo cardio (888)349-5387. LAPTOP- Dell, Windows X (863)763-0583 glide, slightly used. $40LLEGE ONLINE many programs, Good KITCHEN TABLE, Round w/4 (863)467-6060 mATTEND COLLEGE ONLINE shape, loaded, $350 CHAIRS- wooden with cush- chairs & matching hutch. f rom home. Meal, computers (863)674-0212 ion, for dining room, $40 Real nice shape. $150. -ess, parallel, computers, gb., brand new, never t kA2 t MAPLE HUTCH- Large, aid and computer provided if gbopened. Extrand new, never ckg set. Wood/oak. Asking $120. 72"-80" W x 7.5' H $150 or MICROWAVE OVEN: Large, qualified. Call opened. Extra memory pckg or475 best offer. (863)675-4098 best offer. (863)467-8161 ideal for workplace or home. (866)858-2121,- venings (SECTIONAL- New, dark Only $25! (863)357-6303. neTidewaterTech.com. MONITOR- 19" Gateway, COUCHES- (2), 1 is 8ft, brown, Bassett, w/2 reclin- RO AR RFR Kn BOUNCE HOUSESLIDE beige, good picture. $50 (green) 1 is sofa bed, (plaid es, asking $1000 00 AR UBOUNCE HOUSE/SLIDE- (863)697-2033 multi colors) $700 or will sell (863)73-3660 more, Breath clean air. Ex- COMBO: 15x15, Great condi- separate (863)675-2463 ( cellent condition. $75. tion. $1800 (863)228-2440 PRINTER, Epson Stylus 740 & DINETTE SE- 3 pcs. wood ta SECTIONAL SOFA- 3pc, great 863-357-6303 or (863)675-1113 LaBelle Visioneer 1 Touch Scan- ble trimmed in hunter green. shape, $175 (863)978507 WATER COOLER, Sunbeam, 5 CALCULATOR- TI-84, All ner/Fax/Copier. $40/both, Like new $75. SLEEP NUMBER BED- Queen gallon, cold, hot &,room manuals & attachments for will sep. (863)763-5280 (863)634-8758 size. $800 (863)675-0273 temperature water, great download. Used 3 times. SONY LAPTOP 512 ram, all DINING ROOM SUITE- Cherry SOFA & LOVESEAT- Hunter cond. $40 (863)697-1443 $100. (772)708-3645 * XP & program disks & wood, 8 padded chairs, 2 green leather. Excellent DIVORCE$275-$350*COVERS books, $500 or trade for leafs. Paid 2k, asking $350 quality. $750. children, etc. Only one sig- gun. (772)461-8822 (573)281-9007 LaBelle (863)763-4088 nature required! *Excludes DINING SET, Bassett, beautiful SOFA & LOVESEAT- White, RING- Mans, yellow gold, w/ govt. fees! Call weekdays SONY LAPTOP- With all origi- cherry wood, table, 6 chairs good condition. $300 Solitaire diamond (.15pt.) 800)462-2000, ext.600. nal disks-trade for pistol or & hutch. $500 (863)261-7069 leave mes- white gold setting exc cond (8am-6pm) Alta Divorce, $600(772)461-8822 (863)675-5737 sage. $225 neg(863)763-2458 LLC. Established 1977. Hue e 0B 5 Hues Sle105 i Hue S le 2 HH -Sl 1 5 o e -ae 0 I I I I Serving the communities south of Lake Okeechobee Thursday, August 2, 2007 Thursday. Auaust 2. 2007 Serving the communities south of Lake Okeechobee MOBILITY CHAIR- Sundancer, new batteries. $500 (863)675-6214 SLOT MACHINE- Coin operat- ,1 .--:i condition. $175 or e.n:l on (863)467-8161 DRUM SET, 13 pc., Pearl Ex- port Series, emerald green w/accessories. $800 (863)467-5906 PIANO- Spinet, excellent con- dition, $400 (863)517-0489 AMAZON PARROT- 3 mos old, yellow naped, $900 firm (863)673-4716 AQUARIUM, 90 GALLON, wood stand, filter, gravel, volcano's, etc., $325. or best offer. (863)357-3092 BULLDOG/CATAHOULA MIX- F, 4 yrs old, to exc home ONLY, blue eyes, house broken. (863)467-0380 CHIHUAHUA PUPPY: Female, 4 months old. Sweet dispo- sition. Long legged. Must see! $100. (863)801-1302 CHIHUAHUA- tan, male, 2 1/2 month old., $250. (863)675-2541 (days) Barb LaBelle area. DOBERMANS: AKC, Lg. Bred. Shots/Wormed. Docked & Dewclaws done. $550 & up. Ready 8/30. (863)763-6703 DOG PENS, (4), Large chain link dog pens, $500 will sell sep. (863)612-0992 FISH TANK- 240 gallon with accessories. You move. $300 (863)675-6214 LOVEBIRDS, Mated, with large cage & nesting box. $100 (863)697-8731 MALTESE DOG: 1 year old adult, female, small size, $350. Call (863) 983-1970. MALTESE PUPPIES, AKC, Fe- male & Male, Shots & Wormed. (863)983-1970 MALTESE/POODLE MIX- white, 2 yrs old male, friend- ly, has vaccinations & vet record $400 (863)697-0465 MIN DASCHUND PUPS, Long haired, black & tan, dapple, red. $400 w/shots & papers. (863)634-5943 or 634-7883 PEKINGESE PUP, CKC, 10 weeks, male, to good home only. $250. (863)599-8074 PIT BULL- Blue, 4 weeks old. Purebred, $350. (863)673-5513 Stamp Out ITCHAMACALLITS! Shampoo with Happy Jack(R) Paracide I(TM) & ItchNOMore(R). Apply Skin Balm(R). At Tractor Supply.. WHOOPS! German Shepherd / Chesapeake Bay Puppies: 7 wks. old. Adorable, must see. $200. (239)246-6739 ' i 0 69 RESTAURANT EQUIPMENT Stainless Steel Tables, Triple Sinks, 6 & 8 Burner Stoves, 3 Door Freezer, Walk in Cooler w/Freezer, 2 Door Cooler, Meat Display Case, Icemaker, Meat Slicer & more. (305)322-2056 Clewiston area SKI, O'Brien Graphite Slalom w/ custom case & tow rope. Like new. $75 for all. (863)612-9233 LaBelle TABLE- For boat or motor home, rectangular, re- movable, two legs, like new. $50 (863)697-2033 BOOM BOX- Sanyo, AM/FM/CD/Cassette player. 24"L x 9"W $30 (863)763-0625 PIONEER STEREO, York & Bose speakers. Oldies but, still plays good. $150.. (863)634-3659 MAGNAVOX TV- 36", color, like new, used a few times, $300 (863)697-8507 TELEVISION- Toshiba 48", re- built, great picture. $600 or best offer. (863)467-0171 TV- 27", Works good, Nothing wrong with it. $50. (863)610-4674 CEMENT MIXER: Electric. $135. (863)675-8937 DRILL PRESS: Bench Top, $75. (863)234-1344 GENERATOR: Briggs & Strat- ton, 250 watts, 120 & 12 volts., 5 hp. $200. 863-675-1754 GENERATOR- Coleman 6250 surge 5500 run watts. W/220 volt ext. cord. Hardly used. $400. (863)467-6372 GENERATOR- McCullouch, FG5700AK, Brand new, Never used. Have Manuals & re- ceipts. $500. (863)763-8691 PRESSURE WASHER, Electric, 1300 psi. $75. (863)234-1344 WELDER, Portable & Air com- pressor. Mounted on trailer. $1500. neg.561-758-4337 a - TRACTOR- Case 255, runs good. $1200 (863)517-1107 BUSH HOG- Howse 4ft, like new. $500 or best offer-will trade up or down for 3 pt fin- ish mower. (305)299-1203 GARDEN TILLER- Honda GX160, 5.5 HP, rear tine, heavy duty. $300 or best of- fer (863)674-0098 HUSKY LAWN TRACTOR- like new, 18hp, 42" cut, $600 or best offer (863)612-5676 LAWN MOWERS,1 Scag, 48" cut, $5000 & 50" cut Dixie Chopper, $4500. (863)227-0533 MOWER- Craftsman, self pro- pelled, 6.75hp, 21", mulch- ing, exc cond. $200 (863)634-1479 MOWER PAN: 64" Cut, Belly for Kobota Tractor. Like new. $400. (863)612-9233- La- Belle. MOWER: Swisher, 44", pull behind, 10.5 B&S, runs great, $400 or trade for a 4' bush hog, 863-675-1816 RIDING LAWN MOWER- Yard machine, 42" mulcher, runs & cuts great. $500 (239)850-3639/229-1287 RIDING MOWER- Snapper 8hp, 30" cut, runs/cuts' good, just needs rear axle bearing. $80 (863)763-7875 Okeechobee Livestock Market Sales Every Monday-12pm & every Tuesday-11am.763-3127 Rentals ~T~D~", Apartments 905 Business Places 910 Commercial Property 915 Condos.' Townhouses Rent920 Farm Property - Rent 925 House Rent 930 Land Rent 935 Resort Property - Rent 945 Roommate 950 Rooms to Rent 955 Storage Space - Rent 960 $234/Mo! 3BR/2BA HUD Home! (5% down 20 years @ 8% apr) More Homes Available from $199/Mo! For listings call (800)366-9783 Ext 5669 EFFICIENCY, Moorehaven, Incl. W/D, util's & appls, 2 per- son max. Can be used for of- fice. $1050 mo 863-946-3333 MOORE HAVEN- furn. w/util., efficiency $150/wk, 1br apt $200/wk. (863)946-3636 or (863)509-0096 NOW RENTING Collingswood Apartments Units Available with rental assistance. OFFICE HOURS: Mon. & Thurs. 8am-4pm 863-675-7650 Equal Housing Oppor- tunity 3BR/2BA Foreclosure! $19,000! Only $199/Mo! 5% down 20 years @ 8% apr. Buy, 5/BR $302/Mo! For list- ings (800)366-9783 Ext 5798. BETWEEN LeBelle & Clewis- ton, 3br, 2ba home in Horse- shoe Acres. Lg fenced lot w/sm kennel. No indoor pets. $850. mo., + 1st, last & Sec. dep. Must pass rental credit appl. for apprvl. Yrly rebate for timely rental pay- ments. Contact Nakita (407)399-9291 CLEWISTON, 3br, 2ba, 2 car gar, 2.5 ac. New '06, $1800 mo. + sec. w/option to buy. 305-423-5334/561-719-6207 CLEWISTON- Ridge area, newly renovated. 3br/2ba, Double gar., fully equipped kit., Screen lani. $1200/mo, 1st, last & 1 mo sec. Must have exc. cr/refs. (239)353-0396 HOUSE-3br/2ba, 1730 sqft. All apple, W/D, w/laminate floors, arage, handicap access. 1550/mo. (863)946-3333 *Houses*Trailer Lots* *Horse Stalls* Pet Boarding* Clewiston/Dr. LE Thompson, Jr. (754)224-0364 MOORE HAVEN- 3 bedroom, $700/month Call (772589-0794 or 772)633-9719 Never Rent Again! Buy, 4BR/2BA $15,400! Only $199/Mo! 3/BR $11,000! 5% down 20years 8%. HUD Homes Available! For listings (800)366-9783 Ext 5796. PAHOKEE, 3BR/1BA, Avail 9/1. Call Elizabeth (561)441-4397 PAHOKEE, 3BR/2BA, c/a, vinyl tile throughout, Available 8/1, Call Elizabeth (561)441-4397 RENT or ::;- w,,.Opi:in to buy, 5 acres, 3 Bdrm., 2 Ba., Pond, Zoned Ag. w/fencing. $1100 mo. 239-297-5864 (3) 1100 sq. ft. Office Spaces Available Dec. 2007 (2 blocks from Glades General FREE ROOM, In large house, with some light conditions. Se habla Espanol. (786)499-9701 MOORE HAVEN- New '07, 55+ Comm., D/W, 2br/2ba on river. Bring boat/yacht! Beautifully landscaped. Wa- ter & Electric at dock. $1200. mo. (786)290-1542 Real Estate III- 3BR/2BA Foreclosure! $19,000! Only $199/Mo! 5% down 20 years @ 8% apr. Buy, 5/BR $302/Mo! For list- ings (800)366-9783 Ext 5798. 3BR/2BA Foreclosurel $19,000! Only $199/Mo! 5% down 20 years @ 8% apr. Buy, 5/BR $302/Mo! For list- ings (800)366-9783 Ext 5760. BELLE GLADE: 1785 sq. ft., 6 Bdrm., 3 Ba., 1 Car Garage. Corner of S.W. 10th St. & S.W. Ave. C. $200,000. Realty International, Sandy Weiser (561)329-1408 CANAL POINT Quiet country home with many large cy- press shade trees. 3 BR 1 bath, CBS const. on 2/3 acre. Liv. Rm with fire pi., dining rm, kitch, appl. in- cluded. Detached garage with 1/2 bath that could be an apartment. Brick/mas. BBQ 1720 sq. ft. New cen- tral a/c-heat. $125,000 by appointment. (561)924-7702 CBS HOME, 3/2, in Clewiston, newly remodeled, w/ceramic tile firs., brand new kit., met- al roof, a/c, carport, screened-in back porch & fenced in yard, nice neigh- borhood just on the outside of town, Great Area! $196,000. 863-902-0808 or 561-261-7747. CLEWISTON, Montura Ranch, Single Family Home, on 1 & 1/4 acres of land. 3 Bdrm., 2 Ba., 2 Living area's & 1 Large Family Rm. $130,000. (863)228-2933 HOME FOR SALE- 3/2/2, Screened in back porch, shed, brick fire pit in back- yard, home built in 2000. $260,000 (561)261-2554 Belle Glade LaBelle: MOVE IN TODAY! 3/3 Down Town, Near Court- house. Large rooms. Top Area $194,500. or Annual Lease $1800 mo. Owner. 863-675-1107 HARLEM 3/2 Brand New - Harlem Academy Drive Appliances, New carpet, C/Air, 1 Car Garage, Landscaped. $164,500. Low Down payment Call Owner: 863-673-5071 or 561-996-8010 LEHIGH, 1900 sq ft.4BR/2BA, + Den $149K. or Rent. ACREAGE, 5 acres, Zoned AG. $145K (239)368-7164 MOOREHAVEN, 3br/2ba on 1/3 acre, everything new in- side & out, a must see. (863)946-3212 or 265-0248 AFFORDABLE LAKE PROPER- TIES On pristine 34,000 acre Norris Lake Over 800 miles of wooded shoreline Four Seasons- Call (888)291-5253 Or visit Lakeside Realty- siderealty-tn.com. Developer's Closeout Now- September 29th- save on al- ready low pre-construction pricing starting at 70k. Lots & condos available w/ water, marsh, golf, nature views. lyr. no payment options. (877)266-7376- erspoint.com. So/ Central Florida. Lake Lots Reduced $100,000 Owner says "SELl'! 1 to 3 acre lakefront and lake access properties in a gated com- munity with city water and sewer, paved roads and un- derground utilities. Priced from $79,900 w/ excellent fi- nancing available. Call (866)352-2249 ext 2051. BELLE GLADE- Residential- mobile home/buildable lot. Please call (561)792-0203 leave msg. ARIZONA LAND LIQUIDATION! Near Tucson, Football Field 'Sized Lots. $0 Down/$0 Sale 20 to 40+ acre home sites from $109,900 to $169,900, beautiful timber with potential to subdivide. Save $10,000 on your pur- chase and pay no closing costs for a limited time. *Some restrictions apply* Up to 100% financing with approved credit. Call Now! (800)898-4409 ext1319.. NC: Best buy in mountains! Two acres with spectacular view, paved road, gated. housesite in, owner financ- ing. Bryson City. $65,000, $13,000 down. Call owner! (800)810-1590,- catknob.com. NC MOUNTAINS New Log Home- 3.2 Acres Only $79,900. New 2,500 sq.ft. log home package with 3.2 acres with a mountain stream! (800)455-1981, ext.103. ON THE BLUE RIDGE PARK- WAY Beautiful North Caroli- na Mountain Estates. Huge Views Mountain Streams. Prices starting at Only $69,900! Call Now! (800)230-6380, ext. 2378 I Huse al 80 x 100 lot, 10X NORRIS LAKEFRONT, LAFOL- LETTE, TENNESSEE, New Gated Development, Fantas- tic Views, Deep Water, Utilities, Boat Launch, Near Golf Course, One Hour North of Knoxville,- springsonnorrislake.com, (800)362-4225.. 2020 BRAND NEW 3BR, 2BA, Dou- blewide, in S. Clewiston, Avail Now! $850/mo. (863)228-9138 FSBO: Fleetwood Carriage Manor, Xtreme, 3/2, brand new '07, shed, fenced yard on 1/4 acre, city water & sewer $135,000. (863)381-4908 LABELLE- New, 3br, 2ba, dbl wide, on 2.5 fenced acres, W/D, DW, Deck, Good cred- it, $1100 (239)910-5115 LAKE PORT, Doublewide, 4br, 2ba, Central air. $400. deposit. S$200. weekly 863-673-5704 509. 3BR/2BA Foreclosure! $19,000! Only $199/Mo! 5% down 20 years @ 8% apr. Buy, 5/BR $302/Mo! For list- ings (800)366-9783 Ext 5853. . 3 all Kenny @ (863)673-4325) SUNSHINE LAKE ESTATES: '05 Mobile Home w/Land: 4 Br, 2 Ba. w/2 sheds & Lake. $128,000. (863)228-3921 Recreation -III -- Boats 3005 CampersR BASS BOAT- 18', Live well, Bait well, Depth finder, Trol- ling motor. 90 hp Mariner. $800. Neg. (863)467-4566 BOAT- 14' Flat bottom, alum w/trailer Mariner 2.5 HP, motor & Minnkota 65 trolling motor. $650 (863)674-0098 BOAT: 15%/ FT., Aluminum, V- Haul, 20 hp Johnson, Trr., Brand new Minkota Trolling Motor. $600. 863-357-4837 BOAT TRAILER- Magic tilt, single axle, alum., 4 bunk, winch, jack stand, never used $2000 (863)357-6229 FISHING BOAT- Aluminum, '1977 Lone Star, with trailer. Good condition. $450. (863)763-0410 GHEENOE: 15'4", new seats & trolling motor, trailer, 5hp Nissan 4 stroke outboard. $1450 (863)697-9704 PONTOON BOAT, 20 ft., 48hp Evenrude, $2250 or best of- fer. (863)467-2712 or (863)634-3580 SPORTSCRAFT- Tri hull- walk thru windshield, 60hp Mari- ner outboard, galv trailer, $650. (863)467-8038 CAMEO-CARRIAGE, '99, 32', all fiberglass, Ir, dr, elec. slide, Ig. a/c exc. cond., $12,900. (561)346-4692 DODGE '89, Motor home, high top, stove, fridge, shower, good motor, body, tires. i.I' l 'L' 1 I' L.t I *.l :,l: .' DODGE VAN CAMPER- '74, Roof A/C, Runs good. $1000. or best offer. (863)634-2684 TRAVEL TRAILER '92- Road Ranger, sleeps 4-6, great cond, new tires. $3600 or best offer. (863)467-8161 JOHNSON GT200- boat motor, asking $250 or best offer (863)763-4643 OUTBOARD MOTOR '06- Su- zuki 2.5hp, 6 year warranty, exc. cond. $700 or best of- fe. (561)389-3441 HARLEY BUELL '01- 500 cc, black, jet kit, new tires, runs great, V & H exhaust. $1800 (863)946-0850/227-1595 HARLEY DAVIDSON ROAD KING '92- exc cond., Blue, $5900 (863)357-6530 or (863)697-3954 HONDA CRF50 '05- great con- dition, $900 (863)634-6265 HONDA SHADOW VT700 '85- very clean, exc'cond., $1750 (239)745-5817 KAWASAKI KZ1000 '82- Runs. and looks real good. Asking $1800. or best offer (863)634-3344 LOW RIDER BIKE:. Black w/ all gold. $500 or best offer (863)675-1275 LaBelle MOTOR SCOOTER- Off the road. Runs perfect $175. (863)610-4674 YAMAHA 750 Special 1979, Dry Shaft, Runs great. $400. Lost title. (863)467-2609 af- ter 3pm SUZUKI RM250 '05: Dirt bike. Mint condition, runs good. $2500. Neg. (863)261-4633 or (863)357-2271 FORD F250 '95- Power Stroke, runs great. Selling truck or just motor, trans, rear end, cab. $2500. 863-763-8801 FORD RANGER, '85, reg. cab, V8 302, 17" alum. rims, needs gas tank finished, $1200. (863)467-4497 GMC SIERRA- '05, 4x4, With ext. cab. Excellent condition. $21,500. (863)675-1493 JEEP GRAND CHEROKEE La- redo 1993, Not pretty, but runs, runs, runs! $600 or best offer (863)357-5867 ROOF RACK- For '05 Dodge Durango, Like new. $100. (863)801-4283 Automobiles Automobiles 4005 Autos Wanted -1010 CADILLAC SEVILLE '93- Pearl white, great cond, leather in- terior, good on gas. $1700 or best offer (863)357-3639 CHEVY NOVA '76- Good cond., needs minor paint & body work. $800 firm (239)657-2754/503-7653 CHRYSLER TOWN &' COUN- TRY- '06, 11K mi., Like new. With Extended Warranty $16K. (863)763-8953. MERCURY TOPAZ '93- runs ood, new front end parts, 900 (863)612-5676 NISSAN 200SX, '95, 4 cyl., auto, greatair, like new tires, new battery, exc. in & out, $2300. (863)357-0037 Okee TOYOTA TERCEL '89- Needs a transmission. $200 (863)261-2511 ANTIQUE FOR SALE: 1925 Dodge Sedan, 4 Door. $9,000 or best offer. Call (863)673-1803 LaBelle CHEVY 1959, 1 Ton, $1500 (863)234-9564 LaBelle DODGE CLASSIC '68- 30k original miles, needs some work. $2000 (863)467-6036 AUDIO SPEAKERS (2)- 10" _ Memphis Audio w/1,000 BUMPERS, front & rear, from a '99 Chevy Ta- hoe, $300 or best offer. (863)634-6235 FORD 351 HEADS- asking $50 (863)634-7318 MUD TIRES- 17x40x16.5, on rims, good shape, set of 4, $500 or best offer (561)644-4840 PICK UP BED: 2001 Dodge w/ Bumper, Tail lights, Tail Gate & Goose neck hitch. $400. Good cond. (863)675-1862 RIMS & TIRES, 24", 6 lug, fits Chevy & Nissan Titan, $2500 (863)673-2314 TAIL GATE- '84 F250, exc condition, $185 or best offer (863)763-4643 TIRES & RIMS (2), 33/12.50/15, like new. $150 firm. (863)801-4519 TRUCK ENGINE & TRANS: 2.2 liter Chevy, 30k miles, w/5 spd trans, hd clutch, & rear end $1300 (863)675-2557 WHEEL: From 2007 Dodge Ram, 8 lug, polished alumi- num. $400. or best offer. (863)697-0424 WHEELS & TIRES- 15x10" Universal 5-4 3/4 x 5-4 1/2, good cond. $300 firm (239)503-7653 or 657-2754 CHEVY- '90, Shortbed, Auto., A/C, Runs great. $800. (863)261-3358 CHEVY PICK UP 1500 '95- Runs well, transmission may need tune up. $1500 (863)228-2933 DODGE DAKOTA 1997, V6, A/C, Good work truck. $1500. (863)763-1370 DODGE RAM 1500- '03, 4x4, Quad cab, Hemi. Excellent condition. $16,900. (863)675-1493 FORD F100 '82, 3.8L, V6, 3 spd man. trans., camper cap, toolbox, newer tires. $1000 neg. (863)763-8335 5 N jioz. l I arlru/rw-nV ue ule u eI, L n+Il -rF NOTICE OF PROPOSED ENACTMENT OF AN ORDINANCE NOTICE IS HEREBY GIVEN that the Clewiston City Commission will conduct a PUBLIC HEARING on August 20 2007,. 2006-08 AN ORDINANCE OF THE CITY COMMISSION OF THE CITY OF CLEWISTON, FLORIDA PROVIDING FOR REZONING OF AN APPROXIMATE 120 ACRE PAR- CEL OF PROPERTY LOCATED ON THE SOUTH SIDE OF U.S. HIGHWAY 27 ALONG THE WESTERN BOUNDARY OF THE CITY OF CLEWISTON TO PLANNED UNIT DEVELOPMENT ZONING DISTRICT (PUD) AFTER COMPREHENSIVE PLAN APPROVAL BY THE DEPARTMENT OF COMMUNITY AFFAIRS; PROVIDING FOR UPDATE OF THE CLEWISTON EXISTING LAND USE MAP: AND PROVIDING FOR AN EFFECTIVE DATE. P "1 ', ,,jI Ii. -"" 1... ':. i.dj. r : .' j j,. ,, Ir r, rl o.-, C) n,,,'i, City Hall, 1 1-,,,Iur, I. ,,, ,, .i .. NOh I, j, wf., o1. Ih1...l- ,' ,.. ,.I jHl d, rested par- lies anal inerestea paries may appear al me neeing and ea eaia win respect to the proposed ordinance. It City Manager 228232 CN 8/2/07 TOOL BOX- For full size truck, Diamond plated w/top rail. 72" Good condition. $150. (863)697-2704 UTILITY TRAILER- 16ft, w/tandem axles, elec brakes, new lights & 4 new tires $1500 (863)675-3628 CHEVY TAHOE '01, 88k miles, tan leather int., fully loaded, 4wd, exc. cond. Must see. $15,500 (863)467-9902 JEEP CJ7 '79- Excellent condi- tion, must sell. $2500 firm. 352)392-1921 7-4, 352)318-8165 after 4pm UTILITY TRAILER- 4' x 8', good shape, factory made, low miles, orig tires w/spare. $180(863)763-7875 CHEVY CONVERSION VAN, '95, $800. (863)612-0992 MITSUBISHI VAN '87- Low miles, dependable, seats 8 or can move seats $700 or best-offer. (863)357-3639 Public Nolices I AMA Public Notice .. 5005 State Public - Legal Notice 5500 IN THE CIRCUIT COURT OF THE TWENTIETH JUDICIAL CIRCUIT IN AND FOR HENRY COUNTY, FLORIDA CASE NO.: 07-000241-CA GREEN TREE SERVICING LLC, Plaintiff vs. KIMBERLY YANG, UNKNOWN SPOUSE OF KIMBERLY YANG, RICKY LYTLE, AND UNKNOWN TENANTS/OWNERS, Defendants. PLAINTIFF'S NOTICE OF ACTION TO: KIMBERLY YANG Unknown Spouse Of KIMBERLY YANG 430 N. Olivio Street Clewiston, FL 33440 And all parties claiming interest by, through, under or against KIMBERLY YANG UNKNOWN SPOUSE OF KIMBERLY YANG and all parties having or claiming to have any night, title, or interest in theproper- ty herein described: CURRENT RESI- DENCE UNKNOWN/LAST KNOWN ADDRESS: 430 N. Olivio Street, Clewiston, FL33440 EXHIBIT "A" 9810251 B575P129 ANORY ST:FL ,,,i i l', ,, : r. i r. ,, tura Ranch Es- ,1, ii. l '. ,,I,,. ,,'i. ,,,, according to the plat therecf re,,.nd; in Pl3t Eon' 3, Pages 37, a' 1,,, "'i ,a ir, el., h, Records of Hendry County, Florida. YOU ARE NOTIFIED that an action .to foreclose mortgage on the following described property in Hendry County, Florida: All of the property located at 430 N. OLI- VIO STREET, in the City/Townvillage of CLEWISTON, County of Hendry, State of FL, in which the Borrower has an ownership, leasehold or other legal interest. This property is more particu- larly described on the sch lededu Additional Property Description" which is attached hereto as Exhibit A. Together with a security interest in that certain 1998 60 X 28 CREST POIN home, serial number FLA14613730. and having a commonly known address as: 430 N. Olivio Street, Clewiston, FL 33440 has been filed against you and you are required to serve an original of your itten defenses, if any, with the Hendry County Clerk of this Court within 30 days from the first date of ., ,, ,, a copy on :',. in.. .,,,,- ,t, r.- G. Snytkin, of the Law Firm of Saxon, Gilmore, Canraway, Gibbons, Lash & Wilcox, PA., 201 i'- B;.i b600, Tampa, F. :: i. r,,, "' days from the "-, ' .,.,, oth- complaint. DATED: July 16, 2007 Barara S. Butler As Clerk of the Court -., '" I h ,,,T...I.. ".: "'..|., l. 'l In accordance with the Americans With S, ,hi Act, persons with 1i. .i; nd needing a special accom- modalion to participate in this pro- ,,'| r -.l i ') l jj ,II(H hi ,h ,,'. i ,. i I .,dng impaired, il',0 1 I s'l1,1'.' '';,I or Voice I ,."..'I)i' : ." ,.I. Florida Relay Service. 226200 CN 7/26;8/2/07 IN THE CIRCUIT COURT OF ITE 20TH JUDICIAL CIRCUIT IN AND FOR HENRY COUNTY, FLORIDA CASE O.: 07-251-CA HSBC MORTGAGE CORPORATION USA, Plaintiff, VS. PEDROTRUIZ, at ux.,et al., Defendants) NOTICE OF SALE NCTI' E ir iH RE b,' Ci'.ins I :b ,rl i,. '01. 1 I- .k J. r.I ',11 1 , i I T.; l i:;l U-i' ,I .' U-14 r, i n,,. ,1 ,',i i .. .... '. "1 r- :1 ,],: .I Sjrll r, I. I i'l a. ,]'.'. [ '. .11 . I ,.,,' r ii Ci J',." 1 .ij- ,, i l b i' 1 meaL to-wit LOTS 22 AND 23, IN BLOCK 431 OF THE GENERAL PLAN OF CLEWISTON, FLORIDA, AS REVISED SEPTEMBER 7, 1937, ACCORDING TO THE FLAT THEREOF RECORDED IN FLAT BOOK PUBLIC RECORDS OF HENRY COUNTY, FLORIDA. ANY PERSON CLAIMING AN INTEREST IN THE SURPLUS FROM THE SALE, IF ANY, OTHER THAN THE PROPER- TY OWNER AS OF THE DATE OF THE LIS PENDENS MUST FILE A CLAIM WirhiN 60 DAYS AFTER THE SALE ENTERE ,ii HaHfl-O i ,,ri',r iln'i.i t h i s : .ir, ,,) I l J i '', BARBARA S.BUTLER LilIl Iii,r,,]j By:/S/S. Hammond As Deputy Clerk 226073 CGS 7/26;8/2/07 NOTICE Notice is hereby .;., tflt '.n 08/11/2007 at ,il n .l iiA :hr KNOX SELF STORAGE, 1025 Com- merce Drive, LaBelle, FL, r. -. i 'n: ,r,: n ,:, .,;,1 FORT -r ii :lf ; 'T n t II '.1.i 1 ,i 1 Put. I .:h b A ,'lT,: fih.-i l ea,,tn., rn personal property heretofore stored with the undersigned: 863-675-1025 Jennifer Doak #209 Refg., water cooler, heater, speakers & misc. items Wallace Pitts #L-8 Sofa, TV, misc. items RacheiPunere 1L-38 r-- ,' i ," 228282 CGS 8/2,9/07 NOTICE AUCTION on Friday, August 10 2007 at 9:00 a.m. at1233N.W. Avenue L, Belle Glade, Florida Property of Don Simlien: ,,, ', T , , Property of Annie Pringle: Small dryer, bed frame & big box of clothes 228081 CGS 8/2,9/2007 NOTICE OF WORKSHOP Th7 b l,,", l.-l', n l'. ,il,.,l li,,h'. I BjTI. it ,rI |I '.1_ urII ..,,Iu I ja uM Port LaBelle, Florida. The purpose of the workshop is for the Board to consider a candidate for the gositon of General Manager of the district. This meeting is open to the public. Mark Colbert, Chairman 228322 CB/CGS 8/2/07 ) o S- V I -- I m i I Golf Cartsea I Gol Cart Sherri Enfinger, Manager 863763-6434 3E 15 ,ParraotAvenu e -Ok ech be.+nh F 1 474 I .f 1 emohA I c INic I Pb ic o ice Everglades settlement plans were questioned IMPORTANT INFORMATION ABOUT YOUR DRINKING WATER THE LAKEPORT WATER ASSOCIATION WATER TREATMENT SYSTEM HAS A LEVEL OF TOTAL TRIHALOMETHANES WHICH EXCEEDS STANDARDS SITUATION The Department of Environmental Protection requires disinfection of drinking water to inactivate laboratory analysis results for the TTHM sample collected in January 2007, April 2007, July 2007. and November 2006, now indicate a running annual aver- age TTHM concentration of 89.3 micrograms per liter (ug/L). Therefore, The De- partment has determined that this water system has generated a Maximum Contaminant Level (MCL) violation for TTHM's, since Table 3 of Rule 62-550, Flonda Administrative Code (FA.C.), identifies the MCL for TTHM's as 80 (ug/L). HEALTH EFFECTS Some people who dnnk water containing Tdhalomethanes in excess of the Maxi- mum Contaminant Level (MCL) over many years may experience problems with their liver, kidneys, or central nervous system, and may have an increased chance of getting cancer. WHAT SHOULD CUSTOMERS DO? This isenot an immediate risk, however, until the problem is corrected, any custom- ers who are concerned about their exposure to TTHM's may wish to us alternative sources of water for ingestion, such as commercial bottled water, or water treat- ed by an appropriate home water treatment device. Appropriate home water treat- ment devices are those certified by the National Sanitation Foundation (NSF) for reducing TTHM's in drinking water. WHAT IS BEING DONE? The problem will be corrected when the Seminole Tribe builds their new water treat- ment plant on the Brighton Reservation. Construction is expected to be completed in late 2007. For more information, please contact Jeff Ussery at (863) 946-1300, or write to: Lakeport Water Association, Inc., 10055 Red Barn Road, Moore Haven, FL 33471. You may also contact the DeptL of Environmental Protection Potable Water Compliance/Enforcement Section at (239) 332-6975. Please share this informa- tion with all the other people who drink this water, especially those who may not have received this notice directly (for example those in apartments, nursing home, school and businesses. 228275 GD 8/2/07 FAIR HOUSING MEANS: NO ONE MAY BE DENIED HOUSING ON THE BASIS OF RACE, COLOR, RELIGION, SEX, NATIONAL ORIGIN, FAMILIAL OR HANDICAP STATUS. THROUGH THE ACTIONS AND PROGRAMS OF ITS COMMUNITY DEVELOPMENT BLOCK GRANT (CDBG) PROGRAM CITY OF CLEWISTONNOR TDD 1- 800-927-9275 FOR FAIR HOUSING INFORMATION AND REFERRAL. EQUAL HOUSING OPPORTUNITY SOUTH FLORIDA WATER MANAGEMENT DISTRICT PUBLIC NOTICE OF APPLICATION Notice is hereby given that pursuant to Chapter 373, Florida Statutes, the following application(s)for permit have been received for projects) in Hendry County: Hoyt Holbrooks (Church Road Borrow Pit) PO Box 280, Felda, FL 33930, has sub- mitted Application 070620-8 for a Water Use Permit for an industrial use. The water will be withdrawn from groundwater and the project is located in Section 33, Township 45 South, Range 28 East. A, IT ll jlrll l l'l l :l f,1 . i -, l I.I, Il Ill h. i.i -I l i ui,, i i, j ,-. I'l 1 ,r,,1, ,... .. ii,- ,- : ),, ',, ?, r and the project is r -,. 1 . 1 T I : ... l'J I',! i i. ,,Ti,," i .I :w'. rfin :i r: imi, FL 33170, and Frank & Vivian Sabilson- 1,0i I I .l .1 i,.) I, ,, II. 33440 (iaz Farm-Gil Farm) has submitted Application 070618-8 for renewal of Everglades Agricultural Area Works of the District Permit 26-00008-E. The project is located in Section 16, Township 46 .,.ii, Ai,., 'a, ii I ...,.,r, i,,i s fi 120 acres of vegetableswith discharg- i nI ,, I". ," , Trii i i":.,: ,r,.,: 1.1. Iiiii ,',,-A,,,- Ilf- I ., O Boxo7 Clewiston,-FL .. r. i,, ,,T,,n i.l.,,,' ,, n1 r.. '. ,,, 1 ewal of Everglades Ag rcul- ,j,, .,,. ,H.,,i ,:,i ii,. [i,' || ,,t ,,, ,,, r:r ''i i i; he project is located in Sec- a,,,, i. :r T,.i ,, r', I a'. i '.,,uir, F i l i, i i. i: ,-, .1|.,.. Of 767.78 dl' I ,l, .i II Hlll i 11l ll : l l l : l'l, 1110 l l I ll i.. :,r,, l Il I i l 11111 ,I nta .lll RI isi en11 RI g I sI ii 1Pi t bs e: P. l e s P. Il l ii. 1 11 ,. :' 1 1 I'i. I. Tlnn r. l ,i 1-'11,1, iih, m IJ .'i I, I h 1.11 .- ,-a, ,I ll : ,- jl,,l, .Ij I lbjluts cll-h l ce ,meln l-' o r 'q'u l-muT b-III receIIIIIv b STr ,t,.ll IPM In, II a-, ,ii,',' I .i Ji' 1: l'(, 4r. :,,.|I| i: ,j,. I .i I .1 1. ,,,,,],,, .I i 653.25 acres of Interested persons may comment upon the application or submit a written request for a copy of the staff report containing proposed agency action regarding the ap- plication by writing to the South Florida Water Management District, Attn: Environ- mental Resource Regulation, PO Box 24680, West Palm Beach, FL F LO i rn but such comments or requests must be received by 5:00 PM w rn i ,,,. from the date of publication. No further public notice will be pvided regarding this application. A copy of the staff report must be requested in order to remain advised of further proceedings Substantially affected persons are entitled to request an administrative hearing re- garding the proposed agency action by submitting a written request therefore after reviewing the staff report. 228115 CGS 08/02/07 PUBLIC NOTICE CITY COMMISSION CITY OF CLEWISTON, FLORIDA Public notice is herebygiven that the City Commission of the City of Clewiston, Florida (the "City"), wi hold a public hearing in the City Hall Commission Cham- bers, 115 W. Venura Avenue, Clewiston, Florida 33440, during a meeting com- mencing at 6:00 p.m. on Monday, August 20, 2007, or as soon thereafter as possible, on the proposed issuance by the City of its industrial revenue bonds (the a mte censideed at t s m l an ringhed o ohs wiln ed o a onds", ion a principal amount not to exceed $6,000, for the purpose of pro- viding a loan to PranaSleep, LLC (the "Company")to construct, furnish and equip a facility of approximately 70,000 square feet to be located at 1175 South Olym- pic Street in the City of Clewiston Commerce Park, Clewiston, Florida, for the manufacturing of mattresses, bedsprings and related bedding accord inces. All fa- cilities financed with the Bonds will initially be owned and operated by the Com- DATED thisn24thedaydof duly, 200oi7f By: Chades F. Scoc, Cit ::.,,i,, m, ;,, *ii, i -~.~. 1. i,, .- ,, ,; & ,. 1 .,- 1 ,. ,i,.w,' ,,i hI ,i,') ..t,,ch W ill be tr '"1, .,,,ii, r,, ,'i n ,-,i ,,,,, "*ri''" 9 ji'" ,1'., ,- ,. ,, ',,,. ui,,y such in- terested ersons may at their option submit written comments to the City Manag- er, 115 W Ventura Avenue, Clewiston, Florida 33440, prior to the hearing. Written comments should be received by the City on or before 5:00 p.m. on August 20, 2007. Any person desiring to present oral comments should appear at the hear- hin. If a person decides to appeal any decision made by the City with respect to any matter considered at this meeting or hearing, he or she wl need to have a record of the proceedings and for such purpose, he or she may need to ensure that a verbatim of record of the proceedings is made, which record includes the testimony and evidence upon which the appeal is to be based. DATED this 24ame, subject day of July, 207. CITY OF CLEWISTON any, t the highest idde for CASH IN HANDBy: Charles Schoec appl, City Attorney 228104 CGS 08/02/07 NOTICE OF SHERIFF'S SALE Notice is hereby given that pursuant to a Writ of Execution, issued in the Circuit Court of Hendry County, Florida, on the 17th day of May, 2007, in the cause wherein MLH Financal Services, Inc. is plaintiff and Marsha Bussell (Ameet at Marsha Darlene Edgar) is defendant, being Case number 91-240, in said Court, I, Ronald E. Lee, Sr., as Sheriff of Hendry County, Florida, have levied upon all the dght, title and interest of the defendant Marsha Bussell (A/WA will sell the same, subject to taxes, all prior 223596 CN 7/12,19,27;8/2/07 PUBLIC NOTICE Notice is hereby given that the Clewiston Planning and Zoning Board will meet at E in [, ,- I,- ,.,,,,J] i,,,j,.i 13, 2007 in the City Hall Commission Chambers, " r. ., .,-,',h.,,, ^, i ',,.,- hi, eluded in the agenda will be the following request: 1)A request from R. Nigel Miller, J. Irrevocable Trust in accordance with City Code Section 110-60 titled "Required findings: Variance" for a variance to re- duce the minimum lot area requirement at Royal Palm Trailer Park, A.K.A. Lots 1 - 6 in Block 378; Lots 6 11 in Block 379 & Lots 1 11 in Block 380, GPOC. The properties are zoned RM-1. The City Commission will hold a PUBLIC HEARING to consider the recommenda- tions of the Planning & Zoning Board and take final action on this request on Au- gust 20, i*,,iidlnina inl,., ai : :' 63 l. ~ij ,''r .' ii ." Edited By MaryAnn Morris Some may know of Thomas Will, father of Lawrence Will. Lawrence Will wrote such books as "A Cracker History of Okeechobee," "Okeechobee Boats and Skippers" and others on the history of the lake area. Today the Lawrence Will Museum is housed in the Belle Glade Public Library.. Thomas Will was one of the first settlers in the Everglades: quite involved with seeing civi- lization grow and prosper for residents of the Glades. The Belle Glade county branch li- brary bears his name. Here are sooome exerpts from Mr. Will's pamphlet, "Ev- erglades Settlement and Devel- opment, Its Present Status and Why": "Over 20 years ago, a vast Everglades selling campaign was launched over much of the United States. It sprang from the effort of Governor Broward to reclaim that region, as agreed by Florida in accept- ing the land from the U.S. Government. To relaim, funds were essential. These were sought by Glades land sales. Buyers were assured the land was rich and would be speed- ily reclaimed by the State and that they might soon occupy and use their lands. "In the Nation's capital, the interest ran high. In this, the writer led. He was especially active in organizing the buyers and decisions plans to make speedy, successful settlement Courtesy photo/Florida Archives- This photo from around 1920 shows an automobile transported by ferry near Okeelanta. Recollections A series about Florida's pioneers and history ,I-'. .~,'. ; .. and development possible. "In this effort, he came to Florida in 1910, to inspect; and, in 1914, to stay and work. He has lived here continuously since. "He helped start the first settlement, namely at Davie, in the Lower Glades in 1911; and at Okeelanta, in the Upper Glades, in 1913. But Everglades settlement and development do not go forward. Barring re- sults from a few millionaires, they go backward. The ques- tion is WHY? "I have said that, 'Everglades settlements were compelled to fail.' Why say this? Because I can prove it and court opportu- nity to do so. "The first Everglades settle- ment was at Zona (Davie). In 1911, 1 organized the first Ev- erglades Farming Association and sent its representatives from Washington, D.C. and New Jersey there. 1 know the tragic history of early Davie. "On October 24, 1913, I founded the first planned set- tlement in the Upper Glades at Okeelanta. Its history 1 certain- ly know. The other sawgrass settlements suggesting the wrecked French villages in No Man's Land -I have watched with eagle eye and I challenge the enemies of Everglades set- tlement and development to permit me to get before a court or a competent Investigating committee with my facts and show how these settlement were killed. "In 1913, for use in connec- tion with Okeelenta, I devised the first planned, organized, supervised settlement in the U.S. of which I ever heard. However, it did not include Government aid. "In 1917, California adopted the Mead plan, which included State aid. I championed it for use in the Everglades. In 1918, when the soldiers were about to return (from World War I), Secretary Franklin K. Land, of the U.S. Department of the Interior, sought to induce Con- gress to provide such a plan for their use. But the bill was killed and soldiers given, instead the wretched 'bonus'." The full document is found EVERGLADES SETTLEMENT and DEVELOPMENT ITS PRESENT STATUS AND WHY. a/ THOMAS ELMER WILL Ple.-dr nl. Flcn d Ec. .rl.de Hl nuA.* ldel.' A-air illaon. F.uread 19i. .ld S F'un ,d. l r la : SF.. o., nE.,rlSJal Firm.dlg ,.aO. luba .. r u.la 1It: buth n F'a ih.ln., D C. Oelle PblJ Larnl. 0'----- -'b J Fmrrtle In Son" Flor.da. an .Ii... u. m ... i .nip nrl. liO Addui BIall Cled,. F lrm B5Ich Courtesy Art[ Belle Glade Public Library Thomas E. Will, the fa- ther of Lawrence E. Will was an active proponent of settlement of the Ever- glades area and is credited with settling Okeelanta, on the south end of Lake Okeechobee. at:. MaryAnn Morris may be contacted at mmorris@newszap.com. Where did the arsenic in the lake come from? Reports of high concen- trations of arsenic in the muck removed from Lake Okeechobee's shores have some area residents con- cerned. Arsenic consumption or exposure can be dangerous - even fatal. Where did the arsenic in Lake Okeechobee come from? There were probably a lot of sources. Arsenic is occurs nat- urally in the soil and in some kinds of rock. When rock ores are put in a smelter, the arsenic can be released and go up the smokestack and is spread by the wind. Arsenic has been used in fertilizers and pesti- cides. It is pumped into the air by volcanoes and by coal- burning power plants. Arsenic is also released if you sand or burn wood that was treated with arsenic as a preservative. According to a University of Florida study, arsenic-treated lumber debris in landfills could also leach arsenic into the groundwater. Arsenic has been used in rat poisons and in some kinds of medicines. In the early 1900s, Florida ranchers used dipping vats to control cattle disease spread by ticks. The pesticide in those dipping vats was arsenic. When they were no longer needed, the vats were buried along with their toxic residue. Rain fall in the areas of these vats the lo- cations of most are unknown -- can spread the arsenic into the soil. Until just a few years ago, a popular brand of lawn fertilizer sold in Florida contained high levels of arsenic. Well-mean- ing gardeners had no idea their lush, green lawns were sources of arsenic, which washed into swales and drainage ditches with each rain. Should Floridians be con- cerned that the soil and water near their homes might also be A Healthier Life with Katrina Elsken contaminated? I found the following Fre- quently Asked Questions (FAQ) about arsenic on the Center for Disease Control's Web site. What is arsenic? Arsenic is a naturally occur- ring element widely distributed in the earth's crust. In the envi- ronment, arsenic is combined with oxygen, chlorine, and sulfur to form inorganic arse- nic compounds. Arsenic in ani- mals and plants combines with carbon and hydrogen to form' organic arsenic compounds. Inorganic arsenic com- pounds are mainly used to preserve wood. Copper chro- mated arsenic (CCA) is used to make "pressure-treated" lum- ber. CCA is no longer used in the U.S. for residential uses; it is still used in industrial appli- cations. Organic arsenic com- pounds are used as pesticides, primarily on cotton plants.. What happens to arsenic when it enters the environ- ment? Arsenic occurs naturally in soil and minerals and it there- fore may enter the air, water, and land from wind-blown dust and may get into water from runoff and leaching. Arsenic cannot be destroyed in the environment. It can only change its form. Rain and snow remove arse- nic dust particles from the air. Many common arsenic compounds can dissolve in water. Most of the arsenic in water will ultimately end up in soil or sediment. Fish and shellfish can ac- cumulate arsenic; most of this arsenic is in an organic form called arsenobetaine that is much less harmful. How might I be exposed to arsenic? Ingesting small amounts present in your food and wa- ter or breathing air containing arsenic. Breathing sawdust or burning smoke from wood treated with arsenic. Living in areas with un- usually high natural levels of arsenic in rock. Working in a job that in- volves arsenic production or use, such as copper or lead smelting, wood treating, or pesticide application. How can arsenic affect my health? Breathing high levels of in- organic arsenic can give you a sore throat or irritated lungs. Ingesting very high levels of arsenic can result in death. Exposure to lower levels can cause nausea and vomiting, decreased production of red and white blood cells, abnor- mal heart rhythm, damage to blood vessels, and a sensation of "pins and needles" in hands and feet. Ingesting or breathing low levels of inorganic arsenic for a long time can cause a dark- ening of the skin and the ap- pearance of small "corns" or "warts" on the palms, soles, and torso. Skin contact with inorganic arsenic may cause redness and swelling. Organic arsenic compounds are less toxic than inorganic ar- senic compounds. Exposure to high levels of some organic arsenic compounds may cause similar effects as inorganic ar- senic. How likely is arsenic to cause cancer? Several studies have shown that ingestion of inorganic arse- nic can increase the risk of skin cancer and cancer in the lungs, bladder, liver, kidney and pros- tate. Inhalation of inorganic ar- senic can cause increase risk of lung cancer. The Department of Health and Human Services (DHHS) has determined that inorganic arsenic is a known carcinogen. The International Agency for Research on Cancer (IARC), and the EPA have de- termined that inorganic arsenic is carcinogenic to humans. How does arsenic affect children?. Stud- ies in animals show that large doses of arsenic that cause ill- ness, pregnant females can also cause low birth weight, fe- tal malformations, and even fe- tal death. Arsenic can cross the placenta and has been found in fetal tissues. Arsenic is found at low levels in breast milk. How can families reduce their risk for exposure to arsenic? If you use arsenic-treat- ed wood in home projects, you should wear dust masks, gloves, and protective clothing to decrease exposure to saw- dust. If you live in an area with high levels of arsenic in water or soil, you should use cleaner sources of water and limit con- tact with soil. Is there a medical test to show whether I've been ex- posed to arsenic? There are tests available to measure arsenic in your blood, urine, hair, and fingernails. The urine test is the most reliable test for arsenic exposure within the last few days. Tests on hair and fingernails can measure exposure to high levels of arse- nic over the past 6-12 months. These tests can determine if you have been exposed to above-average levels of arse- nic. They cannot predict how the arsenic levels in your body will affect your health. Has the federal govern- ment made recommenda- tions to protect human health? The EPA has set limits on the amount of arsenic that indus- trial pg/m3) for 8 hour shifts and 40 hour work weeks. For more information, call the ATSDR Information Center at 1-888-422-8737. Before making any change in your diet or exer- cise program, consult your doctor. This is especially important if you are on any prescription medications. Some drugs interact bad- ly with foods that would otherwise be considered "healthy." lPpr hiet., siwam I. h t oaa pbk ,m -a401 righted Material -- Syndicated Content Available from Commercial News Providers" - a. -a Serving the communities south of Lake Okeechobee Thursday, August 2, 2007 , ^ * , , 0 e ThU IrIUI O A-UUnUi 2. 2ttLI Action figure Jesus now available By Pastor John Hicks First United Methodist Church, Clewiston I was in the office of my as- sistant, when all of the sudden my eyes focused on something that caused me to do a double- take. There on the shelf was a Jesus action figure. It was a freebie that she received from some promo- tion. I found out. John that there are a Hicks series of Bible action figures that are now available in stores. Just think, we can hold our Noah action figure and ride the waves in an ark. We can lift the hands of our Moses action figure and divide the waters. But the crime de la crime is the Jesus action figure. With the Jesus action figure, we can act as if the Spirit of the Lord is upon us, and pretend to be anointed and sent to proclaim freedom for the prisoners and release for the oppressed and to proclaim the year of the Lord's favor. With the Jesus action fig- ure, we can work to set things straight. Imagine the joy of turn- ing over the tables of the money changers who were more con- cerned with making a buck than sharing a blessing. Imagine the gratification that comes when we can help the blind receive sight, the lame walk, cure those who have leprosy, enable the deaf to hear, raise the dead, and preach the good news to the poor even if we do it through the imaginary action of our Jesus action figure. Who would you have Jesus heal or help? Whether we actually have a Jesus action figure in hand or not, there is a tendency for many of us to live our spiritual lives as if we are directing a Jesus action fig- ure. We know that Jesus healed the sick and helped the blind to see, and we can imagine and di- rect our action figure Jesus to do these things, but we sometimes miss the realization that we can do these things ourselves. In John 14:12, Jesus states, "I tell you the truth, anyone who has faith in me will do what I have been doing. He will do even greater things than these, because I am going to the Father." Do you realize what this means for us? Jesus' promise and challenge for us is not only to do the things He did, but to do even greater things. Does this mean I will be able to walk on water or raise the dead? I don't know about you, but the last time this big boy tried to walk on water, he sank. I can, however, walk across seemingly impossible places to minister to those in need because my God is with me. And I know that there are many spiritually dead around me that I can help raise up with God's help. If we think about it, we realize that the heart of Christ was and is to bring people into a deeper relationship with God. Today more than ever, there are people that need to have this relationship - even more than there was at the time of Jesus. The field is ripe for harvest, but the harvesters are few. We don't need an action figure. We need to be the action figure. We can't be His salt in the world if we don't get out of the shaker. We can't be His light in the dark- ness if we don't shine for people who are walking or struggling in the darkness. Our call is to action, remembering that it's not about us and just what we can do, but about God and all that God in us can do for we are the temple of the living God! mu- sic and the word. Come and join us. All are welcome. Speaking the word will be our own, Kim from Palmdale. Announce your church event Have your Sunday school and service times, along with church events including music programs and potluck gather- ings posted in the area church news column each week. Just forward your church informa- tion to clewnews@newszap. com Church announces service times Clewiston Church of Christ, 336 Central Ave., would like to announce its church services: Sunday Bible study at 10 a.m., worship at 11 a.m., evening worship at 6 p.m.; Wednesday - Bible study at 7 p.m. Minister Gordon Smith. For more infor- mation, call (863) 902-8822. 0 Gotonewszap.com to download and print coupons online! == I I =****==== * **** Finding happiness is around the corner By Rev. Samuel S. Thomas, Ph.D.+ Saint Martin's Church, Clewiston Following a hurricane, some- one told me about a woman in the street holding her family al- bum and a Bible. She was smiling and saying "I have all that I need!" After all of the loss, that's quite an outlook. Others who have lost homes or properties didn't look at it in quite the same way. I remember a woman who was robbed and who told me that was the worst thing that could happen to someone. I didn't agree with her; she had her health, friends; her home was relatively intact and she had enough insurance to cover her losses. When we talked further about her "tragedy" it seems she was upset because someone had invaded her private world. No, nobody likes losing a home or being robbed, but sometimes we need to see what happens from another view. I have had occasions to meet those who have lost worldly pos- sessions or had them taken away from them and they were any- thing but unhappy. People have had to restart their lives after fi- nancial disasters or fires; people have had their freedom taken away from them, others have devoted their entire life to a reli- gious cause; all finding happiness without tangible .. , things or mate- rial goods. I cam remember times ^_ when I look back and say, "Those were happy times." These were dif- ferent than the Samuel S. moments of ela- Thomas tion like getting a driver's license, getting out of school, or finding someone special. The elation of the moment fades and a more mature, deeper, longer-lasting happiness is different from the emotional "high" of the mo- ment. Likewise, some of the disap- pointments .or "downers" were short-lived and the sadness of the moment was overcome by what was gained in the long run. I remember losing a scholarship as a real "downer" and wonder- ing what would happen in my life afterward. I went to work for 13 months, went to night school while working, saved some mon- ey and went back to resume my studies. Things improved when I returned to school. I now knew that: (1) Losing a scholarship wasn't the end of the world; (2) dropping out didn't have to be forever; (3) 1 had to really work at school if I wanted to stay there; (4) I was the one who had some say in whether or not I would finish. Looking back, these were times that were happy times. They were times of accomplishment, learning about myself, having a goal and work- ing toward it. Some of those around us who are regarded as "successes" are also happy; they have goals and work towards them. They are in- wardly fulfilled and have values other than gathering up or wor- rying about material things, they devote themselves to something beyond themselves. Their lives are filled with an all-consuming direction that gets them up each morning ready to go. They do not worry about whether or not they are "happy" and usually are involved in some way to make life better for others. I see these people as happy and doing some- thing with a religious dimension at the same time., They share the learning of the Psalmist who wrote, "I will thank you because I am marvelously made, your works are wonderful and I know it well (Psalm 139, vl3)." The purposes, the reasons for our existence and our happiness come ultimately from the Lord. They have to do with our being fulfilled and our instinctive know- ing we are fulfilled when we find them. They have to do with real- izing the powers within us that are put there by God and they are formidable when we tap into them. They have to do with tak- ing what is set before us as seri- ous, but never letting them over- come us. The woman who lost her house did not lose her home. Those who love worldly posses- sions and who are lost when something happens to them are missing something in life more than the things that surround them. The Lord who told us that, "the Kingdom of God is within us (Luke 17:21)," also placed our happiness there, too. Seeking happiness within is the route to finding the Kingdom of God. QUALITYui*-jrnI.y Service SLicensed & Insured #EC000061 CrHU r CH Attend Church this Sunday 10:00 AM Nursery provided 370 Holiday Isle Blvd Touching the Glades one family at a time. Pshuck&Ka Pe Pk w& G Pg Are you one among the wise? By Jackie Miller, minister First Christian Church, Clewiston This study of wisdom is re- vealed in the book of Proverbs. However, Scriptures found else- where in the Bible are used also. As, an introduction to the subject of wisdom; please read Proverbs 3:13, 26, 35; 4:5-13, I Corinthians 3:19-20; James 3:15; 11 Corinthi- ans 1:12. Marks of wisdom will be point- ed out in this study. The questions of who is wise, according to Solo- mon are: 1. The lowly are wise. "When pride cometh, then cometh shame, but with the lowly is wis- dom." Prov. 11:2 2. He that winneth souls is wise. "The fruit of the righteous is a tree of life; and he that win- neth souls is wise." Prov. 11:30 3. A son who hears his father's instruction is wise. "A wise son heareth his father's instruciton. Prov. 13:1 4. He at that hearkeneth unto counsel is wise." The way of a fool is right in his own eyes: but he that hearkeneth unto a coun- sel is wise" Prov. 12:15. "...with the well advised is wisdom." Prov. 13:10 5. "He that walketh with wise men shall be wise: but a compan- ion of fools shall be destroyed." Prov. 13:20. "Be not deceived: evil companionships corrupt good morals." I Cor. 15:33 S6. "He that feareth and depar- teth from evil is wise: but the fool rageth and is confident." Prov. 14:16 7. "He that is slow to wrath is wise: but he that is hasty of spirit exalteth folly." Prov. 14:29; James 1:10 8. He that speaks knowledge is wise: but the mouth of fools poureth our foolishness." Prov. 15:2 "The lips of the wise disperse knowledge, but the heart of the foolish doeth not so." Prov. 15;7 9. "He that fears the lord is wise..." Prov. 15:33 "The fear of the Lord is the beginning of wis- dom: and the knowledge of the holy is understanding." Prov. 9:10 10. He that hears reproof is wise." "A reproof entereth more into a wise man than a hundred stripes into a fool." Prov. 17:10 "The rod and reproof give wisdom: but a child left to himself bringeth ... shame" Prov. 29:15 11. He that is not deceived by wine is wise. "Wine is a mock- er, strong drink is raging, and whosover is deceived thereby is not wise." Prov. 20:1 12. "He that keepeth the law is wise" Prov. 28:7. "The wise in heart will receive command- ments: but a prating fool shall fall" Prov. 10:8. 13. "He that will hear is wise." Prov. 1:5 Review the marks of wisdom and then ask yourself: "Am I wise or foolish?" How many of these marks of wisdom is found in you? Also read what Jesus said in Mat- thew 7:24-27. Post your News Post or read press releases, announcements & information from your community. Community Links. Individual Voices. Specializing in the Treatment of Skin Cancer Jonathan S. Sanders, M.D., J.D. :Tim loannides, M.D. Mohs Surgery Diseases of Skin, Hair & Nails Fellows of the Board Certified by the American Society for American Board of ABD SMMohs Surgery Dermatology See a Board Certified Dermatologist Everytime Serving the communities south of Lake Okeechobee Thursdrav. Auausrt 2. 20077 RELIGION ScseTu CASHBACK ON 2007 TRUCKS & SUVS BRAND NEW 2007 FORD F-150 I POWER BRAKES, A/C, POWER STEERING, AM/FM STEREO, MANUAL TRANSMISSION *DEALER RETAINS ALL REBATES & INCENTIVES BRAND NEW 2007 FORD F-150 SUPERCAB POWER BRAKES, A/C, POWER STEERING, AM/FM STEREO, AUTOMATIC TRANSMISSION *DEALER RETAINS ALL REBATES & INCENTIVES BRAND NEW 2007 FORD .FW US l ON SE LEASE FOR ONLY: AMO. PLUS TAX* DISCOUNT: $2780s WA.. I $ESEFOR39ONS 10500 14TTA OUTOFPOKEAFIEROUNI S RP *LEASE FOR 39 MONIHS, 10,500 MILES/YR.$1400 TOTAL DOUlARSOUT OF POCK E WrlH APPROVED CREDIT **AFTER REBATES AND DISCOUNTS W.A.C MusT Fi FMCC U BRAND NEW 2007 FORD LORER XLT LEASE FOR ONLY: A MO. PLUS $21,499 *LEASE FOR 39 MONTHS, 10,500 MILES/YR.with $1500 CASH DUE SIGNING pr s Wr TAG MD SITE MS WMAH MPNOVm M "L **AFIER REBATES AND DISCOUNT. WACMLY FMtwo I BRAND NEW 2007 FORD. ESCAPE XLT ;LEASE FOR ONLY AMO2. PLUS TAX* DISCOUNT: $2500 FF * S 250 MSRP EASE FOR39 MONTHS, 0M00 MILES/YL with S1200 ASnsroDuAoIHG NDG STM TAGmA WNr bu S m PV s**AFER REBAIESAND DISCOUNTi CM RfN ft BRAND NEW 2007 FORD FOCUS SE LEASE FOR ONLY: S A MO. PLUS $179 TA DISCOUNT: 33370 IS RP *LEASE FOR 39 MONTHS, 10,500 MILES/YR. SO TOTAL DOLLARS OUT OF POCKET WITH APPROVED CREDIT *AFTER REBATES AND DISCOUNTS. W.A.C MuST FIANGWFMCC BRAND NE2007 FORD EDGE SE EDGE SE LEASE FOR ONLY: PLUS $289TAX* DISCOUNT: S!303 OFF" Imm9V' W300MSRP *LEASE FOR 39 MONTHS, 10,500 MILES/MIR wilh $1500 CSH DUE AT SIGNING PUS TAX, TAG AND STAT FEES WIH APOVED an E **AFI R REBATES AND DISCOUNTS. WACMl~a t M VICC BRAND NEW 2007 FORD EXPEDITION EDDIE BAUER LEASE FOR ONLY. A MO. $35 4PLUS 1'3 5, ro" TAX* DISCOUNT: OFF 6000SRP *LEASE FOR 39 MONTHS, 10,500 MLES/YR. with $2250 ASH DUE AT SIGNING PUI TA, TAG AND SIATE FEE Wml MPIVED rA EDN "* AFTER REBATES AND DISCOUNTS WACM~fthk FIa CC Team Players -1 xJ 0 SALESMAN L -iii ~IIII 'I ~ I P, ..,.m .... .. . -. 1 1 l... ..... .... Thursday, August 2, 200,71
http://ufdc.ufl.edu/UF00028301/00133
CC-MAIN-2019-09
refinedweb
39,665
74.29
- If you missed the first part, go get caught up. Then join us for more DNS and hostname goodness. Last time, we got you up and running. This time, see how you can manage all the hostnames in your domain with just a few DNS tricks. How to set up a home DNS server, part II by Shannon Hughes Welcome backIn the first part of this series on the Domain Name System (DNS), we set up a caching nameserver that allowed our clients to take advantage of faster network operations by caching frequently requested DNS queries. In this article, we will extend our caching nameserver to a master nameserver that is responsible for managing the authoritative information for our internal client hostnames. OverviewAs with our caching-only nameserver, we will see that BIND RPMS packaged by Red Hat® Enterprise Linux® and Fedora ease the process of configuring our master nameserver. Adding authoritative responsibility to the caching-only nameserver only requires us to add two more files and modify the existing named.conffile. For the purpose of this article we will assume the following: - The BIND 9.x RPMS discussed in Part 1 are installed on the machine that will serve as a nameserver. - Our internal network is in the 192.168.15.0/24 subnet. You will need to substitute your subnet if different. - The master nameserver will only allow DNS queries from internal clients in the 192.168.15.0/24 subnet. - The master nameserver will continue to forward any DNS requests it can't answer to your upstream ISP nameserver(s). - We will use the domain hughes.lanas our internal domain name. You might notice that we selected a mock top-level domain (sometimes referred as a TLD) named lan. Our internal domain name can be as creative as we wish since the domain is only known inside our home network. The naming convention for a public nameserver is not as relaxed, since we would need to follow certain rules that would allow our nameserver to respond to other nameservers requesting host information from around the world. ZonesNameservers store information about a domain namespace in files called zone data files. A zone data file contains all the resource records that describe the domain represented in the zone. The resource records further describe all the hosts in the zone. We will need to modify our existing named.conf to reference two zone files for our domain name: - Forward zone definitions that map hostnames to IP addresses. - Reverse zone definitions that map IP addresses to hostnames. /var/named/chroot/etc/named.confand add the following forward and reverse zone file directives: # Forward Zone for hughes.lan domain zone "hughes.lan" IN { type master; file "hughes.lan.zone"; }; # Reverse Zone for hughes.lan domain zone "15.168.192.in-addr.arpa" IN { type master; file "192.168.15.zone"; };Both the forward and reverse zones contain the type masterindicating that our nameserver is the master or primary nameserver for the hughes.landomain. The filekeyword indicates which zone file contains the resource records for the corresponding zone. Note that the reverse zone contains a special domain named in-addr-arpa. DNS uses this special domain to support IP to hostname mappings. Reverse lookups are backwards since the name is read from the leaf to the root (imagine a domain name as a tree structure) so the resultant domain name has the topmost element at the right-hand side. For a home network the reverse lookup zones can be considered optional but we will include them for completeness. Included with the BIND RPMs is a root zone nameservers use when a query is unresolvable by any other configured zones. The root zone directive is named ".", has a type of hint and references a file named named.ca that contains a list of 13 root name servers located around the world. We will not directly use the root servers since we are forwarding any unresolvable queries to our ISP nameservers. We need to modify the named.conf global options to allow our internal clients to query the nameserver. Modify the existing global options block to the following: acl hughes-lan { 192.168.15.0/24; 127.0/8; }; options { directory "/var/named"; allow-query { hughes-lan; }; forwarders { xxx.xxx.xxx.xxx; xxx.xxx.xxx.xxx; }; # ISP primary/secondary forward-only; # Rely completely on ISP for cache misses };The aclstatement above sets up a range of IP addresses we can reference throughout the named.conffile. The allow-queryspecifies IP addresses of hosts that can query our nameserver. The forwardersstatement tells our nameserver to forward any unresolvable queries to our upstream nameservers. The forward-onlystatement restricts our nameserver to only rely on our ISP nameservers and not contact other nameservers to find information that our ISP can not provide. It's very rare for a primary and secondary ISP nameserver to be down at the same time but you can comment forward-onlyif you want your nameserver to try the root nameservers when the upstream ISP nameservers cannot resolve a hostname. Zone filesWe are now ready to start defining our hostname mappings in the zone files we referenced in the named.confconfiguration. Zone files need to be placed in the /var/named/chroot/var/nameddirectory, have 644 permissions with an owner and group of named: cd /var/named/chroot/var/named touch hughes.lan.zone chown named:named hughes.lan.zone chmod 644 hughes.lan.zoneLet's take a look at an example zone file for the hughes.lanforward zone and then dive into the various parts: $TTL 1D hughes.lan. IN SOA velma.hughes.lan. foo.bar.tld. ( 200612060 ; serial 2H ; refresh slaves 5M ; retry 1W ; expire 1M ; Negative TTL ) @ IN NS velma.hughes.lan. velma.hughes.lan. IN A 192.168.15.10 ; RHEL server fred.hughes.lan. IN A 192.168.15.1 ; router scooby.hughes.lan. IN A 192.168.15.2 ; upstairs WAP shaggy.hughes.lan. IN A 192.168.15.3 ; downstairs WAP scooby-dum.hughes.lan. IN A 192.168.15.4 ; Fedora desktop daphne.hughes.lan. IN A 192.168.15.5 ; network printer mysterymachine IN A 192.168.15.6 ; mail server scrappy IN A 192.168.15.7 ; Windows box ; aliases www IN CNAME velma.hughes.lan. ; WWW server virtual IN CNAME velma ; virtual WWW tests mail IN CNAME mysterymachine ; sendmail host ; DHCP Clients dhcp01.hughes.lan. IN A 192.168.15.100 dhcp02.hughes.lan. IN A 192.168.15.101 dhcp03.hughes.lan. IN A 192.168.15.102 dhcp04.hughes.lan. IN A 192.168.15.103 dhcp05.hughes.lan. IN A 192.168.15.104 @ IN MX 10 mail.hughes.lan.The very first line in the hughes.lan.zonecontains the TTL (Time To Live) value and is set to one day. TTL is used by nameservers to know how long to cache nameserver responses. This value would have more meaning if our nameserver was public and had other external nameservers depending on our domain information. Notice the 'D' in the TTL value stands for Day. Bind also uses 'W' for weeks, 'H' for hours, and 'M' for minutes. The first resource record is the SOA (Start Of Authority) Record which indicates that this nameserver is the best authoritative resource for the hughes.lan domain. The IN stands for Internet Class and is optional. The first hostname after the SOA is the name of our master or primary nameserver. The second name, "foo.bar.tld.", is the email address for the person in charge of this zone. Notice the '@' is replaced with a '.' and also ends with a '.'. The third value is the serial number that indicates the current revision, typically in the YYYYMMDD format with a single digit at the end indicating the revision number for that day. The fourth, fifth, sixth, and seventh values can be ignored for the purposes of this article. The NS record lists each authoritative nameserver for the current zone. Notice the first '@' character in this line. The '@' character is a short-hand way to reference the domain, hughes.lan, that was referenced in the named.conf configuration file for this zone. The next block of A records contains our hostname to address mappings. The CNAME records act as aliases to previously defined A records. Notice how fully qualified domains end with a '.'. If the '.' is omitted then the domain, hughes.lan, is appended to the hostname. In our example the hostname, scrappy, will become scrappy.hughes.lan If you want to reference an internal mail server, then add a MX record that specifies a mail exchanger. The MX value "10" in our example indicates the preference value (number between 0 and 65535) for this mail exchanger's priority. Clients try the highest priorty exchanger first. The reverse zone file, 192.168.15.zone, is similar to our forward zone but contains PTR records instead of A records: $TTL 1D @ IN SOA velma.hughes.lan. foo.bar.tld. ( 200612060 ; serial 2H ; refresh slaves 5M ; retry 1W ; expire 1M ; Negative TTL ) IN NS velma.hughes.lan. 10 IN PTR velma.hughes.lan. 1 IN PTR fred.hughes.lan. 2 IN PTR scooby.hughes.lan. 3 IN PTR shaggy.hughes.lan. 4 IN PTR scooby-dum.hughes.lan. 5 IN PTR daphne.hughes.lan. 6 IN PTR mysterymachine.hughes.lan. 7 IN PTR scrappy.hughes.lan. 100 IN PTR dhcp01.hughes.lan. 101 IN PTR dhcp02.hughes.lan. 102 IN PTR dhcp03.hughes.lan. 103 IN PTR dhcp04.hughes.lan. 104 IN PTR dhcp05.hughes.lan. TestingSave your zone files, make sure you have the correct permissions and check the syntax using named-checkzone: named-checkzone hughes.lan hughes.lan.zone named-checkzone 15.168.192.in-addr.arpa 192.168.15.zoneCorrect any syntax errors reported by named-checkzone. Restart the nameserver: service named restartBrowse through the tail of the /var/log/messagesfile and confirm the domain loaded successfully. Make the following DNS queries (substituting your domain): dig scooby.hughes.lan dig -x 192.168.15.2 Your output should be similar to the following: . . . ;; QUESTION SECTION: ;scooby.hughes.lan. IN A ;; ANSWER SECTION: scooby.hughes.lan. 86400 IN A 192.168.15.2 ;; AUTHORITY SECTION: hughes.lan. 86400 IN NS velma.hughes.lan. ;; ADDITIONAL SECTION: velma.hughes.lan. 86400 IN A 192.168.15.10 . . .Continue to test each host you added to the zone file and then enjoy your new master nameserver. ConclusionThe goal of this series of DNS articles was to pick the high-level features DNS can offer to improve the efficiency and management of the home network. In addition to the performance improvement we saw with the caching nameserver, the master nameserver helps manage both static and dynamic clients using human-friendly hostnames instead of IP addresses. For readers interested in learning more about DNS or expanding the nameservers discussed in this series, checkout the following resources: - BIND user documenation located in /usr/share/doc/bind-9.x.x - DNS and BIND (5th Edition)
https://www.redhat.com/magazine/026dec06/features/dns/?intcmp=bcm_edmsept_007
CC-MAIN-2014-10
refinedweb
1,842
60.21
So in the beginning, Im sure i can ditch #include <string>... Im sure at the end, where i have a million cout's (42-69) that could be simplified (i feel like the inverse of the distributive property in math could be applied. I want the ouput to look the same. this seems to work for me for numbers 99,999.00 and smaller. If there is an approach that will allign all dollar signs, (and all decimal points) while keeping the percentages and integers and ends (.00) of the setprecision(2) numbers justified right. This is in my 4th class and my proffessor is such a useless D-bag. one class he decided to read his powerpoints out loud (loudly to himself) without displaying them. I learn absoloutely nothing in class and I only have the book, (sample programs) and google to help me with the rest. thanks I might be confusing so let me know if i can clarify... Again, i got it to output the way i want to, I just feel like i did it in a complicated manner. (i moved all the bricks from one side to another alright, but i did it one mollecule at a time instead of with a forklift... if you catch my analogy.) //This program is used to calculate: Monthly Payment, Amount Paid Back, and Interest Paid //from the inputs: Loan Amount, Monthly Interest Rate, and Number of Payments. #include <iostream> #include <iomanip> #include <string> using namespace std; int main() { float L ; float RatePercent ; float N ; float monthlyPayment=0 ; float amountPaid ; float interestPaid ; float Rate ; cout << setprecision(2) <<fixed << showpoint <<setw(10); //Prompt user to enter data cout << "Enter the following amounts: \n" ; cout << "Loan Amount: " ; cin >> L ; cout << "Yearly Interest Rate: "; cin >> RatePercent ; cout << "Number of Payments: "; cin >> N ; //Calculate Monthly Payment, Amount Paid Back, and Interest Paid. Rate = RatePercent / 1200 ; monthlyPayment = L * (Rate * pow((1+Rate),N))/((pow((1+Rate),N)-1)); amountPaid = monthlyPayment * N; interestPaid = amountPaid - L; //Display calculated data cout << endl << endl << endl; cout << "Loan Amount: " ; cout << setw(12) ; cout << "$ " ; cout << setw(8); cout << L << endl ; cout << "monthly Interest Rate: " ; cout << setw(9); cout << setprecision(0) << noshowpoint ; cout << RatePercent/12 << "%\n" ; cout << "Number of Payments: " ; cout << setw(13); cout << N << endl ; cout << showpoint << setprecision(2) ; cout << "Monthly Payment: " ; cout << setw(8); cout << "$ " ; cout << setw(8); cout << monthlyPayment << endl; cout << "Amount Paid Back: " ; cout << setw(7) ; cout << "$ " ; cout << setw(8); cout << amountPaid << endl; cout << "Interest Paid: " ; cout << setw(10); cout << "$ "; cout << setw(8); cout << interestPaid << endl; system("pause"); return 0; }
https://www.daniweb.com/programming/software-development/threads/383381/can-this-be-simplified-setw-x-parameters-i-hope-so
CC-MAIN-2018-30
refinedweb
423
64.95
This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project. On 09 Aug 2015 14:24, Zack Weinberg wrote: > Is an IFUNC's variant-selecting function called only once per process, > or every time? it's once-per-process. if it were every time, it'd defeat the point of the optimization. > If we sent libc.so-internal calls to 'memset' through the PLT (as is > currently done for 'malloc') would that mean they were subject to IFUNC > dispatch? it's a double edge sword. we specifically want to avoid the PLT for two reasons: (1) speed (PLT is slow) (2) interposition (we don't want someone exporting a memset symbol and then internal glibc code calling that instead of our own version) we could create an internal symbol using the GLIBC_PRIVATE namespace which would solve (2), but we'd still be left with (1). and it's really hard to quantify the speed tradeoffs between using the PLT everywhere and the choice of two different mem/str funcs (e.g. SSE vs AVX). at least on older cpus where only SSE2 is available, we know there will be no speed increase, but there will be a speed loss (but still hard to quantify). > Is there any *other* way (that already exists - nothing that would > require binutils changes) to cause libc.so-internal calls to 'memset' to > be subject to IFUNC dispatch? Compared to using the PLT, what are the > costs and benefits of doing it that way? since IFUNC only exists to handle the PLT slot, doing IFUNC w/out PLT fundamentally doesn't make sense. -mike Attachment: signature.asc Description: Digital signature
http://sourceware.org/ml/libc-alpha/2015-08/msg00310.html
CC-MAIN-2019-30
refinedweb
281
72.97
Just remember, the smaller of a number you pass to the method, the larger the image will be! (I accidentally created a 2.1GB file. You have been warned)Creates either a greyscale plaintext ASCII image, or, for added awesomeness, creates a String containing HTML, which when written to a file and viewed in a browser, contains a full color ASCII'd copy of the original image! import java.awt.image.BufferedImage; import java.awt.Color; public String toASCII(BufferedImage img, double shrinkFactor) { BufferedImage image = img; char[] shades = new char[]{'H', '#', 'M', '8', '$', 'O', '=', '+', '*', '|', '-', '^', '~', ';', ',', ':', '.', ' '}; //ASCII characters to use, ranging from darkest to lightest. //experiment with your own combinations! StringBuilder output = new StringBuilder(); //using a StringBuilder so Java doesn't explode from creating thrirty million strings //(seriously). Running a profiler on the project, Java called the append method of //StringBuilder 10 million times. Granted it was a big picture - gabe's head blown //up 10 times. /*Take Note: The size of the StringBuilder will eventually exceed Java's *internal heap causing the program to burst into flames. If you are *with images that big, I would suggest to write it to a File directly *from within this method, instead of using a StringBuilder*/ String red; //hex red value String green; //hex green value String blue; //hex blue value Color col; //color to store RGB data in int avg = 0; //average of RGB //Uncomment below for HTML //output.append("<pre>"); //for all you non HTML buffs out there (like me), the <pre> tag //means preformatted text. Because we don't want any webbrowser messing //with out spacing! //Why have the y loop go first? Due to the way BufferedImages are laid out //using for(int x //) // for(int y//) //will create a sideways image for (double y = 0; y < image.getHeight(); y += shrinkFactor) { for (double x = 0; x < image.getWidth(); x += shrinkFactor) { //the reason for x and y being doubles is to allow for the method //to expand images as well as shrink them col = new Color(image.getRGB((int) x, (int) y)); //truncate the values of x and y, meaning that it stays on the //same pixel for multiple iterations if the shrink factor //is less than 1 avg = (col.getRed() + col.getGreen() + col.getBlue()) / 3; //find the average avg = avg / (256 / shades.length - 1); //makes the average usable to select an index in the char array while (avg > shades.length - 1) { //make sure average will fit into the array avg--; } red = Integer.toHexString(col.getRed()); //convert it to hex green = Integer.toHexString(col.getGreen()); blue = Integer.toHexString(col.getBlue()); //uncomment this next block for HTML /* red = (red.length() < 2) ? "0" + red.charAt(0) : red; green = (green.length() < 2) ? "0" + green.charAt(0) : green; blue = (blue.length() < 2) ? "0" + blue.charAt(0) : blue; */ //what it does is prepend a 0 to the hex String if it is less //than 15 (F). Why you ask? //because HTML uses color codes like this: #RRGGBB, R being red //obviously, G green, and B blue. If we have an red value of 4, //the entire color gets messed up: #4GGBB, which reads the red //value as 4G instead of just 4, and so on. //this method would provide this color code: #04GGBB. The day is saved! //undo the following block comments for HTML output.append(/*"<FONT COLOR="#"+(red+green+blue)+"">"+*/ shades[avg] + " " /*you can choose to remove the additional * space here if you'd like, I just find * that the images seem less squished * with it*/ /*+"</FONT>"*/); } output.append("n"); //comment out above line and use the below one instead for HTML //output.append(" "); //newline } //uncomment below for HTML //output.append(" </pre>"); return output.toString(); } /*Example program usage*/ //inside main() BufferedImage img = ImageIO.read(new File("src.gif")); Writer output = new BufferedWriter(new FileWriter(new File("ascii.txt"))); output.append(toASCII(img, .1)); //10 times original size! output.close();
https://www.dreamincode.net/forums/topic/363938-Converting-an-Image-to-ASCII-Art-(with-color!)/
CC-MAIN-2019-26
refinedweb
644
65.73
Which statement is true? Select the one correct answer. Objects can be explicitly destroyed using the keyword delete. An object will be garbage collected immediately after it becomes unreachable. If object obj1 is accessible from object obj2, and object obj2 is accessible from obj1, then obj1 and obj2 are not eligible for garbage collection. Once an object has become eligible for garbage collection, it will remain eligible until it is destroyed. If object obj1 can access object obj2 that is eligible for garbage collection, then obj1 is also eligible for garbage collection. Identify the location in the following program where the object, initially referenced with arg1, is eligible for garbage collection. public class MyClass { public static void main(String[] args) { String msg; String pre = "This program was called with "; String post = " as first argument."; String arg1 = new String((args.length > 0) ? "'" + args[ 0 ] + "'" : "<no argument>"); msg = arg1; arg1 = null; // (1) msg = pre + msg + post; // (2) pre = null; // (3) System.out.println(msg); msg = null; // (4) post = null; // (5) args = null; // (6) } } After the line labeled (1). After the line labeled (2). After the line labeled (3). After the line labeled (4). After the line labeled (5). After the line labeled (6). If an exception is thrown during the execution of the finalize() method of an eligible object, then the exception is ignored and the object is destroyed. All objects have a finalize() method. Objects can be destroyed by explicitly calling the finalize() method. The finalize() method can be declared with any accessibility. The compiler will fail to compile code that defines an overriding finalize() method that does not explicitly call the overridden finalize() method from the superclass. The compiler will fail to compile code that explicitly tries to call the finalize() method. The finalize() method must be declared with protected accessibility. An overriding finalize() method in any class can always throw checked exceptions. The finalize() method can be overloaded. The body of the finalize() method can only access other objects that are eligible for garbage collection. Which statement describes guaranteed behavior of the garbage collection and finalization mechanisms? Objects will not be destroyed until they have no references to them. The finalize() method will never be called more than once on an object. An object eligible for garbage collection will eventually be destroyed by the garbage collector. If object A became eligible for garbage collection before object B, then object A will be destroyed before object B. An object, once eligible for garbage collection, can never become accessible by a live thread.
http://etutorials.org/Misc/programmers+guide+java+certification/Chapter+8.+Object+Lifetime/Review+Questions/
CC-MAIN-2017-30
refinedweb
422
58.69
Nested Types A nested type is a type that is a member of some other type. Nested types should be tightly coupled to their declaring type and must not be useful as a general purpose type. Nested types are confusing to some developers and should not be publicly visible unless there is a compelling reason to do so. In a well-designed library, developers should rarely have to use nested types to instantiate objects or declare variables. Nested types are useful when the declaring type uses and creates instances of the nested type, and use of the nested type is not exposed in public members. Do use nested types when the relationship between the nested type and its outer type is such that member accessibility semantics are desirable. Because a nested type is treated as a member of the declaring type, the nested type has access to all other members in the declaring type. Do not use public nested types as a logical grouping construct; use namespaces for this. Avoid publicly exposed nested types. The only exception to this is when variables of the nested type need to be declared in rare scenarios such as subclassing or other advanced customization scenarios. Do not use nested types if the type is likely to be referenced outside of the declaring type. Declaration of variables and object instantiation for nested types should not be required in common scenarios. For example, an event-handler delegate that handles an event defined on a class should not be nested in the class. Do not use nested types if they need to be instantiated by client code. If a type has a public constructor, it should probably not be nested. Ideally, a nested type is instantiated and used only by its declaring type. If a nested type has a public constructor, this would indicate that the type has some use separate from its declaring type. In general, a nested type should not perform tasks for types other than its declaring type. If a type has a wider purpose, it most likely should not be nested. Do not define a nested type as a member of an interface. Many languages do not support such a construct. For more information on design guidelines, see the "Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries" book by Krzysztof Cwalina and Brad Abrams, published by Addison-Wesley, 2005.
http://msdn.microsoft.com/en-us/library/ms229027(v=vs.100).aspx
CC-MAIN-2014-35
refinedweb
399
62.48
Details Description Take this Java class: public class Dsl { public static void novarargs(java.util.List s) { System.out.println("novarargs ok"); } public static void varargs(Object... s) { System.out.println("varargs ok"); } } Run it with Groovy: this.metaClass.mixin(Dsl) Dsl.novarargs(["a", "b"]) novarargs(["a", "b"]) Dsl.varargs("a", "b") varargs("a", "b") // fails here The last one fails: javac Dsl.java && groovy UseDsl.groovy Caught: java.lang.IllegalArgumentException: wrong number of arguments at UseDsl.run(UseDsl.groovy:7) Activity - All - Work Log - History - Activity - Transitions Just debugging what is happening (using the above script): println this.metaClass.methods.grep(~'.*vararg.*').join('\n') yields: org.codehaus.groovy.runtime.metaclass.MixinInstanceMetaMethod@1cd2d49[name: varargs params: [class [Ljava.lang.Object;] returns: void owner: class ConsoleScript9] org.codehaus.groovy.runtime.metaclass.MixinInstanceMetaMethod@12a09d5[name: novarargs params: [interface java.util.List] returns: void owner: class ConsoleScript9] In fact, once this is run: varargs(["a", "b"] as Object[]) then this works from that point on: varargs("a", "b") Planning on applying the attached patch in a day or two unless someone can think of a better way to fix this. Paul, that might fix varargs(Object... s), but it does not fix varargs(String... s) or varargs(Object a, Object... s) or most other cases. So I am for not applying that patch, it leads to the false assumption the bug has been fixed and will later cause problems again Yes, I found the first case you mentioned straight after posting the previous patch. I assumed the second case was not broken but it too is broken. Looks better to hook into some existing code if we can. Attaching an alternative patch for review and its test files. Test can be run as: javac NewDsl.java && groovy TestNewDsl.groovy Attaching a slightly easier version of TestNewDsl.groovy for review. I had a similar solution to Roshan's though I had to do a pre-emptive call to method.getParameterTypes() in order for the testcase that I added to pass. The only difference is that my testcase uses a Groovy mixin class and is located in the same script. It would be nice to push that logic somewhere else but I haven't had time yet to investigate. One ugly workaround until fixed: Also noted that normal category usage appears to work fine:
https://issues.apache.org/jira/browse/GROOVY-3878
CC-MAIN-2017-39
refinedweb
389
61.12
DirecTV's Secret War On Hackers 619 ". "For more information, visit." Re) Re:finally (Score:3) but stealing tv is wrong I am so sick of this attitude! It is not "stealing TV". When you steal something, the person that you stole it from no longer possesses it. An example of stealing TV would be smashing a shop window, grabbing a television set under your arm, and running. This is by no means the same thing. DirecTV are broadcasting their signal over satellite. Whether you pay for their service or not, it gets beamed into your property. If you have a dish, you will pick up the signal. If you happen to have the means of decoding this signal, you can watch their TV shows. How is this stealing? This is no more stealing that watching the Superbowl at a friend's place because he has DirecTV and you don't. Are you "stealing TV is wrong" advocates suggesting that DirecTV should send agents round to their subscribers houses to issue them with an extra pay-per-view bill for any of their friends who happen to be parked on the couch with a bag of doritos watching the game? No, this is an outrageous abuse. If DirecTV don't have a business model which can earn them a profit as they beam their signal into EVERYONE'S airspace, then they shouldn't be in business, end of story. Or, as they would say, "game over". not stealing (Score:3) Please consider this for a moment: Hughes is bombarding us with their electromagnetic emissions... why shouldn't we be allowed to receive and decrypt them? I really don't see how this is much different than DeCSS, which seems to enjoy the support of the Slashdot community. So... stealing motion picture studios' work is OK, but it's wrong to intercept and decrypt electromagnetic signals broadcast through the air? Signals that are being absorbed by our bodies, with still unknown effects. I'll buy the idea that people shouldn't 'steal' DirecTV's signal when DirecTV allows me a way to opt out of being hit with their sattelite beams. (Please don't suggest that I wear a tinfoil hat. ;) LASTLY, I haven't seen any mention of how these counter measures have affected paying customers. I know several legit DirecTV subscribers who had their cards stop working after Black Sunday. How does anyone feel about that? Is it OK for DirecTV to inconvenience paying customers in the course of their battle with the hackers? How many 'civilian casualties' will be tolerated? And is DirecTV going to be giving these people refunds? Probably... if they spend an hour or two on the phone. The customer's time isn't important anyways, right? As long as they're paying their bill... NorthSat and DTV (Score:4) Well, That may not be how it actually went down. In October the guy who ran Northsat in Canada got raided. There was a consent decreee, and as part of his plea bargain he agreed to act as a consultant to DirecTV. Although DTV had already been busy implementing the dynamic code, many old timers claim that they see dean's hand in the 4 (that's right 4, not one) ECM's that came down starting last sunday. So it would seem that the legal system allowed DTV to force a hacker to destroy part of his own creation. Not a clear cut case of DTV defeating pirates with their own engineers. Guess he shouldn't have have a bunch drugs and cash in his house when they raided him hehe. Agree - Re:It's not wrong to figure it out... (Score:5) In fact since most of us DONT get DirectTV and are STILL constantly bathed in its RF emissions Hughes is in the wrong, if anyone is. Mind you, I don't have a problem with them sending the bits to their own subscribers. The fact they they chose a CHEAPER method of distribution to increase their own profits opens them up to this. Anything being broadcast non-interactively(not two-way like say, a cordless phone), whether tv, radio, or otherwise, is like air as far as I'm concerned. i.e. Not any company's but the peoples. If the company doesn't like that, make their own customers use over priced less effective measures, like cable, spread spectrum, or other methods. If the cost of that makes it unprofitable, so be it. The Constitution (Sorry, US centric) gives the right to the PURSUIT of happiness, not the right to it. THere is a difference. Similarly, Hughes can try to make money by giving a service worth paying for. They're not entitled to just because they spent a lot of money. Think about it. If I fire radiation at your home 24/7 without you asking for it (paying subscribing whatever, and that IS what radio/broadcast energy is) you should have the ability to do whatever you want with it. They are NOT STEALING. Stealing implies taking something away from someone else. As in they no longer have an object they previously did. These peeople went out and bought their own satellites, smartcards and gizmos. They can fdo anything they want with them. Xerox did not have to pay all the scribes who were put out of work by copiers, nor did the guy who came up with carbon paper. Just because you used to be able to make money doing something once does not mean you are entitled to keep making money off it forever.:Stealing? No. (Score:5) You wouldn't care if I set up a listening post to hear any wireless stuff going on in your house, right? You probably don't care about Echelon and various Internet-based listening posts monitoring your e-mail and where you surf, right? After all, you are sending your data out over shared space, and if I feel like manipulating it *however I want*, that should be my right.. Re:"Hackers"? (Score:3) As others have pointed out Hughes is sending the signal to hackers. In fact, they want to send it to nearly everyone, ideally. Furthermore they're sending it as a broadcast radio signal, and that's a public resource. If you proceed with your logic, you imply that it would be illegal to read billboards on the side of the road (ideally for this argument in the state-owned right of way) if the whim of the owner was that you weren't allowed. Just as there is a right to free speech, there MUST be in order to actually have such a right function, an equally absolute right to listen. Otherwise you're supporting the opinion that you have a right to free speech, but if the government finds it inconvenient, people who listen can be arrested. (despite the speaker going free) This is a nonsensical propisition you're making, I think we'll all agree. If a communication is privileged or there is an expectation of privacy (e.g. whispering, talking in a way that cannot reasonably be intercepted outside your home, lawyer-client discussions) I can see making that a minor crime. Generally one that's worse for the government (e.g. tapping w/o a warrant) than individuals. But sending data across a public medium to virtually the entire continent does not strike me as private. Even the Internet is not private - it's a network of other, smaller networks, and it's hardly possible to believe that communications across it are automatically private. Certainly the most esteemed privacy/encryption experts on the net don't think so. Once someone recieves such a stream - particularly if it was sent so that they, their neighbors and their countrymen could recieve it - I don't see how it's Hughes' business what's done with it. If they wish to prevent people from seeing it, the best way is to not send it to them at all. The second best way is to heavily encrypt it, but encryption is not a guarantee. It also means that Hughes' business is not TV but decryption software. If someone manages to put out an RE'd version w/o infringing on patents, then that's their right too. We rely on that right to have microcomputers that aren't all sold by IBM. And furthermore, in Canada, which is what we're discussing, the people there explicitly DO have the right to watch broadcast signals. There's just no two ways about it there. If the law in Pottsylvania were that TV broadcasters had to give out free TV sets to people in order to have a license to broadcast then Hughes would have to either stop broadcasting to them, or start handing out the sets; it doesn't matter if the law is different than US law, sovereign states have the right to have different laws. Re:finally (Score:3) But taking DirecTV's own receiver, only made for the purpose of viewing their service by subscription, and then modifying it for free service is theft, plain and simple. By your standard, there should only be free broadcast service (over-the-air commecial TV), because anything else is and should be open for the taking to anyone who can hack a receiver or get their hands on a modded card. If that's the case, forget pay-per-view (what - life without Wrestlemania?), forget all the premium commercial-free services like HBO - and forget pretty much any reception at all anywhere other than in and near urban areas. There's a big difference between fair use and theft of service. I should be able to record off my DTV, time-shift as I like with my VCR or Tivo, and not rely on analog streams to do so if everything I have is digital. But there's nothing inherently wrong with paying to get that signal into my house to begin with, so long as I can re-use what I paid for. A different point entirely. - -Josh Turiel You know, I think I'm with DirecTV on this (Score:5) On the other side, you have a company that sells a dish and programming, at pretty reasonable prices compared to cable rates, and wants to get paid for their goods. Given that's it's at an interesting intellectual game at best to figure out how to hack a DTV smart card system, and theft of service at worst, it just appears that DirecTV has figured out how to win the cat and mouse game once and for all. Good for them. If DirecTV was the only form of television service available (ie., a monopoly), I'd look on theft of service a little more tolerantly, but there's all sorts of TV alternatives out there - broadcast, cable, and other satelite providers. This is different from, say, the i-Opener hack because the i-Opener hack was fundamentally about hardware. Buying the box did not incur an obligation to use the service (due to a mistake on Netpliance's part), and the hack didn't allow you to steal their service - it allowed you to re-purpose the hardware. That would be like hacking a DirecTV box to work with Dish Network instead. A cool, "because it's there" hack. So if DirecTV won the war, more power to them. There may be a fine line between hacking and theft at times, but hacking a DTV smart card for free service is definitely on the wrong side of that line. Besides, stuff like descramblers and smartcards are usually what spammers are filling my emailbox with, and I hate spammers! - -Josh Turiel Re:Three Cheers for Hughes! (Score:3) I have zero respect for these pirates. They could be applying their skills to the next piece of free software, while instead they're just trying to get free TV. What a waste. Of Course you have that right.... (Score:2) ;-) Nice to see, for a change (Score:5) Say what you may about the real and supposed sins of DirecTV and its crackers, they were fighting the war on its technical merits rather than with hordes of lawyers. That's good stuff. It's nice to see a company with the integrity to defend itself within its market and its product rather than look for protection from above. -:2) -- If this is true... (Score:5) [someone should forward this article to the "Beautiful code" guy!] Three Cheers for Hughes! (Score:5) Good job, but we're still pissed about HDTV-CP! (Score:4) Yesterday, we were discussing how we can hack new DirecTV tuners to allow HDTV resolution on analog ports. Does anyone else appreciate the irony of both events happening in the same week? Re... Re:For hackers its just a game (Score:3) Taking out the hackers in only one of Hughes goals with these ECMS. The other was to destroy ALL H-cards, thus forcing their paying customers into upgrading to the HU cards. But I'm sure they're _real_ sorry for whatever inconvenience they've caused people. I don't know where you get your information, but they did not destroy all H cards last Sunday. My trusty old Sony SAT-B2 receiver came with an H card, and it still works fine. But I'm a legitimate paying DirecTV customer. Are you sure your friends were really legit? As soon as I can convince my wife to allow it, I'm gonna upgrade to the Sony SAT-T60 receiver with TiVo -- recording the MPEG streams straight off the satellite is very cool, and I'm dying for that 14-day advance program guide. (I was very annoyed with DirecTV for cutting the guide from 3 days to under 2!) Maybe I'll sell the old Sony receiver after that; the remote codes may conflict with the new Sony, plus the SAT-T60 actually has two DirecTV tuners in it! (But the second one won't work until TiVo gets their act together and updates their software to handle it...). Re:"Hackers"? (Score:3) You're not I don't see this as 'theft' in any way - denying *potential* profits, yes, but not theft. IMO, Hughes did the Right Thing. The crackers cracked their signal, so they cracked the crackers cracks. I think that's pretty nifty. --K Re :) Re:It's not wrong to figure it out... (Score:3) It's true that DirecTV doesn't have as much money as they otherwise would; but it does not necessarily follow that anything has been stolen from them. Many other events could result in them not getting as much money - an economic slowdown, a competitor with a better product, or even a nasty rumor that their satellites are really being used to track people for the sinister purposes of Major League Baseball. Just the fact that they don't have as much money doesn't make it stealing. In the normal understanding of a "theft of service", somebody is still out of some physical quantity that they would otherwise have charged for and that they do not just hand out to all and sundry. Theft of cable TV service, for example (and according to the TV industry at least) steals from your neighbors by degrading their picture quality (a measurable, quantifiable thing). Spam is a theft of network resources and hardware resources on a mail server that your ISP charges you to maintain. Trojans or worms are thefts of service in almost the same way, by consuming network bandwidth and host processing power which somebody paid for and somebody else is getting charged for. But receiving unauthorized satellite broadcasts doesn't deprive anyone of something they are being charged for. Your neighbor's signal is not any more degraded, DirecTV doesn't have to spend any more money than they would have otherwise to achieve national coverage, and the producers of the TV content are already getting paid by DirecTV under terms that were mutually agreeable to both of them. From all of these people's perspective, things are just the same as if you didn't have a DirecTV at all. This doesn't mean that I disapprove of Hughes' actions in this case - I think they are entirely within their rights to police their hardware under any means that are permissible under the contracts they have with DirecTV subscribers, assuming that they have such contracts (although I don't think they have the right to modify the customer's lawfully purchased software or hardware without the customer's permission in the absence of a contract allowing it). I just don't think Hughes should be surprised when other individuals make use of the bits that DirecTV is flinging around so profligately, considering that those bits would just "go to waste" anyway. I have to add, though, that it's nice to see a company whose initial response was not "send in the lawyers". Duking it out hacker a hacker is the way to go on this, and so much more entertaining for the rest of us without DirecTV or the inclination to hack one. Re:It's not wrong to figure it out... (Score:5) I'm curious as to how this is really a theft of service. When that term is applied to spam, for instance, the theft occurs when spammers use up the bandwidth of their relays and the time and hardware of the targeted ISPs. In that case you can point to the extra costs that were required based on the actions of the thieves. However, this satellite broadcast is streaming through all of us all the time. Does just possessing the knowledge to decode these ambient bits somehow make a person a thief? I'll agree that it's unfair to the legit DirecTV subscribers to have to pay for a service that some are getting for free, but I don't agree that decoding bits that are normally present in the environment is theft. Re. Re:"Hackers"? (Score:4) You have no right to make a profit. Nobody can steal that which you have given them for free. Just because you came up with some "clever" business model that involves charging people money for services, that does not entitle you to compensation from people who figure out how to provide this service for themselves. I am deeply disturbed to see this bullshit perpetuated by someone outside the US. Previously, I had been operating on the assumption (obviously false) that "the right of a business to make money" was confined to the US. Once again, for the slow ones: you do not have a right to make a profit, no matter how clever you may think you are, and no matter how long you've been making a profit in the past. If someone out there catches on to your scheme and bypasses it, you lose. (With all that said, I have to applaud the hackers who work for DirecTV. Unlike certain other industries, they didn't resort to dirty tricks or underhanded legislation -- they simply used what they had, and ingeniously too. I'm not ranting against DirecTV here -- I'm ranting against all those who thought that the H-card hackers were "stealing".) "Hackers"? (Score:5) Actually, I *can* do most of those things perfectl (Score:3) YES. 1) yes. Actually, I am 100% allowed by law, in Canada, to listen to your analog cellular calls. Cellphone companies tried to change this, but the crtc was firm: you have no reasonable expectation of privacy by transmitting on public airwaves using standard modulation. Now.. with Digital phones, and specifically, with Encryption this changes. Under Canadian law, encryption wrapping the conversation indicates that you have a reasonable expectation of privacy, and someone violating that woudl be violating your rights. Note that the only reason it's protected is because it is encrypted AND because it is a conversation. Satellite broadcast is not the same thing. Taking photographs, again. If what I see is visible from somewhere I'm legally allowed to be, I'm allowed to take photographs of it. I can photograph anything that can be seen from somewhere I'm allowed to be, especially a public street or my own property. And regarding 'shotgun' mikes, it depends. If I can hear the conversation of you yelling at your wife, and I'm simply using the mike to amplify it, then I am within my rights to record it. If I can't hear you at all, and use the mike to snoop on you, then that's illegal, because you have a reasonable expectation of privacy. Stealing? No. (Score:5) I respect that they put up the satellite, and started the TV service.. however..... Re:Stealing? No. (Score:5) I firmly believe that if you broadcast something on public airwaves, then you have no right to expect privacy. I *know* when I use my cordless phone that anyone who wants can listen in. I also know that when I transmit cleartext data over the internet (like this slashdot post), it is going into a network that I have *no control* over, because I don't own it. I *assume* that someone is listening in. If I want nobody to listen to my conversations, I use encryption, hoping that deters them somewhat, though I'm still aware someone could be intercepting it and decrypting it if they are capable. As for manipulation... If I'm broadcasting through your network, and you want to sniff my info and manipulate/decrypt it, and there is no standing agreement that you won't ever do this... go right ahead. If you *DO* anything with that information outside your own brain/house.. THEN I'll have a problem with it, but not because you intercepted it. Re:"Hackers"? (Score:4) In Canadian law however, it is legal to decrypt a satelite signal provided that it cannot be legally paid for. We cannot legally purchase and pay for the DirecTV stream and thus we are legally and morally entitled to decrypt and watch the DirecTV stream. So whereas Americans who attempt to decrypt the signal can indeed be considered "crackers", the Canadians that have been victimized by the Canadian government and Hughes are "Hackers". We have done nothing wrong and are being punished for it. - DirecTV is very cool about this whole situation. (Score:5) To show you how cool things have become... The latest trend in DSS is using emulation software on a PC to intercept the signal and then sending it to your reciever. It truly is an innovative solution! I swear, words like ECMs (Electronic Counter Measures) that literally destroy cards, and Unloopers (thinks that fix "looped" or destroyed cards") really make this feel like some hollywood hacker movie. But it's not. It's for real! Damn, that is just too cool! -Nick So the hackers got hacked. (Score:5) Direct TV sells a service. They make money from the sale of this service, and they provide the infrastructure, the broadcast, the hardware, etc. Then, a bunch of kids decide that they want what DirectTV has, but not at their terms. So they steal the service. Yes, they stole it. Hell, they admit it in the article. So what does DirectTV do? They beat the hackers at their own game. They outplay, outsmart, and outfox them. Bravo. They protected themselves and their market share in the best way possible. In the end, we can all appreciate the beauty of this particular hack. Re:finally (Score:3) So if they increase thier profits by having more subscribers, you *are* stealing from them, in a very real sense. Dirk And so it begins. (Score:3) Re:So the hackers got hacked. (Score:3) Re:For hackers its just a game (Score:5) Recent Law has Changed (Score:5) This is why the old C-band dishes never had prosecutions for descrambling, or why you could listen in to Cellular Telephone conversations. And this would apply to DirecTV too, except it didn't exist when this law did. Sometime in the mid 90's, a new Radio Telecommunications Act was passed which banned the eavesdropping on cellular telephones and any other signal entering your property that needed to be decoded. Thus, now the old C-Band hackers had become pirates, and the new DirecTV decoding was illegal. The question is this - do you have the right to translate signals that are travelling onto your property - signals which you did not request? The old law said yes. The new one says no. Poetry in code (Score:3) Someone said that they're within their rights to "illegally" descramble DirecTV's content, because it's broadcast over public airwaves. True, but then, isn't DirecTV also entitled to broadcast whatever they want? If you just happen to be foolish/1337 enough to be running a hacked card, well, thanks for coming out, better luck next time. DirecTV didn't physically destroy the cards, so I don't think the hackers have any grievance in that respect... Nicely done, on both sides. I think this deserves an entry into the hacker hall of fame. Re:Agree - Re:It's not wrong to figure it out... (Score:3) Unless the people currently making money out of a specific business model can get their business model made the "law of the land". Which is the same root issue surrounding Napster, DeCSS, etc. Large corporate interests trying hard to make sure their business model doesn't become obsolete. (With their relatives such as the iopener and cue cat, where a business thinks it is the job of the law to protect their, unproven, business model.) The "scribes" are probably wishing they had considered political lobbying... Re:Stealing? No. (Score:3) Canada also has some different views on the RF spectrum. IE: last I checked it was illegal to manufacture a scanner that could scan 800MHz (non-digital Cell) in the US, but not Canada. FWIW, -- Remove the rocks to send email Re:I'm afraid I found this v funny (Score:3) Re:Uh yeah. (Score:3) The "Game" is far from "Over" (Score:5) Secondly, the new HU card has recently been hacked to allow for the "3M" scripts that open all channels. DirecTV launched their first attack against hacked HU cards this past week as well, but the community actually learned quite a bit about the HU card from this attack. This HU hack is only available through "dealers" for several hundred dollars, but I'd expect the necessary scripts to become freeware over the next few months. DirecTV will have their hands full once an emulation script is created for the HU. Lastly, DirecTV also hit many, many paying subscribers running legit cards with their attack on Sunday. You can be certain that this attack cost them quite a few dollars in terms of cards needing to be replaced as well as the loss of subscribers that they have managed to piss off once again. Cool or what? (Score:5) Can we set-up an interview with the techie that planned it? It's not wrong to figure it out... (Score:3) Evan Re:Recent Law has Changed (Score:4) The question is this - do you have the right to translate signals that are travelling onto your property - signals which you did not request? According to the law, no, you don't have that right. I don't agree with that; I still feel you should have the right to do whatever you want with the signals that are sent to your property. But this really doesn't matter one way or another in this particular case, because it doesn't sound like Hughes tried to press legal charges on those who did hack/crack the signal. Here's the rub: Hughes made the cards, and Hughes "leased" or "licensed" the cards to real customers with EULAs. Hughes has the right to damage their own cards, even in your home, through the use of their FCC-licensed class and power of signals. If you were a legit customer who had an old (and now burnt) H card, it dropped your service for a day or two while you stop by a service center. If you were a thief who got pay-to-view entertainment for free, then that burnt card is useless to you. I have absolutely NO problem with the way that Hughes handled this. About Time (Score:4) Re:Uh yeah. (Score:3) Sorry, but you're wrong. Do you think a bank robber can sue a bank who puts a dye pack in his bag of money to render the money useless? Do you think that people who put razor bars around their stereo equipment can be sued by the theif who loses a finger? Thirdly the destruction of the cards would force Hughes to replace them. Not a cheap move. What do you think is cheaper: letting people take $30 or $40 per month out of Hughes' pocket by not paying for the service, or replacing a single smart card. I'm not an authority on the subject, but I think making these people pay for 2 months of service would make up for the cost of a new smart card. BTW, is "thirdly" a word? Finally, the site Michael linked to requests financial support by clicking a paypal link. Sounds like an elaborate setup to fleece the We're glad Shoeboy is looking out for our interests. Slashdot requests financial support by displaying banner ads, and so do 99% of all other sites on the web. The one in question uses PayPal for its financial support instead of banners. What's the problem? Re:"Hackers"? (Score:5) Crackers are not always script kiddies Hackers are never script kiddies Hackers are not Crackers Hackers have my respect. The hacking involved in duping an entire community of crackers (no matter how intelligent they are) for long enough to build a program in their machines, little piece by little piece, then pull the trigger, whilst having the flair and style to leave the message "GAMEOVER" in the first 8 bytes of the code is fantastic, and the credit goes to directv. Of course, since I pay for services and end up subsidising people who think they've a right to the same services for free because they happen to have the skills necessary to steal them probably makes me a little biased. ATTENTION Dept Information warfare! (Score:3) I think the bit I like best about this is that DirecTV managed to upgrade their software remotely without cuasing an interruption to the service. THAT was a ballsy thing to do before the Superbowl! Re:not stealing (Score:5) With DeCSS I paid for the signal and it is illegal for me to decode it myself. With DirecTV the hackers have not paid for the signal and they have been techincally outsmarted by the company. With DeCSS, the company have attempted to encrypt their signals from people who have the right to view them, technically they failed and now they are suing all who know how to decrypt them. With DirecTV the company is attempting to enrypt their signals from those who haven't paid for them, and they've come up with a technical solution and won [for the time being]. DirecTV are not attempting to run over the legal rights of consumers, they are attempting to prevent piracy. CSS attempts to destroy legal rights under the guise of preventing piracy. I subscribe (Score:3) My wife and I are pretty happy with the service (other than rain fade margins-- they don't exist!) and think that we made the right choice over going with TWC. One of her teacher colleagues has TWC digital cable, and the picture is awful compared to DirecTV. (Except in those summer monsoons when DirecTV doesn't work at all!) I have never been comfortable with people getting these kinds of services without paying for them. That monthly bill not only pays for the programming, but also on infrastructure and maintenance. Hughes played a HUGE gamble by launching its DirecTV bird. Unlike cable, satellite systems must have their entire infrastructure in place before they can sign their first subscriber. Cable systems can roll out a piece at a time, and early adoptors help pay to expand into new areas. The only thing I'd like Hughes to add is a non-Windows bidirectional link for DirecPC and a dual-subscriber discount like TWC has with RoadRunner. Re:Physically destroyed? (Score:3) Tit for Tat, etc. (Score:3) Now Obviously, alot of folks are going to be pissed off because they "lost" the game. And I am sure that the fine folks at DirectTV are gleeful about the gnashing of teeth and their own clever victory. Somehow I think this has to been kept quite separate from the other issues dealing with digital media. People providing a service deserve enough to be able to cover the costs of their operation and to make a reasonable profit. Let those who are without sin cast the first stone. Who has not had dotcom phantasies of obscene wealth? Well how did you expect you would do this? by giving away the homeplanet? or do you want them to spent millions of dollars so that you can enjoy your right to the superbowl and free pr0n? That being said there is ALSO the issue of fair and reasonable exchange for goods and services. DirectTV certainly has been on the wrong side of the issue as far as some aspects of copy protection, etc. Some people would rather spend extraordinary effort and money to not not pay for goods and services. In the past, these people were called the 'rich'; it was part of their culture. and now this attitude has dribbled into the rest of society In the past, much of what has passed for morality has been an effort to help keep people in their place, to help mold them into sheeple. This has been the main thrust of modern education since the education "reforms" at the beginning of the 20th century. All those immigrants had to be educated to be good workers, etc. NOT competitors to the status quo. This ties in with the DirectTV game because the company, as such, naturally, and perhaps unwittingly, takes advantadge of the situation to impose conditions that are not fair exchange. People instinctively react, at first, to situations that are not fair. They get mad. and they use this to justify their own attempts to get what they think they are due, and maybe a little bit more. It becomes a viscious circle.Unfortunately, some poeple will never be happy. I'm afraid I found this v funny (Score:3) Re:For hackers its just a game (Score:4) What would be cool is if someone found a way to actually revers-engineer and manufacture smart cards that recieved the regular updates, and acted exactly like legit ones, except they didn't dial into DirecTV. This is the way companies should combat hackers that are "stealing" or "bypassing access control methods"... not tracking them down and suing them, and getting laws put in place to ban things that are useful to the community at large. DirecTV was able to attack hackers without infringing on their paying customers! "Evil beware: I'm armed to the teeth and packing a hampster!" Re:It's not wrong to figure it out... (Score:4) "Evil beware: I'm armed to the teeth and packing a hampster!" Info from the newsgroup (Score:5) It looks to me like DirectTV (better known to the a.d.h members as "Dave", and not to be confused with "SuperDave", one of the newsgroup regulars) played an ace they've had up their sleeve for a long time. Apparently the boot code (in ROM) of the 8051 in the chip checks one bit in a 32-bit region of PROM (as in you can program it but you can't reset it) and goes into an infinte loop (I think this is what is being referred to as a "looped" card) early during the boot process. Since this is in ROM where it can't be re-programmed, you can't bypass it. It seems there's also an ASIC in the card that is crucial to the decoding process. I'm guessing that it has to be enabled by the 8051. And if the 8051 "loops" before you can talk to it, you're hosed. It also seems that there was a recent move to "emulators", which emulated the 8051, but passed commands to the ASIC through to the real card. That way, as long as the card was alive enough to tell it what to do, you would esentially firewall off the card from any nasty code that wanted to do stuff like program write-once bits in the CPU chip. Some people were arguing recently that emulators were overkill, but it seems they have been proven wrong. The only people with hacked cards that still work either had emulators or were lucky enough to pull their cards in time (or the decoder box was unplugged). Apparently for a couple of weeks now "Dave" has been downloading code to detect illegal cards and test it (by locking up assorted cards and seeing what kind of results they got) before sending down the "ECM" code which caused the card to kill itself. As to the timing, it is suspected they chose one week before Super Bowl to allow enough time for legitimate users (or those illegitimate users who wanted the better signal in time for The Big Game) to receive new cards. Here are two messages I found on the newsgroup about all this: (line art removed from the first one because of /.'s lame filter) From: ump25@aol.com (Ump25) Newsgroups: alt.dss.hack Date: 22 Jan 2001 05:38:13 GMT Subject: EVERYONE READ THIS! INFO FROM MAGICIAN ET. AL. Message-ID: <20010122003813.16538.00000761@ng-bj1.aol.com&g t; From Magician and Hypertek comes the following... As most everybody is aware, the ability of the dynamic code to execute a kill-type ECM was displayed today on "Black Sunday". First, the bad news: the ECMs wrote 4 bytes to "write once" area of the EEPROM, 8000h-8003h. Unfortunately, one of the bytes that is changed is 8000h, which is checked extremely early in the ROM startup code (003Fh) to see if it contains "33h". These ECMs re-wrote this byte to "00h", which means that it very quickly enters an infinite loop because "P1.7" is not set. Since this area of the H card is "write once", there is no way to reset this byte back to "33h" to allow normal startup to continue, even by way of an unlooper. Second, for those interested, here are all the EEPROM addresses that were tested to see if they contained modified bytes. Each byte was tested in its own packet (i.e., one address at a time): 2 ,8 D24,8D25,8D32 Ins54 code code: - - - 8243 Vector for setting DPTR to ZKT secret vector 8246,8247 Vector for Cmd09 vector 8255 Vector for Ins58 patch vector 8258 Ins44 preprocessing vector 825B Ins44 extras vector 825E Find tier or PPV vector 8264 "EndInsHandling" vector 8273 Cmd1F vector 827C,827D Ins54 vector 8282,8283 Ins18/Ins1A vecotr 8440 First byte of channel blackout data (checked if non-zero) 8582,858C,8593 Cmd60 code 85B7 B7 nano vector 85BE BD nano vector 85C0,85C1,85C2 C0 nano vector 85C3 C3 nano vector 85C6,85C7 C6 nano vector 85E2,85E6,85ED,85EF,85F6 B5 nano code 8606,8608,8611 AddAToDfdNanoBufIfFlOpn code 8630 Deferred Cmd60 processing code 86DD Never-executed portion of old C6 nano code 87A1 Old CF nano jump table 8800 Hash algorithm code 8955 Main loop vector code 8973 Ins18/Ins1A code 8975 Ins54 check code 8982 Setup for Ins38 code 89A0,89A3 Setup for Ins44 code 89A6,89B2,89B9 Setup for Ins4C code 89DF End of main loop vector code 8BFE Cmd0C code 8CC7,8CCA,8CCB Preprocess deferred Cmd60 code 8CD9,8CDE Cmd0B for non-virgin cards code 8CF2,8CFE Ins58 patch code 8D04,8D09,8D0D,8D11,8D14,8D178D1A,8D1D,8D20,8D2 8D66,8D6A,8D72,8D76 Add ASIC bytes to signature hash code 8DD0,8DD3,8E68 Do 1 hash iteration code 8F2F Preprocess Cmd09 code 8F53 Cmd0C patch 1 code - - - Here is an example dynamic code packet (for the 8D1Ah address; all of the addresses were tested using similar packets, except for 8440h which used a JNZ instead of JZ): code: - - - C3 nano used to preset RAM locatiosn 10h-1Fh: C3 0A 00 20 99 03 AF 01 00 04 00 09 | Seed hash only (using 9 data bytes) results in these bytes at 10h-1Fh: 20 99 03 AF 01 00 04 00 09 CB 29 71 06 19 74 D0 Fourth byte loaded in EEPROM write register Third byte loaded in EEPROM write register Hi byte of 1st loop return address and second byte loaded in EEPROM write register Lo byte of 1st loop return address and first byte loaded in EEPROM write register Hi byte of 2nd loop return address Lo byte of 2nd loop return address Hi byte of 3rd loop return address Lo byte of 3rd loop return address What 8D1Ah is compared to The C9 nano looked like this: C9 10 20 90 8D 1A E0 47 60 08 90 | Write 15 bytes+RET, execute and hash 80 00 78 15 75 81 16 : which caused this code to be executed: 893C mov DPTR,#8D1Ah 893F movx A,@DPTR 8940 xrl A,@R1 8941 jz 894Bh 8943 mov DPTR,#8000h 8946 mov R0,#15h 8948 mov SP,#16h 894B ret - - - Remember, R1 starts equal to 10h. So the above code does the following: Compare 8D1Ah to @10h (which contains #20h) If they match, simply return Otherwise, set DPTR to 8000h Set R0 to 15h Reset the stack to 16h and RET, to resume execution at 0400h to load "00 04 00 09" into EEPROM write register which RETs to 01AFh to enable EEPROM write mode which RETs to 0399h to write 00 04 00 09 to 8000-8003h. In addition, there was an ECM to detect an H cards running with non-H CAM IDs, although this packet did not loop the card but simply "locked it up" until the next reset: code: - - - C3 nano used to preset RAM locatiosn 10h-1Fh: C3 0B 00 FE FC 32 00 00 04 AC 01 68 14 | Seed hash only (using 10 data bytes) results in these bytes at 10h-1Fh: FE FC 32 00 00 04 AC 01 68 14 8A DF A3 AA 81 34 Hi byte of 1st loop return address Lo byte of 1st loop return address Hi byte of 2nd loop return address Lo byte of 2nd loop return address Hi byte of 3rd loop return address Lo byte of 3rd loop return address Hi byte of 4th loop return address Lo byte of 4th loop return address The C9 nano looked like this: C9 12 20 90 83 74 81 60 07 57 70 | Write 17 bytes+RET, execute and hash 05 09 B9 12 F6 22 75 81 19 : which caused this code to be executed: 893C mov DPTR,#8374h 893F movx A,@DPTR++ 8940 jz 8949h 8942 anl A,@R1 8943 jnz 894Ah 8945 inc R1 8946 cjne R1,#12h,893Fh 8949 ret 894A mov SP,#19h 894D ret - - - Remember, R1 starts equal to 10h. So the above code does the following: If first byte of CAM ID is 00, return (everything OK). Otherwise, AND first CAM ID byte with byte @10h (#FEh) If result is non-zero (meaning first CAM ID byte is not 01h), go to ECM routine Otherwise, AND second CAM ID byte with @11h (#FCh) If result is non zero, go to ECM routine Otherwise, return (everything OK) The ECM routine resets the SP to cause the RET to resume execution at 1468h, which RETs to 01ACh, which RETs to 0400h, which RETs to the infinite loop at 0032h... From: Spacemonkey Gleep <Fictitious@Dont.Bother.Its.invalid> .com> Newsgroups: alt.dss.hack Subject: How Write-Once memory works, or "Why H cards hit by the ECM are never going to be fixed" Date: Mon, 22 Jan 2001 10:56:12 -0800 Message-ID: <Fictitious-402BA7.10561222012001@news.primenet In response to the umpty-nine-dozen "Why can't we just..." questions about the corrupted write-once area on the card, here's an explanation that may shed some light. (Note to those "in the know": Yes, I'm simplifying things ridiculously. Not everybody playing in this little sandbox is an EE with the knowledge to understand the inner workings of a chip) A byte of RAM memory is a set of 8 cells that can hold a one or a zero. Which cells have 1s in them determines the value of the byte when you read it. With RAM, you can change the values any time you like. You can think of that byte as 8 switches that can be turned on or off in different combinations to give you various values. A byte of ROM is similar, in that it's 8 cells that can each hold a 1 or a 0. Unlike RAM, these 1s and 0s are fixed. Instead of the "switches" that RAM has, you can think of ROM as having either a wire (for a 1) or no wire (for a zero). They can't be changed once made. The wire (or lack of one) is a permanent thing. A byte of Write-Once memory (Also known as "PROM", or "Programmable Read Only Memory") has characteristics of both RAM and ROM. Like RAM, you *CAN* write to it, under certain circumstances. Like ROM, once written, it's **FOREVER**. Think of a byte of PROM as being 8 microscopic fuses. When the chip is made, all the fuses are "good". If you could see it at the microscopic level, it would look something like this: ( each | is a fuse that isn't blown ) | | | | | | | | and would have the value FF, or 255 in decimal. Now, let's say you want the byte to have the value B7 (That's 183 in decimal, and in binary, it's 10110111) To write that value to it, you deliberately burn out two fuses in the byte, leaving it looking like this: (| = unblown fuse, : = blown fuse) | : | | : | | | From that point, it would be possible to write to it again, and change the value, *BUT* there's a catch. You can only "blow" more fuses. You can't "un-blow" fuses that are already blown. This means that a number that needs one of the fuses that's already blown out is going to be impossible to write. So why is this a problem? Normally, byte 8000 of the H card holds the value 33 (in Decimal, 51. In binary, 00110011) and the byte looks like this: : : | | : : | | But after being hit by DTV's ECM last night, the byte is set to 00 - it looks like this: : : : : : : : : There's no fuses left to blow out. They're all gone. That means that forever and always, byte 8000 of your ECMed card is going to say "I'm holding the value 00" when asked. Why this means the card is permanently dead: VERY early after the card gets powered up and reset, a check is done: Does byte 8000 hold the value 33? If the answer to that question is yes, then all is right with the world, and things start happening. The card gets initialized, spits out the ATR string, and then goes into "wait for a command from the IRD" mode. If, on the other hand, the answer is no, then the card goes into an infinite loop that does nothing. If you program in BASIC, it's the equivalent of the line 10 GOTO 10 NOTHING gets done until the next time the card is reset. And then the same thing happens all over again. This check is in the card's ROM, so it can't be bypassed or changed. Reprogramming the card won't do anything useful, since the ROM doesn't even get looked at, let alone messed with, by programmers (or unloopers, for that matter) and even if it did, it wouldn't do anything useful, since ROM can't be changed (short of actually damaging it). So how can it be fixed? The simple answer: It can't. Congratulations. Your H card is now an ice scraper. Get used to it. Life sucks. The more extended answer: If you've got the micro-tools to "rebuild" the blown fuses on the chip, you could go that route, but unless you're a chip manufacturer, or have access to that type of equipment somehow, you ain't got a prayer. We're talking about electron microscopes, tools for depositing single atoms onto the silicon wafer itself, that sort of thing. In other words, trying to do it is going to mean more money, knowledge, equipment, and effort than most any of us are capable of applying to the problem. In short, last nights ECM was the ECM to end all ECMs. Any card hit by it is toast, and barring someone developing a cheap way to rebuild chips mat the wafer level (which isn't even remotely likely to happen anytime soon) there isn't a thing that can be done about it. Enjoy your new ice scraper. Or get in touch with me about shipping it to me. I want to dissect it to get the ASIC out of it for some experimenting I want to do. -- GLEEEEEP!!!! PGP KeyID: 0x016B6B53 on the keyservers. Re:Stealing? No. (Score:5). The airwaves are public, after all. information wants to be expensive...nothing is so valuable as the right information at the right time. For hackers its just a game (Score:3) Beautiful! (Score:3) I personally believe that any signals that happen to cross the boundaries of my property are mine to do with as I wish, but I also believe that the senders of those signals have the right (and in the case of a commercial enterprise, the necessity) to try and protect those signals. This should be listed as one of the Top Ten Hacks of all time.
http://hardware.slashdot.org/story/01/01/25/1343218/directvs-secret-war-on-hackers
CC-MAIN-2014-52
refinedweb
8,485
68.7
The QIconSet class provides a set of differently styled and sized icons. More... #include <qiconset.h> List of all member functions. Once a QIconSet is fed some pixmaps, it can generate smaller, larger, active and disabled pixmaps. Such pixmaps are used by QToolButton, QHeader, QPopupMenu, etc. to show an icon representing a piece of functionality. The simplest usage of QIconSet is to create one from a QPixmap then use it, allowing Qt to work out all the required icon sizes. For example: QToolButton *tb = new QToolButton( QIconSet( QPixmap("open.xpm") ), ... ); Using whichever pixmaps you specify as a base, QIconSet provides a set of six icons each with a Size and a Mode: You can set any of the icons using setPixmap() and when you retrieve one using pixmap(Size,Mode), QIconSet will compute it from the closest other icon and cache it for later. The Disabled appearance is computed using a "shadow" algorithm which produces results very similar to that both large and small sizes of pixmap. QIconSet provides a function, isGenerated(), that indicates whether an icon was set by the application programmer or computed by QIconSet itself. If you write your own widgets that have an option to set a small pixmap, you should consider instead, or additionally, allowing a QIconSet to be set for that pixmap. The Qt class QToolButton is an example of such a widget. Provide a method to set a QIconSet, and when you draw the icon, choose whichever icon is appropriate for the current state of your widget. For example: void YourWidget::drawIcon( QPainter* p, QPoint pos ) { p->drawPixmap( pos, icons->pixmap(isEnabled(), QIconSet::Small) ); } You might also make use of the Active mode, perhaps making your widget Active when the mouse in inside the widget (see QWidget::enterEvent), while the mouse is pressed pending the release that will activate the function, or when it is the currently selected item. See also QPixmap, QLabel, QToolButton, QPopupMenu, QIconViewItem::setViewMode(), QMainWindow::setUsesBigPixmaps() and GUI Design Handbook: Iconic Label Normal- the pixmap to be displayed when the user is not interacting with the icon, but when the functionality represented by the icon is available. Disabled- the pixmap to be displayed when the functionality represented by the icon is not available. Active- the pixmap to be displayed when the functionality represented by the icon is available and the user is interacting with the icon, such as by pointing at it or by invoking it. Automatic- the size of the pixmap is determined from its pixel size. This is a useful default. Small- the pixmap is the smaller of two. Large- the pixmap is the larger of two If a Small pixmap is not set by QIconSet::setPixmap(), then the Large pixmap may be automatically scaled to two-thirds of its size to generate the Small pixmap. Conversely, a Small pixmap will be automatically scaled up by 50% to create a Large pixmap if needed. See also setPixmap(), pixmap(), QIconViewItem::setViewMode() and QMainWindow::setUsesBigPixmaps(). Constructs an icon set of null pixmaps. Use setPixmap(), reset(), or operator=() to set some pixmaps. See also reset(). Constructs an icon set for which the Normal pixmap is pixmap, which is assumed to be the given size. The default for size is Automatic, which means that QIconSet will determine if the pixmap is Small or Large from its pixel size. Pixmaps less than 23 pixels wide are considered to be Small. See also reset(). Creates an iconset which uses the pixmap smallPix for for displaying small a small icon, and largePix for displaying a large one. Constructs a copy of other. This is very fast. [virtual] Destructs the icon set and frees any allocated resources. Detaches this icon set from others with which it may share data. You will never need to call this function; other QIconSet functions call it as necessary. Returns TRUE if the variant with size s and mode m was automatically generated, and FALSE if it was not. This mainly useful for development purposes. Returns TRUE if the icon set is empty. Currently, a QIconSet is never empty (although it may contain null pixmaps). Assigns other to this icon set and returns a reference to this icon set. This is very fast. See also detach(). Returns the pixmap originally provided to the constructor or to reset(). This is the Normal pixmap of unspecified Size. See also reset(). Returns a pixmap with size s and mode m, generating one if needed. Generated pixmaps are cached. Returns a pixmap with size s, and Mode either Normal or Disabled, depending on the value of enabled. Sets this icon set to provide pm for the Normal pixmap, assuming it to be of size s. This is equivalent to assigning QIconSet(pm,s) to this icon set. Sets this icon set to provide pm for a size and mode. It may also use pm. See also reset(). Sets this icon set to load fileName as a pixmap and provide it for size s and mode m. It may also use the pixmap. Search the documentation, FAQ, qt-interest archive and more (uses): This file is part of the Qt toolkit, copyright © 1995-2005 Trolltech, all rights reserved.
http://doc.trolltech.com/2.3/qiconset.html
crawl-002
refinedweb
862
64.91
The most common solution for this problem is using DP, BFS or Number theory. Here I will give a brief explanation of the DP solution. The solution is as following: public int NumSquares(int n) { int[] DP = new int[n + 1]; for (int i = 1; i <= n; i++) { int min= int.MaxValue; for (int j = 1; j * j <= i; j++) { min= Math.Min(min, DP[i - j * j] + 1); } DP[i] = min; } return DP[n]; } First of all, we created the DP array as usual. This DP array stands for the least number of perfect square numbers for its index. For example DP[13]=2 stands for if you want to decompose 13 into some perfect square numbers, it will contains at least two terms which are 33 and 22. After the initialization of the DP array. We want to iterate through the array to fill all indices. During each iteration we're actually doing this: dp[i] = 1 + min (dp[i-j*j] for j*j<=i). The formula itself is a little bit hard to understand. Here's an example of how it works: (C#) Suppose we want to get DP[13] and we already have the previous indices filled. DP[13] = DP[13-1x1]+DP[1] = DP[12]+1 = 3; DP[13] = DP[13-2x2]+DP[2x2] = DP[9]+1 = 2; DP[13] = DP[13-3x3] + DP[3x3] = DP[4] + 1 = 2; We pick the smallest one which is 2 so DP[13] = 2. Hope it helps. Why do you explicitly set DP[1] = 1; instead of just starting i at 1? And if you think explicitly setting unnecessary base cases is good, then why not also add DP[2] = 2; and start i at 3? Btw, your text got messed up because some * got interpreted as markup and are now missing. Actually the base case is necessary, and the actual base case should be DP[0] = 0 (which may be set by the compiler when you "new" the array). For the above code, whenever i = j * j, it will reach DP[i - j * j] = DP[0]. Lol. Sorry I wasn't the one who posted this algo. I agree with you that the 1-case is not needed. For the “multiple", it must be something wrong with this editor. It won't show up by simply typing the ""*(star). Oh. I meant @jim11 was the one (NOT ME) posted this solution. I am NOT HIM. I just added my comment like you did. When you referred to "your comment" I assumed that you mistook me as him. PLAGIARISM?? what's going on? Ah ****, I didn't realize you're a different person, sorry :-) I now hid my thus nonsensical comments in shame... Nice solution. In case recursive DP is easier to understand for anyone (Like it is for me) here's my solution: public class Solution { public int numSquares(int n) { int[] cache = new int[n + 1]; return numSquares(n, cache); } public int numSquares(int n, int[] cache) { if (n <= 1) { return Math.max(0, n); } if (cache[n] == 0) { cache[n] = Integer.MAX_VALUE; for (int i = 1; i * i <= n; i++) { cache[n] = Math.min( cache[n], numSquares(n - i * i, cache) + 1 ); } } return cache[n]; } } Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.
https://discuss.leetcode.com/topic/24159/explanation-of-the-dp-solution
CC-MAIN-2018-05
refinedweb
557
73.27
Introduction This article of the series, “Diving into OOP,” will explain all about delegates in C#. This article focuses more on practical implementations and less on theory, and.” Following is the list of all the other articles of the OOP series. Delegates A delegate is one of the most interesting features of C# programming language. And, it can directly be placed under namespace as classes are placed. Delegates completely follow the rule of object oriented programming. Delegates extend System.Delegate class. Delegates are the best suite for anonymous invocations as they can call any method provided the signature of the method i.e. the return type and the parameters, is the same. Let’s try to cover the topic via practical examples. Lab 1 Create a console application and name it as per your choice. I named it EventsAndDelegates. Add a public class named DelegateExercises, with the following implementation. DelegateExercises Read more For more technical articles you can reach out to CodeTeddy My other series of articles, Happy coding ! View All
http://www.c-sharpcorner.com/article/explore-delegates-in-c-sharp/
CC-MAIN-2018-09
refinedweb
171
50.84
Important: Please read the Qt Code of Conduct - Why the app theme did not change with the system - Dylan Deng last edited by I have specified the Material theme as "System" in qtquickcontrols2.conf, and the current macOS theme is set to dark mode. But when I compile and re-run the application, the title bar and window contents of the application are still displayed in light mode. [Controls] Style=Material [Material] Primary=#41cd52 Accent=#41cd52 Theme=System What other settings should I make? Don't know how you could do it in qtquickcontrols2.conf, but you could do this, as described by the docs, Maybe specifying Universal.System in conf works too.. import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Controls.Universal 2.12 ApplicationWindow { visible: true Universal.theme: Universal.System Column { anchors.centerIn: parent RadioButton { text: qsTr("Small") } RadioButton { text: qsTr("Medium"); checked: true } RadioButton { text: qsTr("Large") } } } @Dylan-Deng seems like you should be able to do this; [Controls] Style=Universal [Universal] Theme=System There is plenty of information on this subject, found with a simple search. for example; ~ this page gives some pretty detailed configurations for various themes/fonts/colours. - Dylan Deng last edited by @Markkyboy I spent an afternoon through google and Qt documents, which failed to achieve the program to change the theme color according to the theme set by the system. According to the documentation, the only thing I can see is that set Themeas System, but it does not work. The use of Universal.theme: Universal.Systemin QML files, it does not work too. @Dylan-Deng You have also included the universtal style when testing Universal.theme:Universal.System ? import QtQuick.Controls.Universal 2.12 And removed every other setting related to styles? - Dylan Deng last edited by Dylan Deng @MEMekaniske Yes, I'm using Qt example gallery and removed QQuickStyle::setStyle in mian.cpp QSettings settings; QString style = QQuickStyle::name(); if (!style.isEmpty()) settings.setValue("style", style); else QQuickStyle::setStyle(settings.value("style").toString()); Then I set the qtquickcontrols2.conf like this: [Controls] Style=Material [Material] Primary=#41cd52 Accent=#41cd52 Theme=System It does not working out whether or not I set Material.theme: Material.System
https://forum.qt.io/topic/115815/why-the-app-theme-did-not-change-with-the-system/4
CC-MAIN-2021-25
refinedweb
368
50.23
Quickstart¶ Eager to get started? This page gives a good introduction to Flask. It assumes you already have Flask installed. If you do not, head over to the Installation section. A Minimal Application¶ A minimal Flask application looks something like this: from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello, World!' So what did that code do? First we imported the Flaskclass.. For more information have a look at the Flaskdocumentation. We then use the route()decorator to tell Flask what URL should trigger our function. The function is given a name which is also used to generate URLs for that particular function, and returns the message we want to display in the user’s browser. Just save it as hello.py or something similar." Alternatively you can use python -m flask: $ export FLASK_APP=hello.py $ python -m flask run * Running on This launches a very simple builtin server, which is good enough for testing but probably not what you want to use in production. For deployment options see Deployment Options. Now head over to, and you should see your hello world greeting. Externally Visible Server: flask run --host=0.0.0.0 This tells your operating system to listen on all public IPs. What to do if the Server does not Start¶ In case the python -m flask fails or flask does not exist, there are multiple reasons this might be the case. First of all you need to look at the error message. Development Server docs to see the alternative method for running a server. Invalid Import Name¶ The FLASK_APP environment variable is the name of the module to import at flask run. In case that module is incorrectly named you will get an import error upon start (or if debug is enabled when you navigate to the application). It will tell you what it tried to import and why it failed. The most common reason is a typo or because you did not actually create an app object. Debug Mode¶ (Want to just log errors and stack traces? See Application Errors) The flask script Development Server docs.. - For example, here we use the test_request_context() method to try out url_for(). test_request_context() tells Flask to behave as though it’s handling a request even while we use a Python shell. See Context Locals. from flask import Flask, escape, url_for')) / . Static Files¶. Rendering Templates¶: Context Locals¶¶. File Uploads¶ You can handle uploaded files with Flask easily. Just make sure not to forget to set the enctype="multipart/form-data" attribute on your HTML form, otherwise the browser will not transmit your files at all...utils import secure_filename @app.route('/upload', methods=['GET', 'POST']) def upload_file(): if request.method == 'POST': f = request.files['the_file'] f.save('/var/www/uploads/' + secure_filename(f.filename)) ... For some better examples, checkout the Uploading Files pattern. Redirects and Errors¶. See Error handlers for more details. a tuple is returned the items in the tuple can provide extra information. Such tuples have to be in the form (response, status, headers), (response, headers)or (response, status)where at least one item has to be in the tuple. Sessions¶__) # Set the secret key to some random bytes. Keep this really secret! app.secret_key = b'_5#y2L"F4Q8z\n\xec]/' @app.route('/') def index(): if 'username' in session: return 'Logged in as %s' % escape. Besides the default client-side based sessions, if you want to handle sessions on the server-side instead, there are several Flask extensions that support this. Message Flashing¶. Logging¶ Changelog docs for more information. Read more on Application Errors. Hooking in WSGI Middleware¶ To add WSGI middleware to your Flask application, wrap the application’s wsgi_app attribute. For example, to apply Werkzeug’s ProxyFix middleware for running behind Nginx: from werkzeug.middleware.proxy_fix import ProxyFix app.wsgi_app = ProxyFix(app.wsgi_app) Wrapping app.wsgi_app instead of app means that app still points at your Flask application, not at the middleware, so you can continue to use and configure app directly. Using Flask Extensions¶ Extensions are packages that help you accomplish common tasks. For example, Flask-SQLAlchemy provides SQLAlchemy support that makes it simple and easy to use with Flask. For more on Flask extensions, have a look at Extensions. Deploying to a Web Server¶ Ready to deploy your new Flask app? Go to Deployment Options.
https://flask.palletsprojects.com/en/1.0.x/quickstart/
CC-MAIN-2020-16
refinedweb
723
60.11
I have some C++ code that has a structure something like this: class Base1{} class Base2{} class Intermediate : Base1{} class Intermediate : Base2{} class Top : Base1::Intermediate, Base2::Intermediate{} I have heard that gcc has issues with this multiple inheritance, because it does not handle the namespace/scope resolution correctly and sees both "Intermediate" classes as the same class, which of course they're not. Is this something that has been resolved in newer versions of gcc? Anyone know of any references to a problem like this (I looked, but couldn't find much in my brief search)? Thanks for your help.
http://forums.devshed.com/programming-42/multiple-inheritance-naming-issues-gcc2-9x-63564.html
CC-MAIN-2017-34
refinedweb
101
55.58
You can subscribe to this list here. Showing 1 results of 1 Feature Requests item #1560502, was opened at 2006-09-18 08:26 Message generated for change (Comment added) made by petli You can respond by visiting: Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Priority: 5 Submitted By: Nick Welch (mackstann) Assigned to: Nobody/Anonymous (nobody) Summary: window.change_property will not accept a unicode string Initial Comment: line 636 of protocol/rq.py checks if type(val) is types.StringType. This means that unicode strings end up getting treated as integers. A good replacement for that line would be: if isinstance(val, types.StringTypes) This will catch plain str's as well as unicode strings. To reproduce: from Xlib import display dpy = display.Display() win = dpy.screen().root.create_window(0, 0, 1, 1, 0, X.CopyFromParent) props.change_prop(dpy, win, dpy.intern_atom('_NET_WM_NAME'), u'hey guy') take the u off and it works fine. ---------------------------------------------------------------------- >Comment By: Peter Liljenberg (petli) Date: 2006-10-12 22:29 Logged In: YES user_id=68375 But that would require that Python Xlib assumes that all unicode strings should be sent as UTF-8 strings to the server. I don't think that is necessary valid. Can't you just convert the string explicitly to utf-8, since you say that you are going to store it? If anything should be added, I think that would be a utility method change_utf8_property(atom, string) which always uses UTF8_STRING and UTF-8-converts whatever gets sent in. ---------------------------------------------------------------------- Comment By: Nick Welch (mackstann) Date: 2006-09-18 08:28 Logged In: YES user_id=653631 Oops, I screwed that example up a little. from Xlib import display dpy = display.Display() win = dpy.screen().root.create_window(0, 0, 1, 1, 0, X.CopyFromParent) win.change_property(dpy.intern_atom('_NET_WM_NAME'), dpy.intern_atom('UTF8_STRING'), 8, u'hey guy') ---------------------------------------------------------------------- You can respond by visiting:
http://sourceforge.net/p/python-xlib/mailman/python-xlib-notifications/?viewmonth=200610&viewday=12
CC-MAIN-2015-11
refinedweb
336
66.74
IRC log of erswad on 2002-06-26 Timestamps are in UTC. 08:13:54 [RRSAgent] RRSAgent has joined #erswad 08:14:30 [maxf] maxf has joined #erswad 08:15:51 [chaalsXXX] In the room: 08:16:23 [chaalsXXX] Charles McCathieNevile, Jim Ley, Nick Gibbins, Paul Shabajee, Jill Evans, Liddy Nevile, 08:16:48 [chaalsXXX] Max Froumentin, Wendy Chisholm, Jonathan Chetwynd, Bert Bos, Dave Pawson, Nick Kew 08:17:26 [chaalsXXX] Libby Miller, Nadia Heninger, Ian Hickson, Dan Brickley 08:19:10 [Bert-lap] Bert-lap has joined #erswad 08:20:47 [wendy] wendy has joined #erswad 08:21:16 [chaalsXXX] CMN Topics for today: 08:21:41 [chaalsXXX] What kind of interfaces are there for making annotations - demos please 08:21:56 [Zakim] Zakim has joined #erswad 08:22:12 [chaalsXXX] agenda+ What kind of interfaces are there for making annotations - demos please 08:22:27 [chaalsXXX] agenda+ What uses are we making of annotations? 08:22:58 [chaalsXXX] agenda+ how is information stored? Does this meet our needs, and can we interoperate between different storage systems? 08:23:59 [chaalsXXX] agenda+ Can these storage mechanisms cope with other kinds of annotations, and can we interoperate with those. 08:24:16 [nadia] nadia has joined #erswad 08:24:30 [libby] libby has joined #erswad 08:25:46 [libby] annotations creation systems: libby, dan, nadia, jim, niq, dp 08:26:18 [libby] (for images) 08:27:11 [Hixie] Hixie has joined #erswad 08:27:14 [danbri] danbri has joined #erswad 08:27:22 [nmg] nmg has joined #erswad 08:28:04 [chaalsXXX] Libby MIller: Codepiction information 08:34:25 [chaalsXXX] 08:34:48 [chaalsXXX] adding data for co-depiction - two or more people in a picture. 08:35:33 [chaalsXXX] We created the tool to search information and then realised that it was difficult to add information to the database. 08:35:43 [chaalsXXX] So this is a webform that collects information. 08:35:59 [chaalsXXX] This system doesn't actually store the information - we don't want to own it. 08:36:38 [chaalsXXX] So we persudae other people to store their information, and submit it to the database. 08:41:48 [chaalsXXX] [Libby goes through the process of adding a codepiction] 08:42:36 [chaalsXXX] LM: We copy the RDF and store it somewhere, then give the URI of that somewhere to the database. 08:42:50 [chaalsXXX] ...it's a very simple system that gives an easy way to get the data. 08:43:43 [chaalsXXX] Questions... 08:43:57 [chaalsXXX] JC It isn't possible to change the input fields easily is it? 08:44:09 [chaalsXXX] ... I have different requireemnts for things I want to find. 08:44:28 [chaalsXXX] LM You can store any RDF you want in the database and the query can get anything out. 08:44:39 [chaalsXXX] JC So I just need to work out how to add something. 08:44:56 [chaalsXXX] LM The issue is that generating the forms is really hard work - I don't have a schema for it. 08:45:24 [chaalsXXX] DB When Libby demonstrated you go through forms and get RDF, and then you put the RDF into the Web. 08:45:45 [chaalsXXX] ...ther was one thing that was dealing with the data for ages - now there are two. 08:46:33 [chaalsXXX] DP What is the objective, other than playing with RDF, to have the data elsewhere than with the image you are describing? 08:47:03 [chaalsXXX] JL So you can annotate pictures that you don't own. 08:47:29 [chaalsXXX] CMN The system doesn't say anything about whether it should be in the same place or a different place. 08:49:01 [chaalsXXX] Dan Brickley: Amaya - demo by screenshot 08:49:20 [chaalsXXX] Amaya is an authoring tool produced by W3C 08:49:43 [chaalsXXX] DB This stuff was a toy to play with things, but it turns out to be useful for playing... 08:50:05 [chaalsXXX] we wanted to say a bit more about photos than we had - what other things are in the photo. 08:50:29 [Hixie] DB some people on the web are going to be obsessed with ash trays 08:50:49 [chaalsXXX] The early stuff, like libby's demo, said "there is a photo and it depicts chaals and dan" 08:51:09 [chaalsXXX] (it also depicts an ashtray and a table. Some people are interested in that but not everyone) 08:51:31 [chaalsXXX] This also comes from a project collecting information about pictures from the medical world. 08:51:58 [chaalsXXX] Creating authoring tools for web content is expensive, but we want to have tools that people can use - even the form thing is slow. 08:52:21 [chaalsXXX] So what we want is an image overlaid with regions. We had a way of doing that in HTML by using imagemaps. 08:52:42 [chaalsXXX] They are used in an odd way, but they basically overlay polygons on an image. 08:53:04 [chaalsXXX] We have revisited this in Amaya, which is an SVG editor. 08:53:35 [chaalsXXX] We create an image with a photo as a background, and trace out paths over it to identify the things that are in it. 08:53:51 [chaalsXXX] Amaya let us do this easily, and save the new image to the web. 08:54:31 [danbri] 08:54:33 [chaalsXXX] Then we had to try and add the RDF data... 08:54:45 [danbri] 08:54:46 [chaalsXXX] previous URI: screenshot of Amaya 08:55:39 [chaalsXXX] then an HTML image map that does something similar. 08:56:04 [chaalsXXX] Created by GIMP (an image tool). Usually the image map is for clicking on to follow as links. 08:56:29 [chaalsXXX] I ran the HTML from GIMP through HTML tidy - 08:56:37 [chaalsXXX] to clean up the HTML. 08:57:03 [chaalsXXX] Then Max used XSLT to create a transformation 08:57:06 [danbri] 08:57:29 [chaalsXXX] that generates SVG - like what we used with Amaya 08:57:57 [chaalsXXX] DP It was GIMP that let you pick out the outline? 08:58:34 [chaalsXXX] DB Yes. but there are hundreds of tools for editing HTML imagemaps. So the smart thing was to work out how to use existing tools - take their output, transform it through a couple of tools and end up with something. 08:58:46 [chaalsXXX] JC Is this available on the Web as a demonstration? 08:59:00 [chaalsXXX] DB No, it is scattered around... 08:59:09 [chaalsXXX] ... maybe this record helps a bit. 09:01:16 [danbri] 09:01:21 [chaalsXXX] So we can create data that says "there is a rock rabbit" (by using an RDF dictionary), that is depicted in an image, and there is a person in that image - Damian Steer 09:02:05 [chaalsXXX] Each of the individuals can be noted by email address - so we can play with other tools. 09:03:08 [chaalsXXX] Wordnet: a dictionary based on an electronic dictionary that provides class hierarchies of things. 09:03:19 [chaalsXXX] CMN Is there an interface for dealing with this stuff? 09:03:21 [chaalsXXX] DB No. 09:03:45 [nadiaa] nadiaa has joined #erswad 09:04:45 [chaalsXXX] We can trace the things in the image, but if we had a way to add wordnet definitions easily that would be helpful - we can easily create clip-art... 09:05:06 [chaalsXXX] we look for a mammal, and we find out that there is a picture of a rock-hyrax, which is a type of mammal... 09:06:06 [danbri] 09:06:11 [chaalsXXX] What is fun about this is that it isn't massive heavily-funded projects - these things work on very simple tools that do just enough to make useful things 09:06:24 [chaalsXXX] 09:06:50 [chaalsXXX] Jim Ley: More demonstrations 09:07:01 [chaalsXXX] A tool with no name? 09:07:19 [chaalsXXX] 09:07:34 [chaalsXXX] Lucky for me Dan and Libby have explained the rationale 09:07:52 [chaalsXXX] So I saw the demos that we have seen, and worked out how to do those in SVG. 09:08:01 [danbri] 09:08:10 [danbri] 09:08:11 [chaalsXXX] DB Amaya is evocative and inspiring, but not a mass-market tool. 09:08:33 [chaalsXXX] JL I try to do everything so it works in Internet Explorer - which millions of people do use. 09:09:08 [chaalsXXX] There is a form that asks for some information about an image. The text interface 09:09:17 [chaalsXXX] is clunky - on the TODO list. 09:09:39 [chaalsXXX] In theory you can also add RDF in nTriple format (in theory - that bit doesn't work yet) 09:11:07 [chaalsXXX] CMN So the interface requires explorer plus an SVG plugin 09:11:21 [chaalsXXX] JL Don't need explorer - can use any browser with the plugin. 09:11:39 [chaalsXXX] JC Can we have some more documentation in the tool? 09:12:04 [chaalsXXX] DB In terms of things we have noticed, wordnet is cool but typing URIs is a pain - we need a tool that does it better. 09:13:14 [chaalsXXX] ...Documentation has been weak - a lot of this is done as fast development. It would be nicer to 09:13:22 [chaalsXXX] ...get more of that done. 09:13:38 [chaalsXXX] (dan finishes tracing out the sheep) 09:14:44 [chaalsXXX] JL The tool then gives you some options - the SVG with the traced line. You can also add text to the image that labels the sheep and the shepherd (or whatever you labelled the things) 09:15:23 [chaalsXXX] You can get the RDF that describes the picture. And then I alllow you to store the RDF on my server to re-use it later on. 09:16:44 [chaalsXXX] So I can search through the annotations and say "is there a thing which has the wordnet label of being a sheep?" and then shows the thing it finds in its database. 09:18:29 [chaalsXXX] I have also created something that asks for the same information that libby does, but also lets you trace out the person. Again, this is in SVG. When you generate it, I store it locally and submit it to Libby's codepiction system. 09:20:31 [danbri] 09:23:09 [chaalsXXX] Coffee break 09:25:50 [danbri] -- I just annotated the rock hyrax w/ jim's tool 09:26:46 [danbri] :) 09:36:44 [chaalsXXX] Coffee break... 09:39:04 [chaalsXXX] DB Now you can find a picture of a Rock Hyrax on the Web... 09:39:54 [chaalsXXX] JL well, it stores an outline, not a region as such. Minor tool bug. 09:40:27 [chaalsXXX] Nadia Heninger: This is RDFPic - a standalone application in Java that stores its data inside the image. 09:40:58 [chaalsXXX] This started as a tool for entering other types of information - Dublin Core information, a schema containing technical information about a photo, etc. 09:41:40 [chaalsXXX] The tool lets you add information about a person in the picture, and make an outline, and stores SVG information 09:42:11 [chaalsXXX] (not directly as SVG, but as RDF that can be used to generate SVG). 09:42:45 [chaalsXXX] It can read EXIF information - a binary format that contains information about photos, automatically generated by some digital cameras 09:43:48 [chaalsXXX] This demo is of a development update - the original version is available, and this update will be made "soon" 09:44:48 [chaalsXXX] 09:45:29 [chaalsXXX] JL We can store the information and submit it - for example to the codepiction database. 09:45:47 [marja] marja has joined #erswad 09:47:00 [chaalsXXX] Libby, it's handy having a list of the people available. 09:47:54 [chaalsXXX] Nadia: Yes, although it would be nice to have a way of identifying them (at the moment there are just boxes and you need to click on wach one to see what it refers to) 09:48:41 [chaalsXXX] The interesting thing about this is that it uses XMP - Adobe's format based on RDF. They have some tools that can scan that and put information into different formats like PDF... 09:48:53 [chaalsXXX] LM Can you save the RDF locally? Remotely? 09:49:41 [chaalsXXX] NH: You can cut and paste to save remotely ;-) It saves the information into the image. If it moves around then you need to deal with the thing that is being described in a bit of editing trickery. 09:50:13 [chaalsXXX] NH This uses a different model for the information. 09:50:23 [chaalsXXX] JC You put this on the Web - what can people do with it? 09:50:29 [chaalsXXX] NH it comes out as RDF. 09:51:09 [chaalsXXX] JL I have tools that can read that RDF and do some things with it. But it won't consume the data that this tool produces, but that isn't going to be a lot of work to make it happen 09:51:50 [chaalsXXX] DB It turns out a lot of the photos that have been described are easy to find as images from google - not because it reads RDF but because it reads HTML pages generated. 09:52:01 [chaalsXXX] Bert Bos: I can show two things that use this information. 09:53:15 [chaalsXXX] One is a thumbnail tool - it makes a page of thumbnail images that includes the photo, a thumbnail, pointers to the RDF, and you can get to the image in a page that includes other data extracted from the RDF (title, creator, etc). 09:54:59 [chaalsXXX] This is done with a little bash script... 09:55:06 [danbri] Oh, wanted to mention Gerald's photo/rdf tools for the record: 09:55:44 [chaalsXXX] - Bert's script 09:56:36 [chaalsXXX] DP There is a question of whether the information is stored in the image, or the annotation is somewhere else 09:56:58 [chaalsXXX] BB: Yves Lafon has a different thubnailing tool that uses the same information in a differnt style 09:57:22 [chaalsXXX] DB wonders if we are getting enough of these tools that we should be concerned about vocabularies being interchangeable 09:57:59 [chaalsXXX] LM There is an issue here. I was talking to someone who wants to store information inside the images so he can move them around later. 09:58:17 [chaalsXXX] DP What kind of format should we be using for these annotations to package them up? 09:58:41 [chaalsXXX] JL There is RDF, which lets us pass it around. XMP is a good way to do it. 09:59:12 [chaalsXXX] NH There are tools that can extract XMP from different formats. DanBri has made a tool that can extract that information. 09:59:37 [danbri] 09:59:41 [chaalsXXX] DB I made a little web service - give it a URI and it extracts data. 10:00:22 [chaalsXXX] DB The interesting thing about XMPis that it ignores information it doesn't care about - it is very standard in what it passes around and ignores stuff being used by particular communities. 10:01:08 [chaalsXXX] Adobe have made lots of products based on this. But we can extract that information into RRDF and from there into a Web page. 10:01:29 [libby] nadia: you don;t have to erase the xif data with rdf data - both can coexist 10:01:38 [libby] ...xmp is not a full rdf inplementation 10:01:42 [libby] sure 10:02:05 [libby] ....this means that nadia is not corect in addiung teh more complex codepiction rdf in xmp 10:02:24 [libby] ..although it is a really uswefl way of storing arbitrary RDf in documents 10:02:38 [libby] danbri: mixes up storage and the format [?] 10:03:13 [libby] ...would be good to show them this sort of thing - they're not really expefring this. phpotoshop 7 has the XMP in it 10:03:41 [libby] ps: for museums community would be great to store the rdf in the pic so it never gets lost 10:03:52 [libby] dp: standardize? 10:04:06 [libby] chaals: usecases are great, esp the museums one 10:04:49 [libby] niq: classroom situation - submitting the images to teacher 10:05:50 [marja] I think your should store to the image when you can - but if cannot then you can still store elsewhere 10:05:54 [libby] jc: if you clicked on the images it offers you 'more of the same' e.g. more popgroups with similar attributes in an image-based jukebox 10:06:46 [libby] danbri: depends on how detiled the metadta is, e.g. colour 10:06:52 [libby] jc: yes, image based 10:07:29 [libby] ps: images have stories; what makes an image really great is the story behind it. all this info is text; how do you make that information avilable as non-text? 10:08:02 [libby] danbri: e.g. mixing with calendar type rdf 10:08:44 [libby] ps: data protection act? 10:09:21 [libby] ..explains - have to contact the person, check ok or not 10:09:27 [chaalsBRS] ... if I collect data on anybody, I am suposed t register the fact, get your agreement that I can use information about you and tell you why I want it and have permission for each user 10:09:30 [libby] ...uk thing - personal data 10:10:05 [libby] danbri: subscribe to my yahoogroups list i'm gettign data on you 10:10:12 [libby] ...its going to be a problem 10:10:51 [chaalsBRS] LM The issue is when somebody makes information available about someone else. 10:11:12 [chaalsBRS] LN When you aggregate information you are doing something different to information that is already out there, and would bneed permission 10:11:27 [libby] dnbri: data oriented search 10:11:44 [libby] ...maybe how to draw the distinction. amybe rdf is same as google 10:11:53 [libby] chaals - google could fall foul too... 10:12:10 [libby] ...answer - we don;t know - build these systems to test it 10:13:49 [chaalsBRS] Libby Miller: Codepiction 10:14:17 [chaalsBRS] LM There is a demo I am trying to do where you embed information as XHTML, which can be harvested by a tool to generate RDF. 10:14:51 [chaalsBRS] 10:15:14 [chaalsBRS] You give an email address and it looks for all the pictures that say they depict the person who has that email address 10:16:29 [chaalsBRS] LM This is a simple RDF database of images, and who is in them. 10:16:40 [chaalsBRS] The second demo tries to work out the paths between people. 10:18:22 [liddy] liddy has joined #erswad 10:19:20 [libby] 10:19:35 [libby] 10:20:06 [libby] LM: the paths things is nice and fast becasue it uwes an RDF query to build a relational database optimised 10:20:31 [libby] chaals: usecase - only let me see this (rude/strage) photo if you have the right access 10:21:14 [chaalsBRS] LM This path thing is nice and fast, becuase it doesn't directly use the RDF - it runs its queery and creates a fast XML database for this one question. 10:21:35 [libby] danbri: normally you expect to ahve control over images, but thses images and their annotatiosn can go wandering round the web - its unexpected and unsettling 10:22:02 [libby] ....fair use requirements for the image - langauge doesn;t exist yet - privacy and rights information 10:22:24 [chaalsBRS] chaalsBRS has changed the topic to: logs: info- 10:22:52 [chaalsBRS] chaalsBRS has changed the topic to: logs- 10:23:04 [libby] bb: agenda - a standardriosed machine-readable api for accessing the data 10:23:08 [libby] ? 10:23:08 [chaalsBRS] chaalsBRS has changed the topic to: - 10:24:08 [libby] bb: a machine can;'t deduce how to fill in a web form 10:24:34 [liddy] liddy has joined #erswad 10:24:38 [libby] bb: form exprtessed in RDF? 10:24:55 [wendy] lm i'd like to do that. 10:25:04 [wendy] .. say that in a human and/or machine readable way. 10:25:20 [wendy] .. have the database say "i can tell you all this stuff" 10:25:33 [wendy] .. not sure how to do machine-readably. 10:25:44 [libby] ...maybe daml? 10:26:05 [libby] dp: xforms? 10:26:18 [libby] ...could you generate an xform? 10:26:40 [libby] bb: yes maybe - that's what I was thinking 10:27:04 [libby] LM: don;t know how to describe the schemna to do this - woudl e very cool 10:27:28 [wendy] bb web services? perhaps in description lang 10:27:31 [libby] danbri: we have a webservice...not sure what else you need 10:27:44 [libby] libby: but you don;t know what's in the database 10:27:50 [libby] dp: rddl? 10:28:10 [libby] danbri: not sure if robust enough for very larag ethings like Wordnet 10:28:32 [marja] generating an Xform from RDF beneficial also to annotations - need application profile and some presentation description 10:29:44 [marja] would be able to show new properties without programming the interface 10:29:50 [libby] I thinjk its worth investiagting 10:30:04 [libby] danbri demos RDFAuthor querying over soap 10:30:23 [libby] ...a particla description of something can be used as a query (visually) 10:30:35 [libby] s/particla/partial 10:31:02 [libby] ..craete a fragmented description of your area of interest and then say what bits you don;t know 10:31:45 [libby] ..this is basically the usual query structure for RDF 10:33:49 [chaalsBRS] another demo of using information: 10:34:56 [libby] danbri talks about PICS 10:35:05 [libby] ...e.g. as embedded in teh w3c homepage 10:35:31 [wendy] danbri: "i can't read b/c it's curly brackets instead of pointy brackets" :) 10:35:39 [libby] :) 10:35:59 [libby] chaals - ncludes a rating for canadianness 10:36:40 [libby] ...rating true for w3.org/ and anything else that starts with the url - no sex, no violence... 10:37:17 [libby] ...also says who makes the claims 10:37:24 [libby] ...ratings are numbers 10:37:36 [libby] ...gives you a url for the ratings definietion place 10:38:36 [libby] danbri: pics agressed a difficult social problems: don;t want a single committee saying what is rude - allows different communites 10:38:53 [libby] ...differenbt communites could also make claims according to teh categires 10:39:43 [libby] ...there was a spec for a pics label filter protocol - a simple machine-intereface for porography description " get me the lebel for playboy.com' 10:39:46 [marja] with Annotea can choose different communities by choosing annotation servers 10:39:52 [libby] ...no business model 10:39:57 [libby] (foir pics) 10:40:07 [libby] ...this might also be an issue for rdf remote access, servers 10:40:13 [libby] ...pics is dead... 10:40:49 [libby] ...pics descriptions could not be mixed well. with RDF you can mix them better - people, images, cvs etc etc 10:41:02 [libby] ... a big architectural improvement 10:41:50 [libby] ...can say - not just - is payboy rude, but find me all the things with a rude rating between 7 and 9 10:42:15 [libby] ...comes doen to repurposig the data - add the bits that you want to know 10:42:46 [libby] ...pic: 10:42:59 [libby] == a guy pulling a truck along with his genitals, in bath 10:43:19 [libby] ...not intrinsically a teaching resource, a piece of art, a piece of bad photography... 10:43:29 [libby] ...but could be any of these things... 10:44:11 [libby] ...can be annotated using Jim's tool: http;//rdfweb.org/2002/svgsemantics/picsdemo/rdf-taboo.rdf 10:44:18 [libby] annotates the parts of the image 10:44:28 [libby] ...pics architectiure in the RDF world 10:44:55 [libby] ...can be annotated in lots of places. e.g. society for banning rude things could say somewhere that penises are rude 10:45:27 [libby] ...no one langauge for saying this - can have your own langauge 10:47:07 [libby] ...ruby script, which iterates through the contents of the image, for example for translating these categories terms into different languages - images are interestly non-langauge speciaic 10:47:49 [libby] danbri shows: 10:48:16 [libby] ...the tool finds the rude things in the database and displays them i9n a different way 10:48:32 [libby] ...but can do this in reverse " show me pictures of all the rude things" 10:49:16 [liddy] liddy has joined #erswad 10:49:26 [libby] ...this dual use also applies to rights management information - its really useful to have one single name for a movie whether you are a p2p file ripper or you own the rights to the film, to identify it 10:49:53 [libby] danbri: would like to take lots of clipart, markup in RDf using different tools and see if they interoperate. 10:49:58 [libby] ..some probs aleady: 10:50:03 [libby] - people's arms 10:50:25 [libby] - wordnet can be perjorative; there are also much better tools for certain domains 10:50:44 [libby] ...not clear hiow to connec teh generic tools and the vast thesauri 10:51:13 [libby] ps: can you picck out images annotated by libby alone? 10:51:32 [libby] ...access contraol v important, e.g. just information catalogued by librarians 10:51:46 [libby] jj: they have already addressed this in annotea - later 10:52:07 [libby] danbri: we can do this in rdf 10:52:33 [libby] dp: is it reasonable to assuem you could have many descriptions of the data - e.g. student and expert 10:52:52 [libby] ..if I'm desparate, give me anything; if there are experts, give me those 10:53:27 [libby] chaals, yes, though expernsive, and depends on the iamge 10:54:13 [libby] ...an ex-art historian, wants to see how my friends describe images, then can get some idea of how they might describe a picture that I don;t know. everyone leaves out a differentb thing 10:55:42 [libby] jc: has a bunch of images in a page that you can mocve around; the relations between teh images have semantic information. e.g. cat and dustbin, or a cat and a mouse, an immeduate connotation 10:55:56 [libby] ...any thoughts on this - a deep problem... 10:57:24 [libby] dp: if W3C were to pick up on this, then Hatfield has a particular sklill in describing images for people; knowing why you are describing it and what for is very important 10:58:28 [libby] jc: a few years ago - lots of auro-erotic asphyxiation - just because you ahve the rope, the organge etc, doesn;t tell you what is happening in teh information 10:59:00 [libby] danbri: also the human-readbale prose is very important (and expensive) 10:59:08 [libby] dp: and all the text tends to bve brief 10:59:44 [libby] dp: my only request is to ensure you can insert paragraphed text 11:00:53 [libby] [discussion of afternnon's agenda] 11:00:56 [libby] chaals - annotea 11:01:14 [libby] ...also interested in whether the tools can talk to each other? 11:02:30 [libby] bb: a tech question - a way of matching different fragments of RDF with different schemas and models, e.g. a photographer is just a string, or a firstname, last name. 11:03:25 [libby] ...I knwo I can match those myself. maybe this is a general operation we can namer and describe. maybe any node in rdf might be able to be replaced by an intermedate b-node which can help you find more matches 11:03:49 [libby] chaals: also, what use is thiise stuff - playing about or further applicateion, usecases 11:04:17 [libby] danbri: not just codepiction, but categorisation, parts of the pictures 11:04:22 [marja] also I guess we need to add different contexts in the annotated resource e.g. not just XPointer but also SVG area or a time for movies 11:04:45 [libby] chaasl: what do we want to do with image information ion general 11:04:53 [libby] marja - interesting 11:05:19 [libby] niq: large archives of satellite images, global positioning 11:05:34 [libby] dp/niq demo 11:06:13 [libby] dp: when cited people look at the picture of teh tndall family 9in the room, a painting, they get caertin information 11:07:08 [libby] ....blind people, how do they get the realtion between teh parts, the overall description of the painting - aim is to give the blind person a cmparable amount of information about the painting as signed people 11:07:38 [libby] ...not parts, but navigation within the image, not mouse-driven, a 'navigation map' of the iamge 11:08:29 [libby] ...get differet pieces of information abotu different parts of teh iamge, e.g. 'a 14 year old girl, 90% t th right and 50% up'; can get these faciliteis for description in svg, but not the navigation 11:09:35 [maxf] maxf has joined #erswad 11:09:44 [libby] jj: this is the same - if we can describe thatg image in a 'codepcitoopn areas' kind of way, then we can relate the parts of teh image together. it can help you with your application - other peopel can aid your usecase by doing the annotatiions for their own benefit 11:09:57 [marja] if done right can get at least main parts/subparts from SVG but ui not usually supports this 11:10:41 [libby] chaals: for info, lynx/linx has this vocabulary - behind, under 11:11:56 [libby] ...can extract information inn the svg for other uses. chaals thinks the soureccode is avilable somewhere. also someone in geneva, phd, can assign sound information and also mouse feedback information to regions of the image 11:12:34 [libby] ...at the moment uses binary content, proprietory 11:13:49 [libby] danbri: thinks jim is rights in saying that dp's needs and codepiction things is quite similar 11:15:02 [libby] ...would be very cool to be able to grab the information dp siad about the iamges and associate them with a region 11:15:34 [libby] dp: yes; sme people are specialised at describing things for blind eople; would be good to get this information, if only for the demos 11:15:55 [wendy] describing images from the National Braille ASsociation. we were able to publish an excerpt from their manual: 11:15:55 [libby] danbri: this isn;t the only way to do this, we know this; we would liek help in making it usefgul for accessibility 11:16:32 [libby] ps: a museum expert would describe the image in yet another way. would be graet to be asble to find the sorts of annotatios that you need 11:16:44 [libby] dp: - totally differnt usecases 11:16:53 [libby] danbri: lets's try and do that! 11:17:20 [libby] chaals - "what questions have been answered about this image?" 11:19:06 [libby] libby: posible output of this meeting - a multiply described image, uising different tools, for different communites 11:19:43 [libby] ps: filter project - difefrent descriptions of images in teh filter project (jill evans) - would be even beter if could do this with tools such as jims 11:20:31 [libby] jill would like to build up a database of how peopel have used these images (e.g. for teching and learning) 11:20:38 [marja] marja has joined #erswad 11:21:06 [libby] filter exercise in describing images: 11:21:47 [libby] ...rating is also useful 11:22:02 [libby] we have kit - maybe we could arrange a bridge 11:22:13 [libby] or if it's just you maybe we could call you 11:22:38 [marja] thats ok 11:23:02 [marja] I'll take shower while you eat first :-) 11:23:11 [libby] ps: show me all the pictures of images of things that fly - doesn;t work in current technology (noone says that birds fly; will usually pick up penguins) 11:23:25 [chaalsBRS] we are wondering what happened to lunch. It doesn't seem to be arriving. 11:23:29 [libby] ...RDF/ontologies could help with this and make catloguig cheaper 11:23:54 [wendy] we do have a bridge (just fyi) zakim. 11:24:13 [wendy] when i requested it for monday, i got it for yest and today as well. 11:24:24 [marja] when do you start again? 11:24:25 [wendy] (i now realize i might not have passed that info along...) 11:24:52 [chaalsBRS] 1.45? (time here is now 12.30) 11:24:54 [wendy] i have several possible use cases...but some are way out there. 11:25:31 [wendy] same as the other day... 11:25:45 [chaalsBRS] lunch. Back at 1.45 pm local time 11:25:49 [libby] ---lunch arrives---- 11:26:41 [wendy] it's in the log from monday, i'll have to locate after lunch. 11:54:15 [Zakim] Zakim has left #erswad 12:30:40 [Hixie] Hixie has joined #erswad 12:33:07 [marja] marja has joined #erswad 12:37:11 [Hixie] Hixie has joined #erswad 12:40:34 [Hixie] Hixie has joined #erswad 12:45:00 [ericP] hi all 12:45:34 [marja] hi ericP - others are probably still eating 12:45:43 [ericP] roger 12:48:39 [libby] hia marja, ericp 12:48:48 [ericP] hi libby 12:50:31 [chaalsBRS] monday's minutes: 12:50:52 [chaalsBRS] Tuesday's log (they aren't really minutes actually): 12:50:59 [wendy] wendy has joined #erswad 12:51:03 [chaalsBRS] Today's: 12:51:20 [chaalsBRS] Do people want to dial in? 12:55:27 [danbri] afternoon: 12:55:43 [danbri] charles: would like to tlk about annotea 12:55:52 [danbri] ...about whether these tools can work together, whether they do 12:56:09 [danbri] ...of tools here, build a list, ask whether this works with that, and with other tools from elsewhere 12:56:17 [danbri] ....at use cases; things we need but don't have 12:56:37 [danbri] ...other folks views? 12:58:42 [libby] danbri talks about swad-europe a little 12:58:54 [libby] ...we have some time to carry this on 12:59:04 [libby] ...peiople could join the list to discuss things further 12:59:14 [libby] ...write upcommunity efforts, for example 12:59:27 [libby] wendy asks about the list 12:59:32 [libby] ...and the members 12:59:40 [marja] old slides:, KCAP:, www2002: 13:00:08 [libby] ...5 partners: ilrt finance, project m,angement; W3C overall direction 13:00:28 [libby] ...hplabs, rutherford-appleton labs, Stlio, a little company in bristol 13:00:43 [libby] ..georgrphocally focused, dan/chaals honourary frenchies 13:01:04 [libby] ...previously e.g. swad-mit, v high-powered programming 13:01:16 [libby] marja, try the minutes - chaals just posted them 13:01:35 [libby] ...writing up stuff already done 13:02:04 [libby] chaals - so practically a report - finding out stuff from this meeting about how to do stuff 13:02:16 [libby] wendy - for this report some discussion and usecases 13:02:44 [libby] libby would like to do something oractivcal in thos meeting 13:03:10 [libby] wendy - relation to earl - similarities 13:04:06 [libby] danbri: we have some visaulisation workp[age. we are going to work in public as ffar as possible - working with communites 13:05:16 [libby] wendy: what could we practuically do today? 13:05:27 [libby] libby: annotate 2 pics from difeent points of view... 13:05:51 [libby] wendy is interested in stepping through like a flowchart in svg - would lie to work on something like that 13:06:09 [libby] s/lie/like 13:06:54 [libby] danbri: we have different flavours of collaboration...being on the sane mailing list might be enough... 13:07:12 [libby] ---- 13:09:06 [libby] it worked monday 13:10:29 [libby] we could call you direct marja 13:10:35 [libby] want to give us a number? 13:11:30 [libby] --chaals talking about amaya 13:11:36 [libby] ok marja, just a sec... 13:12:26 [libby] marja, can you hear chaals? 13:12:40 [libby] cool :) 13:12:42 [ericP] working on slides for O'Reilly Open Source Conv --> 13:13:09 [wendy] 92479 13:13:15 [ericP] re five digit passcode - i worked for me 13:13:27 [libby] do we want to try the bridge again? 13:13:35 [libby] ok 13:13:46 [libby] what's the zakim number again 13:14:23 [wendy] zaim +1 617.761.6200 13:14:38 [wendy] s/zaim/zakim 13:15:34 [libby] annotea: 13:15:53 [libby] there's a query protocol, using the RDF query language algae 13:15:53 [Zakim] Zakim has joined #erswad 13:16:13 [libby] danbri demos making an annotation in amaya 13:16:28 [libby] (the phone has not been a popular option :( 13:17:18 [libby] you can create the annotation of partic;lar parts of an image, and then save it locally or remotely 13:17:20 [wendy] the phone is next to the projector. 13:17:28 [wendy] i bet all marja hear's in the projector. 13:17:28 [libby] ah, good poiny wendy 13:17:54 [chaalsBRS] zakim, who is here? 13:17:56 [Zakim] sorry, chaalsBRS, I don't know what conference this is 13:17:57 [Zakim] On IRC I see Zakim, wendy, Hixie, marja, maxf, nadia, nmg, danbri, libby, Bert-lap, RRSAgent, chaalsBRS, sbp, ericP 13:18:10 [libby] wendy'd gone to get a little table marja - shoudl be quieter shortly 13:18:19 [chaalsBRS] zakim, who is here? 13:18:20 [Zakim] On the phone I see Marja, ??P1 13:18:21 [Zakim] On IRC I see Zakim, wendy, Hixie, marja, maxf, nadia, nmg, danbri, libby, Bert-lap, RRSAgent, chaalsBRS, sbp, ericP 13:18:30 [chaalsBRS] ??P1 is bristol 13:19:02 [wendy] how's that marja? moved it further from t he projector, but also further from cmn (unfortunately). 13:19:06 [Zakim] +EricP 13:19:21 [libby] ...then from a page you can see other annotations, eityhjer of teh whole page or of part fo it yusing xlink 13:19:39 [libby] chaals: ericP - what kind of queries can we ask annotea? 13:20:10 [libby] ericP; the query for annotea is a thin veneer over teh rdf query language/database 13:20:47 [libby] ...you write the query in algae. it does graph match but also transitive closures 13:21:22 [libby] danbri: if we loaded up teh wordnet heirarchy and put in snowleapard and askedd for mammal we would get it? 13:21:31 [libby] marja, url? 13:21:35 [libby] ericP thinks so 13:22:08 [libby] chaals: in teh annotea db, just quering annotations? 13:22:14 [marja] Algy interface 13:22:29 [libby] ericP - in one interface can query anything in the database 9algae query) 13:22:58 [libby] ....also specific short queries sepcifically for annotations which expand to algae 13:23:17 [libby] chaals: can you query 2 annotera databases at once? 13:23:46 [libby] ericP: yes you can, we use this a lot. you can give it several servers to look in 13:23:55 [marja] Algae with rules: 13:24:07 [libby] chaals - what about 2 diffeent sources e.g. annotea and codepiction databaes? 13:24:35 [libby] ericP has been playing with this 13:24:44 [libby] chaals: any neat demos? 13:25:15 [libby] .... 13:25:17 [marja] should document that too as updating the protocol draft right now - almost finished 13:25:43 [libby] ericP - what about making an RDF payload of the annotation? have you lookmed at that? 13:27:02 [libby] ericP: we've tried html; jim's rtied svg I think (in the body) 13:27:36 [marja] also mathml etc. 13:27:37 [libby] ericP: you can put anything in there, but ...[missed something important!] 13:27:56 [marja] basically any XML 13:27:56 [libby] jc: could you have a small image in the payload? 13:28:25 [ericP] :27 <libby> ... but i would preserve the semantics of the Annotation type and the annotates property 13:28:41 [liddy] liddy has joined #erswad 13:28:45 [libby] danbri: bookmarks? 13:28:48 [danbri] i'm interested in taxonomy/categories for bookmarks via annotea... 13:29:21 [libby] ericP: soap over algae doing this for the server, but we don;t have a user agent for it. 13:29:52 [marja] you can use any taxonomy 13:29:54 [libby] danbri: if the bookmarks server had a taxonomy of some kind, could maybe associate the small image with it, a particular category within some taxonomy 13:30:04 [libby] no, not really 13:30:25 [libby] danbri: do you have a way of pluggig oin large taxonomies, e,f=g wordnet 13:31:15 [libby] erip - you could say was a restuarant, and give it a ruile to use the img since a restuarnt. bookmarks thing has no idea of a rendering agent or anything 13:31:17 [wendy] wendy has joined #erswad 13:31:37 [libby] ...prob with applying rules like that is that the rules are stored in perpetuity on teh server side 13:31:52 [marja] we can annotate SVG 13:32:18 [marja] or the whole document with an image - need URI 13:32:20 [libby] chaals; can I query for an image uri in teh annotea? 13:32:51 [libby] ...will it return the actual annotationitself? - the annotation that is identified by some uri? 13:32:55 [libby] ep: yes 13:33:19 [libby] chaals: e.g. create a codepiction anjmotation, stote in annotea then query it 13:33:19 [libby] ? 13:33:21 [libby] ep: yes 13:34:02 [marja] if more properties added to annotation server about annotated image you get those too 13:34:12 [libby] ca someone else make notes? 13:34:21 [danbri] ep: SW is a huge graph, but you don't want to slurp the entire thing into your query engine each time 13:34:55 [danbri] charles: procees I'm interested in: Using Amaya/Annotea with an image. It creates an SVG which uses the image as a background, has paths in it + metadata about region/paths covering who-is-which 13:35:30 [danbri] ...if I build that svg as an annotation, can I get back from the annotea server the URI where it lives, so I can feed it to other RDF indexing tools? (eg. libby's db) 13:35:34 [danbri] eric: yes 13:36:05 [danbri] ...get the annotation from the main server, use the body data which has the uri of the annotation 13:36:14 [danbri] jim: the body has the uri in it 13:36:15 [marja] we have been talking with Ralph to expand the context so that we could have other ways to get the place annotated - not only Xpointer 13:36:22 [danbri] charles: so I can query for the uri of the body 13:36:38 [danbri] (marja, that's interesting... relates to EARL discussion mon/tue...) 13:36:51 [marja] so maybe the SVG should be in the context and not in the body? 13:36:55 [danbri] jim: If you have the body URI, can you get back to the annotation URI(?!) 13:37:06 [marja] the outline SVG 13:37:15 [danbri] eric: you can find out whatever created each annotation or body? 13:37:42 [danbri] eric: currently if you do a compound query aginst multiple sources, you _should_ get back multiple attributions, but you currently don't 13:38:03 [danbri] ...if you have the (aggregate) graph, you can find out whcih bit came from which sources (servers...) 13:38:24 [danbri] charles: one other tool we discussed... Favourite Icon (favico)... 13:39:06 [marja] what is favorite icon ? we do have ways to define new icons for different types 13:39:42 [danbri] see 13:39:44 [danbri] for an example 13:40:34 [marja] oh you can add an icon to a fragment and not so nuch care about the note about that thing 13:40:56 [marja] nice idea 13:43:31 [wendy] 13:43:58 [libby] jc: talks about problems of using sites if you can;'t read 13:44:06 [libby] e.g. finding games 13:45:48 [libby] there's a sound on mouseover 13:46:00 [libby] you cvan use the keys 13:47:09 [marja] I misunderstood favicon - but adding an image annotation to parts of pages and presenting them as embedded on the page might be helpful for users with cognitive problems 13:47:14 [libby] ...oooh a really cool thing! 13:47:33 [libby] it makes noises and has pictures :) 13:47:44 [chaalsBRS] danbri plays with a system that lets him make noises and put splashes of colour on the page... 13:48:54 [libby] 13:49:00 [chaalsBRS] dan: I am not a web access person, and when I think about accessibility I tend to think about it in terms of blindness. Thanks for reminding us that there are reasons why sounds and fun is important. 13:49:24 [wendy] important - but also part of accessibility. 13:49:39 [wendy] accessibility is more than blindness and text, for some images and sounds are what make it accessible. 13:49:50 [wendy] s/for some/for some people 13:51:20 [chaalsBRS] CMN can we make favicon work with the tools that we have? 13:51:43 [chaalsBRS] JL There is a problem of the file format - you have to convert them which loses a lot of the benefit. 13:52:01 [chaalsBRS] ... mozilla doesn't have that problem, because it can use any graphic type. 13:52:29 [chaalsBRS] BB The CSS3 spec lets you associate an icon with an element... 13:52:32 [danbri] bert: in css, we're adding an icon 13:52:34 [danbri] thanks 13:52:38 [chaalsBRS] CMN can you do that for sounds in the same way? 13:53:11 [chaalsBRS] BB if you use an aural media type. There is interest in associating sound with visual things - like BGSOUND in some proprietary HTMLs 13:53:20 [chaalsBRS] ...but we don't have it yet. 13:54:32 [chaalsBRS] DB Going through finding icons for sites is going to be slow. Looking at the games example, I followed my alexa toolbar to find out how the site is categorised in an open directory. 13:54:44 [chaalsBRS] ... then you can go to the site that the directory came from. 13:55:33 [chaalsBRS] ... So it seems that you should be able to drill down and find icons that match the category - it seems at least like a worthwhile student project to provide icons that can be used for the categories. is that plausible? 13:55:42 [chaalsBRS] JC Makes sense if someone is able to do the work. 13:56:53 [libby] 13:56:57 [libby] was the blobs thing 13:58:38 [danbri] urls I just showed: http:/dmoz.org/rdf.html and dmoz categories (plus image/icons per category). 13:58:42 [chaalsBRS] At the annotea page there is the image 13:58:57 [chaalsBRS] is there any way of knowing that that icon represents anything? 13:59:42 [marja] we could annotate it 14:03:44 [Bert-lap] On W3C CSS WG pages I use REL attribute, e.g., <a rel="in-area">, <a rel="in-activity">, to label the icons 14:04:08 [chaalsBRS] plan for after the coffee break: List the tools we have looked at and which works with what... 14:04:19 [chaalsBRS] Use cases - do we have tools that can meet them. 14:05:07 [chaalsBRS] Break for 15 minutes 14:05:43 [Zakim] -Marja 14:05:58 [Zakim] -EricP 14:06:05 [Zakim] -Bristol 14:06:08 [Zakim] WAI_(SW)9:00AM has ended 14:15:44 [Bert-lap] non 14:16:31 [Bert-lap] s/non// 14:21:30 [chaalsBRS] we're baack... 14:21:45 [chaalsBRS] dialling the bridge.... 14:22:21 [chaalsBRS] we don't know the magic dialout code :( 14:22:42 [chaalsBRS] waiting for libby to return if you folks want to be on the phone. 14:31:14 [chaalsBRS] Tools: Libby's codepiction form doesn't provide storage 14:31:26 [libby] we're back on the bridge 14:31:54 [chaalsBRS] Amaya in principle would allow annotations saved as annotea annotations. 14:32:07 [chaalsBRS] Jim's SVG tool saves the data locally 14:32:29 [chaalsBRS] RDFPic saves data into the image. 14:32:40 [chaalsBRS] DB does it do that as EXIF and XMP? 14:33:03 [chaalsBRS] NH no. EXIF is just used by digital cameras. I was just in the comment area. 14:33:37 [chaalsBRS] CMN can a tool that reads EXIF still find the EXIF after you have put it back? 14:34:03 [chaalsBRS] NH I don't change it. It can still be found as EXIF. 14:34:20 [chaalsBRS] CMN how do you get at the data? 14:35:13 [chaalsBRS] NH it can be sucked out of an image. 14:35:23 [danbri] nadia: Adobe XMP technique is to scan thru looking for 'x packet' tags 14:35:45 [chaalsBRS] CMN A jigsaw server can get RDF data out of a jpeg and give it to you, no? 14:35:53 [danbri] nadia: I broke that currentyl while migrating to XMP 14:36:02 [danbri] charles: are you going to fix it? 14:36:11 [wendy] want me to take notes for a while? 14:36:12 [danbri] nadia: ...if directed to the code 14:36:27 [wendy] lm i can do this too. 14:36:35 [marja] dynamic icons not published yet but look something like <rdf:Description rdf:about=" "> 14:36:35 [marja] <i:usesIcon rdf: 14:36:35 [marja] </rdf:Description> 14:36:38 [wendy] jl using adobe's example code, 14:36:44 [wendy] hard to hear down here!! 14:37:03 [wendy] cmn bunch of ways to annotate images. 14:37:16 [wendy] cmn points to marja's scheme 14:37:35 [danbri] [[ 14:37:58 [wendy] cmn of the tools that query data...codepiction queries what type of database? 14:38:19 [wendy] db lm's squish (for rdf dbs) i wrapped a layer around annotea so that it understands squish queries. 14:38:24 [wendy] .. however the data is very diff. 14:38:39 [wendy] .. not a common interface. 14:39:00 [wendy] db we can do more thorough testing to make sure our tools speak the same language. 14:39:13 [Hixie] Zakim: ??PI is Bristol 14:39:13 [wendy] cmn (to jl) you query your own db? 14:39:18 [danbri] while($c =~ m/id='W5M0MpCehiHzreSzNTczkc9d'\s*(bytes=')*([^']*)'?\?>(.*)<\?xpack 14:39:19 [danbri] et end='([^']*)'\?>/sg) 14:39:19 [danbri] { 14:39:19 [danbri] $rdf.= $3; 14:39:19 [danbri] } 14:39:21 [wendy] jl yes 14:39:29 [wendy] jl can be fed any kind of rdf. 14:39:32 [danbri] ...is Perl code for extracting XMP 14:39:47 [wendy] jl in principle. none are robust for large size of data. 14:39:57 [wendy] jl 500 triples now, it's beg to get slow 14:40:03 [wendy] cmn scalability problem for other tools? 14:40:12 [wendy] nh a prob for every sem web tool? 14:40:26 [wendy] lb there are some large ones, dave becket, and guha 14:40:48 [wendy] lm it works w/lengthy queries (about 1000 triples). slow with text matches. 14:41:03 [wendy] db we can build apps over rdf query. 14:41:09 [wendy] .. it doesn't care how things are actually stored. 14:41:10 [libby] s/1000/30,000/ 14:41:14 [wendy] .. we can rip out db and put in back end. 14:41:17 [wendy] thx libby 14:41:25 [wendy] db depends on the types of queries. 14:41:56 [wendy] cmn do we have tools that can handle 100K triples 14:41:57 [wendy] ? 14:42:20 [wendy] db started a project with dave becket. a sense of tools and their maturity. connect stores for use cases. 14:42:32 [wendy] db substring searching requires brute force. 14:42:45 [wendy] lb maybe ericp's does more than this? 14:43:05 [wendy] eric - does your database handle lots of triples and queries? 14:43:26 [danbri] see for draft towards swad-europe rdf/db report 14:43:39 [danbri] [[ 14:43:40 [danbri] Providing fair, useful and timely summaries of the characteristics of RDF "database and storage systems" is a subtle problem. We need first to establish a clearer notion of what an RDF storage system amounts to. Are we considering just generic 'triple stores'? Which value adding features should be tested, benchmarked? 14:43:41 [danbri] ]] 14:43:50 [wendy] ep query-wise - don't know. similar to yours, therefore probably scale like yours. 14:44:05 [wendy] ep you're using a weak cache to determine # for a string or literal? 14:44:06 [wendy] lb yep 14:44:08 [wendy] s/lb/lm 14:44:09 [danbri] s/cache/hash/ 14:44:13 [danbri] (sha1... fwiw) 14:44:35 [danbri] eric: I think the queries (in our resp systems) scale the same way. A set of self-joins on a table of all integers. 14:44:47 [wendy] cmn a database that does acl control. 14:44:53 [ericP] acl --> 14:45:06 [danbri] (eric's db also does ACLS == Access Control Lists) 14:45:11 [wendy] ep that's an rdf interface to a triples database. 14:45:24 [wendy] ep acls is interface to app-specific relational database. 14:45:37 [wendy] ep on ly certain questions it can answer for certain properties. 14:45:48 [wendy] ep a sql query that joins the tables 14:46:15 [wendy] cmn if have database of triples, so can ask 10 questions... 14:46:21 [danbri] (ie you're rewriting generic-looking RDF queries into some SQL representation focussed on an app-specific RDBMS schema...?) 14:46:46 [libby] (which would be rather like the paths db I described earlier) 14:46:47 [wendy] ep the queries in that paper executes in a millisecond. 14:46:57 [wendy] ep on the order of several trillion. 14:47:12 [wendy] ep largest table is ~x,000 (missed x) 14:47:25 [wendy] cmn can take 1/2M datapoints and assume robust. 14:47:27 [db] for notes: points to RDF / SemWeb Access Control work at W3C. 14:47:37 [wendy] ep ya. 14:47:42 [chaalsBRS] x=600 14:48:16 [wendy] ep if have something that includes daml, can have relational db tailored to that data. 14:48:25 [wendy] ep build rules that are optimized. 14:48:28 [db] cardinality contraints from DAML+OIL/WebOnt might help us create more optimised SQL representations. 14:48:33 [wendy] cmn how diff to build the tailored db? 14:49:19 [wendy] lm nightly requeries database and optimizes in db that is much faster. 14:49:36 [libby] lM is building a relational database table using an rdf query over an rdf database 14:49:46 [wendy] ep digital library folks looking at optimized database that does bulk of work. triple-store for incidentals that don't fit. 14:50:09 [wendy] ep then reoptimize once ... 14:50:31 [wendy] db dspace might be a swad-e demo possibility. 14:51:01 [wendy] cmn we don't expect to see this in mid-august? 14:51:03 [wendy] ep no 14:51:21 [wendy] ep rdf -> sql, that is written. 14:51:39 [wendy] ep will include linke to write-up 14:52:10 [wendy] (:44) 14:52:37 [wendy] jl some sort of web services 14:52:55 [libby] (jj is on a different platform) 14:52:56 [ericP] RDF queries on an application-optimized relational database --> 14:53:04 [wendy] cmn nadia, your tool read its own data? if load an img, rdfpic read that data, does it read data from other places? pass it data as rdf? 14:53:37 [wendy] nh there are many options to dump the contents of file into 14:54:13 [ericP] nadia, project! tell the world! 14:54:27 [libby] ericP are you happy to publicise that url? 14:54:44 [ericP] sure 14:54:48 [wendy] bb jigsaw server doesn't know about rdf, but finds info in jpg. 14:55:22 [wendy] cmn jill, can you describe what you want to do. did you see anything today that looks useful? 14:55:36 [wendy] jill bits. like users to link quality of an image. 14:55:49 [wendy] jill self-sustaining system rather than input from library. 14:55:58 [wendy] jill rating on visual aspects. 14:56:18 [wendy] jill pick out regions of images and annotate those. perhaps get students to annotate. 14:56:25 [wendy] jill microcommunities of users. 14:56:28 [wendy] (ooh, neat word) 14:56:45 [wendy] jill registered members or shared with anybody. requires registration and security. 14:56:56 [wendy] jill comment on how they use the image. 14:57:24 [wendy] jill in an img of 2 people, some pick out beer or ashtray...what is it they pick out (and why). 14:57:51 [wendy] db i'm interested in clients for tools. 14:58:00 [wendy] db jl are you planning on devving yours? 14:58:12 [wendy] jl the main things are to combine codepiction w/? 14:58:32 [wendy] jl improve so that it consumes other rdf sources. make authoring easier. 14:58:48 [wendy] db need to know about instances that could be in things 14:59:02 [wendy] jl look up in wordnet (for tree) 14:59:48 [wendy] db what can we do? 14:59:52 [wendy] jl suggest ui. 15:00:03 [wendy] jl what would look good? how do you want it to work? 15:00:08 [wendy] db test is as well? 15:00:09 [wendy] jl ya 15:00:22 [wendy] db grab a snapshot? 15:00:26 [wendy] jl you betcha 15:00:57 [wendy] cmn ln, any thoughts about how you can use these tools w/all the stuff you're wokring on? 15:01:22 [wendy] cmn haven't talked about access control. 15:01:46 [wendy] ln several things: 1. in the collection of cave paintings, vary in age. interesting to see how image changed over time. 15:02:13 [wendy] ln rights mngmt interesting b/c as i understand it in aboriginal culture, it's not a matter of stating rights at beginning 15:02:40 [wendy] .. distinguishing between sacred paintings....a case of user saying "x died, therefore all of these categories id on't wwant to have in my world for 6 weeks) 15:02:46 [wendy] .. world changes as people die 15:03:20 [wendy] ln when we show them a catalog of a paitning, depending on who looks at it, will describe it differently. 15:03:37 [wendy] ln mtn folks talk very differently from river folks. 15:03:43 [wendy] ln those need to have = status. 15:03:52 [wendy] ln need to know who said it (will give you context) 15:03:56 [wendy] db capture spoken word? 15:04:07 [wendy] ln yes, they are illiterate. there is not a written ver of their lang. 15:04:14 [wendy] ln some are 80 yrs old and only speakers of the lang. 15:04:18 [wendy] ln good to capture that. 15:04:28 [wendy] ln would we ever translate that into text or leave it as spoken word? 15:04:38 [wendy] ln hearing it is the only thing that will make sense to them. 15:05:03 [wendy] db sound clips + tech meta data... 15:05:12 [wendy] ln might be video clip. gesture+sound. 15:05:19 [wendy] ln just sound won't tell whole story. 15:05:57 [wendy] db vocabularies and schemas? we tend to use combo of DC, goofy people stuff... 15:06:12 [wendy] db +RDFPIC 15:06:22 [wendy] nh i use depics and regiondepics 15:06:55 [wendy] db rdfpic used to use dc, ... should we get together on mailing list, announce who doing what, 15:07:05 [wendy] jl isn't annotea using other namespaces? 15:07:15 [wendy] jl b/c of its age, using older namespaces. 15:07:43 [db] two version of dc namespace: or /1.1/ 15:07:45 [wendy] jl sir name is sir name or full name. don't know if get sir or full. 15:07:50 [db] ...capitals vs lowercase 15:07:51 [wendy] jl using dc 1 15:07:54 [db] annotea: using dc1 15:08:13 [db] nick: is there a list of what annotea's using? 15:08:20 [db] jim: only by dumping the rdf 15:08:23 [wendy] db - gonna minute for a while? 15:08:34 [wendy] i'm happy to take a break. :) 15:08:39 [ericP] nick, using for what? 15:08:57 [wendy] db a w3c note? 15:09:00 [ericP] i could minute 15:09:04 [wendy] lol 15:09:07 [ericP] phone: bip bp 15:09:22 [ericP] phone: titter - click pop 15:09:25 [wendy] asdfkljaseroipuab;ljk asdfasndfaweoiuraslkjdf asfjlweofu dfalhsdr 15:09:40 [ericP] that;s my name, don't wear it out 15:09:48 [wendy] :) 15:10:14 [wendy] cmn selection of stuff looked at - some of tools that r aroond 15:10:26 [wendy] .. stacks of annotation toools 15:10:35 [wendy] .. rate folks photos 15:10:59 [wendy] phone giving cmn a rating... 15:11:02 [db] 15:11:07 [libby] amihotornot.com 15:12:16 [ericP] plus the t-inator and the pornolizer 15:12:17 [wendy] cmn do they create data we can use? is the s/w avail? 15:13:18 [wendy] action: db summarize in an email...something very special 15:13:53 [wendy] db in hawaii adobe engs interested. i sent themnadia's examples. there will be a write-up. 15:14:01 [wendy] action nh review db's write-up. 15:14:15 [wendy] action all: read the xmp spec 15:15:05 [nadia] on xmp... you have to register to get access to the xmp materials on adobe's site 15:15:24 [nadia] the spec itself is quite long 15:15:53 [db] see under 'whiteboard' 15:15:57 [Zakim] -EricP 15:15:58 [nadia] there's a shorter document "embedding xmp" that is more practical, but only useful if you're familiar with the file formats in question... 15:16:00 [db] jim: idea... you have a board with the background 15:16:13 [ericP] oops 15:16:23 [ericP] dropped the phone (literally) 15:16:32 [db] charles: lots of univesrities want to do... 15:16:36 [db] (i) shared drawing spaces 15:16:38 [ericP] i wasn't hearing much anywyas 15:16:41 [db] (ii) accessibility 15:17:04 [db] lots of whiteboard tools don't capture the mening/semantics/stuff 'behind the scribbles' 15:17:17 [db] q to jim: how much work technically to turn this kind of tool to that end? 15:17:26 [db] jim: not much programming work, lots of usability, ui work 15:17:41 [db] ...i'd be interested. I'm not a UI person... 15:18:12 [db] ...suggestions? 15:19:40 [marja] need to know what kinds of semantics to use - maybe different for different drawing categories or user groups 15:21:00 [db] (discussion of military apps; daml etc) 15:22:11 [db] charles: how many folk here now see themselves as users / potential uses f these tools...? 15:22:13 [libby] chaals: how many people see themseleves as users of the tool and how many developers? 15:22:17 [db] ...and developers? 15:22:23 [db] about 1/2-2/3 15:22:30 [db] ok, thanks for coming marja, eric 15:22:31 [Zakim] -Marja 15:23:29 [danbri] danbri: I'm not a UI person but have thru using Jim's tools, various bits of feedback 15:23:46 [danbri] niq: as a developer, hard to get quality feedback, easy to feel like working in vacuum 15:24:14 [danbri] charles: people often acquire the software, use it but don't take time (or see utility) to send feedback 15:24:17 [danbri] ...takes time 15:25:58 [marja] I can try some tools from user perspective if needed 15:32:05 [libby] 15:32:46 [danbri] discussion of mailing lists 15:33:02 [danbri] danbri: if I set up a specific list for tasks/actions outcoming from this meeting, who would join 15:33:17 [danbri] (some reasonable amount of nodding, but not huge enthusiasm for Yet More EMail) 15:33:25 [danbri] discussion of www-annotation list 15:33:35 [danbri] niq: has flagged up prblem areas, eg xpointer stuff 15:33:44 [danbri] jim: www-annotation interesting list 15:33:54 [danbri] charles: should we be trying to find a mailing list 15:35:23 [danbri] danbri: where to take, for example, the namespace divergence problem amongst our tools... 15:35:27 [marja] for annotations why not use www-annotation 15:35:38 [danbri] charles: diff people will take things in different directions 15:36:20 [danbri] charles: some people likely to go away wondering 'which namespace to use x'... others looking at other things, eg scalability 15:37:21 [marja] trying to write instructions for Annotea extensions - probably need feedback at some point 15:37:59 [danbri] danbri: things will inevitably scatter to the winds, eg. Scalability work will be addressed in swad-e, more annotational stuff in www-annotation... in swad-e we'll try to keep pointers to latest work fresh on our website 15:38:27 [danbri] charles: I'm looking fwd to the report, write up of today... 15:38:39 [danbri] jill: what's the best way to keep up to date with what various folk in this room are doing? 15:38:43 [danbri] ...how we'll coordinate their efforts 15:39:39 [danbri] ...how to take my interest in these tools fwd. 15:39:43 [libby] some ideas for annotatiuons from different points of view: 15:40:28 [danbri] danbri: keep an eye on swad-europe web pages ( ) which should be a good point of call. Also mailing list (public-esw@w3.org, archives will be public) for swad-e. 15:40:36 [danbri] charles: and www-annotation is a good list 15:41:46 [danbri] (some nodding re use of www-annotation) 15:42:15 [danbri] charles: also the RDF Interest Group. Has mailing list(s) and an IRC chat channel, see 15:43:41 [danbri] see for weblog from irc chat 15:44:10 [chaalsBRS] irc.w3.org/#er chat about tools in accessibilty but a lot of stuff about annotations 15:44:16 [danbri] danbri: also irc.w3.org 6665 #er 15:44:17 [danbri] yup 15:44:23 [chaalsBRS] there are other fora... 15:45:26 [danbri] The participants record their thanks to Libby. 15:45:28 [danbri] we're not worthy! 15:45:33 [danbri] ADJOURNED. 15:45:33 [nmg] nmg has left #erswad 15:45:35 [danbri] ------ 15:45:41 [danbri] RRSAgent, pointer? 15:45:42 [RRSAgent] See 15:45:47 [chaalsBRS] Thanks to all.... 15:46:01 [wendy] wendy has left #erswad 15:50:53 [marja] marja has left #erswad 16:03:43 [Zakim] -Bristol 16:03:45 [Zakim] WAI_(SW)9:00AM has ended 17:52:43 [Hixie] Hixie has joined #erswad 18:00:58 [nadia] nadia has joined #erswad
http://www.w3.org/2002/06/26-erswad-irc
CC-MAIN-2017-04
refinedweb
11,491
69.62
This might seems a naive post about sending email, especially when there are hundreds of posts out there. However, most of these posts don't show a complete or comprehensive example for the beginners on how to send email with more options. I'm sure when you search for the phrase "Sending email using C#" you will find a plenty of results, but if you look closely you will see every post focuses on one thing perhaps attachment, multiple recipients, etc. Note: This post is intended for beginners and folks who want to copy the class and use it directly in their application :) I remember that I wrote a class for sending email, which I still use till today, and I thought to share it with you. This class provides most of the basic functionalities that I need and it covers: The class provide many overloading methods for the send email, we will just focus here on two basic methods one for Sync and the other for Async. To switch between Sync and Async I created a delegate method as follow The synchronous send email method would look like this The Asynchronous send email method would look like this The main method that will do the sending is the following In the config file configure the SMTP server host if you want you can add the follwing code to the main method above to explicitly set the SMTP host as follow Hope this help :) Your code examples are illegible. But when the Internet browser view is set on 150% there's no problem. Yah, I noticed that now!!! I have posted it using a laptop display set to 1400 * 1050, I’m truly sorry, Thank you very much for the notice, I will correct that as soon I get home. Thanks a lot. That’s really weird, when I saw it from my 1280 * 800 work’s display monitor it wasn’t so clear, but now I’m using my laptop which is set to the same resolution, yet it seems fairly clear except the last two big images. Anyway, you can download the code for clear view :) Link Listing - December 7, 2007 %110 zooming made the samples images readable How can send an email using this to multiple recipients? Hi, You can do like this: Utiltiies.Mail.SendMail.SendSync("from@sample.com", new string[] { "to1@sample.com", "to2@sample.com" }, "Subject", "message body"); Hope this helps I'm trying to use your code, but I can't make an attachment[] to call the function. I'm trying this: AttachmentCollection aCollection; if (FileUpload.HasFile){ Attachment a1 = new Attachment(FileUpload.Content, FileUpload.Name); aCollection.Add(a1)} I tried with Attachment[] aCollection, but it doesn't work too Regards Paul Hi Paul, I'm not 100% sure, but I think your problem has to do with disposing the IO stream. Try to make sure not to close the file stream "FileUpload" untill you send the email, and close it right after sending the email like this if (aCollection!= null) { // Release any resource used by the attchement. foreach (System.Net.Mail.Attachment att in aCollection) { try { att.Dispose(); } catch { } } } Also try to set FileUpload.FileContent.Position = 0; Hope this helps I am trying to send attachments using the following code but the attachment will not attach even though it shown up in the message.attachments. Any help would be greatly appreciated. private void EmailForm() { SmtpClient smtp = new SmtpClient("smtp host name"); MailMessage msg = new MailMessage(); //create the render engine RenderEngine re = new RenderEngine(); //create the bitmap and populate the first page Bitmap image = re.RenderPage((FormPage)form.Pages[0], 38); //traverse the pages and render them if (form.Pages.Count > 1) { for (int i = 1; i < form.Pages.Count; i++) //create the bitmap image = re.RenderPage((FormPage)form.Pages[i], 38); } byte[] byteMe = imageToByteArray(image); MemoryStream ms = new MemoryStream(byteMe); Attachment att = new Attachment(ms, "image/jpeg"); try msg.Attachments.Add(att); catch (Exception ex) ErrorLogger.LogMessage("Attachment add failed" + ex); //populate the body and subject msg.Body = "Image is attached";//ms.ToArray().ToString(); msg.Subject = "Image of Form With Session Id " + this.SessionId; smtp.Send("skellman@rovertechfusions.com", "skellman@rovertechfusions.com", msg.Subject, msg.Body); } Hi Scott, in your code at the last line, you don't seem to send the attachment. I think you should write instead smtp.Send(msg); I have tried to utilise this in VS 2008 and have experienced difficulties to get the APPsettings from here. SmtpSection smtpSec = (SmtpSection)ConfigurationManager.GetSection("system.net/mailSettings/smtp"); everything is null. any hint? Hi I have tested it on VS 2008 SP1 beta, and no problems. I have no clue really what's wrong but try to make sure you have mailSettigs in the config there. Thanks for the reply. One thing I have realised is that in VS2008, it requires the FROM address to be specified while you only had SENDER. Not sure why things changed, but that is the something you may like to consider update for 2008 compatibility. Thanks. Sorry, another question. I am trying to utilise your code to send email from Gmail. it works if I add an extra line at the end, please see in code comments --------------- // Call the send delegate method sendDelegate(emailClient, message); // it goes to the delegate and the server always timeout from here, with or without the extra send prior to this. do you have any idea what I have done wrong? Sorry, it was timed out because I was in my debug mode and the stepping through was too slow. All good now, have to think of ways to utilise the config file from different project and to get Async to work. how to embed images inside the mail body using c# the images and text will be read from a html file I need a email application with multiple attachment.Iam developing my application in asp.net+c#.Main problem that iam facing is it should work as in GMail.help me Can someone advise me on what to put in the USEING section at the top, i have the following: using System; using System.ComponentModel; using System.Collections.Generic; using System.Diagnostics; using System.Text; using System.Net; using System.Net.Mail; using System.Media; using System.Windows.Forms; I'm i missing some thing? Also i'm getting the following error: Error 2 The name 'Send' does not exist in the current context Please Help! I'm sooooo dumb, sorry. Hello Every body !!! Sorry everybody. help me, i'm begining learn C#. i can;t understand "UtilityException". Who can help me now; and SmtpSection , how can use it ??/ Thank's so much Hi Elmanuel, UtilityException is custom Exception, you can change it to System.Exception or whatever you exception you want. But if you do then make sure you change all the methods. As for the SmtpSection you need to add reference to the System.Configuration from the references menu. Also you can remove the smtpSection section, because the framework will read the default settings automatically. Nawaf Hi everyone, im quite new to this and im starting a project. I just want to find out if its possible to implement this code in a c# Windows Application. Iv done something similar when working with web developer but im not sure if i can do the same in a windows form. Any help would be much appreciated Thanks in Advance Why is your code displayed as a picture? It makes it impossible to cut + paste. Prat. Hi stapes, Why do you need to copy and paste, where you can get the entire source code. Please check the attachment section.
http://weblogs.asp.net/nawaf/archive/2007/12/07/sending-email-in-c-sync-async-multiple-recipients-attachments-etc.aspx
crawl-002
refinedweb
1,281
65.01
current position:Home>Untested Python code is not far from crashing Untested Python code is not far from crashing 2022-01-31 07:51:16 【Nuggets translation program】 - Original address :Untested Python Code is Already Broken - Original author :Matthew Hull - The translation comes from : Nuggets translation plan - Permanent link to this article :github.com/xitu/gold-m… - translator :jaredliw - Checked by :ItzMiracleOwO、KimYangOfCat My first mentor was incredibly . He showed me the code 、 logging 、 Best practices and benefits of documentation . But there's one thing he couldn't instill in me , That's the test . His way of testing code is complicated , Including writing the test program first , And then coding implementation ! His way is opposite to my coding style , It makes me feel :" If I write the test before I write the function , Then I might as well not write a test .”…… It makes me feel much better . But the problem is : Your code needs to be tested . Because all the code , Even good code , Both with bug There is only a thin line between them . For starters :bug Is an unexpected function or error in the code . You may know your code and its limitations very well , But new teammates ? perhaps , In a year , You want to add a feature to a project you've largely forgotten , What should I do ? The test is like a bumper on a bowling alley , So that you can be confident that the submitted code will get full marks every time . This article will reuse my Python In the learning series The first 3 part Code for , And use me in here To introduce the Makefile. If you are Python Novice , Why don't you take a look first The first 1 part and The first 2 part ? Besides , If you don't have your own Python The work environment , Please be there. here Check out the tutorials you need . Topics discussed : - unit testing - Inherit - Mocking and patch - Makefile - When to test ? Because this requires some code , I've created a Github Project To help us start this topic . The easiest way to get it is through Github Desktop Clone it , Or download it as ZIP file . The folder contains order_up.py、 One Makefile And a Pipfile, One more Solutions Folder , But let's ignore it for the time being . Create a file called tests Of Python package . So how to create ? It's a little complicated —— First, create a folder , Create a file named __init__.py Empty file . Yes , That's it . And then in the new tests In the folder , Create another one called test_order_up.py The file of . Now we can start . Be careful :unittest( and pytest) According to “test” The beginning of the file determines the test code , So avoid this when naming non test files ! What is the test ? In short , The test answered “ Whether the execution results of the program meet our expectations ?” This problem . To answer this question , We can run a function by using preselected input and check whether the output meets our expectations . You can run a function and verify the output , Make sure it doesn't throw errors , Or make sure it exactly Throw an error , To ensure that the code has been fully tested . A good set of tests should include normal use cases 、 Edge use cases and creative use cases . You don't just have to make sure your code runs as it is , And make sure your The test will capture any stupid behavior you or others will do in the future . Unittest Unittest yes Python Built in test framework , So we'll start here . Put this code into your test file : import unittest import order_up class TestOrderUp(unittest.TestCase): def test_get_order_one_item(self): order = ["fries"] result = order_up.get_order(order) self.assertEqual(order, result) Copy code First , We import unittest, It is a tool for testing code Python Built in bag , And then we import order_up.py file ( Notice that we have omitted .py Extension ). notes : If you're using PyCharm And in order_upSee the red underline below , This means that the package cannot be found . You can go back to Github Open the project under the root directory of the project or right-click the project folder and select “Mark Directory as” -> “Sources Root” To solve this problem . Next , Let's create a name TestOrderUp Class , Its name matches our file name , This makes it easier to find failed tests . Oh , But there's something in parentheses , unittest.TestCase, This means that our class inherits TestCase class . Inherit Inheritance means that a class receives functions and variables from its parent class . In our case , We from TestCase It inherits rich functions to facilitate our testing work . What functions and variables are inherited ? We'll discuss this later . Create a test Under our class is a class named test_output_order_one_item Function of , It should roughly explain what we do in the test . We will use it to test get_order() Function and check whether the output meets our expectations . Let's run it , See what happens ! You can execute... In the terminal python -m unittest, Or click PyCharm The green arrow next to the function in . You can also choose to perform make unit-test, Let the code run in a virtual environment ( We will mention later Makefile). Look at the results : Assertion (assert) We from unittest.TestCase Functions inherited in include assertions , It ensures that the result of the function is within our expectations . stay Pycharm in , Input self.assert, The code completion function will display all the different options . There are a lot of them , But I mainly use self.assertEqual, It checks whether the two objects are the same , as well as self.assertTrue/ self.assertFalse, The function is self-evident . Now? , order_up The main function of is to get orders , Delete items that are not on the menu , And allow duplicate items . therefore , Let's add tests to make sure we keep these functions in our code . # Make sure these functions are indented in the class . def test_get_order_duplicate_in_list(self): order = ["fries", "fries", "fries", "burger"] result = order_up.get_order(order) self.assertEqual(order, result) def test_get_order_not_on_menu(self): order = ["banana", "cereal", "cookie"] expected_result = ["cookie"] result = order_up.get_order(order) self.assertEqual(expected_result, result) Copy code Now we are checking whether our function can handle duplicate items and items not on the menu . Run these tests and make sure they pass ! sidenote : It's best to write a test with a line between the executed code and the verified code . such , You and your teammates can easily tell which is which . Patch I have to admit : I did a little cheating . If you will The first 3 part The code in is the same as the current order_up.py Compare , You will notice that I added a function to accommodate a new variable : test_order. With this new variable , We can bypass the introduction of input(), In this way, we won't let the program ask the user for input every time we run the test . But now we have mastered the basic knowledge of testing , We can start trying to use mock.Mock Can imitate and create functions / object , So that our tests can focus on logic . under these circumstances , We will “ Mend ” input() function , Or rewrite it temporarily , To simply return the output we want . have a look : def test_is_order_complete_yes(self, input_patch): self.assertEqual(builtins.input, input_patch) result = order_up.is_order_complete() self.assertFalse(result) Copy code First , Add... At the beginning of the test file from unittest.mock import patch. In limine , We are mending builtins.input() Function and tell it to return “yes”. then , We execute assertions to check whether the parameters obtained from the patch are consistent with input It's exactly the same ! be aware builtins.input Are there no parentheses ? We can reference the signature of the function to verify , Instead of executing functions . after , Let's go back to the normal test protocol : Operation function , To get the results , And assert the result . under these circumstances , Because of our input() The return value is “yes”, We expect is_order_complete() return False. Add it to your test class , Click Run , Get red OK Or green check mark , Let's move on ! Side Effect Now we've learned patch, We can solve get_output() The input problem in ! Um. , almost . First , We need to understand side_effect, When we need to provide different return values for the same function , It is our Savior . stay get_output() in , adopt input(), We were asked “ What do you want ?” and “ Have you finished? ?”. therefore , We need to get input() Not just one but multiple outputs are returned to accommodate each situation . have a look : def test_get_order_valid(self, input_patch): self.assertEqual(builtins.input, input_patch) expected_result = ["cookie", "fries"] result = order_up.get_order() self.assertEqual(expected_result, result) Copy code So , We don't know return_value, It's for side_effect Assign a list . remarks : You can also assign values in the test function side_effector return_value. side_effect Will get each item in the list , And in every call patch Function is provided separately . Add the code and click the test button / command ! The last thing : stay “banana” and “cookie” None of them is / no , Because if MENU The item does not exist in , get_order() Don't ask “ Would you like to order more ?”. If you want to play with this list yourself , Please remember this thing . Makefile Having finished the basics of testing , Let's take a look Makefile. I won't copy / Paste the code here , Because you can see it in the project . The main method is unit-test and run. unit-test need venv To execute , According to our Pipfile Configure and start a virtual environment . Pay attention to unit-test At the end of , We did python3 -m pipenv run python3 -m unittest;, This is where testing magic takes place , Even if you forget how to run tests , You can also find it there ! When to write tests ? So when to write a test ? It doesn't matter . The point is that the test written can cover most of the code and the potential use cases it may encounter . If you can't test your code correctly or need to 8 A different test to cover a function , Then you probably need to refactor your code . This doesn't make you a bad programmer , It's just a programming process / Part of the experience . Test-driven development (TDD) Let me talk about test driven development (TDD) The question of .TDD Is a development practice , Write the failed test program first, and then write the function to pass it . Story time : I joined a startup , The startup will Robert C. Martin(《 Clean code 》 And the authors of other books ) Of TDD And the concept of negative patterns , Or bad coding practices to avoid , As a faith . There is a , We held a meeting on TDD And its benefits of meetings to encourage the team to think more “ It works ” The way to code . Unfortunately , Spend most of your time arguing TDD On the definition and correct usage of . The organizer of the meeting , A senior engineer , Think we “ Coding too fast ”, Not by writing " smart " Tests or functions that exceed the functions tested to correctly implement TDD Principles . I left the meeting with an idea : Let your philosophical debate from my work disappear . The point of this article is : Find a suitable way to include testing in the project . I didn't give a specific way to implement them or when , As long as they can prevent your code from entering the drain after the next submission . bye ! If there are errors in the translation or other areas that need to be improved , Welcome to Nuggets translation plan Revise the translation and PR, You can also get bonus points . At the beginning of the article Permanent link to this article That's what this article is about GitHub Upper MarkDown link . Nuggets translation plan It is a community that translates high-quality Internet technology articles , The source of the article is Nuggets Share articles in English on . Content coverage Android、iOS、 front end 、 Back end 、 Blockchain 、 product 、 Design 、 Artificial intelligence Other fields , If you want to see more excellent translations, please keep your eyes on Nuggets translation plan 、 Official micro-blog 、 Know about columns .
https://en.pythonmana.com/2022/01/202201310751094389.html
CC-MAIN-2022-27
refinedweb
2,054
70.84
A perfect tool to get you know users of your application. Read more.... Use structured logging e.g. use just a machine name for a log record's message and keep its localized version in a Bundle. Set the logger name to be below the namespace {org.netbeans.ui} in some meaningful subpackage. The statistic on the server shall then recognize the logger name as well as the message. Make sure the interactive gestures collector is installed. Make "Memory" toolbar visible. Execute the action that does the logging. Invoke the icon in the "memory" toolbar and "View Data". Use the combo box to scroll to the right message - which anyway should be somewhere at the bottom of the displayed file. They are listed at UIGesturesCollector.
http://wiki.netbeans.org/wiki/index.php?title=DevFaqUIGestures&oldid=29876
CC-MAIN-2019-51
refinedweb
125
69.68
Ask Ben: Using ColdFusion Components As Return Types, Argument Types, And Property Types Hi Ben! I have been reading your blog for about four years now (since I first played with Skin Spider), and I finally have a question to ask. I have finally started playing with Coldfusion 9, and I must say I'm impressed thus far. That said, I've stumbled upon my first problem that I haven't been able to find a solution to: How do you (or rather, can you) explicitly type return values for functions or inbound arguments to user defined components? I am one of those people who compulsively likely to explicitly type things and I haven't been able to find much about it on the web or in the CF docs. Any input would be fantastic! I knew that this could be done to some extent; but, since I typically use "any" as my return type for non-built-in data type, I wasn't sure of the ins-and-outs and intricacies of such an approach. So, to answer your question, I had to do a little trial and error. I wanted to make sure that my test included multi-part paths, application-specific mappings, and, as you requested, return types and arguments types. And, in all honesty, I found some kind of cool stuff! To test the full feature set of using ColdFusion components as data types, I needed to make sure that I had at least one situation where a path-mapping was used. As such, I created the following directory structure: - ./model/Contact.cfc - ./vo/ValueObject.cfc - ./Application.cfc - ./index.cfm In the above pseudo file tree, the Contact.cfc and the ValueObject.cfc are located in sibling directories; as such, in order for the Contact.cfc to reference the ValueObject.cfc, it would have to do so through an application-specific mapping (NOTE: application-specific is not required, per say, but it's really the right way to do this). In the Application.cfc, I set up a mapping to both the "model" and "vo" directories: Application.cfc - <cfcomponent - output="false" - - <!--- Define the application. ---> - <cfset this.name = hash( getCurrentTemplatePath() ) /> - <cfset this.applicationTimeout = createTimeSpan( 0, 0, 0, 20 ) /> - <!--- - Get the root directory of the application. This will - be needed to define the subsequent app-specific mappings. - ---> - <cfset this.rootDirectory = getDirectoryFromPath( - getCurrentTemplatePath() - ) /> - <!--- Define application-specific mappings. ---> - <cfset this.mappings[ "/com" ] = (this.rootDirectory & "model/" ) /> - <cfset this.mappings[ "/vo" ] = (this.rootDirectory & "vo/" ) /> - <!--- Define page request settings. ---> - <cfsetting - showdebugoutput="false" - /> - </cfcomponent> In the above application-specific mappings, you will notice that I mapped "com" to the "model" directory; I did this only to make sure that no pathing shenanigans were taking place behind the scenes. By making sure that the mapping and the directory were not the same name, I could ensure that it was indeed my mapping that was being used to locate the given components. With these mappings in place, I then created my Contact.cfc ColdFusion component within the model directory. I created the Contact.cfc using the new CFScript-based implementation in part because that is the format that the reader submitted to me; and, I did it in part because it has more options to test (in terms of where things can be defined within the component). In the following code, you will see references to ValueObject.cfc; this is a very simple get/set type component that I'll show you later on. For the moment, though, realize only that it (ValueObject.cfc) can only be referenced using the "vo" mapping: Contact.cfc - // Import the "vo" name space. - // NOTE: The name space that we are importing is an application- - // specific mapping and that this name-space is used to define the - // return type of one of the functions below. - import "/vo.*"; - // Define the component. - component - output="false" - accessors="true" - hint="I am a contact entity." - { - // Define properties. - property - name="name" - type="string" - default="" - validate="string" - validateParams="{ minLength = 1, maxLength = 30 }" - hint="I am the full name." - ; - property - name="lastValueObject" - type="vo.ValueObject" - hint="I am the last requested value object." - ; - /** - * Define constructor. Notice that the return type of the - * ColdFusion component uses BOTH the app-specific mapping - * to "com" as well as the multi-part, dot-delimitted path - * to THIS component. - * - * @access public - * @output false - * @hint I return an initialized component. - **/ - com.Contact function init( - string name = "" - ){ - // Store default properties. - this.setName( arguments.name ); - // Return this object reference. Remember, when used in - // conjunction with the NEW keyword, you must explicitly - // return the object reference. - return( this ); - } - /** - * Notice that in this method, we are defining a local path - * to the component (no app-specific mappings) and that the - * returnType attribute is being defined in the comments. - * - * @access public - * @returnType Contact - * @output false - * @hint I return the current contact. - **/ - function getContact(){ - return( this ); - } - /** - * Notice that in this method, the return type "ValueObject" - * is only valid becuase our IMPORT command above imported - * the app-specific mappings / namespace, "/vo". Notice also - * that the default argument value does NOT use the imported - * namespace, but rather, refers back to the multi-part, - * dot-delimtted mapping path. - * - * @access public - * @returnType ValueObject - * @output false - * @hint I return a value-object representation of this entity. If you want to, you can pass-in an existing valueObject instance. - */ - function getValueObject( - valueObject valueObject = new vo.ValueObject() - ){ - // Store local properties into the given value object. - arguments.valueObject.set( "name", this.getName() ); - // Store the value object as a property. - this.setLastValueObject( arguments.valueObject ); - // Return populated value object. - return( arguments.valueObject ); - } - } There's actually a good number of features being put to the test here. - Both the return type and argument types can use a multi-part, dot-delimited path. They can also both use name-only paths, so long as the name of the ColdFusion component is readily accessible (in a place where ColdFusion will search for it, such as the current directory). - The path for either the return type or argument type can reference application-specific mappings. - ColdFusion component property "type" values can also use components. This works with both multi-part and name-only paths (although I only demonstrate the multi-part case in the above code). - Using the IMPORT statement before the component definition acts like a package import in Java-style applications and can be used to help define both return type and argument types without referencing the full class name. (NOTE: Import does not need to precede class definition - it can be contained within class definition as well). - IMPORT statements within a ColdFusion component, even those that precede the component definition, can make use of application-specific mappings. - Return type (as well as Access for that matter), can be defined inline with the function definitions; or, it can be defined in the preceding comments. Both multi-part and name-only paths can be used in either place. Not a bad number of tests for a fairly straight forward question, right? To make sure that this was all working as expected, I then set up a small demo page: Index.cfm - <!--- - Import the COM name space (NOTE: This actually maps to the - "model" directory thanks to our appliation-specific mappings). - ---> - <cfimport path="com.*" /> - <!--- Create a new Contact instance. ---> - <cfset tricia = new Contact( "Tricia Smith" ) /> - <!--- Rename contact (only to test accessors). ---> - <cfset tricia.setName( "Tricia 'the hottie' Smith" ) /> - <!--- - Get the contact object (to test the return type is enforced - as a Contact instance). - ---> - <cfset contact = tricia.getContact() /> - <!--- - Get the value object (to test that mapped-return type - based on the IMPORT command used inside the CFC). - ---> - <cfset valueObject = contact.getValueObject() /> - <cfoutput> - <!--- Output name contained within value object. ---> - Name: #valueObject.get( "name" )#<br /> - <!--- Output name contained within LAST value object. ---> - Name: #tricia.getLastValueObject().get( "name" )# - </cfoutput> This code simply makes use of the various methods to ensure that nothing would throw an error. And, while I can't easily demonstrate it in the code (see the video above), if I changed the data types, an error was thrown (demonstrating that it was not using "any" as a data type). When I run the code, I get the following page output: Name: Tricia 'the hottie' Smith Name: Tricia 'the hottie' Smith As you can see, ColdFusion components can be successfully used as data types in the property types, return types, and argument types. In the Contact.cfc code, I referenced the ValueObject.cfc; while this component is completely meta to the conversation, I will show it below in case you were curious as to what it was doing. There was very little thinking behind this component - I just needed something to test: ValueObject.cfc - <cfcomponent - output="false" - - <cffunction - name="init" - access="public" - returntype="any" - output="false" - - <!--- Set up default properties. ---> - <cfset variables.propertyMap = {} /> - <!--- Return this object reference. ---> - <cfreturn this /> - </cffunction> - <cffunction - name="get" - access="public" - returntype="any" - output="false" - - <!--- Define arguments. ---> - <cfargument - name="name" - type="string" - required="false" - hint="I am the name of the property beging gotten (if omitted, fulle property set is returned)." - /> - <!--- Check to see if property name was included. ---> - <cfif isNull( arguments.name )> - <!--- - No property was requested; return entire - property map. - ---> - <cfreturn variables.propertyMap /> - <cfelse> - <!--- Return selected property. ---> - <cfreturn variables.propertyMap[ arguments.name ] /> - </cfif> - </cffunction> - <cffunction - name="set" - access="public" - returntype="any" - output="false" - - <!--- Define arguments. ---> - <cfargument - name="name" - type="string" - required="true" - hint="I am the name of the property." - /> - <cfargument - name="value" - type="any" - required="true" - hint="I am the property value." - /> - <!--- Set the given property. ---> - <cfset variables.propertyMap[ arguments.name ] = arguments.value /> - <!--- Return this object reference for method chaining. ---> - <cfreturn this /> - </cffunction> - </cfcomponent> Out of this entire experiment, the two features I found the most interesting were the fact that you could use IMPORT before the ColdFusion component definition to help define all aspects of a CFC-as-data-type approach; and, that the return type and access attributes of the function could be declared in the comments preceding the function definitions. In the end though, I just hope this helped point you in the right direction. Looking For A New Job? - 100% Remote - Sr ColdFusion Developer at Short's Travel Management - ColdFusion Developer Opportunity at Cavulus - Senior JavaScript/Angular Engineer at Kelaca - IS Sr. Systems Analyst - Web Development at Nationwide Children's Hospital Reader Comments Thanks Ben! Wow, this answers my question and at least three others. I was not aware that you could use a Java-style IMPORT statement in my CF components for easy object reference. I'm always in favor of writing less code, and in some of my more complex applications I find myself with a sizable component directory tree. I was also unaware that you could define the attributes of your component's methods in preceding comment meta-data. VERY useful in multiple ways, as it simplifies the appearance of your method declarations for easy visual scanning and sort of forces a commenting convention in your components. It will help me force my team to better comment their components (of course, they should WANT to... lol.) I greatly appreciate your prompt and thorough efforts in helping me to solve this problem! @Nick, Glad to help out! If you have any further questions, drop me a line. Also, for type safe arrays, you can use: path.to.MyCFC[] as your return type or parameter type. I don't think it actually checks each array index for that type (I think maybe just the first index). @Devin, I think I have heard that too - that it checks only the first index. I think I read a blog post or a tweet along those lines not too long ago, but can't remember where. Something that I have noticed with the cf9 scripting interface is that you can no longer accept an argument with a defined type. This is something I do quite a bit with flex coding. As an example I would do something like this: public com.model.vo.Member function DoSomethingMemberIsh( required com.model.vo.Member vo) { return vo; } Ben do you know if there is a work around for this, other than using the type of Any? @Jeremy, I am not sure what you are asking? You can certainly require function arguments to be of a certain type. In fact, that is part of what I am doing in this demo. Am I misunderstanding what you are asking? @Ben Lets say I have these two files: UserVO.cfc UserService.cfc UserVO.cfc: component { property name="Firstname" type="string"; property name="Lastname" type="string"; public string function getFirstname() { return Firstname; } public void function setFirstname(required string Firstname) { Firstname=Firstname; } public string function getLastname() { return Lastname; } public void function setLastname(required string Lastname) { Lastname=Lastname; } } UserService.cfc component { public com.model.vo.UserVO function DoThis(required com.model.vo.UserVO vo) { return vo; } } Having the argument vo type casted as com.model.vo.UserVO does not work with in the scripted cfc in cf9. You will always get the error: You cannot use a variable reference with "." operators in this context @Jeremy, Ah, I see what you're saying now. I had to run a quick test to double-check that and you are right. You cannot use multi-part paths in your argument types. You can, however, as a work around, import the name space: import "com.model.vo.*"; ... and then use a non-pathed class name: public UserVO function DoThis(required UserVO vo) I am personally a fan of full-path names as I find them to be self-documented; but, until they get this fixed, this would be an available work around. Do you know if this is a known bug? I sent something very similar over to Ray Camden on day two after the release of CF9. He did say it was a known bug. As of yet, I have not been able to find a workaround that I liked. Importing the name space is nice, but not something I would like to do with an application as large as the one I am currently working on. @Jeremy, I can understand that. In general, I am not a fan of importing name spaces. When I do that, I find that I get confused as to where things are coming from. ... but then again, I also work so often with loosely typed languages that doing anything more than basic date type requirements is not something I am used to either. @Jeremy, Thanks again for the insight; I codified your issue in a subsequent blog post: Hi, I tried the same program you have mentioned. It gives me an error. 11:22:14.014 - Template Exception - in : line -1 Invalid CFML construct found on line 2 at column 21. The error its refering to is <cfset tricia = new Contact( "Tricia Smith" )> Line 2 Colomn 21 is Contact
http://www.bennadel.com/blog/1795-ask-ben-using-coldfusion-components-as-return-types-argument-types-and-property-types.htm
CC-MAIN-2015-18
refinedweb
2,464
57.37
Java Exception - Handle Exceptions in Java ; Exception in Java Learn about the Java Exceptions.... You will also learn how to create your own exceptions in your Java program... about handling double exceptions in Java. In Java double is used to store Learn Java in a day Learn Java in a day  ...; Variables In this section, you will learn about Java variables... easy explanation of java concepts through simple programs. We hope explanation - Java Beginners explanation I have create small java appication. I don't know about garbage collection, memory leak. I want reference about these and how to use my... to know about the Garbage collection. index Fortran Tutorials Java Tutorials Java Applet Tutorials Java Swing and AWT Tutorials JavaBeans Tutorials I want detail information about switchaction? - Struts I want detail information about switch action? What is switch action in Java? I want detail information about Switch index of javaprogram index of javaprogram what is the step of learning java. i am not asking syllabus am i am asking the step of program to teach a pesonal student. To learn java, please visit the following link: Java Tutorial explanation the explanation in internet,but not very clear about it. Thank you Making Custom (User Defined) Exceptions to be handled the exceptions in java ======= So far you would have been known, how to be handled the exceptions in java >>>>>>> 1.3... Making Custom (User Defined) Exceptions   How to learn Java with no programming experience Tutorial, how to learn Java provides you the opportunity to you about.... Apart from these, topic How to learn Java with no programming experience, provides you the detail about the jargons of this language and enables a new comer Java exceptions Java exceptions Which arithmetic operations can result in the throwing of an ArithmeticEx example explanation - Java Beginners example explanation can i have some explanation regarding the program given as serialization xample.... Hi friend, import java.io..../java Exceptions Tutorials With Examples Java Exceptions Tutorials With Examples Exceptions in Java Exceptions... Catch Clauses In java when we handle the exceptions then we can Java Code Explanation Java Code Explanation Can you please Explain the following code : import java.util.*; class Difference { public static void main(String args[]) { int n,i,res=0,sum=0,dif Making Exceptions Unchecked - java tutorial,java tutorials Checked and Unchecked Exception In this section, you will learn Checked and Unchecked Exceptions in java and how to handle it. The Exception is a condition... since it is implicitly available in all java programs. The exceptions derived exceptions in java - Java Beginners :// Thanks...exceptions in java can any one explain exceptions with example... the normal flow of execution of a program. Exceptions are used for signaling Identify correct and incorrect statements or examples about the client's view of exceptions received from an enterprise bean invocation. Identify correct and incorrect statements or examples about the client's view of exceptions received from an enterprise bean invocation...; Identify correct and incorrect statements or examples about the client's view Exceptions in java Exceptions in java Exceptions are used for handing errors and other exceptional events in Java... try, catch, throw, throws and finally are used to hand the exceptions in java including index in java regular expression including index in java regular expression Hi, I am using java regular expression to merge using underscore consecutive capatalized words e.g.... in the sentence so that i dont need to worry about first word starting with capital Where to learn java programming language fast and easily. New to programming Learn Java In A Day Master Java Tutorials...Where to learn java programming language I am beginner in Java and want to learn Java and become master of the Java programming language? Where charAt() method in java charAt() method in java In this section you will get detail about charAt() in java. This method comes in java.lang.String package. charAt() return the character at the given index within the string, index starting from 0 Core Java Exceptions - Java Beginners Core Java Exceptions HI........ This is sridhar .. Exceptions r checked exception and unchecked exception ........? Checked exceptions r at compile time and Unchecked exceptions r runtime? but Exception is Runtime applications, mobile applications, batch processing applications. Java is used... | Linux Tutorial | Java Script Tutorial | PHP Tutorial | Java Servlet Tutorial | Java Swing Tutorial | JEE 5 Tutorial | JDBC project detail - Java Beginners project detail Dear roseindia, i wnat to the idea for doing project in the java Catching Exceptions in GUI Code - Java Tutorials In this section, we will discuss how to catch uncaught exceptions in GUI. Lets see... at java.awt.EventDispatchThread.run After printing the above exceptions at console the java event dispatch thread dies after this. Solution The Solution Easiest way to learn Java There are various ways to learn Java language but the easiest way to learn..., video tutorials and lectures that help beginners learn in Java. This tutorials..., Java classes, etc are covered. To make it easy for novices to learn Day for the given Date in Java Day for the given Date in Java How can i get the day for the user input data ? Hello Friend, You can use the following code: import..."); String day=f.format(date); System.out.println(day How to learn Java easily? If you are wondering how to learn Java easily, well its simple, learn... Java learning. The students opting to learn Java are of two types, either... a simple language and easy way to understand and learn the language. Java on its Java User-defined Exception Java User-defined Exception In this tutorial, you will learn about the User-defined Exceptions. These custom exceptions actually all the programmer to handle errors in the applications with customized responses. It creates the java Exceptions Rethrowing with Improved Type Checking Exceptions Rethrowing with Improved Type Checking In this section, you will learn about the Java SE 7 exception rethrowing with improved type checking. Take a a look at the following code having improved type checking of Java EXCEPTIONS-----1 - Java Interview Questions EXCEPTIONS-----1 How To Handle The Exceptions With Out Using Try,Catch And Throws?I Want Region Plz Post Answer Exceptions - Java Beginners Exceptions Write a program that prompts the user to enter a series of integers from the command line (-1 to stop). Use Java's Exception handling to ignore invalid input. Thank You Hi Friend, Try the following Get first day of week Get first day of week In this section, we will learn how to get the first day of ..._package>java FirstDayOfWeek Day of week: 7 Sunday Connectivity with sql in detail - JDBC Connectivity with sql in detail Sir/Madam, I am unable to connect the sql with Java. Please tell me in detail that how to connect. Thankyou EXCEPTIONS - Java Interview Questions learn learn how to input value in java Best way to learn Java every possible detail about it. Some of the topics that are covered in the Java...Best way to learn Java is through online learning because you can learn it from the comfort of your home. Online learning of Java is also free, the only About Java About Java Hi, Can anyone tell me the About Java programming language? How a c programmer can learn Java development techniques? Thanks Hi, Read about java at. Thanks... in Java starts with how to install Java, to learning about IDE (Eclipse, jCreator, NetBeans), about Java and creating his/her first Hello World program in Java Connectivity with sql in detail - JDBC Connectivity with sql in detail Sir/Madam, I am unable to connect the sql with Java. Please tell me in detail that how to connect. Thankyou. Hi Friend, Put mysql-connector Learn Java Programming in it, Learn Java programming online with tutorials and simple examples... of the programmer wants to learn this language quickly. The basic of Java tutorials... knowledge of these languages then it will be comparatively easy for you to learn Java index - Java Beginners index Hi could you pls help me with this two programs they go hand in hand. Write a Java GUI application called Index.java that inputs several... the number of occurrences of the character in the text. Write a Java GUI interfaces,exceptions,threads interfaces,exceptions,threads SIR,IAM JAVA BEGINER,I WANT KNOW THE COMPLETE CONEPTS OF INTERFACES,EXCEPTIONS,THREADS Interface... class. In java, multiple inheritance is achieved by using the interface JDBC Training, Learn JDBC yourself programming language of java then fist learn our following two tutorials: Learn Java in a Day and Master... - Learn about JDBC with small examples JDBC Java arraylist index() Function Java arrayList has index for each added element. This index starts from 0. arrayList values can be retrieved by the get(index) method. Example of Java Arraylist Index() Function import about threading in java - Java Server Faces Questions need to index some files and URL's every day at certain time.. so plz help me...about threading in java Hello Sir how can i write a program using threads and which need to check and compare the system date and time every day Learn JSP CheckBox The tutorial highlight the features by whihc you... in JSP. Further, you can know in details about the multiple chechbox values.... The important features about the fact it that methodrequest.getParameter to learn java to learn java I am b.com graduate. Can l able to learn java platform without knowing any basics software language. Learn Java from the following link: Java Tutorials Here you will get several java tutorials The APPLET Tag in Detail The <APPLET> Tag in Detail After understanding a simple Java-enabled Web page... the APPLET tag but can't run Java applets. NAME = appletInstanceName String indexOf() method in Java String indexOf() method in Java In this tutorial we will discuss about indexOf...[]) { String str="Hello java world"; int index=str.indexOf('e'); String substr="java"; System.out.println(""); System.out.println("Index of e Java zip package - Learn how to use java zip package. Java zip package In this section we will learn about java.util.zip package of java library. We will also learn how to use the zip API to create and read... learn zip package of java with examples How to Learn Java , how to learn Java? Learning Java is not that difficult just the right start is needed. The best way to learn Java today without spending money in through... or twice. If you are opting to learn Java online the only thing required how to send contact detail in email how to send contact detail in email hi...all of u.....i am work... problem...frnd how to send a contact form detail mail on a click submit button...;/html> and this is my jsp page.... <%@ page language="java What is AWT in java What is AWT in java In this section, you will learn about the java.awt.*; package... the native system input events and it automatically test the java platform about J2EE. - Java Beginners about J2EE. I know only core Java ... what chapter I will be learn to know about J2EE. Hi Friend, Please visit the following link: Thanks Hi Friend ..Doubt on Exceptions - Java Beginners Hi Friend ..Doubt on Exceptions Hi Friend... Can u please send some Example program for Exceptions.. I want program for ArrayIndexOutOfbounds OverFlow Exception.. Thanks... Sakthi Hi friend, Code Java EE 6 Profiles In this section, you will get a brief detail about profiles in Java EE6 How to learn programming free? , Here are the tutorials: Beginners Java Tutorial Learn Java in a day Master Java...How to learn programming free? Is there any tutorial for learning Java absolutely free? Thanks Hi, There are many tutorials on Java Exceptions Tutorials With Examples What are Chained Exceptions? What are Chained Exceptions in Java?  ... by the Java run-time system - These are the exceptions which violate the rules... causes an another exception, that is termed as Chained Exception. Java User Defined Exception In Java User Defined Exception In Java In terms of programming when we talk about... class of all the exceptions and errors in Java and the java.lang.Exception.... In Java, when an exception occurs an exception object is created by the method Exceptions in Java Exceptions in Java  ... the execution of java program. The term exception in java stands ... also be error in the program. Error in Java are of two type- 1.Compile Find the Day of the Week Find the Day of the Week This example finds the specified date of an year and a day... time zone, locale and current time. The fields used: DAY_OF indexOf() Method ; In this section, you will get the detailed explanation about... class in Java. The description of the code is given below for the usage of the method. Description of the code: Here, you will get to know about the indexOf Determining the Day-of-Week for a Particular Date Determining the Day-of-Week for a Particular Date This section simply show the current day in word i.e. the Day of Week for a particular date. Here, you can learn about the way About java and JDBC About java and JDBC Hello sir, I am doing project on java...);; JLabel l = new JLabel("", JLabel.CENTER); String day = ""; JDialog d...) { day = button[selection].getActionCommand Remove a value with remove() method ; In this section you will learn to remove an object from a particular position specified by a index value. Here is an example that provides the usage of the remove() method in more detail. Create a class Learn Java in 24 hours tutorials and Java description. The course start with explaining developers about... with chapters explaining about everything in Java, RoseIndia also provides Java... find it easy to understand the example. To learn Java in 24 hours, you must clear about java swing - Java Beginners about java swing How to upload the pictures and photo on the panel in java swing ,plz help thank a lot. Hi Friend, Try...; public class UploadImage extends JPanel { static File file=null; int index Shopping Cart Index Page the search results about the product to the customer. In administration part part... on the product link the complete detail of the product is opened on a new about Detail file path where to store application. about Detail file path where to store application. can you tell me detail path where we have to store our application How we learn java How we learn java what is class in java? what is object in java? what is interface in java and use? what is inheritence and its type Catching and Handling Exceptions Java Catching and Handling Exceptions The various keywords for handling exceptions... the exceptions. These are try, catch and finally clause. The mechanism to catch How to Throw Exceptions How to Throw Exceptions in Java  .... Point to note here is that the Java compiler very well knows about...\vinod\Exception>java Test MyException: can't be divided by zero Getting Previous, Current and Next Day Date Getting Previous, Current and Next Day Date In this section, you will learn how to get previous, current and next date in java. The java util package provides Changing the value of Array in Java . In this tutorial you will learn how to change array values. The one dimensional array program is provided Java application program about the explanation... Changing the Value of Array in Java
http://www.roseindia.net/tutorialhelp/comment/81537
CC-MAIN-2014-52
refinedweb
2,583
56.25
Results 1 to 5 of 5 Strategies for Orientation/Repositioning - Member Since - Apr 15, 2012 - 5 With the code working, it's time to get the interface looking nice in all orientations. Does anyone have any general advice about which way to go - and which ways not to go? I'm assuming at the moment that I'm best putting groups of elements into views and that those views then have methods to reposition themselves when rotated? Or do superviews reposition their subviews? Thanks. You can reposition all of your views and sub views with code, but you have to provide all of the CGPoints and X and Y coordinates for the different orientations, so the easiest way is to let the iOS systems autorotation method handle things for you. And yes, the super view will automatically rotate its sub views, in the autorotation method provided. I recently posted the correct implementation of this method in another forum post, but I have posted it again below. Code: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)io { return (io == UIInterfaceOrientationPortrait || UIInterfaceOrientationIsLandscape(io); } the method, will allow for any portrait, or landscape orientation, but you can change this methods code to only support certain orientations if you wanted. You did'nt say wether you where coding for the iPhone or iPad, as you should also be aware, that there are some types of view controller that are device specific, for example the UISplitViewController class, will only operate on the iPad, so check the documentation to see if the type of view controller class's you are using, are universal to both devices. Hope this is of some help. Regards Mark - Member Since - Apr 15, 2012 - 5 Thanks Mark. I'm okay with the orientation itself (so far, anyway) but I'm looking for a sensible way to reposition the control elements - recentering being the most frequent need. This applies to both iPad and iPhone of course. Is there some kind of [myButton whereAmIinTheWindow] or [myButton.super whereIsMyButtonInTheWindow] call I can make? The UIButton class is a sub class of UIView, so any methods or properties of UIView can be called on a UIButton, that includes all of the CGPoint CGRect and Bounds properties, I believe from memory that the UIView class has frame and center properties, which gets and sets the view's position within its super view. So those UIView properties and methods are the nearest thing to a where am i implementation for a UIButton object. So read the docs on the UIView class, and you can use any of the methods on all of the other UI controls. Regards Mark - Member Since - Apr 15, 2012 - 5 Ah, that sounds like what I'm looking for. I'll bury my head in that as soon as I can. Thanks. Thread Information Users Browsing this Thread There are currently 1 users browsing this thread. (0 members and 1 guests) Similar Threads rMBP + Cinema Dispaly 24' - desktop icons repositioningBy booree in forum Apple NotebooksReplies: 2Last Post: 06-14-2013, 03:42 AM Pages '09 page orientationBy bettyg in forum OS X - Operating SystemReplies: 1Last Post: 12-04-2012, 11:58 AM moving or repositioning an iMacBy kevn in forum Apple DesktopsReplies: 2Last Post: 11-24-2010, 09:14 AM Strategies for dealing with the MacBook Air's Single USB PortBy m021478 in forum Apple NotebooksReplies: 8Last Post: 12-24-2008, 11:45 PM Monitor OrientationBy jdgti in forum OS X - Operating SystemReplies: 4Last Post: 10-04-2006, 06:08 PM
http://www.mac-forums.com/ios-development/272448-strategies-orientation-repositioning.html?s=c3784ab85a0493fc53b89c16f412a6fc
CC-MAIN-2016-30
refinedweb
583
54.56
Time complexity: the time complexity of an algorithm is a function that qualitatively describes the running time of the algorithm. This is a function representing the length of the string of the input value of the algorithm. The time complexity is usually expressed by large O sign, excluding the low-order term and first term coefficient of this function. In this way, the time complexity can be called asymptotic, that is, when the size of the input value approaches infinity. (generally speaking, the speed of running time is relative here. For example, if we use the same code and there are few codes, we don't need to use complex sorting, but if the code is too large, we have to use complex sorting to shorten the time. If we still don't understand it, we can convert it into a mathematical model and regard different algorithms as different powers Function, some power functions have large y value in the early stage, and some power functions have large y value in the later stage). Example: Garlic gentleman has an array A with length n. Because the array is too large, you don't know what numbers are in the array, so you often ask whether the integer x is in array A. Input format In the first line, enter two integers n and m, representing the length of the array and the number of queries, respectively. The next line has n integers a1 Next m lines, each line has an integer x, which represents the integer asked by garlic gentleman. Output format For each query, if it can be found, output "YES", otherwise output "NO". Data range 1 ≤ n,m ≤ the 5th power of 10, 0 ≤ x ≤ the 6th power of 10. I'll just show you the algorithm. Quick sort #include <stdio.h> void quickSort(int left, int right, int a[]) { //Quick sort int key, low, high, s, j, temp; if (left >= right) { //Returns the main function when the left is greater than the right return; } key = a[left]; low = left; high = right; while (low < high) { while (low < high && a[high] >= key) { high --; } while (low < high && a[low] <= key) { low ++; } if (low < high) { temp = a[low]; a[low] = a[high]; a[high] = temp; } }//Find a number at will, and put the row less than this number on the left and the row greater than this number on the right a[left] = a[low]; a[low] = key; s = low - 1; j = low + 1; quickSort(left, s, a); //Sort once with the number to the left of this number quickSort(j, right, a); //Sort once with the number to the right of this number } int main() { int n, g, x, h = 0, z = 0, i = 0, num, num1, judge, left, right, mid, temp; scanf("%d", &n); int str1[n]; while (1) { scanf("%d", &num); char c = getchar(); str1[i++] = num; if (c == '\n') { break; } } x = n - 1; quickSort(0, x, str1); for (i = 0; i < n; i++) { printf("%d ", str1[i]); } } Bucket sorting: #include <stdio.h> int main() { int n, t, i, j; scanf("%d", &n); long long a[n]; for (i = 0; i < n; i++) { a[i] = 0; } for (i = 0; i < n; i++) { scanf("%d", &t); a[t]++; } for (i = 0; i < n; i++) { for (j = 0; j < a[i]; j++) { printf("%d ", i); } } } Bubble sort: #include <stdio.h> int main() { int n, t, i, j, temp;; scanf("%d", &n); long long a[n] = {0}; for (t = 0; t < n; t++) { scanf("%d", &a[t]); } for (i = 1; i <= n - 1; i++) { //The outer loop is the number of rounds compared. If there are 10 rounds in the array, then 10-1 = 9 rounds should be compared for (j = 0; j <= n - 1 - i; j++) { //The inner loop compares the number of comparisons in the current round. For example, the first round of comparison 9-1 = 8 times, and the second round of comparison 9-2 = 7 times if (a[j] > a[j + 1]) { //If two adjacent numbers are in reverse order, they exchange positions temp = a[j]; a[j] = a[j + 1]; a[j + 1] = temp; } } } for (i = 0; i < n; i++) printf("%-4d", a[i]); printf("\n"); } There are infinite numbers in the array sorted by this question. We should consider whether to exceed the limit and whether to timeout (we should pay attention to the time complexity here). We can copy these codes and try to compare the time when the number is small and the time when the number is many.
https://programmer.group/time-complexity.html
CC-MAIN-2022-40
refinedweb
756
64.38
#include <unistd.h> char *getlogin(void); int getlogin_r(char *name, size_t namesize); The getlogin() function shall return a pointer to a string containing the user name associated by the login activity with the controlling terminal of the current process. If getlogin() returns a non-null pointer, then that pointer points to the name that the user logged in under, even if there are several login names with the same user ID. The getlogin() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe. The getlogin_r() function shall put the name associated by the login activity with the controlling terminal of the current process in the character array pointed to by name. The array is namesize characters long and should have space for the name and the terminating null character. The maximum size of the login name is {LOGIN_NAME_MAX}. If getlogin_r() is successful, name points to the name the user used at login, even if there are several login names with the same user ID. Upon successful completion, getlogin() shall return a pointer to the login name or a null pointer if the user's login name cannot be found. Otherwise, it shall return a null pointer and set errno to indicate the error. The return value from getlogin() may point to static data whose content is overwritten by each call. If successful, the getlogin_r() function shall return zero; otherwise, an error number shall be returned to indicate the error. The getlogin() and getlogin_r() functions may fail if: The getlogin_r() function may fail if: The following sections are informative. The following example calls the getlogin() function to obtain the name of the user associated with the calling process, and passes this information to the getpwnam() function to get the associated user database information. #include <unistd.h> #include <sys/types.h> #include <pwd.h> #include <stdio.h> ... char *lgn; struct passwd *pw; ... if ((lgn = getlogin()) == NULL || (pw = getpwnam(lgn)) == NULL) { fprintf(stderr, "Get of user information failed.\n"); exit(1); } Three names associated with the current process can be determined: getpwuid( geteuid()) shall return the name associated with the effective user ID of the process; getlogin() shall return the name associated with the current login activity; and getpwuid( getuid()) shall return the name associated with the real user ID of the process. The getlogin_r() function is thread-safe and returns values in a user-supplied buffer instead of possibly using a static data area that may be overwritten by each call. The getlogin() function returns a pointer to the user's login name. The same user ID may be shared by several login names. If it is desired to get the user database entry that is used during login, the result of getlogin() should be used to provide the argument to the getpwnam() function. (This might be used to determine the user's login shell, particularly where a single user has multiple login shells with distinct login names, but the same user ID.) The information provided by the cuserid() function, which was originally defined in the POSIX.1-1988 standard and subsequently removed, can be obtained by the following: getpwuid(geteuid()) while the information provided by historical implementations of cuserid() can be obtained by: getpwuid(getuid()) The thread-safe version of this function places the user name in a user-supplied buffer and returns a non-zero value if it fails. The non-thread-safe version may return the name in a static data area that may be overwritten by each call. None. getpwnam() , getpwuid() , geteuid() , getuid() , the Base Definitions volume of IEEE Std 1003.1-2001, <limits.h>, <unistd.h>
http://www.makelinux.net/man/3posix/G/getlogin
CC-MAIN-2016-36
refinedweb
610
51.28
24 August 2010 17:04 [Source: ICIS news] WASHINGTON (ICIS)--US sales of existing homes plummeted by more than 27% in July from June, national housing market officials said on Tuesday, falling to their lowest level since 1995 in an accelerating decline that is expected to last through September. The sharp fall in sales of existing homes last month also meant that the inventory of unsold homes on the ?xml:namespace> In normal economic times, the inventory of unsold homes on the market would range between four to six months. The The National Association of Realtors (NAR) said that existing home sales last month fell by 27.2% to a seasonally-adjusted annualised figure of 3.83m units from the downwardly revised pace of 5.26m in June. Existing home sales had fallen by 2.2% in May from April, but some of May’s sales were closings on contracts initiated during April when a home-buyer tax credit was available. The post-incentive decline was stronger in June with sales slightly more than 5% down from May, and the crash-dive drop in July represents a much sharper acceleration. July’s sales pace also was 25.5% below the level of activity reported for July 2009, when existing home sales were at the 5.14m level (also seasonally adjusted and annualised). The association noted that in the single-family homes category - considered the core of the housing market - sales in July were at the lowest level since May 1995, a period well before the housing boom of 2003-2005. The sharp fall-off in July was attributed in large part to continuing after-effects of the lapsed federal home-buyer tax incentive that expired at the end of April. “Consumers rationally jumped into the market before the deadline for the $8,000 [€6,320] home buyer tax credit expired,” said NAR chief economist Lawrence Yun. “Since May, contract signings have been notably lower and a pause period for home sales is likely to last through September,” Yun said. However, the continuing nose-dive in real estate sales and housing construction also suggested an underlying weakness in basic demand, Yun indicated. He pointed out that mortgage loan interest rates were at rock-bottom and home prices at historic lows, a combination that ordinarily should trigger a home-buying frenzy. But Yun indicated that a housing market recovery is not anticipated until the overall Despite the gloomy month-to-month figures, Yun said that overall home sales for 2010 should be at or near averages seen over the last several decades. “Even with sales pausing for a few months, annual sales are expected to reach 5m in 2010 because of healthy activity in the first half of the year,” he said, referring to stimulus-related sales in the January through April period. “To place this in perspective, annual sales averaged 4.9m in the past 20 years and 4.4m over the past 30 years,” Yun said. However, the 3.83m sales pace for existing homes in July compares less favourably with the real estate boom years, when month-to-month residential property sales routinely exceeded 7m units on a seasonally adjusted and annualised basis. ($1 = €0.
http://www.icis.com/Articles/2010/08/24/9387915/us-existing-home-sales-fall-27-in-july-slide-likely-to-continue.html
CC-MAIN-2013-20
refinedweb
536
51.89
BackgroundSn so that we can roll out new upgrades and quickly pull them from the server side if we notice a problem. Snappy devices even support rolling back upgrades on a single device, by using a dual-partition root file system. Phones generally don't support this due to lack of available space on the device. Of course, the other part really interesting thing about Snappy is the lightweight, flexible approach to deploying applications. I still remember my early days learning how to package software for Debian and Ubuntu, and now that I'm both an Ubuntu Core Developer and Debian Developer, I understand pretty well how to properly package things. There's still plenty of black art involved, even for relatively easy upstream packages such as distutils/setuptools-based Python package available on the Cheeseshop (er, PyPI). The Snappy approach on Ubuntu Core is much more lightweight and easy, and it doesn't require the magical approval of the archive elves, or the vagaries of PPAs, to make your applications quickly available to all your users. There's even a robust online store for publishing your apps. There's lots more about Snappy apps and Ubuntu Core that I won't cover here, so I encourage you to follow the links for more information. You might also want to stop now and take the tour of Ubuntu Core (hey, I'm a poet and I didn't even realize it). In this post, I want to talk about building and deploying snappy Python applications. Python itself is not an officially supported development framework, but we have a secret weapon. The system image client upgrader -- i.e. the component on the devices that checks for, verifies, downloads, and applies atomic updates -- is written in Python 3. So the core system provides us with a full-featured Python 3 environment we can utilize. The question that came to mind is this: given a command-line application available on PyPI, how easy is it to turn into a snap and install it on an Ubuntu Core system? With some caveats I'll explore later, it's actually pretty easy! Basic approachThe basic idea is this: let's take a package on PyPI, which may have additional dependencies also on PyPI, download them locally, and build them into a snap that we can install on an Ubuntu Core system. The first question is, how do we build a local version of a fully-contained Python application? My initial thought was to build a virtual environment using virtualenv or pyvenv, and then somehow turn that virtual environment into a snap. This turns out to be difficult in practice because virtual environments aren't really designed for this. They have issues with being relocated for example, and they can contain a lot of extraneous stuff that's great for development (virtual environment's actual purpose ) but unnecessary baggage for our use case. My second thought involved turning a Python application into a single file executable, and from there it would be fairly easy to snappify. Python has a long tradition of such tools, many with varying degrees of cross platform portability and standalone-ishness. After looking again at some oldies but goodies (e.g. cx_freeze) and some new offerings, I decided to start with pex. pex is a nice tool developed by Brian Wickman and the Twitter folks which they use to deploy Python applications to their production environment. pex takes advantage of modern Python's support for zip imports, and a clever trick of zip files. Python supports direct imports (of pure Python modules) from zip files, and the python executable's -m option works even when the module is inside a zip file. Further, the presence of a __main__.py file within a package can be used as shorthand for executing the package, e.g. python -m myapp will run myapp/__main__.py if it exists. Zip files are interesting because their index is at the end of the file. This allows you to put whatever you want at the front of the file and it will still be considered a zip file. pex exploits this by putting a shebang in the first line of the file, e.g. #!/usr/bin/python3 and thus the entire zip file becomes a single file executable of Python code. There are of course, plenty of caveats. Probably the main one is that Python cannot import extension modules directly from the zip, because the dlopen() function call only takes a file system path. pex handles this by marking the resulting file as not zip safe, so the zip is written out to a temporary directory first. The other issue of course, is that the zip file must contain all the dependencies not present in the base Python. pex is actually fairly smart here, in that it will chase dependencies, much like pip and it will include those dependencies in the zip file. You can also specify any missed dependencies explicitly on the pex command line. Once we have the pex file, we need to add the required snappy metadata and configuration files, and run the snappy command to generate the .snap file, which can then be installed into Ubuntu Core. Since we can extract almost all of the minimal required snappy metadata from the Python package metadata, we only need just a little input from the user, and the rest of work can be automated. We're also going to avail ourselves of a convenient cheat. Because Python 3 and its standard library are already part of Ubuntu Core on a snappy device, we don't need to worry about any of those dependencies. We're only going to support Python 3, so we get its full stdlib for free. If we needed access to Python 2, or any external libraries or add-ons that can't be made part of the zip file, we would need to create a snappy framework for that, and then utilize that framework for our snappy app. That's outside the scope of this article though. RequirementsTo build Python snaps, you'll need to have a few things installed. If you're using Ubuntu 15.04, just apt-get install the appropriate packages. Otherwise, you can get any additional Python requirements by building a virtual environment and installing tools like pex and wheel into their, then invoking pex from that virtual environment. But let's assume you have the Vivid Vervet (Ubuntu 15.04); here are the packages you need: - python3 - python-pex-cli - python3-wheel - snappy-tools - git For extra credit, you might want to get a copy of Python 3.5 (unreleased as of this writing). I'll show you how to do some interesting debugging with Python 3.5 later on. From PyPI to snap in one easy stepLet's start with a simple example: world is a very simple script that can provide forward and reverse mappings of ISO 3166 two letter country codes (at least as of before ISO once again paywalled the database). So if you get an email from guido@example.py you can find out where the BDFL has his secret lair: $ world py py originates from PARAGUAY world is a pure-Python package with both a library and a command line interface. To get started with the snap.py script mentioned above, you need to create a minimal .ini file, such as: [project] name: world [pex] verbose: true Let's call this file world.ini. (In fact, you'll find this very file under the examples directory in the snap git repository.) What do the various sections and variables control? - name is the name of the project on PyPI. It's used to look up metadata about the project on PyPI via PyPI's JSON API. - verbose variable just defines whether to pass -v to the underlying pex command. $ ./snap.py examples/world.ini You'll see a few progress messages and a warning which you can ignore. Then out spits a file called world_3.1.1_all.snap. Because this is pure Python, it's architecture independent. That's a good thing because the snap will run on any device, such as a local amd64 kvm instance, or an ARM-based Ubuntu Core-compatible Lava Lamp. Armed with this new snap, we can just install it on our device (in this case, a local kvm instance) and then run it: $ snappy-remote --url=ssh://localhost:8022 install world_3.1.1_all.snap $ ssh -p 8022 ubuntu@localhost ubuntu@localhost:~$ world.world py py originates from PARAGUAY From git repository to snap in one easy stepLet's look at another example, this time using a stupid project that contains an extension module. This aptly named package just prints a yes for every -y argument, and no for every -n argument. The difference here is that stupid isn't on PyPI; it's only available via git. The snap.py helper is smart enough to know how to build snaps from git repositories. Here's what the stupid.ini file looks like: [project] name: stupid origin: git [pex] verbose: yes Notice that there's a [project]origin variable. This just says that the origin of the package isn't PyPI, but instead a git repository, and then the public repo url is given. The first word is just an arbitrary protocol tag; we could eventually extend this to handle other version control systems or origin types. For now, only git is supported. To build this snap: $ ./snap.py examples/stupid.ini This clones the repository into a temporary directory, builds the Python package into a wheel, and stores that wheel in a local directory. pex has the ability to build its pex file from local wheels without hitting PyPI, which we use here. Out spits a file called stupid_1.1a1_all.snap, which we can install in the kvm instance using the snappy-remote command as above, and then run it after ssh'ing in: ubuntu@localhost:~$ stupid.stupid -ynnyn yes no no yes no Watch out though, because this snap is really not architecture-independent. It contains an extension module which is compiled on the host platform, so it is not portable to different architectures. It works on my local kvm instance, but sadly not on my Lava Lamp. Entry pointspex currently requires you to explicitly name the entry point of your Python application. This is the function which serves as your main and it's what runs by default when the pex zip file is executed. Usually, a Python package will define its entry point in its setup.py file, like so: setup( ... entry_points={ 'console_scripts': ['stupid = stupid.__main__:main'], }, ... ) And if you have a copy of the package, you can run a command to generate the various package metadata files: $ python3 setup.py egg_info If you look in the resulting stupid.egg_info/entry_points.txt file, you see the entry point clearly defined there. Ideally, either pex or snap.py would just figure this out explicitly. As it turns out, there's already a feature request open on pex for this, but in the meantime, how can we auto-detect the entry point? For the stupid example, it's pretty easy. Once we've cloned its git repository, we just run the egg_info command and read the entry_points.txt file. Later, we can build the project's binary wheel from the same git clone. It's a bit more problematic with world though because the package isn't downloaded from PyPI until pex runs, but the pex command line requires that you specify the entry point before the download occurs. We can handle this by supporting an entry_point variable in the snap's .ini file. For example, here's the world.ini file with an explicit entry point setting: [project] name: world entry_point: worldlib.__main__:main [pex] verbose: true What if we still wanted to auto-detect the entry point? We could of course, download the world package in snap.py and run the egg-info command over that. But pex also wants to download world and we don't want to have to download it twice. Maybe we could download it in snap.py and then build a local wheel file for pex to consume. As it turns out there's an easier way. Unfortunately, package egg-info metadata is not availble on PyPI, although arguably it should be. Fortunately, Vinay Sajip runs an external service that does make the metadata available, such as the metadata for world. snap.py makes the entry_point variable optional, and if it's missing, it will grab the package metadata from a link like that given above. An error will be thrown if the file can't be found, in which case, for now, you'd just add the [project]entry_point variable to the .ini file. A little more snap.py detailThe snap.py script is more or less a pure convenience wrapper around several independent tools. pex of course for creating the single executable zip file, but also the snappy command for building the .snap file. It also utilizes python3 setup.py egg_info where possible to extract metadata and construct the snappy facade needed for the snappy build command. Less typing for you! In the case of a snap built from a git repository, it also performs the git cloning, and the python3 setup.py bdist_wheel command to create the wheel file that pex will consume. There's one other important thing snap.py does: it fixes the resulting pex file's shebang line. Because we're running these snaps on an Ubuntu Core system, we know that Python 3 will be available in /usr/bin/python3. We want the pex file's shebang line to be exactly this. While pex supports a --python option to specify the interpreter, it doesn't take the value literally. Instead, it takes the last path component and passes it to /usr/bin/env so you end up with a shebang line like: #!/usr/bin/env python3 That might work, but we don't want the pex file to be subject to the uncertainties of the $PATH environment variable. One of the things that snap.py does is repack the pex file. Remember, it's just a zip file with some magic at the top (that magic is the shebang), so we just read the file that pex spits out, and rewrite it with the shebang we want. Eventually, pex itself will handle this and we won't need to do that anymore. DebuggingWhile I was working out the code and techniques for this blog post, I ran into an interesting problem. The world script would crash with some odd tracebacks. I don't have the details anymore and they'd be superfluous, but suffice to say that the tracebacks really didn't help in figuring out the problem. It would work in a local virtual environment build of world using either the (pip installed) PyPI package or run from the upstream git repository, but once the snap was installed in my kvm instance, it would traceback. I didn't know if this was a bug in world, in the snap I built, or in the Ubuntu Core environment. How could I figure that out? Of course, the go to tool for debugging any Python problem is pdb. I'll just assume you already know this. If not, stop everything and go learn how to use the debugger. Okay, but how was I going to get a pdb breakpoint into my snap? This is where Python 3.5 comes in! PEP 441, which has already been accepted and implemented in what will be Python 3.5, aims to improve support for zip applications. Apropos this blog post, the new zipapp module can be used to zip up a directory into single executable file, with an argument to specify the shebang line, and a few other options. It's related to what pex does, but without all the PyPI interactions and dependency chasing. Here's how we can use it to debug a pex file. Let's ignore snappy for the moment and just create a pex of the world application: $ pex -r world -o world.pex -e worldlib.__main__:mainNow let's say we want to set a pdb breakpoint in the main() function so that we can debug the program, even when it's a single executable file. We start by unzipping the pex: $ mkdir worldIf you poke around, you'll notice a __main__.py file in the current directory. This is pex's own main entry point. There are also two hidden directories, .bootstrap and .deps. The former is more pex scaffolding, but inside the latter you'll see the unpacked wheel directories for world and its single dependency. $ cd world $ unzip ../world.pex Drilling down a little farther, you'll see that inside the world wheel is the full source code for world itself. Set a break point by visiting .deps/world-3.1.1-py2.py3-none-any.whl/worldlib/__main__.py in your editor. Find the main() function and put this right after the def line: import pdb; pdb.set_trace() Save your changes and exit your editor. At this point, you'll want to have Python 3.5 installed or available. Let's assume that by the time you read this, Python 3.5 has been released and is the default Python 3 on your system. If not, you can always download a pre-release of the source code, or just build Python 3.5 from its Mercurial repository. I'll wait while you do this... ...and we're back! Okay, now armed with Python 3.5, and still inside the world subdirectory you created above, just do this: $ python3.5 -m zipapp . -p /usr/bin/python3 -o ../world.dbg Now, before you can run ../world.dbg and watch the break point do its thing, you need to delete pex's own local cache, otherwise pex will execute the world dependency out of its cache, which won't have the break point set. This is a wart that might be worth reporting and fixing in pex itself. For now: $ rm -rf ~/.pex $ ../world.dbg And now you should be dropped into pdb almost immediately. If you wanted to build this debugging pex into a snap, just use the snappy build command directly. You'll need to add the minimal metadata yourself (since currently snap.py doesn't preserve it). See the Snappy developer documentation for more details. Summary and Caveats There's a lot of interesting technology here; pex for building single file executables of Python applications, and Snappy Ubuntu Core for atomic, transactional system updates and lightweight application deployment to the cloud and things. These allow you to get started doing some basic deployments of Python applications. No doubt there are lots of loose ends to clean up, and caveats to be aware of. Here are some known ones: - All of the above only works with Python 3. I think that's a feature, but you might disagree. ;) This works on Ubuntu Core for free because Python 3 is an essential piece of the base image. Working out how to deploy Python 2 as a Snappy framework would be an interesting exercise. - When we build a snap from a git repository for an application that isn't on PyPI, I don't currently have a way to also grab some dependencies from PyPI. The stupid example shown here doesn't have any additional dependencies so it wasn't a problem. Fixing this should be a fairly simple matter of engineering on the snap.py wrapper (pull requests welcome!) - We don't really have a great story for cross-compilation of extension modules. Solving this is probably a fairly complex initiative involving the distros, setuptools and other packaging tools, and upstream Python. For now, your best bet might be to actually build the snap on the actual target hardware. - Importing extension modules requires a file system cache because of limitations in the dlopen() API. There have been rumors of extensions to glibc which would provide a dlopen()-from-memory type of API which could solve this, or upstream Python's zip support may want to grow native support for caching.
http://voices.canonical.com/user/88/tag/python3/
CC-MAIN-2015-18
refinedweb
3,394
73.17