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
00001 //-*-c++-*- 00002 #ifndef INCLUDED_Thread_h_ 00003 #define INCLUDED_Thread_h_ 00004 00005 #ifdef PLATFORM_APERIOS 00006 # warning Thread class is not Aperios compatable 00007 #else 00008 00009 #include "Shared/Resource.h" 00010 #include <stddef.h> 00011 00012 struct timespec; 00013 00014 //! provides Thread related data structures 00015 namespace ThreadNS { 00016 //! an inter-thread lock -- doesn't work across processes, only threads within a process. (see MutexLock for inter-process locks) 00017 class Lock : public Resource { 00018 public: 00019 Lock(); //!< constructor 00020 //explicit Lock(const Lock& l); //!< copy constructor -- shallow copy, share a lock, is handy for locking over a scope!!! (lock is automatically obtained on copy -- to avoid autolock, pass false to the two-argument constructor: Lock(const Lock& l, bool autolock) ) 00021 //Lock(const Lock& l, bool autolock); //!< copy constructor -- shallow copy, share a lock, is handy for locking over a scope!!! 00022 //Lock& operator=(const Lock& l); //!< assignment -- dereference (and release) any previous lock, take on the new storage (shallow copy!) 00023 ~Lock(); //!< destructor -- dereference and release (if any references remain) 00024 void lock(); //!< block until lock is obtained 00025 bool trylock(); //!< see if lock is available 00026 void unlock(); //!< release lock, if held 00027 unsigned int getInstanceLockLevel() const { return locklevel; } //!< returns the lock level of the local instance of Lock (as opposed to the lock storage structure, which might be shared with other Lock instances) 00028 unsigned int getLockLevel() const; //!< returns the lock level of the lock storage itself, the sum of all instance's lock levels 00029 protected: 00030 friend class MarkScope; 00031 friend class Condition; 00032 virtual void useResource(Resource::Data&) { lock(); } 00033 virtual void releaseResource(Resource::Data&) { unlock(); } 00034 00035 class LockStorage; //!< this internal class will hold the system-dependent lock information 00036 static LockStorage* glock; //!< The global lock to protect Locks sharing #mylock's 00037 LockStorage* mylock; //!< This lock's implementation 00038 static void setup(); //!< creates a new #glock if it is currently NULL (should be called by the Lock() constructor) 00039 unsigned int locklevel; //!< the current lock level from this Lock, may differ from #mylock's lock level if several Locks are sharing a storage! 00040 private: 00041 Lock(const Lock& l); //!< don't call 00042 Lock& operator=(const Lock& l); //!< don't call 00043 }; 00044 00045 //! Provides an inter-thread signaling and synchronization mechanism 00046 class Condition { 00047 public: 00048 Condition(); //!< constructor 00049 ~Condition(); //!< destructor 00050 00051 void broadcast() const; //!< wake up all threads waiting on the condition 00052 void signal() const; //!< wake up a single thread waiting on the condition (which thread is unspecified) 00053 bool timedwait(Lock& l, const timespec* abstime) const; //!< wait for at most @a abstime for the condition before giving up (return true if condition found) 00054 void wait(Lock& l) const; //!< wait for condition 00055 protected: 00056 class ConditionStorage; //!< internal class to hold system-dependent information 00057 ConditionStorage* mycond; //!< the condition's implementation storage 00058 private: 00059 Condition(const Condition& l); //!< don't call 00060 Condition& operator=(const Condition& l); //!< don't call 00061 }; 00062 } 00063 00064 //! Provides a nice wrapping of pthreads library 00065 /*! If you need to provide cleanup functions on stop(), cancelled(), etc., you 00066 * should override the destructor to stop and join so that you can be assured 00067 * that your cleanup will be called if the thread is auto-destructed by going out of scope */ 00068 class Thread { 00069 public: 00070 typedef ThreadNS::Lock Lock; //!< shorthand for pthread lock wrapper 00071 00072 Thread(); //!< constructor, does not start thread by itself (although subclasses may) 00073 virtual ~Thread()=0; //!< destructor, will stop and join the thread, but you should override it to do the same if you provide any cleanup functions 00074 00075 //! requests that the thread be started, if not already running (you need to create a separate instances if you want to run multiple copies) 00076 virtual void start(); 00077 00078 //! sends a signal to the thread which will interrupt any sleep calls (and trigger interrupted() to be called within the thread) 00079 virtual void interrupt(); 00080 00081 //! requests that the thread be stopped gracefully, if running. 00082 /*! A cancel flag is sent, and the thread will be stopped at next cancel point, defined 00083 * by whenever testCancel(), or a set of other system functions, are called. 00084 * See your system's pthread_testcancel() manual page for a list of cancel points. 00085 * 00086 * This function may imply a call to interrupt() on systems which have extremely limited 00087 * system cancel points. Currently, this consists of only Mac OS X. There is hope that 00088 * additional cancellation points will be enabled on this system: 00089 * 00090 * 00091 * @see pushNoCancel(), popNoCancel() */ 00092 virtual void stop(); 00093 00094 //! sends a SIGUSR1 to the thread, breaking its execution, but still allowing handle_exit (and thus cancelled()) to be called. 00095 /*! Beware if your thread uses mutual exclusion locks, this can cause the thread to terminate while still holding locks */ 00096 virtual void kill(); 00097 00098 //! detaches thread and sends SIGSTOP, which immediately halts the thread without any chance for cleanup 00099 /*! Beware if your thread uses mutual exclusion locks, this @b will cause the thread to terminate while still holding locks. */ 00100 virtual void murder(); 00101 00102 //! sends a signal to the thread 00103 virtual void sendSignal(int sig); 00104 00105 //! blocks calling thread until this Thread has terminated, via one means or another; return value is final return value by the thread 00106 virtual void * join(); 00107 00108 //! indicates whether start() has been called (but may be some delay before isRunning() is true...) 00109 virtual bool isStarted() const { return started; } 00110 00111 //! indicates whether the thread is currently alive and running, implies isStarted() 00112 virtual bool isRunning() const { return running; } 00113 00114 //! returns the Thread object for the current thread (or NULL for the main thread) 00115 static Thread* getCurrent() ; 00116 00117 //! should be called before any threads are created to allow some global thread-specific data to be set up 00118 static void initMainThread(); 00119 //! should be called if you no longer expect to have any threads in use 00120 static void releaseMainThread(); 00121 00122 //! should be called whenever a critical section has been entered (i.e. mutex obtained) -- prevents cancel from occurring until popNoCancel() is called 00123 static void pushNoCancel(); 00124 //! should be called whenever a critical section is left (i.e. mutex released) -- if it was the last one, tests cancellability as well 00125 static void popNoCancel(); 00126 00127 //! returns #group 00128 void* getGroup() const { return group; } 00129 //! assigns #group, which will then be inherited by any threads instantiated by this one (the constructor call queries the current thread, no the start() or launch()) 00130 void setGroup(void* g) { group=g; } 00131 00132 protected: 00133 //! called by launch() when thread is first entered, return false to cancel launch (set #returnValue as well if you care) 00134 virtual bool launched() { return true; } 00135 //! called by launch() once the thread has been set up; when this returns, the thread ends, see runloop() 00136 /*! Default implementation repeatedly calls runloop(), usleep(), and testCancel(). 00137 * If you override, you should also be sure to call testCancel occasionally in order to support stop() 00138 * If function returns a value, that value overrides #returnValue. If cancel occurs, #returnValue is used. */ 00139 virtual void * run(); 00140 //! override this as a convenient way to define your thread -- return the number of *micro*seconds to sleep before the next call; return -1U to indicate end of processing 00141 virtual unsigned int runloop() { return -1U; } 00142 //! called when handle_exit() is triggered, either by the thread being cancelled, or when run() has returned voluntarily 00143 virtual void cancelled() {} 00144 00145 //! checks to see if stop() has been called, and if so, will exit the thread (passing through handle_exit() first) 00146 virtual void testCancel(); 00147 //! thread entry point -- calls launched() on the thread (as indicated by @a msg), and then run() 00148 static void * launch(void * msg); 00149 //! indicates kill() has been called (or SIGUSR1 was sent from some other source) while launch() was still running 00150 static void handle_launch_signal(int sig); 00151 //! indicates kill() has been called (or SIGUSR1 was sent from some other source) 00152 static void handle_signal(int sig); 00153 //! indicates the thread is exiting, either voluntary (run() returned), stop(), or kill() -- calls cancelled() for the thread as indicated by @a th 00154 static void handle_exit(void * th); 00155 00156 //! called by handleInterrupt() in target thread following call to interrupt(), assuming thread has not been cancelled (which can intercept the interrupt) 00157 virtual void interrupted() {} 00158 00159 //! called by SIGALRM signal handler installed by interrupt() just before it posts the corresponding SIGALRM 00160 /*! tests for thread cancel condition before calling on to interrupted() */ 00161 static void handleInterrupt(int signal); 00162 00163 //! emit a warning that the last thread exited while the self-pointer thread-specific key still exists (need to call releaseMainThread() or handle_exit()) 00164 static void warnSelfUndestructed(void* msg); 00165 00166 //! stores the actual pthread data fields 00167 struct Threadstorage_t * pt; 00168 //! set to true once start() has been called, set back to false by handle_exit(), or by murder() itself 00169 bool started; 00170 //! set to true once launch() has been called, set back to false by handle_exit(), or by murder() itself 00171 bool running; 00172 //! indicates the value to be returned by the thread entry point (and thus passed back to join()) -- set this in runloop() or launched(), overridden by run()'s return value 00173 void * returnValue; 00174 //! depth of the pushNoCancel() stack 00175 unsigned int noCancelDepth; 00176 //! cancel status at root of no-cancel stack (may be no-cancel through and through) 00177 int cancelOrig; 00178 00179 //! indicates a common group of threads, inherited from the thread which created this one, default NULL if created from main thread 00180 void* group; 00181 00182 private: 00183 Thread(const Thread& r); //!< don't call, not a well defined operation 00184 Thread& operator=(const Thread& r); //!< don't call, not a well defined operation 00185 }; 00186 00187 #endif //Aperios check 00188 00189 #endif 00190 00191 /*! @file 00192 * @brief Describes the Thread class and its AutoThread templated subclass 00193 * @author ejt (Creator) 00194 * 00195 * $Author: ejt $ 00196 * $Name: tekkotsu-4_0 $ 00197 * $Revision: 1.15 $ 00198 * $State: Exp $ 00199 * $Date: 2007/10/12 16:55:04 $ 00200 */ 00201
http://www.tekkotsu.org/dox/Thread_8h-source.html
crawl-001
refinedweb
1,702
62.98
I am not sure of how are used the "Resource" in the Ant code, but it makes me think of the Eclipse adapters (probably a design pattern ?): Though it changes the tests of the appendability, the touchability, etc... of a Resource in the ant code, the "instanceof+cast" would be replaced by some "getAdapter". This solution is not very self- contained... But I see another solution, quite different. Probably most of the work should be done in the Resource class: interface NameMapper { String getName(); } public class Resource extends DataType implements ..... NameMapper nameMapper = new NameMapper() { return isReference() ? ((Resource) getCheckedRef()).getName() : name; } public String getName() { return nameMapper.getName(); } } And then: public static Resource map(Resource r) { r. nameMapper = new NameMapper() { return doMapName(); } } hoping it helps, Nicolas Le 14 nov. 08 à 17:29, Stefan Bodewig a écrit : > I
http://mail-archives.eu.apache.org/mod_mbox/ant-dev/200811.mbox/%3CF18B1657-6F73-43F0-92D1-AE2AF4BFBC96@hibnet.org%3E
CC-MAIN-2019-51
refinedweb
136
67.86
. Field 1 : start date Field 2 : end date Field 3 . total number of days. Expected result: Filed 3 = field 2 - field 1 i used the following script <script type="text/javascript"> var startdate = new Date(); var enddate = new Date(); var days = 0; startdate = document.getElementById('Start Date').value; enddate = document.getElementById('End Date').value; days = enddate.getTime()-startdate.getTime(); document.getElementById('Total Number of Days').values = days; </script> i used the follwing link as the reference : You can in the "post-function" calculate the different in dates of two fields and then populate the required custom field in the post-function transition, thus it will save you from writing JS as things happen in the postfunction. Hi Tarun, Does the change happen immediately as i change the values of the field 1 and field 2 or it happens after submitting the request. It will happen after submitting the request, but the field can be hidden on create screen and populated in the post-function so that it's visible on the view screen Hi Tarun, Thabks for the reply. could you please elaborate on this, i am bit confused i tried by adding the script to the post function of the transition by selecting "update issue custom field", but the entire script is visisble on the view screen instead of a particular value. please correct me if i have done anything worng. Can you share screenshot as to where you are adding the script. You have to add the script in the post-function of "Script Post-Function" and then "Custom script post-function" It's pretty much wrong at many levels, you are inserting JS in the post-function which is not required, try to put the script as i have mentioned in the previous comment in the "Script post-function" and then custom script post-funciton i am new to jira service desk . can you tell me where can i find script post function and custom script post function. First, please check if you have "script runner" plugin installed, if not then the approach I suggested to you isn't possible as it requires an plugin. i dont have script runner, i chked for the pricing and stuf.. is there any other workaround.. Without the plugin, the only way to do it is to use simple Javascript which you have already shared in the question. But this is not supported by Atlassian. The JS code which you have written, doesn't take into account the "change"/ "blur" events i.e. when do you want the field's value to be filled. So you have to write an JS which gets triggered when dates in both fields are filled and then you calculate the days and fill that value in 3rd field. But for that you have to register event listener like in the link which you have shared there is an *onchange()* event listener in the method. hi @Tarun Sapra I tried the script runner plugin but i was not able to get the result i wanted // custom field references // date picker 1 def startdate = 'customfield_10401' // date picker 2 def enddate = 'customfield_10403' // text field where i want my result of the date difference calculation def totaldays = 'customfield_10406' // Extract the existing values from the issue def sdate = issue.fields[startdate] as Integer def edate = issue.fields[enddate] as Integer if (sdate == null && edate == null) { // No date's was specified, we can't calculate the date return } def tdays = issue.fields[totaldays] as Integer // Calculate the days def days = edate-sdate put("/rest/api/2/issue/${issue.key}") //.queryString("overrideScreenSecurity", Boolean.TRUE) .header("Content-Type", "application/json") .body([ fields:[ (totaldays): days ] ]) .asString() thats the script i used.. Hi Alexey, Yeah i need this to work on create issue screen (customer portal).
https://community.atlassian.com/t5/Jira-Service-Desk-questions/Using-Scripts/qaq-p/678738
CC-MAIN-2019-13
refinedweb
631
60.24
Iteration Inside and Out, Part 2↩ ↪ February 24, 2013 You’ll probably want to have read part one first unless you’re feeling brave. In our last episode, we learned that iteration involves two chunks of code: one generating values, and one consuming them. During a loop, these two chunks take turns in a cycle of generate, consume, generate, consume, like some sort of weird incremental Ouroboros. This means that one chunk has to fully return and unwind its stack frames before it can hand off to the next one. We also learned that external and internal iterators each nail some problems and totally fail at others. The discrepency boils down to which chunk of code has more useful stuff to store on the callstack. With external iterators, the code consuming values has control over the stack, so it works well with problems where most complexity is in consuming values. For example, short-circuiting or interleaving multiple iterators is trivial in an external iterator. Conversely, internal iterators put the code generating values in control. They excel when generating values is complicated, like walking a tree and iterating over the nodes. Now we’ll see some techniques to deal with this. The basic idea is reification. If you’ve got some data on the callstack that you want to hang onto, you need to find a place to store it. Iterators and generators Say we want to define a method that concatenates two sequences. We don’t want to actually create a data structure that contains the elements of both, we just want to return an iterator that walks the first sequence and then the second one. Here’s how you could do that in C#: IEnumerable Concat(IEnumerable a, IEnumerable b) { return new ConcatEnumerable(a, b); } class ConcatEnumerable { IEnumerable a; IEnumerable b; ConcatEnumerable(IEnumerable a, IEnumerable b) { this.a = a; this.b = b; } IEnumerable GetEnumerator() { return new ConcatEnumerator( a.GetEnumerator(), b.GetEnumerator()); } } class ConcatEnumerator { IEnumerator a; IEnumerator b; bool onFirst = true; ConcatEnumerator(IEnumerator a, IEnumerator b) { this.a = a; this.b = b; } bool MoveNext() { // Which sequence are we on? if (onFirst) { // Stay on first. if (a.MoveNext()) return true; // Move to the next sequence. onFirst = false; return b.MoveNext(); } // On second. return b.MoveNext(); } Object Current { get { return onFirst ? a.Current : b.Current; } } } Oof, that seems like a pile of code for such a simple goal. The problem is that we’ve got all of this state to maintain: the two sequences being iterated, which one we’re in, and where we are in it. Since this is an external iterator, we can’t just store that as local variables on the stack because we have to return from MoveNext() between each item. But but but! C# has something called iterators. (A confusing name. What other languages call “iterators”, C# calls “enumerators”. So “iterator” means something special in C#-land.) The above code can also be written: IEnumerable Concat(IEnumerable a, IEnumerable b) { foreach (var item in a) yield return item; foreach (var item in b) yield return item; } How’s that for an improvement? (Note: if your employer pays you by the line, you’ll want to avoid this.) The magic here is yield return. When a method contains it, the compiler turns the method into an iterator. You can think of it sort of as a “resumable method”. When you call Concat(), it runs to the first yield, then stops. Then when you resume it, it picks up where it left after the yield. So here it iterates through the first sequence, stopping at each item and returning it. Then it does the same thing with the second sequence. But what does it mean to “resume” a method? The return type here clarifies that. When you call Concat(), what you get back is an IEnumerable. This is C#‘s iterable sequence type. So what you get back is a “collection”. “Resuming the method” just means “get the next value in the sequence”. So, given the above, we’ve got a nice solution to our original problem. We can use it like: foreach (var item in Concat(stuff, moreStuff)) { Console.WriteLine(item); } Using yield lets us store all of the interesting state—the two sequences and our current location in them— just as local variables right in the Concat() method. C# will reify that stuff for us so that when the Concat() method “returns”, that data gets squirreled away somewhere safe. You may wonder how it does that. That’s kind of the funny bit. In the case of C#, the answer is that the compiler itself will automatically generate a little hidden class exactly like our ConcatEnumerator one up there. The actual runtime (the CLR) doesn’t have any support for yield. It’s done purely by automatically generating code. It’s large delicious lump of syntactic sugar. In the last post, I crafted some glorious ASCII art showing where all of the state is being stored. The main problem was that the state for the code generating values and the state for the code consuming them both live on the stack. Using an iterator, though, gives you this: stack heap +---------------------+ | iterator.MoveNext() | +---------------------+ +-------------------+ | loop body | --> | DesugaredIterator | +---------------------+ +-------------------+ ... main() So the stack has the state for the code consuming values. But the state needed to generate values lives on the heap. There’s an instance of this little class that the compiler created for us. When MoveNext() returns, we don’t trash the state because it’s still over there in the heap available the next time we call MoveNext(). There are a few other languages that do (or will) work this way. Python calls these “generators” and uses a similar yield statement. The next version of JavaScript will have something similar. The language that invented generators and the yield keyword was Barbara Liskov’s CLU, immortalized forever in Tron. (I’m not making that up.) There’s a limitation here, though. You can only yield from the method itself. Let’s say (for whatever reason) we wanted to organize our C# code like: IEnumerable Concat(IEnumerable a, IEnumerable b) { WalkFirst(a); WalkSecond(b); } IEnumerable WalkFirst(IEnumerable a) { foreach (var item in a) yield return item; } IEnumerable WalkSecond(IEnumerable a) { foreach (var item in a) yield return item; } What we want to have happen is that the yield return in WalkFirst() and WalkSecond() will cause Concat() itself to yield and return, but it doesn’t work that way. Iterators/generators reify a stack frame for you, but they only reify one. If you want to have your iteration logic call other methods which also yield, you have to manually reify every level yourself by walking the sequence at each level. Something like: IEnumerable Concat(IEnumerable a, IEnumerable b) { foreach (var item in WalkFirst(a)) yield return item; foreach (var item in WalkSecond(a)) yield return item; } IEnumerable WalkFirst(IEnumerable a) { foreach (var item in a) yield return item; } IEnumerable WalkSecond(IEnumerable a) { foreach (var item in a) yield return item; } You see how we’re doing foreach and yield return both in the Walk_ methods and in Concat itself? We’re explicitly making every level of the callstack an iterator. That makes sure every call frame gets reified like we need. Can we do better? Python 3.3: Delegating generators The above example can be translated to Python like so: def concat(a, b): for item in walkFirst(a): yield item for item in walkSecond(a): yield item def walkFirst(a): for item in a: yield item def walkSecond(a): for item in b: yield item Aside from being more terse, this is a one-to-one mapping with the C# code. But Python 3.3 adds something new for us here. Let’s use it: def concat(a, b): yield from walkFirst(a) yield from walkSecond(a) def walkFirst(a): for item in a: yield item def walkSecond(a): for item in b: yield item The explicit loops in concat() have been replaced with a new yield from statement. Nice. This makes composing generators a little cleaner. But there’s no real magic here. We still have to have yield at every level of our iteration code. In most cases, this is just a bit tedious but not a showstopper. But if you have higher-order functions this can actually prevent code reuse. If you have some function that takes a callback, it doesn’t know if that callback wants to yield or not, so it doesn’t know if it needs to yield. You may end up having to implement that function twice, once for each style. So yield from is only a tiny improvement. Can we do better? Ruby: Enumerables, Enumerators, and Fibers If you ever find yourself in a game of “which language has a better feature than X”, Ruby is usually a safe play. Matz has culled an impressive array of features from Smalltalk and Lisp. (And let’s not forget Perl, the ugly duckling paddling around Ruby’s Pond of Inspiration.) In Ruby, iteration is usually internal. The idiomatic way to go through a collection is by passing a block (more or less a callback, if you’re not familiar with Ruby/Smalltalk parlance) to the each method on a collection. But it also supports external iterators and a for expression. Impressively, it can convert the former to the latter. (Going the other way is trivial in any language.) Let’s dig up an example from the previous post. Here’s some Ruby code for defining a tree and iterating over the nodes of the tree in order: class Tree attr_accessor :left, :label, :right def initialize(left, label, right) @left = left @label = label @right = right end def each(&code) @left.each &code if @left code.call(self) @right.each &code if @right end end We can use it like: tree.each { |node| puts node.label } This is using internal iteration. We pass in that { |node| ... } block and the Tree class itself recursively walks the nodes and invokes the callback on each node. Now let’s say we want this to be an external iterator. Maybe we want to walk two trees in parallel to see if they have the same labels. We can do this something like: class Tree # Mixin all of the enumerable methods to our class. include Enumerable end a = some tree... b = another tree... if a.zip(b).each.all? { |pair| pair[0] == pair[1] } puts "Equal!" end The zip method takes an enumerable on the left and another on the right and “zips” them together one pair at a time. The result is an array of pairs of elements. If you zip [1, 2, 3] and ['a', 'b', 'c'] together, you get [[1, 'a'], [2, 'b'], [3, 'c']]. Neat. Then all? walks an array, testing each element using the given block. If the block returns true for every element, all? returns true too. Swell. But there’s a subtle problem here. The zip method converts its arguments to arrays before doing anything. So we’ve got our nice each method on Tree that generates values incrementally without wasting memory, but then we throw it at zip and it goes ahead and allocates big arrays to store all of these intermediate values. If the two trees we’re comparing are huge, that’s a lot of wasted memory. What we’d like is a way to walk those two trees iteratively without creating any intermediate arrays. The each method on Tree does that, but it’s an internal iterator. External iterators are perfect for this task. Can we convert it? In Ruby, that’s as easy as: a = some tree... b = another tree... a_enum = a.to_enum b_enum = b.to_enum That little to_enum method takes an object that implements each and returns an external iterator. We can use these iterators like so: loop do if a_enum.next != b_enum.next puts "Not equal!" end end The protocol here is that next returns the next item in the sequence. If there are no more items, it raises a StopIteration error (which loop conveniently handles). Double-plus good! We’ve got nice support for both internal and external iterators, and we can easily convert back and forth between them. It’s like having cake and pie for dessert. The one remaining question is how does this work? Look at what we have here: The internal iterator (the eachmethod on Tree) recursively calls itself and builds a deep callstack. At any point during that, it can emit values. The to_enummethod takes that and returns an enumerable object. When you call nextit runs that recursive code then somehow suspends it whenever a value is generated. The next time you call nextit picks up exactly where it left off. Somehow that entire callstack gets frozen and then thawed between each call to There must be some kind of data structure that represents an entire callstack. It doesn’t reify a stack frame like generators, it reifies the whole stack. A fiber by any other name This mystery data structure is what Ruby calls a fiber. Its sort of like a thread in that it represents an in-progress computation. It has a callstack, local variables, etc. Unlike a “real” thread, though, it doesn’t involve the OS, kernel scheduling and all of that other heavyweight stuff. It’s also cooperatively scheduled instead of pre-emptively. That’s a fancy way of saying fibers have to play nice with other. If you want a fiber to run, you have to give it control. It can’t take it from you. These constructs have been given as many names as languages that support them. Lua calls them “coroutines” (which is, I think, the oldest name for the idea). Stackless Python calls them “tasklets”. Go’s “goroutines” are similar, though with some interesting differences. This is the special sauce we need for to_enum. When you call it, it spins up a new fiber. Then it runs the internal iterator on that new fiber. When you call next on the enumerator, it runs that fiber until it generates a value. When it does, it suspends the fiber, returns the value, and runs the main fiber. When we need the next value, it just suspends the main fiber and resumes the spawned one again. In other words, a simplified implementation of to_enum looks a bit like: class Object def to_enum MyEnumerator.new self end end And the MyEnumerator class (which is simplified from this excellent StackOverflow answer) is: class MyEnumerator include Enumerable def initialize(obj) @fiber = Fiber.new do # Spin up a new fiber. obj.each do |value| # Run the internal iterator on it. Fiber.yield(value) # When it yields a value, suspend # the fiber and emit the value. end raise StopIteration # Then signal that we're done. end end def next @fiber.resume # When the next value is requested, # resume the fiber. end end Iteration or concurrency? I started this two-parter with a question about how you can make iteration beautiful and easy to work with. This leads us to wanting both internal and external iteration, and the ability to go from one to the other. The piece needed to really make that work is an easy way to create a new callstack. And fibers are a great answer for that. But what I find interesting is where we arrived at. We started talking about iteration, one of the most shallow of flow control structures. But look where we ended up. Fibers are a concurrency mechanism. Concurrency is way over in the deep end of language features. I don’t think this is a coincidence. If you look at iteration, it actually is about concurrency. You’ve got two “threads” of behavior: one that’s generating values and one that’s consuming them. You need to run these two threads together and coordinate them. That is concurrency. We’re just so used to it, that we don’t think of it that way. Wait, what about Magpie? I screwed myself over here. The secret agenda of this pair of posts was to trick you into reading about my language by promising to teach you something about other languages you may actually use in real life. If we’re both lucky you did learn something, but I haven’t gotten to my language yet. Alas, I’m already 5,000 words in and I’ve surely exhausted your patience. I guess Magpie will have to wait for a later post. Trust me, though. It’s awesome. Promise.
https://journal.stuffwithstuff.com/2013/02/24/iteration-inside-and-out-part-2/
CC-MAIN-2020-24
refinedweb
2,765
66.44
I frequently receive PDF files where the first page is either empty or is just a cover page for which I have no use. Can you suggest a quick and efficient way (Applescript, Service, or ???) for me to delete just that first page and save the file? If this can be automated via Preview or Adobe Acrobat Professional, that would be most ideal. Any ideas? Backspace You can do this using an Automator workflow. It's a bit more complex than most, so be careful when implementing it. This post contains two versions: One is shorter and stores the output as Processed PDF File.pdf on the desktop, the other longer and stores the file as (Edited)InputFileName.pdf in the same directory. The steps required for the longer version only are marked (optional). Processed PDF File.pdf (Edited) InputFileName.pdf Open Automator and select to create a new Service that receives PDF files as input in Any application. FilePath (optional) Add a Run AppleScript action and use the following script code to get the folder name the file is located in: on run {input, parameters} tell application "Finder" to return (container of first item of input) as alias end run (optional) Add a Set Value of Variable action and name the variable Folder. Folder (optional) Add a Run Shell Script action and pass input as arguments. Use the following script to extract the basename of the file: echo "$( basename "$1" )" (optional) Add a Set Value of Variable action and name the variable FileName. FileName (optional) Add a Get Value of Variable action and name the variable FilePath. Ignore this action's input in its Options. Add a PDF to Images action, saving output to Desktop or any folder that can hold temporary files. Name them however you want. TempFiles Add a Run AppleScript action, and use the following script code to filter the list of temporary files (this is where we remove the first page): on run {input, parameters} return rest of input end run Add a Combine PDF pages action to put the pieces together again, by appending pages. zOpY3O.pdf Processed PDF File Here's a screenshot of the finished longer version of the workflow: Someone at another forum developed some command-line PDF tools, incuding one that deletes pages. Looked ot be relatively easy. The only possible hiccup might be how it works with your workflow. From your description, it looks you'd something that works while the PDF is open and these tools seem to work (better) with a closed file. Using the aforementioned command-line PDF tools, I was able to compile a workflow that does the following: First I installed the PDF tools as instructed. The key tool in this case is pdfsplit. In Automator, I created a new service to receive selected PDF files in the Finder. I added the "Run Shell Script" action, with the shell as "/bin/bash" and "pass input" set to "as arguments." I then wrote the following simple script: for f in "$@" do /usr/local/bin/pdfsplit "$f" 2- > "$f".tmp done I added a "Move Finder Items to Trash" action for the original file and a "Replace Text" action to remove the .tmp extension from the new file. To run the process with a folder input, the script would be something like: cd "$@" for f in *pdf do /usr/local/bin/pdfsplit "$f" 2- > "$f".tmp done I suppose I could have done everything in the shell script, including the remove and rename. But the rm command can be dangerous, and I prefer moving the original file to the trash instead. The script can be modified to do more than simply remove x number of pages. I've developed a similar program to batch crop and combine PDFs, for example. Check out the manual on pdfsplit and its accompanying tools for more info. Just to add to the answer provided by Joseph Yannielli, for those who decide to run the shell script it may be easier to include commands to delete and rename the file in the script instead of adding separate actions via Automator: for f in "$@" do /usr/local/bin/pdfsplit "$f" 2- > "$f".tmp rm "$f" mv "$f".tmp "$f" done On the matter of installing command line PDF tools, it can be conveniently done with use of the Homebrew: brew install pdf-tools By posting your answer, you agree to the privacy policy and terms of service. asked 3 years ago viewed 1447 times active 1 month ago
http://superuser.com/questions/385042/how-do-i-set-up-a-osx-service-to-delete-the-first-page-of-a-pdf?answertab=oldest
CC-MAIN-2015-40
refinedweb
756
70.84
. String is a global object that may be used to construct String instances. String objects may = new String(s_prim = s_also_prim = "foo"); s_obj.length; // 3 s_prim.length; // 3 s_also_prim.length; // 3 'foo'.length; // 3 "foo".length; // 3 (A string literal is denoted with single or double quotation marks.) String objects can be converted to primitive strings with the valueOf method." The second way (treating the string as an array) is not part of ECMAScript 3. It is a JavaScript and ECMAScript 5 feature. In both cases, attempting to set an individual character won't work. Trying to set a character through charAt results in an error, while trying to set a character via indexing does not throw an error, but the string itself is unchanged.. Reflects the length of the string. This property returns the number of code units in the string. UTF-16, the string format used by JavaScript, uses a single 16-bit code unit to represent the most common characters, but needs to use two code units for less commonly-used characters, so it's possible for the value returned by length to not match the actual number of characters in the string. For an empty string, length is 0. var x = "Netscape"; var empty = ""; console.log("Netspace is " + x.length + " code units long"); console.log("The empty string is has a length of " + empty.length); // should be 0 Returns the character at the specified index. Characters in a string are indexed from left to right. The index of the first character is 0, and the index of the last character in a string called stringName is stringName.length - 1. If the index you supply is out of range, JavaScript returns an empty string. The following example displays characters at different locations in the string "Brave new world": var anyString="Brave new world"; document.writeln("The character at index 0 is '" + anyString.charAt(0) + "'"); document.writeln("The character at index 1 is '" + anyString.charAt(1) + "'"); document.writeln("The character at index 2 is '" + anyString.charAt(2) + "'"); document.writeln("The character at index 3 is '" + anyString.charAt(3) + "'"); document.writeln("The character at index 4 is '" + anyString.charAt(4) + "'"); document.writeln("The character at index 999 is '" + anyString.charAt(999) + "'"); These lines display the following: The character at index 0 is 'B' The character at index 1 is 'r' The character at index 2 is 'a' The character at index 3 is 'v' The character at index 4 is 'e' The character at index 999 is '' The following provides a means of ensuring that going through a string loop always provides a whole character, even if the string contains characters that are not in the Basic Multi-lingual Plane. var str = 'A\uD87E\uDC04Z'; // We could also use a non-BMP character directly for (var i=0, chr; i < str.length; i++) { if ((chr = getWholeChar(str, i)) === false) {continue;} // Adapt this line at the top of each loop, passing in the whole string and the current iteration and returning a variable to represent the individual character alert(chr); } function getWholeChar (str, i) { var code = str.charCodeAt(i); if (isNaN(code)) { return ''; // Position not found } if (code < 0xD800 || code > 0xDFFF) { return str.charAt(i); } if (0xD800 <= code && code <= 0xDBFF) { // High surrogate (could change last hex to 0xDB7F to treat high private surrogates as single characters) if (str.length <= (i+1)) { throw 'High surrogate without following low surrogate'; } var next = str.charCodeAt(i+1); if (0xDC00 > next || next > 0xDFFF) { throw 'High surrogate without following low surrogate'; } return str.charAt(i)+str.charAt(i+1); } // Low surrogate (0xDC00 <= code && code <= 0xDFFF) if (i === 0) { throw 'Low surrogate without preceding high surrogate'; } var } While the second example may be more frequently useful for those wishing to support non-BMP characters (since the above does not require the caller to know where any non-BMP character might appear), in the event that one does wish, in choosing a character by index, to treat the surrogate pairs within a string as the single characters they represent, one can use the following: function fixedCharAt (str, idx) { var ret = ''; str += ''; var ''; } ret += str.charAt(idx); if (/[\uD800-\uDBFF]/.test(ret) && /[\uDC00-\uDFFF]/.test(str.charAt(idx+1))) { ret += str.charAt(idx+1); // Go one further, since one of the "characters" is part of a surrogate pair } return ret; } index : Number An integer between 0 and 1 less than the length of the string. Individual character from string. Returns a number indicating the Unicode value of the character at the given index. Unicode code points range from 0 to 1,114,111. The first 128 Unicode code points are a direct match of the ASCII character encoding. Note that charCodeAt will always return a value that is less than 65,536. This is because the higher code points are represented by a pair of (lower valued) "surrogate" pseudo-characters which are used to comprise the real character. Because of this, in order to examine or reproduce the full character for individual characters of value 65,536 and above, for such characters, it is necessary to retrieve not only charCodeAt(i), but also charCodeAt(i+1) (as if examining/reproducing a string with two letters). See example 2 and 3 below. charCodeAt returns NaN if the given index is not greater than 0 or is greater than the length of the string. Backward Compatibility with JavaScript 1.2 The charCodeAt method returns a number indicating the ISO-Latin-1 codeset value of the character at the given index. The ISO-Latin-1 codeset ranges from 0 to 255. The first 0 to 127 are a direct match of the ASCII character set. Example 1: Using charCodeAt The following example returns 65, the Unicode value for A. "ABC".charCodeAt(0) // returns 65 Example 2: Fixing charCodeAt to handle non-Basic-Multilingual-Plane characters if their presence earlier in the string is unknown This version might be used in for loops and the like when it is unknown whether non-BMP characters exist before the specified index position. function fixedCharCodeAt (str, idx) { // ex. fixedCharCodeAt ('\uD800\uDC00', 0); // 65536 // ex. fixedCharCodeAt ('\uD800\uDC00', 1); // 65536 idx = idx || 0; var code = str.charCodeAt(idx); var hi, low; if (0xD800 <= code && code <= 0xDBFF) { // High surrogate (could change last hex to 0xDB7F to treat high private surrogates as single characters) hi = code; low = str.charCodeAt(idx+1); if (isNaN(low)) { throw 'High surrogate not followed by low surrogate in fixedCharCodeAt()'; } return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000; } if (0xDC00 <= code && code <= 0xDFFF) { // Low surrogate // We return false to allow loops to skip this iteration since should have already handled high surrogate above in the previous iteration return false; } return code; } Example 3: Fixing charCodeAt to handle non-Basic-Multilingual-Plane characters if their presence earlier in the string is known function knownCharCodeAt (str, idx) { str += ''; var code, NaN; } code = str.charCodeAt(idx); var hi, low; if (0xD800 <= code && code <= 0xDBFF) { hi = code; low = str.charCodeAt(idx+1); // Go one further, since one of the "characters" is part of a surrogate pair return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000; } return code; } index : Number An integer greater than 0 and less than the length of the string; if it is not a number, it defaults to 0. Value between 0 and 65535. Combines combines the text from one or more strings and returns a new string. Changes to the text in one string do not affect the other string. The following example combines strings into a new string. var hello = "Hello, "; console.log(hello.concat("Kevin", " have a nice day.")); // Hello, Kevin have a nice day. strings : String... The strings to concatenate. Result of both strings. Creates new String object. value : Object The value to wrap into String object. Returns a string created by using the specified sequence of Unicode values. This method returns a string and not a String object. Because fromCharCode is a static method of String, you always use it as String.fromCharCode(), rather than as a method of a String object you created. Although most common Unicode values can be represented in a fixed width system/with one, fromCharCode() alone is inadequate. Since the higher code point characters use two (lower value) "surrogate" numbers to form a single character, fromCharCode() can be used to return such a pair and thus adequately represent these higher valued characters. Be aware, therefore, that the following utility function to grab the accurate character even for higher value code points, may be returning a value which is rendered as a single character, but which has a string count of two (though usually the count will be one). // String.fromCharCode() alone cannot get the character at such a high code point // The following, on the other hand, can return a 4-byte character as well as the // usual 2-byte ones (i.e., it can return a single character which actually has // a string length of 2 instead of 1!) alert(fixedFromCharCode(0x2F804)); // or 194564 in decimal function fixedFromCharCode (codePt) { if (codePt > 0xFFFF) { codePt -= 0x10000; return String.fromCharCode(0xD800 + (codePt >> 10), 0xDC00 + (codePt & 0x3FF)); } else { return String.fromCharCode(codePt); } } The following example returns the string "ABC". String.fromCharCode(65,66,67) numbers : Number... A sequence of numbers that are Unicode values. String containing characters from encoding. Returns the index within the calling String object of the first occurrence of the specified value, or -1 if not found. Characters in a string are indexed from left to right. The index of the first character is 0, and the index of the last character of a string called stringName is stringName.length - 1. "Blue Whale".indexOf("Blue") // returns 0 "Blue Whale".indexOf("Blute") // returns -1 "Blue Whale".indexOf("Whale",0) // returns 5 "Blue Whale".indexOf("Whale",5) // returns 5 "Blue Whale".indexOf("",9) // returns 9 "Blue Whale".indexOf("",10) // returns 10 "Blue Whale".indexOf("",11) // returns 10 The indexOf method is case sensitive. For example, the following expression returns -1: "Blue Whale".indexOf("blue") Note that '0' doesn't evaluate to true and '-1' doesn't evaluate to false. Therefore, when checking if a specific string exists within another string the correct way to check would be: "Blue Whale".indexOf("Blue") != -1 // true "Blue Whale".indexOf("Bloe") != -1 // false The following example uses indexOf and lastIndexOf to locate values in the string "Brave new world". var anyString="Brave new world" document.write("<P>The index of the first w from the beginning is " + anyString.indexOf("w")) // Displays 8 document.write("<P>The index of the first w from the end is " + anyString.lastIndexOf("w")) // Displays 10 document.write("<P>The index of 'new' from the beginning is " + anyString.indexOf("new")) // Displays 6 document.write("<P>The index of 'new' from the end is " + anyString.lastIndexOf("new")) // Displays 6 The following example defines two string variables. The variables contain the same string except that the second string contains uppercase letters. The first writeln method displays 19. But because the indexOf method is case sensitive, the string "cheddar" is not found in myCapString, so the second writeln method displays -1. myString="brie, pepper jack, cheddar" myCapString="Brie, Pepper Jack, Cheddar" document.writeln('myString.indexOf("cheddar") is ' + myString.indexOf("cheddar")) document.writeln('<P>myCapString.indexOf("cheddar") is ' + myCapString.indexOf("cheddar")) The following example sets count to the number of occurrences of the letter x in the string str: count = 0; pos = str.indexOf("x"); while ( pos != -1 ) { count++; pos = str.indexOf("x",pos+1); } searchValue : String A string representing the value to search for. fromIndex : Number The location within the calling string to start the search from. It can be any integer between 0 and the length of the string. The default value is 0. Position of specified value or -1 if not found. Returns the index within the calling String object of the last occurrence of the specified value, or -1 if not found. The calling string is searched backward, starting at fromIndex. Characters in a string are indexed from left to right. The index of the first character is 0, and the index of the last character is stringName.length - 1. "canal".lastIndexOf("a") // returns 3 "canal".lastIndexOf("a",2) // returns 1 "canal".lastIndexOf("a",0) // returns -1 "canal".lastIndexOf("x") // returns -1 The lastIndexOf method is case sensitive. For example, the following expression returns -1: "Blue Whale, Killer Whale".lastIndexOf("blue") The following example uses indexOf and lastIndexOf to locate values in the string " Brave new world". var anyString="Brave new world" // Displays 8 document.write("<P>The index of the first w from the beginning is " + anyString.indexOf("w")) // Displays 10 document.write("<P>The index of the first w from the end is " + anyString.lastIndexOf("w")) // Displays 6 document.write("<P>The index of 'new' from the beginning is " + anyString.indexOf("new")) // Displays 6 document.write("<P>The index of 'new' from the end is " + anyString.lastIndexOf("new")) searchValue : String A string representing the value to search for. fromIndex : Number The location within the calling string to start the search from, indexed from left to right. It can be any integer between 0 and the length of the string. The default value is the length of the string. Returns a number indicating whether a reference string comes before or after or is the same as the given string in sort order. Returns a number indicating whether a reference string comes before or after or is the same as the given string in sort order. Returns -1 if the string occurs earlier in a sort than compareString, returns 1 if the string occurs afterwards in such a sort, and returns 0 if they occur at the same level. The following example demonstrates the different potential results for a string occurring before, after, or at the same level as another: alert('a'.localeCompare('b')); // -1 alert('b'.localeCompare('a')); // 1 alert('b'.localeCompare('b')); // 0 compareString : String The string against which the referring string is comparing. Returns -1 if the string occurs earlier in a sort than compareString, returns 1 if the string occurs afterwards in such a sort, and returns 0 if they occur at the same level. Used to match a regular expression against a string. If the regular expression does not include the g flag, returns the same result as regexp.exec(string). If the regular expression includes the g flag, the method returns an Array containing all matches. If there were no matches, the method returns null. The returned Array has an extra input property, which contains the regexp that generated it as a result. In addition, it has an index property, which represents the zero-based index of the match in the string. In the following example, match is used to find "Chapter" followed by 1 or more numeric characters followed by a decimal point and numeric character 0 or more times. The regular expression includes the i flag so that case will be ignored. str = "For more information, see Chapter 3.4.5.1"; re = /(chapter \d+(\.\d)*)/i; found = str.match(re); document.write(found); This returns the array containing Chapter 3.4.5.1,Chapter 3.4.5.1,.1 " Chapter 3.4.5.1" is the first match and the first value remembered from (Chapter \d+(\.\d)*). " .1" is the second value remembered from (\.\d).); document.write(matches_array); matches_array now equals ['A', 'B', 'C', 'D', 'E', 'a', 'b', 'c', 'd', 'e']. regexp : RegExp Contains results of the match (if any). Used to find a match between a regular expression and a string, and to replace the matched substring with a new substring. This method does not change the String object it is called on. It simply returns a new string. To perform a global search and replace, either include the g flag in the regular expression or if the first parameter is a string, include g in the flags parameter. The replacement string can include the following special replacement patterns: " XXzzzz - XX , zzzz": function replacer(str, p1, p2, offset, s) { return str + " - " + p1 + " , " + p2; } var newString = "XXzzzz".replace(/(X*)(z*)/, replacer); In the following example, the regular expression includes the global and ignore case flags which permits replace to replace each occurrence of 'apples' in the string with 'oranges'. var re = /apples/gi; var str = "Apples are round, and apples are juicy."; var newstr = str.replace(re, "oranges"); print(newstr); In this version, a string is used as the first parameter and the global and ignore case flags are specified in the flags parameter. var str = "Apples are round, and apples are juicy."; var newstr = str.replace("apples", "oranges", "gi"); print(newstr); Both of these examples print "oranges are round, and oranges are juicy." In the following example, the regular expression is defined in replace and includes the ignore case flag. var str = "Twas the night before Xmas..."; var newstr = str.replace(/xmas/i, "Christmas"); print(newstr); This prints "Twas the night before Christmas..." The following script switches the words in the string. For the replacement text, the script uses the $1 and $2 replacement patterns. var re = /(\w+)\s(\w+)/; var str = "John Smith"; var newstr = str.replace(re, "$2, $1"); print(newstr); This prints "Smith, John".]/, '-' + '$&'.toLowerCase()); // won't work This is because '$&'.toLowerCase() would be evaluated first as a string literal (resulting in the same '$&') before using the characters as a pattern.); } pattern : String/RegExp Either a string or regular expression pattern to search for. replacement : String/Function Either string or function: patternwith. Number of special replacement patterns are supported; see the "Specifying a string as a parameter" section above. String of matched replaced items. Executes the search for a match between a regular expression and a specified string. If successful, search returns the index of the regular expression inside the string. Otherwise, it returns -1. When you want to know whether a pattern is found in a string use search (similar to the regular expression test method); for more information (but slower execution) use match (similar to the regular expression exec method). The following example prints a message which depends on the success of the test. function testinput(re, str){ if (str.search(re) != -1) midstring = " contains "; else midstring = " does not contain "; document.write (str + midstring + re); } regexp : RegExp A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj). If successful, search returns the index of the regular expression inside the string. Otherwise, it returns -1. Extracts a section of a string and returns a new string. slice extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. slice extracts up to but not including endSlice. string.slice(1,4) extracts the second character through the fourth character (characters indexed 1, 2, and 3). As a negative index, endSlice indicates an offset from the end of the string. string.slice(2,-1) extracts the third character through the second to last character in the string. The following example uses slice to create a new string. // assumes a print function is defined var str1 = "The morning is upon us."; var str2 = str1.slice(4, -2); print(str2); This writes: morning is upon u beginSlice : Number The zero-based index at which to begin extraction. endSlice : Number All characters from specified start up to (but excluding) end. Splits a String object into an array of strings by separating the string into substrings.. However, not all browsers support this capability. Note: When the string is empty, split returns an array containing one empty string, rather than an empty array. In the following example, split looks for 0 or more spaces in a string and returns the first 3 splits that it finds. var myString = "Hello World. How are you doing?"; var splits = myString.split(" ", 3); print(splits); This script displays the following: Hello,World.,How If separator contains capturing parentheses, matched results are returned in the array. var myString = "Hello 1 word. Sentence number 2."; var splits = myString.split(/(\d)/); print(splits); This script displays the following: Hello ,1, word. Sentence number ,2, . seperator : String Specifies the character to use for separating the string. The separator is treated as a string or a regular expression. If separator is omitted, the array returned contains one element consisting of the entire string. limit : Number Integer specifying a limit on the number of splits to be found. The split method still splits on every match of separator, but it truncates the returned array to at most limit elements. Substrings are returned in an array. Returns the characters in a string beginning at the specified location through the specified number of characters.. Consider the following script: // assumes a print function is defined var str = "abcdefghij"; print("(1,2): " + str.substr(1,2)); print("(-3,2): " + str.substr(-3,2)); print("(-3): " + str.substr(-3)); print("(1): " + str.substr(1)); print("(-20, 2): " + str.substr(-20,2)); print("(20, 2): " + str.substr(20,2)); This script displays: (1,2): bc (-3,2): hi (-3): hij (1): bcdefghij (-20, 2): ab (20, 2): start : Number Location at which to begin extracting characters. length : Number The number of characters to extract. Modified string. Returns the characters in a string between two indexes into the string. substring extracts characters from indexA up to but not including indexB. In particular: indexAequals indexB, substringreturns an empty string. indexBis omitted, substring extracts characters to the end of the string. NaN, it is treated as if it were 0. stringName.length, it is treated as if it were stringName.length. If indexA is larger than indexB, then the effect of substring is as if the two arguments were swapped; for example, str.substring(1, 0) == str.substring(0, 1). The following example uses substring to display characters from the string "Sencha": // assumes a print function is defined var anyString = "Sencha"; // Displays "Sen" print(anyString.substring(0,3)); print(anyString.substring(3,0)); // Displays "cha" print(anyString.substring(3,6)); print(anyString.substring(6,3)); // Displays "Sencha" print(anyString.substring(0,6)); print(anyString.substring(0,10));"); indexA : Number An integer between 0 and one less than the length of the string. indexB : Number (optional) An integer between 0 and the length of the string. Returns the characters in a string between two indexes into the string. The characters within a string are converted to lower case while respecting the current locale. For most languages, this will return the same as toLowerCase. The toLocaleLowerCase method returns the value of the string converted to lower case according to any locale-specific case mappings. toLocaleLowerCase does not affect the value of the string itself. In most cases, this will produce the same result as toLowerCase(), but for some locales, such as Turkish, whose case mappings do not follow the default case mappings in Unicode, there may be a different result. The following example displays the string "sencha": var upperText="SENCHA"; document.write(upperText.toLocaleLowerCase()); Returns value of the string in lowercase. The characters within a string are converted to upper case while respecting the current locale. For most languages, this will return the same as toUpperCase. The toLocaleUpperCase method returns the value of the string converted to upper case according to any locale-specific case mappings. toLocaleUpperCase does not affect the value of the string itself. In most cases, this will produce the same result as toUpperCase(), but for some locales, such as Turkish, whose case mappings do not follow the default case mappings in Unicode, there may be a different result. The following example displays the string "SENCHA": var lowerText="sencha"; document.write(lowerText.toLocaleUpperCase()); Returns value of the string in uppercase. Returns the calling string value converted to lower case. The toLowerCase method returns the value of the string converted to lowercase. toLowerCase does not affect the value of the string itself. The following example displays the lowercase string "sencha": var upperText="SENCHA"; document.write(upperText.toLowerCase()); Returns value of the string in lowercase. Returns a string representing the specified object. Overrides the Object.toString method. The String object overrides the toString method of the Object object; it does not inherit Object.toString. For String objects, the toString method returns a string representation of the object. The following example displays the string value of a String object: x = new String("Hello world"); alert(x.toString()) // Displays "Hello world" A string representation of the object. Returns the calling string value converted to uppercase. The toUpperCase method returns the value of the string converted to uppercase. toUpperCase does not affect the value of the string itself. The following example displays the string "SENCHA": var lowerText="sencha"; document.write(lowerText.toUpperCase()); Returns value of the string in uppercase. Removes whitespace from both ends of the string. Does not affect the value of the string itself. The following example displays the lowercase string "foo": var orig = " foo "; alert(orig.trim()); NOTE: This method is part of the ECMAScript 5 standard. A string stripped of whitespace on both ends. Returns the primitive value of the specified object. Overrides the Object.valueOf method. The valueOf method of String returns the primitive value of a String object as a string data type. This value is equivalent to String.toString. This method is usually called internally by JavaScript and not explicitly in code. x = new String("Hello world"); alert(x.valueOf()) // Displays "Hello world" Returns value of string.
https://docs.sencha.com/extjs/6.5.0/classic/String.html
CC-MAIN-2018-30
refinedweb
4,244
58.89
jQuery Custom Selectors - Holy Cow That Is So Badass! One. - <html> - <head> - <title>jQuery Custom Selector Test</title> - <script type="text/javascript" src="jquery-latest.pack.js"></script> - <script type="text/javascript"> - // Extend the jQuery object to include the - // custom selector "hottie" for the ":" expression. - jQuery.extend( - jQuery.expr[ ":" ], - { - hottie : ( - "jQuery( a ).attr( 'rel' ) == 'girl' && " + - "jQuery( a ).attr( 'hotness' ) >= 9" - ) - } - ); - // This will highlight the girls who are hotties. - function FindHotties(){ - $( "ol a:hottie" ).css( "font-weight", "bold" ); - } - </script> - </head> - <body> - <ol> - <li><a rel="girl" hotness="9.0">Sarah</a></li> - <li><a rel="girl" hotness="8.0">Libby</a></li> - <li><a rel="girl" hotness="9.0">Azure</a></li> - <li><a rel="girl" hotness="8.5">Cindy</a></li> - </ol> - <p> - <a href="javascript:void(0);" - onclick="FindHotties();" - >Find Hotties</a> - </p> - </body> - </html> Running this page, the initial output is: - Sarah - Libby - Azure - Cindy But, once I click on the "Find Hotties" link, the output gets changed to: - Sarah - Libby - Azure - Cindy Sweet man! You're really digging jQuery from what I see! :) Hey Ben, cool for showing how easy it is to make a custom selector, but shouldn't you use a namespace to add custom/arbitrary attributes to existing tags? Otherwise your code wont validate as xhtml. And how do you declare namespaces Jordan? --Otherwise your code wont validate as xhtml. But who cares what a validator somewhere thinks? It affects nothing. Stylo, While I would agree with you in theory, in practice, a surprising number of clients will require that their site validates as XHTML. But other than client needs, agreed, it affects nothing. This is cool, Thanks. Awesome example but your choice of example data is mildly annoying. @C.R, I am not I know what you mean? Can you explain further? Pretty nice indeed. more women in software, you need to look no further than posts like this. the header images, not a single one in which Ben does not smile. Concentrate on the content which is top quality. Cheers! I've started using my "friends" in examples rather than girls. @Ben, I don't think there's anything wrong with you using hot girls for your examples, or for rating girls as hot. As for there not being women in software, I doubt very seriously a post would have any effect on that whatsoever, or that it has anything to do with the lack of women in the field. The type of girl who is going to be interested in software development isn't likely to be "so offended" by someone's choice of data that they are going to be scared out of the field like that. We female developers do have slightly tougher skin than that. :-P I think, if anything, that if there is a shortage of girls in the field, it simply has to do with the fact that most women are very right-brained, leading them into career fields like graphic design, web design, and more art-centered fields, whereas men tend to be more left-brained, leading them into fields such as mathematics or software development. I do admire your attempt at not offending anybody, and am glad you are trying to keep the peace, but please don't let anyone make you think that you or your posts are to blame for a shortage of women in the field. The very few women who may be offended by ONE post like this ENOUGH to leave the field must not be very interested in the field at all to begin with. And this particular post isn't even all that offensive...it's not like it is outright porn or that you are describing area's of a woman's body in a lewd manner...it's just a fun post! And SOME WOMEN LIKE TO FEEL HOT. Some women don't mind a man actually calling them hot. What woman has a problem with that??? I hate how men in the computer field seem to hate hot girls. What is wrong with hot girls? Why are men in the computer field hating on hot girls? What is wrong with men in this field? front of their custom attributes. So instead of hotness="9.0" you would get data-hotness="9.0" It is nearly the same, but data- is added in front of it, which is (officialy) supported in html5. I'd prefer 100% custom attributes, but unfortunately those are not valid. A bespoke application growth organization uses applications that could form up your specifications. Thus, it meets your particular business needs.
http://www.bennadel.com/blog/547-jquery-custom-selectors-holy-cow-that-is-so-badass.htm?_rewrite
CC-MAIN-2015-35
refinedweb
768
75.4
Buying a Small, Light Linux Notebook Computer? 1048 "I have no Windows software and will not be running any, not even via WINE. I have no desire to go through the hassle of purchasing software I'm not going to use and then fighting to get a token rebate that doesn't actually equate to the cost of a Windows license. Nor am I interested in buying a machine that was purchased with a Windows license, and simply having Windows erased with no refund given. So far I've found iDot Computers, who will sell laptops with no OS installed. Unfortunately, their lightest, smallest offering is a hefty 2.8kg brick, 3cm bigger than the iBook in width and depth. What I really want is something comparable to a Toshiba Libretto or Sony VAIO R505--except that neither of those companies want to sell me a machine without Windows. I'm sure plenty of Slashdot readers have faced the same problem--what's the solution?" performance (Score:5, Funny) a Jedi craves not these things, only affordability. Metamatic - your answer. (Score:5, Informative) Sounds like you want a used machine. I would suggest looking on ebay and/or the computer refurb houses for a machine that is maybe a year old, go with a high quality manufacturer and it could still be under warranty (I personally like Dell, I have three within arms reach of me, counting laptops and my server.) The only issue I see going with hardware that is a year+ old is the 1394 connection - but if it was top of the line a year ago it should have that connection (my last Latitude C800 did and it was a year and a half old.) Note that you should be able to find a one year old machine for about half of what it cost new, but remember that today's hardware costs less than top of the line gear did a year ago and is much faster. Based on what I remember, you should be able to get whatever was top of the line a year ago for the same price as the entry level stuff new, but the entry level stuff is going to be about 1.5x as fast as the one year old top of the line machine. I am not saying it will give you the best bang for the buck, but it will satisify your entire request. Personally I would buy a new entry level machine from Dell (or your favorite company) for about $750 delivered and then toss the XP CD / license in your closet. Add some aftermarket RAM and networking gear and you are all set - for about $900 including the 802.11b. I just checked, Dell has a laptop (the Inspiron 2650C) on sale for $700 after rebate (yes, rebates suck but I did get mine back 14" screen XGA 128M RAM () 20G hd 24x CD 16MB DDR 4X AGP NVIDIA GeForce2 Go(TM)Vid Floppy Integrated 56k modem and NIC 1 year warranty. If you didn't want to jack with the warranty ($150) you could get the 802.11b PCMCIA card and a 802.11b router (I didn't bother to read the details) instead. Brings the price of the system to $850. Upgrade to a 15" screen for $50. Nice. Re:Metamatic - your answer. (Score:5, Informative) Re:Metamatic - your answer. (Score:4, Interesting) One year old Inspiron 8200 top of the line : 1GHz w/ 20G drive = current ebay price $900. Brand new entry level Inspiron 2650C : 1.6GHz w/ 20G drive = current new price $750. the dumb answer... (Score:5, Interesting) uh, get an ibook? oh wait... seriously, ibook + osx + fink + apple X11 == everything you want in a linux laptop, except for the ugly fonts. If you're dying for more speed get the new 12" G4 Powerbook (~$1700), which is just like the ibook only smaller in every dimension, and faster. why exactly does your current ibook fail your requirements, anyway? Re:the dumb answer... (Score:3, Informative) money back (Score:3, Funny) Re:money back (Score:3, Informative) Google 'windows refund'--it's a work in progress with little result so far. a slashdot orginal (Score:3, Interesting) I'd say local connections helped G get his refund. (Score:3, Interesting) mindset... you know the one: "everybody knows everybody" I'd bet that G's dad's Cisco connections did more to get G the cheque from Toshiba than anything else, even if the dad in question didn't have to lift a finger to make it happen. I don't think that the not-so-well-connected (read: needy, eg, student of Linux) computer buyer would get the same hearing - let alone a similar refund. To test this: How many -other- Australians managed to win similar refunds, at about the same time (ie, even -after- G's [uncashed] refund cheque was photographed & published online)? Not too many... "Plenty of good info"...? Doubtful at best. How good depends on how many, who do similar footwork, will -ever- get -their- refunds, in future. Good means effective, not just -apparently- so. Now, if someone had complained (eg to Oz's ACCC), eg that vendor(s) were requiring them to buy unwanted product/license/software from another source, ie just to get the chance to buy the computer they wanted to purchase... -that- might have got a refund-right for every Linux user. But, no, that wasn't how G did it... He stopped when he could show (without cashing) the photo of his refund check... let the others do their own haggling... Read: Re-Invent the refund [paper-chase] wheel! Result: -Lots- have visited the online photo of the uncashed check but -few- have got a refund of their own. Com'on people, the only way to change this is to work a bit smarter... & together... ie, if you want to win, not just cheer-lead... Re:money back (Score:3, Informative) Maybe this has changed, but when you buy a new, prebuilt PC, do you have to click an EULA anyway? Your "acceptance" of the EULA comes not as a product of clicking a button marked 'I Agree', but as a mere result of your using the OEM product. Thus, most refund sites stress that in order to get a refund, you must not boot into the preinstalled copy of Windows, not even a single time. They will tell you in no uncertain terms not to turn the PC on until you have boot disks for Linux/*BSD/whatever inserted into it. Re:money back (Score:4, Informative) Re:money back (Score:5, Informative) Technically the oem pays for Windows. This is why its hard to return it. Yes, I relize that most OEM's just pass the cost to the consumer but its not that much since OEM's buy in bulk. Dell, HP, and Toshiba also get massive bulk discounts in laptop parts which makes up for the price. Dell's are cheap because of this. Go to their website and look at entry level pc's for just $700. Its cheaper to buy a Windows based laptop from Dell and reformat the drive and install Linux then to buy from some small no name company that specialised in Linux but does not get bulk pricing. Just pay the extra $25 dollars. IBM only pays $15 per copy of Windows for each pc from what I read back in the anti trust trial when ms strong armed it to kill os/2. The price has gone up for Windows alot but its no big deal and its nothing compared to the amount Windows cost in a store. I am sure the money saved from buying from a big outlet is probably hundreds of dollars so more money is being saved. Or if you hate ms and refuse to support them go buy a powerbook from apple. They are pricy but have been known for over a decade to be supperior quality. Apple invented alot of the cool stuff in laptops today. The finger pads on laptops for mouse movements is an example of apple's inventions. You can run Linux on a mac as well as have a big selection of software to choose from with MacOSX. Adobe photoshop, IE, MS-Office, games, etc. Another benefit of the mac is that the linux distro's will work better and be less buggy then intel ones because of the limited hardware. They don't need to support 3,000 peripherals from god knows where. They are less buggy and standard configurations are heavily tested by the mac-linux community. This is one of the arguements still used for Unix over Linux. It is heavily integrated with the hardware. Re:money back (Score:5, Insightful) Is there something wrong with someone standing up for principles? I think you should be able to buy hardware without buying software (and iBooks don't accomplish this) , regardless of how little it turns out to be when you work out the math. I'm told that MS makes most of their windows-license money from new PC's, so it certainly is not an insignificant amount ($25 is much less than I have heard from other sources) Re:money back (Score:5, Funny) Personally I prefer nipples Re:money back (Score:4, Funny) </rant> I prefer the touch pads, personally, and Apple does make the best! Far superior to any I've used on a PC laptop (even some really nice ones [defined as whatever Orifice Depot has out for me to screw with when I'm in there, and that I cannot afford]). Re:money back (Score:4, Funny) I feel sorry for your girlfriend. For some of us, it's no effort at all... Re:money back (Score:3, Funny) I'd bet that you wouldn't stand using the eraser-mouse either when it started to burn the skin from your fingertips after a heated gaming session (well, for the only computer I bought with one, more like a heated Solitare session, but that's still a game). Touchpads won't do that to you. Re:money back (Score:5, Funny) That sounds like the kind of thing that started a certain tea party in Boston... Re: Apple *did* have the first touchpad (Score:3, Informative) Half right, half wrong... Apple didn't invent it, they licensed it from George Gerpheide. Apple was the first to market a laptop with a touchpad. If you want a source [azstarnet.com] for this tidbit, click away. Emperor Linux (Score:4, Informative) The benefit? You get laptops with full knowledge of exactly what does and what doesn't work under linux. The catch? You pay the same (or more) as you would in the high street and don't get the shiny Windows CD. Frankly Re:Emperor Linux (Score:3, Interesting) That disc isn't free. The vendor (should have) paid Microsoft for bundling it with the machine. That cost is passed on to the buyer. Also referred to as "the Microsoft tax". Re:Emperor Linux (Score:3, Insightful) Re:Emperor Linux (Score:5, Insightful) Don't you pay anyway? (Score:5, Interesting) And as another poster mentioned, you will probably spend way more money buying such a machine from some no-name vendor (and still pay the Microsoft tax) compared to the cheaper price of a name-brand laptop with Windows pre-installed. One alternative for the poster is to sell a $50 pen with a free copy of Windows included Re:Don't you pay anyway? (Score:5, Informative) Microsoft site licenses usually require companies to pay for machines which don't have Windows on them. Depends on the license that companies have, but not generally true. ----- ----- I can only imagine that Microsoft makes the same requirements on computer vendors when they sell machines without Windows, or with some other OS. So even if you buy a new machine without Windows, you will probably still be lining Microsoft's pockets buying such a machine. Not true anymore. Microsoft USED to force OEMs to pay OS licenses for every PC shipped, regardless of whether every PC actually has Windows installed on it. Microsoft and the U.S. DOJ signed a consent decree in 1994 that halted this 'per processor' license fee (among other practices alleged to be improper). OEMs pay licenses only for machines shipped. Now, between volume rates, advertising allowances, joint marketing & partnering arrangements, licenses for other products, etc, etc,. MS still has incredible licensing flexibiliy, and due to its market control, massive power over those OEMs. But no licenses for every machine shipped. Are you sure? (Score:5, Informative) probably not Windows-free (Score:5, Insightful) Re:probably not Windows-free (Score:5, Informative) Note: I have no problem with Emporer Linux's business model, and wish them success. However, I don't think they'll meet the submitter's requirement to never pay for Windows. Re:probably not Windows-free (Score:4, Insightful) Re:probably not Windows-free (Score:5, Insightful) You just very eloquently explained why calling it "the microsoft tax" is really not far from the truth. If it is really that hard to obtain a product in a particular market without sending 5% of the purchase price to a company in a different market, how can you call that anything but a tax? Re:probably not Windows-free (Score:3, Insightful) With Windows on laptops, I get no choice at all: Windows is it. And if I install Linux, I can't re-sell the OEM version of Windows. Re:Emperor Linux (Score:3, Insightful) Re:Emperor Linux (Score:4, Interesting) Although I agree that you are voting with your money, your assumption, ATMAvatar, isn't exactly correct. You are telling the market, "either I like Windows, or, I like the hardware and care about hardware more than software." The difference between my statement and your statment is the reason that Microsoft spends so much to insure 100% OEM compliance. ). In a "Democratic" society, the citizens should be making the laws. I get scared when the RIAA, BSA, MPAA has so much lobbying power, because by changing the laws, these companies can make our markets innefficient. However, I'm happy with our capitalist society as it is right now. Even though Microsoft commands a vulgar profit margin on each copy of WindowsXP that it sells (a sign of an inefficient market), I understand that software is a commodity and in the long run (10 years? 5 years?), Microsoft is royally screwed with respect to operating system software. The same holds true for office/productivity software. I kind of feel sorry for them, since the best they can come up with is "XBox". Re:Emperor Linux (Score:4, Insightful) ). Nonsense. MicroSoft has been engaged in conduct that violates anti-trust laws, and much of their financial success is based on their predatory conduct, not on the merits of their products. To me (and apparently to the author of this topic article) paying money to MicroSoft is like supporting organized crime. I'm not going to admire organized crime for its financial success and conceed that it "must be doing something right," even if I am trapped into having to deal with them, somehow. When MicroSoft plays fair (or at least plays legal) and makes a big profit, I'll be impressed. As long as they continue their criminal conspiracy to violate antitrust laws, I'm going to continue to feel soiled every time I'm touched in any way by their lousy software. Adrian Buy a Used Laptop - No Microsoft Tax (Score:5, Insightful) eBay is a great place to start looking Re:Emperor Linux (Score:5, Interesting) If that's not a fuck job, I don't know what is. I mean, the evidence here clearly supports that A) when you buy an EmperorLinux laptop, you are clearly still paying the Microsoft tax - they are just wiping Windows XP off of it (or you can still get it dual boot if you want it as such). And B) you are paying a shit price. The worst retail price online I found for the VX-89 was around 1700 dollars. So why not just suck it up and accept that the MS tax is unavoidable for laptops, and buy a decent laptop you like? I understand the idea of voting with your dollars, but it doesn't get through to the shitheads at Sony corporate since they are still shipping a Vaio with Windows license to some schlocky overpriced "Linux" reseller. Or find a source of laptops that truly doesn't include the MS tax (they do exist, but I don't know of any super lightweight ones). 12" Apple PowerBook (Score:5, Insightful) they're smaller (Score:5, Insightful) Re:they're smaller (Score:5, Informative) You better shut up if your only experience with the iBook came from watching a demo. I am using OS X on a 700 MHz iBook for programming C++ and Java, browsing, playing music, editing graphics, etc, and it feels faster than a Sony Vaio with more than twice clock rate. The $999 iBook comes with a proper 3D card (ATI Radeon 7500) and 16 MB dedicated VRAM, while some of much more expensive Vaio models use cheap Intel integrated graphics with only shared VRAM. Personally, I wouldn't touch a Dell with a 10" pole, having known 3 people all had discovered serious problem with their Dell laptops within weeks of purchasing. While there are Wintel laptops lighter than the iBook, none has longer battery life and full features. Another huge advantage of the Apple portables is that they all come free with much more best-of-class software than any of the Windows or Linux machines: iPhotos, iMovies, iTunes, iCal, iSync, iChat, and so on. If you are a programmer and loves play with Unix and open standards, you simply can't get a better deal than Mac OS X. For instance, OS X comes with gcc 3.1 enhanced by Apple to handle Objective C / C++ on top of standard C / C++, and there are dozens of other tools that allow you to write and debug native Carbon, Cocoa, QuickTime, OpenGL, or terminal applications. Many popular open source applications (such as Perl, Ruby, Apatche, X11) are preloaded, and others (like MySql, PostgreSQL) can be downloaded and installed with a few mouse clicks. Project Builder and Interface Builder are free and much more powerful than tools on any other Unix platforms including Linux. In contrast, MS Visual Studio.NET costs up to $3000. Powerbook? (Score:5, Informative) Not a problem because... (Score:3, Informative) When using an external keyboard it's more of a pain - but then you also usually have an external USB mouse with two buttons (which I do). I really don't find it annoying to switch between the two, and in fact more and more I find myself away from the dock and just using the computer wherever I am (since I have wireless almost every I sit around now). buy used. (Score:5, Informative) just be careful when buying used- I made the mistake of buying from a tradeshow [homelinux.net] and it took 2 months before I could get a usable one. I did end up with a gateway solo2150 which is working pretty well. if you're not playing games, a 600 mhz will work fine. I have kde 3.1 and openoffice on debian and it runs with little lag. powernotebooks.com (Score:5, Informative) windows tax not required. was in a slashdot article awhile back. Re:powernotebooks.com (Score:5, Funny) >while(reading_slashdot){++nerdiness;--so IANAC (I am not a compiler) but I am guessing your generic C compiler might get pissy about not having a semi-colon before the ending brace. Re:powernotebooks.com (Score:4, Funny) Re:powernotebooks.com (Score:3, Funny) while (reading_slashdot) nerdiness++, social_life--; Knoppix. (Score:5, Informative) Re:Knoppix. (Score:5, Interesting) Kind of ironic that you're not permitted to 'test' the machine you're about to fork out several thousand dollars for. When I was last searching for a laptop I encountered this brick-wall mentality, consequently I ended up telling them "Oh, in that case, no sale, goodbye" ( Commissions obviously doesn't exist in sales any more ). As for the reasoning behind the no-fiddle mentality, it's because they're afraid that you'll install some sort of hacker software. Fujitsu P2000 Series (Score:3, Interesting) here is a Link [fujitsupc.com] to the fujitsu website for it. i have an older version with a slower 800mhz processor and 4 megs of video ram. it struggles with the latest divx encodes unplugged, but plugged in they display fine. The best feature is its real life 8-10 hour battery life. i could never go back to a 2 hour laptop. apple (Score:5, Funny) Yao and mini-me use 'em, why can't you? HP is not the way (Score:5, Informative) Re:HP is not the way (Score:3, Interesting) Anyway, $0.02. HP is really oriented towards corporate sales and not personal sales, and it is dern near impossible trying to get decent specs from them. But, the machine has worked like a charm so far, and its been through a lot. Back to the original poster. If you want Firewire built in, you gotta buy a MAC or a SONY. If you won't pay for Windows, you will get a MAC. End of story. However, I dislike the SONY laptop keyboards, and the Macs run like crippled pigs (even if they look beautiful and have sweet user interfaces). I am not sure what I would get now. The built-in Firewire is much more limiting than you would think, due to licensing issues. In laptop use I have come to value battery life more and more, as well as a decent keyboard. I'd probably look at Crusoe powered laptops to get good battery life, and then look for one with a good keyboard. Quick links (Score:3, Informative) I have an answer. (Score:4, Informative) why not go with the iBook (Score:4, Informative) maybe you could find some usful info here too Buy used. (Score:5, Informative) Since you've ruled out the iBook, I'd suggest that you look for a laptop that meets your requirements on the used market (eBay, local want ads, computer resellers, outlets that deal in refurbished and formerly leased equipment). Someone else will have already paid the Windows Tax for you, and the money you save will more than compensate for the time you'll have to spend scraping Windows off the hard drive and installing your operating system of choice. k. You could try X-Technology (Score:3, Informative) P4 2.4Ghz/512mb DR/40GB/DVD/CDRW/USB 2.0/FireWire/56K/LAN/15" TFT for ~1200 No OS, no brand name. I have no idea if they are good are not, but they look decent. -Jon We recently had a thread like this in c.o.l.misc (Score:5, Informative) For more information about Linux on laptops, go to the web page about Linux on laptops [linux-on-laptops.com]; help can be found in the Usenet newsgroups comp.os.linux.misc [google.com] or comp.os.linux.hardware [google.com] - Sam Talk about wierd drivers... (Score:5, Informative) hmmm (Score:5, Funny) Re:hmmm (Score:5, Funny) Winner, Most Disturbing Image of the Day. The P2000 does come equipped with firewire. (Score:3, Informative) Here's a direct link [fujitsupc.com]. Also, here is a very good user discussion forum concerning the P2000 laptop, which actually has a seperate forum for the linux users, so you can check up on what you can expect: [leog.net] On a sidenote, I can say that Fijutsu will *not* ship any laptop without the windows license. In fact, when you send in the system for repair and they need to replace the hard drive (which contains the repair image), you have to pay for a new license. Go For The PowerBook (Score:5, Insightful) I recently acquired the last model of the PowerBook series. 15"/G4/1G RAM. I must say I am very impressed with the hardware, the size, the layout, etc. I'm still trying to get used to the Operating System. I do a lot of Java Development, and have gotten my favorite IDE to work (Eclipse), and have gotten JBoss to run semi-succesfully. There are a lot of things to get used to though. The built in mouse has but one button, so you must ctrl->click to do a right click...that is annoying as heck. So, purchase an external mouse whatever you do. being able to drop to the shell and be in a familiar place is very nice. Install Fink and you can apt-get your favorite software. There are a lot of apps out there...more than I thought there was (). All in all...I'd say get a PowerBook and leave OS X on it, and install your favorite Open-source software. If you choose to wipe it clean and install a version of Linux...it is still very impressive hardware, so you should be in a win-win situation. My two cents... Re:Go For The PowerBook (Score:4, Informative) The "mouse" is a touchpad, isn't it? Many PC touchpad drivers have a feature that tapping in the upper-right corner is a right click. Hasn't somebody made such a driver for Macs or for Linux on Mac? I don't own a Mac or Powerbook, but I wish I did. Neocomputers (Score:5, Informative) Here is a link to the custom laptop page. [neocomputers.com] Are you a troll. (Score:5, Insightful) If there's one place where Apple kicks ass (and I'm of the opinion there are more), it's in full-featured notebooks. Dude! You're getting an Apple! Fujitsu Lifebook (Score:3, Informative) There are also a number of 2-4 pound laptops from Dell, HP, Gateway, etc.; that's what I have right now. They are considerably lighter than the iBooks, have comparable or better battery life, and are much, much faster. They often don't include the CD/DVD in the main laptop, but frankly, I prefer that choice; it's easy to plug a bus-powered CD/DVD into the USB2 or FW port. You will effectively not find a notebook where you don't pay the Windows tax: the big manufacturers just bundle it that way, and if anything goes wrong with the machine, they will have you run stuff under Windows before even accepting it for warranty return (I have been there). Apple is no better: you can't get their HW without their OS, and they won't even support their laptops connecting to a non-Apple wireless access point. Re:Fujitsu Lifebook (Score:5, Insightful) oh really. i bought an ibook and called them up when i couldn't connect to my linksys WAP. the guy told me exactly what i needed to do. very helpful. if you want to bash apple, at least know wtf you're talking about. Re:Fujitsu Lifebook (Score:4, Informative) I own two Macintoshes. One of them didn't work with my non-Apple AP. Everything else did (Windows, Linux). Apple tech support told me there was nothing they could do--"We don't support connecting to non-Apple 802.11b access points, it may or may not work. You could bring it in to a dealer that has an airport set up to see whether it's a hardware problem." Yes, Apple tech support is generally good and helpful. Their folks seem to be smarter than those at PC companies. But there are limits to what they support (and what they can support). And they will almost certainly not support Linux on an iBook either. So, if you want to bash me, at least know WTF you are talking about. Notebooks are mass market items. (Score:3, Insightful) The only way to assemble one is if there's a commodity hardware standard for notebooks or subnotebooks... but there's little chance of that happening since much of the size advantages of subnotebooks is a result of the tight intergration that an all-in-one solution affords. So you're pretty much stuck buying something OEM. Personally I can't see why you shy from an iBook. With an iBook, you're paying for Mac OS X anyways.. Although nothing is stopping you from installing Linux on it- once you give OS X a shot you'll probrobly won't need to. Windows Tax vs. Apple Tax (Score:3, Insightful) Re:Windows Tax vs. Apple Tax (Score:3, Informative) Except that oddly enough, when people compare the price of PC laptops to the price of Apple laptops, they almost invariably compare the lowest-priced PCs they can find to the Apple laptop. When you compare solid, reliable, long-lasting PC laptops to their Apple equivalents, the "Apple Tax" disappears. If you want to buy a cheap Dell and replace it in 18 months, that's fine, but if you want 3+ years out of your laptop, you'll have a tough time beating an Apple laptop for durability and reliability. Powerbook 12" (Score:5, Insightful) The catch is always software. With Mac OS X, you get great software. Better by far than any Linux configuration on the desktop. Want to burn a CD? Insert the bank CD, drag the files onto it, and then eject it ("do you wish to burn this CD?") How easy is that? I don't have time to fsck around with cdrecord and mkisofs anymore. I just want to burn a goddamned CD. I just want to connect to a wireless network. I just want to watch a DVD. I just want to fire up emacs and write some code. I don't want to tinker and stuff around all day making things work. So remember, hardware is half the story. Software is the other. If you can take the mac premium price, you get the best of both worlds. Re:Powerbook 12" (Score:5, Funny) Tell that to the guy that burned his penis. DELL Inspiron with Linux (Score:3, Informative) Couple links... (Score:3, Informative) You might also take a look at Los Alamos Computers [laclinux.com]. They aren't as light as you want, but they might be an option. QLI [qlilinuxpc.com] is also an option, but weight is an issue again. Finally, Emperor Linux [emperorlinux.com] has some very light looking machines Good luck.. I don't have any experience with any of these companies except for Micron PC.. You might do a quick search on google next time... I smell a rat (Score:5, Insightful) See a market , exploit that market and I think we may being exploited here. Re:I smell a rat (Score:5, Interesting) You don't always get that by buying a notebook off the shelf and installing Linux yourself. For some people and/or businesses, it might be worth the markup to receive the hardware and know that it's already set up, everything works, and help is just a phone call away. Re:I smell a rat (Score:3, Interesting) I'm moving to PPC/Linux. I was going to say something insightful, but: (Score:4, Insightful) I *do* find it F*cking hillarious that you would buy and Apple notebook computer, and load linux onto it, and be just as happy. OHMYGOD: Apple won't sell a laptop without an OS either. THE BASTARDS! It's quite odd that the You feel better about paying the "Apple Tax"? Now, Merits of Mac OS X aside, if the poster wants *Linux* on the desktop, buying an iBook hardly fixes the problem, as a matter of fact, it does just encourages Apple, 'Cause no-one complains. In an Ideal world, you could buy that notebook Windows free. Trouble is, welcome to earth. Suppliers like companies that build millions a year vs thousands a year. They get cheaper access to the components to build laptops. Even if you find a distributor that ships and OS-free laptop, the added cost for that distributor to build laptops in small quantity would drive up the price, most likely past the point of buying one with Windows included. Buy the laptop based on what you want it to have, suck it up and chuck away the Windows or MacOS license. Or resell it on ebay. Now, that's just my opinion. I could be wrong. Re:I was going to say something insightful, but: (Score:5, Insightful) Obligatory Powerbook answer (Score:5, Interesting) It's been said, but not like this. Look, what you really want is a PowerBook. You know it, everyone here knows it. You just won't admit it. So let's compare features. The Apple certainly has no potential whatsoever of running Microsoft Windows except through some complete emulation/virtualization software. Score one for Apple. The Apple comes with an actual GUI far superior to Microsoft Windows (not even a contest) and much more polished than your typical UNIX GUI. Score another (or a couple) for Apple. Want more? Well, your Mac is actually capable of running Microsoft Office should you later find yourself in a bind and be REQUIRED to deal with it to put food on the table. On the plus side, you can always pirate it and you don't need Windows or Windows emulation software to run it. That's worth about a half a point (MS Office isn't that great in my book). Your Mac will also be able to run just about any open source program you want. Furthermore, Apple has now even decided to provide an official version of X11 which they have even extended to allow full access to the OpenGL extensions. That means that you can create "lickable" GUIs using the X Window System. But even if you don't want to run Mac OS X (and trust me, you will), you can always run Linux on it. There are several very good quality PowerPC distros available. Furthermore, even if you go this route, it still doesn't preclude you from running MacOS X (or 7 8 or 9 for that matter) using the mac on linux software. And on top of all of that you'll be supporting a company who actually understands that it is customers that drive the bottom line; a company that creates GUIs that even your mom can understand, GUIs that actually make sense and help you get on with what you are trying to do-- especially if you are a hard-core geek. So please at least consider the Powerbook. It's a sleek machine, it's extremely solidly built (well, the 12" model I hear leaves something to be desired, but the rest are excellent). It comes with a good OS. You can run Linux on it. And you're not supporting a company that supports Microsoft. In fact, you are supporting a company that actually competes with Microsoft (on some small level). A company whose CEO made a little deal with Microsoft and got a lot of gain for very little (putting MS IE in as the default browser, BFD). In short: you know you want it dude! ibooks are fine (Score:3, Insightful) and, the best part, i get 3.5-4 hours battery, plus, the it truly is a laptop. i can leave it my lap for hours. everything just works. usb, firewire, cd-rw, etc. yes, i have gotten all to work fine in linux. i use linux in my classroom. have for a few years. i was thinking seriously about a dell, or powernotebook.com laptop. but i ended up with the ibook simply because it is a sub 5 pound unix laptop and i didn't want to pay the m$ tax either. if you measure the price, you're not giving up too much with an ibook compared to a PC laptop. and you're getting a ton more. just get minimum 256mb, preferrably 384mb. IBM (Score:3, Informative) They also sell the Thinkpads with Linux. My experience with Dell refund (Score:3, Interesting) So, this is what I did. 1.) Don't boot the software. 2.) Don't open the software. 3.) Since you have not agreed to these licenses, the "thou shalt not resell this" does not apply to you. 4.) So, I resold the license to a guy at work for $50. (There was no real OS CD, just a recovery disk. However, he had one already, so I just sold him a license). 5.) In theory, you could sell this on ebay, but I've heard of MS using its' clout to pull those ads. Of course, there is another reason to actually fight with the OEM - MS can no longer publish those "we run on 95% of all consumer PC's sold", when what really happens is that many people wipe the disk and install another OS. (I'd call it perhaps 25% dual boot, and maybe another 10% just do 1 OS.) Re:My experience with Dell refund (Score:3, Informative) You might want to re-read that EULA. OEM licenses are not only not for resale, they're tied to the hardware. It doesn't matter if you booted it or not - your co-worker did, and he's running an unlicensed copy. It sounds like you got the better of the deal. ." IBM ThinkPads (Score:4, Informative) try this (Score:3, Informative) Why is the Author not willing to pay MS, but Apple (Score:4, Insightful) The iBook is cute, but, IMHO overpriced. Moreso, the lack of a PC Card slot and the lack of IR means I won't be getting one. The author is going out of his way to avoid giving MS any money for something he won't use, but seemed to have no problem paying apple for software he won't use. My point is perhaps he should not be outright opposed to buying windows if he gets a better machine. Windows "only" adds maybe $30 to the cost of a PC. CNET Notebook section (Score:5, Informative) My take on notebooks (currently); wait. Banias [tomshardware.com] is around the corner (March 12 last I heard) bringing +3 hour battery time coupled with excellent performance (it's easy to find slower laptops with significantly longer battery times though). Cost will be an issue (if you're looking at sub-$1500), so I'd suggest waiting even longer after Banias. Having performance, price and portability all in one laptop is about to become possible though; all you need to do is hold off from purchasing for a bit more. Japan Rush (Score:3, Informative) So don't pay! Want to know how far Apple has come? (Score:5, Insightful) Think this would of happened 2 years ago? make a statement- give to GNU and EFF (Score:5, Interesting) If you want to make a statement by spending an extra $500- $1000 just to not have Windows, fine. I suggest you can make a more effective statement by just getting the commodity laptop and giving the $500+ you save over an allegedy "Windows-free" machine to GNU, BSD, and/or EFF, depending upon the particular point you are trying to make. If you truly want to avoid money going to MS, just get an iBook ( or Powerbook if you can swing it.) Those are great, sturdy, well-arranged machines. Actually, I'm not sure how sturdy the Powerbooks are but the iBooks are unbelievable and really are made for 12-year olds as far as being tossed in backpacks and so on. IBM or Dell. Call for no OS (Score:5, Informative) If you, however, call them on the phone and talk to one of their sales reps, you can have the bundled software removed (including the OS). I would recommend a Dell, or if you have the money for it, an IBM Thinkpad. I love my ThinkPad. You just have to talk to a real person, which I understand is sometimes difficult for some computer literate people, but you have to work to get what you want in life. Stay away from the R505 (Score:5, Informative) I just replaced a R505 with a 12" PowerBook. In every respect, the Apple is the superior machine: The R505 series of Vaio feel very very cheap. The nice metal cover that had been on the older series Vaios has been replaced by a run-of-the-mill piece of plastic. After a year, the screen hinge barely works, and the power adapter socket will only make an adequate connection when I hold it just right. On paper, the R505 is smaller, but it doesn't feel any smaller. The way the 12"PB is hinged makes it open in a very compact way - unlike the R505 which seems to need a great deal more room to fully open. On a train or plane, the 12" PB can be held on the tray table with the screen at a reasonable angle even with the seat reclined in front of you. No chance of doing this with the Vaio. Finally, the PB12" is much much smaller when you consider its relative size with the DVD drive installed. On the Vaio, you need to plug the unit into its base to get the DVD drive - doubling the size and weight of the thing. With the Apple, it's just there, and just works. You say you're fine with a PCMCIA 802.11 solution, but have you really used one of these for any length of time? The antenna portion of the card makes for an awkward fit - especially compared with the elegance of the Mac's built-in airport. Don't get me started on OSX. You want to run Linux why? Honestly, with X11 installed within OSX, I'm finding it hard to find reasons to run Linux. TransMeta (Score:5, Informative) Buy an off-lease Dell (Score:5, Informative) I don't think you're to beat a 12 inch iBook or Powerbook for small and light, though, and if "[p]erformance isn't a major concern," why are you worried about it enough to rule out a Mac? Qli Linux PCs (Score:5, Informative) Qli [qlilinuxpc.com] sells new laptops with Linux preinstalled. Their prices range from one thousand to over two, for a fully loaded machine. They don't sell any that are tiny, like the Vaio, but there are other [laclinux.com] companies [emperorlinux.com] that do sell refurbished laptops and small form factor [emperorlinux.com] laptops with no Windows tax. I chose Qli because I was looking for a particular feature set, and because one of their installation options is Gentoo [gentoo.org], which is my current favorite distribution. I got an 1800MHz, 512MB (2GB max), 15.1" LCD, 20Gb, DVD/CDRW laptop for a shade over $1800. It has onboard ethernet, three USB (one of which is USB 2.0), onboard firewire, and a single CardBus slot. It was, practically, the perfect configuration I was looking for; the price was reasonable, and (as I said) they offered Gentoo as an install option. My experience with Qli has been good. I agreed that they would install Gentoo 1.4, which is technically still beta, and this was Qli's first 1.4 laptop, so I had to do some work after the machine arrived to get it fully configured. I would expect that if you chose Gentoo 1.2, Mandrake, or Redhat, it would arrive fully configured. Qli provides a large number of installation options, and money you pay for the distribution of your choice (which varies) goes to the distribution. The best thing about Qli, IME, was the customer service. The staff are extremely knowledgable and helpful, and are good about responding to support requests. They have a good understanding of kernel configurations, from which kernel modules are required to support which features to various configuration options. I'm also very happy with the hardware. Although it isn't yet supported by Linux, I was pleasantly surprised that the laptop came with an unadvertised MMC/SD slot. There are a couple of hangups with my particular hardware, but none of it is Qli's fault. The laptop is entirely ACPI, and ACPI support in Linux is immature. Consequently, I can't suspend the laptop (!) -- yet. OpenGL is proved to be a bear to get working, but this is due to my choice of distributions; apparently, Redhat on this laptop has full accellerated GL support out of the box. There is an onboard WinModem, but we know about those. In summary, I can recommend Qli. You need to evaluate your own requirements, and then send them an email before you buy. They'll give you status reports on various configurations and recommend a system for you. [Disclaimer] I do not work for Qli, and I don't receive any compensation for recommending them. My only relationship with Qli is that I've recently purchased a laptop from them. Re:Simple solution: (Score:3, Funny) You mean peel an Apple?
https://hardware.slashdot.org/story/03/02/17/0213201/buying-a-small-light-linux-notebook-computer
CC-MAIN-2016-30
refinedweb
7,613
72.26
Hello! I’m Paul Goodson, and I’m a Program Manager on the Microsoft Intune Customer Experience (CXP) Team. Today I’d like to talk about how you can do some cool things with Windows Phone 8.1 and Microsoft Intune. This blog post will focus on how to do the basics such as deploying an app or wiping a device since those tasks are already well documented on TechNet. Instead, we’ll focus on some of the more advanced things you can do with Windows Phone such as configuring management settings not available in the GUI and extending the inventory using MOF files. Windows Phone 8.1 Management Prerequisites To manage Windows Phone 8.1 devices there are some prerequisites that must be completed first. You should have System Center Configuration Manager 2012 R2 (although not required we recommend Cumulative Update 3) connected to your Intune tenant. You should also have created the proper DNS entries for enrollment and have either purchased a code signing certificate from Symantec or utilized the Support tool for Windows Phone trial management. These and the other necessary pre-requisite steps can be found here. You can manage Windows Phone 8.1 with standalone Intune (no System Center Configuration Manager integration) but you won’t be able to do the things that I’ll be discussing in this blog post. However, the ability to use OMA URI strings for Windows Phone 8.1 will be coming to standalone Intune in the coming months. Look for a blog post with additional information about those changes in the near future! What are OMA URI strings and how do we use them? System Center Configuration Manager has the ability to create custom settings with OMA URIs (Open Mobile Alliance Uniform Resource Identifier) to target Configuration Service Providers (CSPs) on a device to directly configure nodes available on a mobile device. This allows us to bridge the gap between what features and functionality are available for a mobile device and what is available for configuration through the System Center Configuration Manager GUI. How do we know what OMA URI strings to configure? All of the Windows Phone 8.1 settings you can configure via an MDM solution such as Intune are documented in the Windows Phone 8.1 MDM Protocol documentation located here. Let’s create an OMA URI setting to solve a problem! The problem we are trying to solve is that a customer does not want to allow their users to connect a Windows Phone 8.1 device to a PC and be able to copy files to or from the phone’s storage. If you go to page 140 of the protocol documentation, you’ll see the appropriate setting for this task (screenshot below). You’ll also notice many other interesting settings that you can deploy using this same technique. Now that we know the setting and the value, we should create this configuration item in the System Center Configuration Manager console. See step-by-step instructions below. From within the System Center Configuration Manager console create a new configuration item Give the configuration item a name and specify the type as “Mobile Device” and then click “Next” Check the box “Configure additional settings that are not in the default settings group” and then click “Next” Click “Add…” Click “Create Setting…” Give the setting a name, choose “OMA URI” from the drop down and since the value can be either “0” or “1” per the documentation it will be an integer data type. Enter “./Vendor/MSFT/PolicyManager/My/Connectivity/AllowUSBConnection” as your OMA URI. Then click “OK”. Note: You can understand the full OMA URI value by reading the section of the protocol document called “PolicyManager configuration service provider (New in Windows Phone 8.1)” On the “Browse Settings” dialog, search for the setting you just created and choose “Select” Next we’ll need to provide an integer value of 1 (allow) or 0 (disallow). Since we want to disable USB connectivity we’ll enter “0”. Make sure you leave “Remediate noncompliant rules when supported” checked and then click “OK” Click “Close” Click “Next” Select Windows Phone 8.1 as the supported platform for this setting and then click “Next” Click “Next” Click “Next” Click “Close” You’ve successfully created a configuration item with an OMA URI setting. Now you should add the configuration item to a baseline and deploy it to users or devices as you would any configuration item. Congrats! Now you can repeat this process for any settings in the Windows Phone 8.1 MDM Protocol documentation. Next up, inventory! While System Center Configuration Manager and Intune will inventory a ton of great information by default, there might be a few items that you think are missing. Well, just as you create custom MOF (Managed Object Format) files to collect additional information on the servers and workstations you manage with System Center Configuration Manager, you can do the same for Windows Phone 8.1. The below is the code you would create to inventory the device name (the one the end user specified), IMEI, and the phone number of the device. This is an example that includes the three most common pieces of hardware inventory that I’ve heard customers request for Windows Phone 8.1 that isn’t included by default. Simply copy and paste the code into Notepad and save it with a “.MOF” extension on your System Center Configuration Manager server. For example, “DeviceName and IMEI and Phone Number.MOF” #pragma namespace (“\\.\root\cimv2”) instance of __Namespace { Name = “SMS” ; }; #pragma namespace (“\\.\root\cimv2\SMS”) instance of __Namespace {:./DevDetail/Ext/Microsoft/DeviceName“)] String DeviceName; [SMS_Report (TRUE), SMS_DEVICE_URI(“WM:./Vendor/MSFT/DeviceInstanceService/IMEI”)] String IMEI; [SMS_Report (TRUE), SMS_DEVICE_URI(“WM:./Vendor/MSFT/DeviceInstanceService/PhoneNumber“)] String PhoneNumber; }; Right-click your “Default Client Settings” and choose “Properties” On the “Hardware Inventory” pane choose “Set Classes…” Choose “Import” Select the MOF file you created previously and click “Open” Click “Import” Then click “OK” to return to the System Center Configuration Manager console. The next time your Windows Phone 8.1 devices send inventory to Intune you’ll get the additional information specified in the MOF. You can further extend your MOF file by using other data specified in the Windows Phone 8.1 MDM Protocol documentation located here. Thank you! I hope that you’ve found this blog post useful and that it makes your Windows Phone 8.1 management with Intune more complete. Please bookmark this blog and check back often as we plan to post new content weekly!
https://cloudblogs.microsoft.com/enterprisemobility/2014/11/04/extending-windows-phone-8-1-management-and-inventory-with-oma-uri-settings-and-mof-files/
CC-MAIN-2018-34
refinedweb
1,095
54.83
If you’ve built applications using javascript and some form of Web API, you’ve probably run into the “separate models” problem. This is where you define one model in the backend (in .NET, typically a C# class) and return instances of it via your API (serialised to JSON to send over the network). public class CartLineItem { public int Id { get; set; } public string Title { get; set; } public string Image { get; set; } public decimal Price { get; set; } } So far, so simple. Now you want to retrieve that data and use it in your javascript application. So you make your network call, retrieve the model as JSON and whack it into a javascript (or indeed Typescript) object… const cartLineItem = await httpGet('/api/cart/line/1'); This example uses a little httpGet helper, but essentially takes the JSON and deserializes it into a javascript object. If you’re using Typescript, you might even specify the structure of that object (so you get handy intellisense and compile errors if you try to access a property that doesn’t exist). interface ICartLineItem { Id: number; Title: string; Image: string; Price: number; } Now at this point, everything works and all is well with the world. But, you may have noticed web applications have this nasty habit of changing and this architecture makes changes a little difficult. We’ve ended up with two versions of our model, separated by that funny thing called the internet, sitting between your browser and your API and this is where things get a bit… messy. What if your backend model changes? Say you decide Image is a terrible property name and want to change it to ImagePath; if you’re feeling a bit cavalier you might just go ahead, say to hell with the consequences and use the refactoring tools in your IDE to change it there and then (after all, I’m all for improving the readability of code)… But what now for your poor javascript application? It doesn’t know you’ve improved your model; all it knows is it suddenly can’t find anything called Image on your object. The result? A sea of errors in your browser console… A simple change has turned into some kind of crazy game of whack-a-mole; bugs are popping up all over the place and the only way to fix them is to hunt each one down and update the reference to Image. How does Blazor handle it? Blazor has an obvious answer to this problem of keeping two models in sync; don’t use two models! Remember that CartLineItem class we mentioned earlier? In Blazor, you would populate that model with data (presumably from a database or some-such) but then, when it comes to using the model in your components, you can reference CartLineItem directly. Here’s an example with Blazor Server: <h3>Your Shopping Cart</h3> @foreach (var line in Lines) { <Item details="@line"/> } @code { public List<CartLineItem> Lines; protected override void OnInitialized() { Lines = _cartService.ForLoggedInCustomer(); } } We can retrieve a list of lines using _cartService then assign those to a field. In our markup we can loop over that list of lines and bind each one to whatever we like (a component called Item in this case). Blazor WebAssembly manages a similar trick even though it’s using network calls to retrieve the data: @inject HttpClient Http <h3>Your Shopping Cart</h3> @foreach (var line in Lines) { <Item details="@line"/> } @code { public CartLineItem[] Lines; protected override async Task OnInitializedAsync() { Lines = await Http.GetJsonAsync<CartLineItem[]>("api/cart"); } } This will take the JSON returned via the network call and cast it to an array of CartLineItem. In either case, if you decide to rename the Image property on CartLineItem now, the compiler will catch any code which is still using the old property name and your application won’t even compile. Plus, you can use your IDE’s refactoring tools to rename Image and automatically fix all references to it. Give it a go for yourself; spin up a new Blazor project and you’ll find a class called WeatherForecast. Try just renaming one of the properties and then try to compile your application. You’ll see an error like this: ‘WeatherForecast’ does not contain a definition for ImagePath’ In Visual Studio you can double-click the error and it will take you straight to the place you need to change: Fix the red squiggle and you’re done!
https://jonhilton.net/blazor-shared-models/
CC-MAIN-2020-40
refinedweb
740
54.46
Beta Draft: 2014-03-25 Developers can run and debug IMlets on the Raspberry Pi board directly from the NetBeans IDE 8.0 Beta or using the Oracle Java ME SDK 8.0 EA 2. This chapter describes how to add the board to the Device Manager in the Oracle Java ME SDK 8.0 EA and how to debug an IMlet on the board from the NetBeans IDE 8.0 Beta. Running and debugging IMlet projects on the Raspberry Pi board using the NetBeans IDE 8.0 Beta requires the following software: NetBeans IDE 8.0 Beta with Java ME 8 support Oracle Java ME SDK 8.0 EA 2 Oracle Java ME SDK 8.0 EA 2 plugins For complete instructions on installing Oracle Java ME SDK 8.0 EA 2, the NetBeans IDE 8.0 Beta, and Oracle Java ME SDK 8.0 EA 2 plugins for NetBeans, see the Oracle Java ME Embedded Getting Started Guide for the Windows Platform. Follow these steps to add the Raspberry Pi board to the Device Manager in the Oracle Java ME SDK 8.0 EA 2: Ensure that the sudo./usertest.sh script in the /bin directory is running on the Raspberry Pi board. Open a Device Manager window shown in Figure 2-1 by clicking the Oracle Java ME SDK 8.0 EA Device Manager icon on the taskbar. Figure 2-1 Device Manager Window Click the Add button, ensure that the IP Address or Host Name list contains the correct IP address of the Raspberry Pi board, and press OK. Figure 2-2 Device Manager Window With Raspberry Pi Connected Once the Raspberry Pi board is registered, its IP address is listed on the Device Connections Manager list and its status is Connected as shown in Figure 2-2. There are two ways to assign the Raspberry Pi board to your project: Using an existing NetBeans Project with an IMlet you want to run or debug. Creating a new NetBeans project. Once you assign the board to your project, clicking on Run Project in the NetBeans IDE 8.0 Beta runs your IMlets on the board instead of on the emulator. If you already have an existing NetBeans project with an IMlet that you want to run or debug on the board, follow these steps: Right-click on your project and choose Properties. Select the Platform category on the properties window. Select the Platform Type (CLDC) and make sure Oracle Java(TM) Platform Micro Edition SDK 8.0 EA is selected in the Java ME Platform list. Select EmbeddedExternalDevice1 from the Device list, as shown in Figure 2-3. Check (or uncheck) Optional Packages as needed for your project, and press OK. Figure 2-3 Adding a Device to Your Project If you are creating a new NetBeans project from scratch, follow these steps: Select File -> New Project. Select the Java ME Embedded category and Java ME 8 Embedded Application in Projects. Click Next. Provide a project name, for example, ME8EmbeddedApplication1. Be sure that the Java ME Platform is Oracle Java(TM) Platform Micro Edition SDK 8.0 EA and Create MIDlet option is checked. Select EmbeddedExternalDevice1 from the Device list and click Finish, as shown in Figure 2-4. Figure 2-4 Creating a New Project When the new project is created, it is displayed in NetBeans IDE with the name ME8EmbeddedApplication1. Once the new project is created, use the source code in Example 2-1 to create a sample IMlet.java source file. Example 2-1 Sample Code to Access a GPIO Port with NetBeans package me8embeddedapplication1; import com.oracle.deviceaccess.PeripheralManager; import com.oracle.deviceaccess.UnavailablePeripheralException; import com.oracle.deviceaccess.PeripheralNotFoundException; import com.oracle.deviceaccess.gpio.GPIOPin; import java.io.IOException; import javax.microedition.midlet.*; public class IMlet extends MIDlet { public void startApp() { try { GPIOPin pin = (GPIOPin)PeripheralManager.open(2); boolean b = pin.getValue(); } catch (UnavailablePeripheralException ex) { ex.printStackTrace(); } catch (PeripheralNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } } public void pauseApp() { } public void destroyApp(boolean unconditional) { } } This sample application will obtain an object representing GPIO pin 2 from the PeripheralManager, and attempt to obtain its high/low value. Now you can update the generic project you created with your sample code. In the NetBeans Projects window, you see the sample project with file ME8EmbeddedApplication1.java. Do the following Right click to select ME8EmbeddedApplication1.java in the Projects window and select Properties. This displays the ME8EmbeddedApplication1.java Properties window. To see the path to the location of the ME8EmbeddedApplication1.java file, look in the All Files line. Make a note of this path. Take the IMlet.java file you created and copy it into the me8embeddedapplication1 directory in the file path you noted. Delete the file ME8EmbeddedApplication1.java or remove it from the directory. This changes the content of the NetBeans Project window to the content in the IMlet.java file. (If it does not double-click IMlet.java in the Projects window.) Clean and build the ME8EmbeddedApplication1 project by clicking on the hammer-and-broom icon in the NetBeans toolbar or by selecting Run > Clean and Build Project (ME8EmbeddedApplication1). Run the newly cleaned and built ME8EmbeddedApplication1 project by selecting the green right-arrow icon in the NetBeans toolbar or by selecting Run > -> Debug Project or use the Debug button on the toolbar. The debugger connects to the debug agent on the board and the program execution stops at your breakpoint. Applications that require access to Device Access APIs must request appropriate permissions in JAD files. For more information on using the Device Access APIs, please see the Device Access API - Version 8 specification and the associated Javadocs at the following site: First, the JAD file must have the proper API permissions. Here is how to sign the application both in NetBeans and without an IDE. In NetBeans, right-click the project name (ME8EmbeddedApplication1 in this example) and choose Properties. Select Application Descriptor, then in the resulting pane, select API Permissions. Click the Add... button, and add the com.oracle.deviceaccess.gpio API, as shown in Figure 2-5. Click OK to close the project properties dialog. Figure 2-5 Adding API Permissions with NetBeans If you are not using an IDE, manually modify the application descriptor file to contain the following permissions. MIDlet-Permission-1: com.oracle.deviceaccess.PeripheralMgmtPermission "*:*" "open" MIDlet-Permission-2: com.oracle.deviceaccess.gpio.GPIOPinPermission "*:*" "open" Microedition-Profile: MEEP The first method is more complex, but is the preferred route for applications that are widely distributed. Here are the instructions on how to setup a keystore with a local certificate that can be used to sign the applications. Generate a new self-signed certificate with the following command on the desktop, using the keytool that is shipped with the Java SE JDK. keytool -genkey -v -alias mycert -keystore mykeystore.ks -storepass spass -keypass kpass -validity 360 -keyalg rsa -keysize 2048 -dname "CN=thehost" This command will generate a 2048-bit RSA key pair and a self-signed certificate, placing them in a new keystore with a keystore password of spass and a key password of kpass that is valid for 360 days. Feel free to change both passwords as you see fit. Copy the appdb/_main.ks keystore file from the Raspberry Pi over to the desktop using an sftp client or scp command will import the information in mykeystore.ks you just created to the _main.ks keystore. Once this is completed, copy the certs directory back to the Raspberry Pi an sftp client or scp command. Use the following command to sign your application before deploying to the Raspberry Pi board. > jarsigner -keystore mykeystore.ks -storepass spass app.jad myalias This method allows to bypass a certificate check and execute unsigned applications as if they were signed and given all requested permissions. This method should be used only for development and debugging. Final testing must be done using a real certificate as described in method #1. To use NullAuthenticationProvider, set the following property in the jwc_properties.ini file on the Raspberry Pi board: [internal] authentication.provider = com.oracle.meep.security.NullAuthenticationProvider and restart the Java runtime.
http://docs.oracle.com/javame/config/cldc/rel/8/rpi/html/getstart_rpi/debugging.htm
CC-MAIN-2016-36
refinedweb
1,358
50.33
#include <rte_ipsec_sa.h> #include <rte_mbuf.h> #include <rte_ipsec_group.h> Go to the source code of this file. RTE IPsec support. librte_ipsec provides a framework for data-path IPsec protocol processing (ESP/AH). Definition in file rte_ipsec.h. Checks that inside given rte_ipsec_session crypto/security fields are filled correctly and setups function pointers based on these values. Expects that all fields except IPsec processing function pointers (pkt_func) will be filled correctly by caller. For input mbufs and given IPsec session prepare crypto ops that can be enqueued into the cryptodev associated with given session. expects that for each input packet: Definition at line 118 of file rte_ipsec.h. Finalise processing of packets after crypto-dev finished with them or process packets that are subjects to inline IPsec offload. Expects that for each input packet: Definition at line 155 of file rte_ipsec.h.
https://doc.dpdk.org/api-20.11/rte__ipsec_8h.html
CC-MAIN-2021-39
refinedweb
141
60.41
Compiler Warning C4950 Visual Studio 2005 Error Message'type_or_member' : marked as obsolete A member or type was marked as obsolete with the ObsoleteAttribute. C4950 is always issued as an error. You can turn off this warning with the #pragma warning or /wd; see warning or /w, /Wn, /WX, /Wall, /wln, /wdn, /wen, /won (Warning Level) for more information. The following sample generates C4950: // C4950.cpp // compile with: /clr using namespace System; // Any reference to Func3 should generate an error with message [System::ObsoleteAttribute("Will be removed in next version", true)] Int32 Func3(Int32 a, Int32 b) { return (a + b); } int main() { Int32 MyInt3 = ::Func3(2, 2); // C4950 } Show:
https://msdn.microsoft.com/en-US/library/t62ch7kw(v=vs.80).aspx
CC-MAIN-2015-32
refinedweb
108
50.77
This tutorial explains the fundamentals of Java enums with examples. It starts with defining enum types. Next it explains where enums can be defined – in a class file of their own, alongside another class definition, or as a member of another class. Next the values() and valueOf() static methods of enum are covered, along with the ordinal() method, with code examples to show the methods’ usage. Enum equality is then touched upon briefly along with benefits of using enums. After covering the basics of Java enums, the tutorial then moves on to explain enhanced enums with variables, methods and constructors with detailed code examples. It then covers the topic of specific method overriding for an enum constant, aka constant specific class body, with examples. Lastly, the tutorial shows how enums can be efficiently used to decide between multiple execution paths when using switch-case statements. What are enums Enums are types which represent a fixed set of related constants. Let us break the above definition down into the terms used in it to make it simpler – - Fixed Set – Enums have a fixed number of values specified upfront when defining an enum type. - Related Constants – The fixed set of values are for a given enum type defined. Hence, these enum values are related by their common enum type. - Enums are types – Enums are types in themselves; they are in fact special types of classes. Examples of Enums - Departments in an Organization – HUMAN RESOURCES, MARKETING, IT, OPERATIONSare all departments of an organization. Hence, for a Departmentenum the fixed set of enum values are the department names. - Sizes of Shirts – SMALL, MEDIUM, LARGE, EXTRA_LARGEare all sizes which a shirt can take. Hence, for a ShirtSizeenum the fixed set of enum values are the various shirt sizes. Defining an Enum Let us take the Department enum from the 1st example we saw above and start building upon it. To start with, defining a fixed set of constant values for departments as an enum is as simple as writing the following code – public enum Department { HR, OPERATIONS, LEGAL, MARKETING //; semi-colon is optional here } Departmentenum has four values – HR, OPERATIONS, LEGAL, MARKETING. - The 4 department constants can be accessed as Department.HR, Department.OPERATIONSand so on.(Note – The syntax to access enums can vary based on where enums are defined which will be covered shortly.) - Semi-colon(;) at the end of enum constants is optional unless you decide to add more to the enum in terms of variables, methods etc., which will be covered further down under the topic enhanced enums. - It is important to note at this stage that Enums are special types of classes All enum types are classes. When an enum type is compiled, then behind the scenes the compiler inserts a lot of boilerplate code which gives the enum type classes their ‘special’ nature. This boiler code provides features of a full blown class and object constants definitions based on just the enum definition. So, in effect the compiler is doing all the hard work involved in creating a type and its constants objects behind-the-scenes, and abstracting it all out as a simple enum type and constants definition. Thus, all a programmer needs to do is define a enum type and its constants, and the compiler does the rest automatically. Let us now quickly take a look at all the features which the Java compiler provides to an enum type – - All enums implicitly extend java.lang.Enum<E>. - Methods name(), ordinal()and valueOf(), inherited from Enum<E>, are available on all enums. - Enum objects cannot be created explicitly except by using reflection. - Boilerplate code includes the definition of a fixed set of instance variables which are public static finalobjects corresponding to each of the enum constants defined for that type. - Static values()method is available on all enum types. When invoked on an enum type, values()method returns an array of all enum constants defined for that enum type. toString()method, overridden automatically by the compiler for all enum constants, returns the name of the enum constant as a string by default. - Enums can be used in switch-case statements (explained with code example further down). Enum Naming Convention By convention, enum values are named in capitals and underscores(_). This is because enum values are constant values , and in Java constants are named in capitals and underscores. Where to define enums Similar to other type definitions in Java, enums can be defined in the following ways – - Enums can be defined independently(as a top-level class) - In a file which contains only the enum definitionImportant points to note in above codeEnum defined in a separate Java file //In file - Department.Java public enum Department { HR, OPERATIONS, LEGAL, MARKETING } //In file EnumTest.java public class EnumTest { public static void main(String args[]) { Department enumVar = Department.HR; } } Department.javafile contains only the Departmentenum definition. Departmentenum can be defined with public or defaultaccess in this case. - An enum constant of Departmenttype can be accessed using the syntax – <enum-name>.<constant-name>. For example, in the above program the enum constants of Departmentcan be accessed as – Department.HR, Department.OPERATIONS, and so on. - In the class EnumTest, a variable of type Departmentis defined as enumVar, which is assigned the HR Department using syntax Department.HR. - enum definition can accompany another class definition in that class’ fileImportant points to note in above codeEnum defined alongside another class in same file //In file Employee.java enum Department { HR, OPERATIONS, LEGAL, MARKETING } public class Employee { String name; Integer age; Double salary; } Employee.javafile contains Employeeclass definition along with Departmentenum definition. Departmentenum can be defined with only defaultaccess in this case, as only a type which is named after the file name( Employeeclass in this case) can be publicin Java. - An enum constant of Departmenttype can be accessed using the syntax – <enum-name>.<constant-name>. This is same as that for previous enum definition in its own file, as both this enum and previous one are not defined as member of another class. - Enums can be defined as members of a class aka ‘nested enum types’. Important points to observe in above codeNested enum defined as member of a class //In file Employee.java public class Employee { enum Department { HR, OPERATIONS, LEGAL, MARKETING; } private String name; private Integer age; } //In file EnumTest.java public class EnumTest { public static void main(String args[]) { Employee.Department enumVar = Employee.Department.HR; } } Employee.javafile contains Employeeclass definition. Departmentenum is defined inside Employeeclass. Departmentenum in this case can be defined with any desired access, (i.e. public, private, default), here. Departmentenum defined above is a nested enum type as it is ‘nested’ inside another class. Nested enum types are implicitly static, and hence mentioning static in their definition is actually redundant. - An enum constant of static nested enum Departmenttype can be accessed using the syntax – <enclosing-class-name>.<enum-name>.<constant-name>. For example, in the above program the enum constants of Department can be accessed as – Employee.Department.HR, Employee.Department.OPERATIONS, and so on. - In the class EnumTest.java, a variable of type Employee.Departmentis defined as enumVar, which is assigned the HR Department accessed using syntax Employee.Department.HR. What exactly is an enum – logically! Logically an enum is a set of fixed/constant instances of an enum ‘type’. So, a Department type above has 4 constant instances – HR, OPERATIONS, LEGAL, MARKETING. Now any variable defined in any class which is of type Department can have only one of these 4 constant values. Using the static values() method of an enum The static values() method is a very handy method as it is available on every enum type, and when invoked it returns an array of all enum constants of that enum type. Lets see a code example showing the use of values() method. public class EnumTest { public static void main(String args[]) { for(Department dept:Department.values()){ System.out.println("Enum constant-> "+dept+" with ordinal value-> "+dept.ordinal()); } } } Enum constant-> OPERATIONS with ordinal value-> 1 Enum constant-> LEGAL with ordinal value-> 2 Enum constant-> MARKETING with ordinal value-> 3 - Example uses the enum Departmentwhich we defined in a file of its own. - Using a for loop, the constants in Departmentenum are iterated through. Each enum constant’s value and ordinal position is printed as it is encountered. <enum-constant>.ordinal()is an int value equal to the enum constant’s ordinal position in enum declaration, starting from the value 0(zero). Using the static valueOf() method of an enum Static valueOf() method, which can be invoked on the enum type, takes a single String parameter which needs to be the name of any of the constants of the enum on which this method is invoked. It returns an enum constant object whose name matches the name value passed as parameter. In case the string passed as parameter to valueOf() method is not a valid name of one of its constants then a java.lang.IllegalArgumentException is thrown. public class EnumTest { public static void main(String args[]) { Department enumVar = Department.valueOf("HR"); System.out.println("enumVar == Department.HR? "+(enumVar == Department.HR)); System.out.println("enumVar equals Department.HR? "+(enumVar.equals(Department.HR))); } } enumVar equals Department.HR? true - Example uses the enum Departmentwhich we defined in a file of its own. enumVaris a variable of type Departmentwhich is assigned the object returned by invoking valueOf()method on Departmentwith "HR"as value for name parameter. - On equating enumVarwith Department.HR, using both ==and Object.equals()method, the enum constants are found be equal. ‘==’or the ‘equals()’method, without the need to override Object.equals()method in the enum definition. Benefits of using enums Enums restrict the values to the defined constants and this is a huge benefit from a system designer’s point of view. A system designed for 4 departments will only allow these 4 values to be assigned to any variable of type Department used anywhere in the whole system. This prevents a lot of potential defects and improves code maintainability. Moving beyond the basic enum to enhanced enums Having seen how to define a basic enum and how to use it in code, it is now time to explore the full potential of an enum as a ‘type’. As we understood above, enums are nothing but classes albeit that of a ‘special’ type. So, by virtue of being a class, an enum type can also have methods, variables and constructors defined in it. One can also selectively override method definitions for specific enum constants. Let us look at these advanced features of enums now. Lets say we need to define a ‘Department Code’ for evey Department enum constant. This code will be alphanumeric and so we will store it as a String. Just like in a class definition, we can create a private instance variable for department code in Department enum, along with a getter method for fetching this value. In addition, we will also define a constructor for passing the department code at the time of defining the enum itself. The enhanced enum with a new private instance variable deptCode holding the department code, a getter method for deptCode named getDeptCode(), and a constructor which accepts the department code at the time of enum creation would look like this. public enum Department { HR("DEPT-01"), OPERATIONS("DEPT-02"), LEGAL("DEPT-03"), MARKETING("DEPT-04");//semi-colon is no longer optional here Department(String deptCode){ this.deptCode=deptCode; } private String deptCode; public String getDeptCode(){ return deptCode; } } An important point to note about enum constructors: All enum constructors, including of course the Department enum constructor defined above, are implicitly private. So, even in case there is no access modifier defined for an enum constructor (as is the case in example shown above), the compiler implicitly assumes it to be private. Also, note that defining an enum constructor with public or protected access would result in a compiler error. To check whether the newly added method, variable and constructor are working fine let us iterate through the Department enum constants using the static values() method we saw earlier and print the department constants along with code. deptCodeinstance variable, which was then printed correctly when we iterated over Departmentenum using static values()method. Enum with selective instance method overrides To understand this feature of enums, let us now extend the department use case a little. The HR department on seeing the above output where all department codes are accessible publicly has raised an exception to its code being visible to all. It has asked that only its department code should be shielded from any public access attempts such as using the values() method call, and instead of actual deptCode value the string "NOT ACCESSIBLE" be returned. This requirement now requires us to change the behavior of getDeptCode() method for only the enum constant HR. Fortunately, enum does provide selective override of methods for specific constants. Lets see how it works. Lets now change our Department enum definition and write a constant specific class body for HR enum constant for overriding the getDeptCode() method. We will then iterate again through the enum constants using values() method, and see if department code for HR is shielded as per requirement or not. //Department.java public enum Department { @Override HR("DEPT-01"){ public String getDeptCode(){ return "NOT ACCESSIBLE"; } }, OPERATIONS("DEPT-02"), LEGAL("DEPT-03"), MARKETING("DEPT-04");//semi-colon is no longer optional here Department(String deptCode){ this.deptCode=deptCode; } private String deptCode; public String getDeptCode(){ return deptCode; } } //EnumTest.java getDeptCode()we specifically added to the enum constant HR in curly braces, did indeed override the default getDeptCode()implementation for only HR enum constant. The code for HR Department was printed in output as "NOT ACCESSIBLE"just as we wanted. Design Note – In case you want every enum constant to override some method and do it in a mandatory manner, then you can make that method in enum definition as abstract. This will force all enum constants to mandatorily override this method with their own custom logic. Enums and switch-case One of the commonly used applications of enums is when deciding between multiple execution paths using switch-case statements. When the decision on which execution path to take can be reduced to a single enum constant value, then using that enum type in switch statement and specifying logic to execute for each of the enum constants of that type using a corresponding case is an efficient option to implement. The code snippet shown next has a method which prints different outputs for each of the four department types based on which Department enum constant is passed to the switch statement as input. EnumTest class iterates through the Department enum constants using the values() method, so that each of the enum constants is encountered exactly once. public class EnumTest { public static void main(String args[]) { for (Department dept : Department.values()) { switch (dept) { case HR: System.out.println("Case - HR"); break; case OPERATIONS: System.out.println("Case - OPERATIONS"); break; case MARKETING: System.out.println("Case - MARKETING"); break; case LEGAL: System.out.println("Case - LEGAL"); break; } } } } Case – OPERATIONS Case – LEGAL Case – MARKETING Summary In the above tutorial we understood enums in their entirety. Starting from the basics we looked at what are enums, how to define an enum, enum constant naming convention, where to define enums, using the static values() and valueOf() method of enums, enum equality and ordinal values. We then looked at enhanced enums containing variables, methods, constructors and constant specific class body. Lastly, we saw how enums can be used to write conditional logic using switch-case statements.
https://www.javabrahman.com/corejava/the-complete-java-enums-tutorial-with-examples/
CC-MAIN-2018-34
refinedweb
2,605
54.02
import "github.com/cockroachdb/cockroach/pkg/util/uuid" codec.go generator.go sql.go uuid.go uuid_wrapper.go const ( V1 byte // Version 1 (date-time and MAC address) V3 // Version 3 (namespace name-based) V4 // Version 4 (random) V5 // Version 5 (namespace name-based) ) UUID versions. UUID layout variants. Size of a UUID in bytes. var ( NamespaceDNS = Must(FromString("6ba7b810-9dad-11d1-80b4-00c04fd430c8")) NamespaceURL = Must(FromString("6ba7b811-9dad-11d1-80b4-00c04fd430c8")) NamespaceOID = Must(FromString("6ba7b812-9dad-11d1-80b4-00c04fd430c8")) NamespaceX500 = Must(FromString("6ba7b814-9dad-11d1-80b4-00c04fd430c8")) ) Predefined namespace UUIDs. Nil is the nil UUID, as specified in RFC-4122, that has all 128 bits set to zero. Gen is a reference UUID generator based on the specifications laid out in RFC-4122 and DCE 1.1: Authentication and Security Services. This type satisfies the Generator interface as defined in this package. For consumers who are generating V1 UUIDs, but don't want to expose the MAC address of the node generating the UUIDs, the NewGenWithHWAF() function has been provided as a convenience. See the function's documentation for more info. The authors of this package do not feel that the majority of users will need to obfuscate their MAC address, and so we recommend using NewGen() to create a new generator. NewGen returns a new instance of Gen with some default values set. Most people should use this. NewGen by default uses crypto/rand.Reader as its source of randomness. func NewGenWithHWAF(hwaf HWAddrFunc) *Gen NewGenWithHWAF builds a new UUID generator with the HWAddrFunc provided. Most consumers should use NewGen() instead. This is used so that consumers can generate their own MAC addresses, for use in the generated UUIDs, if there is some concern about exposing the physical address of the machine generating the UUID. The Gen generator will only invoke the HWAddrFunc once, and cache that MAC address for all the future UUIDs generated by it. If you'd like to switch the MAC address being used, you'll need to create a new generator using this function. NewGenWithReader returns a new instance of gen which uses r as its source of randomness.. type Generator interface { NewV1() (UUID, error) // NewV2(domain byte) (UUID, error) // CRL: Removed support for V2. NewV3(ns UUID, name string) UUID NewV4() (UUID, error) NewV5(ns UUID, name string) UUID } Generator provides an interface for generating UUIDs. DefaultGenerator is the default UUID Generator used by this package. type HWAddrFunc func() (net.HardwareAddr, error) HWAddrFunc is the function type used to provide hardware (MAC) addresses. NullUUID can be used with the standard sql package to represent a UUID value that can be NULL in the database. MarshalJSON marshals the NullUUID as null or the nested UUID Scan implements the sql.Scanner interface. UnmarshalJSON unmarshals a NullUUID Value implements the driver.Valuer interface. ShortStringer implements fmt.Stringer to output Short() on String(). func (s ShortStringer) String() string String is part of fmt.Stringer. Timestamp is the count of 100-nanosecond intervals since 00:00:00.00, 15 October 1582 within a V1 UUID. This type has no meaning for V2-V5 UUIDs since they don't have an embedded timestamp. TimestampFromV1 returns the Timestamp embedded within a V1 UUID. Returns an error if the UUID is any version other than 1. Time returns the UTC time.Time representation of a Timestamp UUID is an array type to represent the value of a UUID, as defined in RFC-4122. FastMakeV4 generates a UUID using a fast but not cryptographically secure source of randomness. FromBytes returns a UUID generated from the raw byte slice input. It will return an error if the slice isn't 16 bytes long. FromBytesOrNil returns a UUID generated from the raw byte slice input. Same behavior as FromBytes(), but returns uuid.Nil instead of an error. FromString returns a UUID parsed from the input string. Input is expected in a form accepted by UnmarshalText. FromStringOrNil returns a UUID parsed from the input string. Same behavior as FromString(), but returns uuid.Nil instead of an error. FromUint128 delegates to FromBytes and wraps the result in a UUID. MakeV4 calls Must(NewV4) Must is a helper that wraps a call to a function returning (UUID, error) and panics if the error is non-nil. It is intended for use in variable initializations such as var packageUUID = uuid.Must(uuid.FromString("123e4567-e89b-12d3-a456-426655440000")) NewPopulatedUUID returns a populated UUID.. DeterministicV4 overwrites this UUID with one computed deterministically to evenly fill the space of possible V4 UUIDs. `n` represents how many UUIDs will fill the space and `i` is an index into these `n` (and thus must be in the range `[0,n)`). The resulting UUIDs will be unique, evenly-spaced, and sorted. Equal returns true iff the receiver equals the argument. This method exists only to conform to the API expected by gogoproto's generated Equal implementations. GetBytes returns the UUID as a byte slice. It incurs an allocation if the return value escapes. GetBytesMut returns the UUID as a mutable byte slice. Unlike GetBytes, it does not necessarily incur an allocation if the return value escapes. Instead, the return value escaping will cause the method's receiver (and any struct that it is a part of) to escape. Use only if GetBytes is causing an allocation and the UUID is already on the heap. MarshalBinary implements the encoding.BinaryMarshaler interface. MarshalJSON returns the JSON encoding of u. MarshalText implements the encoding.TextMarshaler interface. The encoding is the same as returned by the String() method. MarshalTo marshals u to data. Scan implements the sql.Scanner interface. A 16-byte slice will be handled by UnmarshalBinary, while a longer byte slice or a string will be handled by UnmarshalText. SetVariant sets the variant bits. SetVersion sets the version bits. Short returns the first eight characters of the output of String(). Size returns the marshaled size of u, in bytes. String returns a canonical RFC-4122 string representation of the UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. StringBytes writes the result of String directly into a buffer, which must have a length of at least 36. ToUint128 returns the UUID as a Uint128. Unmarshal unmarshals data to u. UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. It will return an error if the slice isn't 16 bytes long. UnmarshalJSON unmarshals the JSON encoded data into u. UnmarshalText implements the encoding.TextUnmarshaler interface. Following formats are supported: "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}", "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8" "6ba7b8109dad11d180b400c04fd430c8" "{6ba7b8109dad11d180b400c04fd430c8}", "urn:uuid:6ba7b8109dad11d180b400c04fd430c8" ABNF for supported UUID text representation follows: URN := 'urn' UUID-NID := 'uuid' hexdig := '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' hexoct := hexdig hexdig 2hexoct := hexoct hexoct 4hexoct := 2hexoct 2hexoct 6hexoct := 4hexoct 2hexoct 12hexoct := 6hexoct 6hexoct hashlike := 12hexoct canonical := 4hexoct '-' 2hexoct '-' 2hexoct '-' 6hexoct plain := canonical | hashlike uuid := canonical | hashlike | braced | urn braced := '{' plain '}' | '{' hashlike '}' urn := URN ':' UUID-NID ':' plain Value implements the driver.Valuer interface. Variant returns the UUID layout variant. Version returns the algorithm version used to generate the UUID. Package uuid imports 20 packages (graph) and is imported by 191 packages. Updated 2019-10-14. Refresh now. Tools for package owners.
https://godoc.org/github.com/cockroachdb/cockroach/pkg/util/uuid
CC-MAIN-2019-47
refinedweb
1,208
58.99
: Before You Begin Currently, IntelliJ IDEA Scala plugin is in beta stage and is being actively developed. Here is the list of what you will need to try it: - One of the latest IntelliJ IDEA EAP builds (can be downloaded from IntelliJ IDEA EAP page). - Scala SDK should be downloaded and installed on your computer. Setting up the Environment After you have downloaded, installed and configured all the prerequisites, follow this simple procedure to get the Scala plugin up and running. - Run IntelliJ IDEA. On the Welcome Screen, click Open Plugin Manager. - Press Browse repositories button the necessary jars will be downloaded automatically, but you also may pick them from an already existing IDEA library or a secret place on your hard drive. - It's possible to adjust the level of a library you want to create. Select Global or Project from the Level drop-down list. - If you plan to create other projects that involve this library, select Global - thus you will be able to share the library anywhere on the current machine. - If you select Project level, then all the jar archives will be included in your project. This makes your project portable between the different computers and independent from the Scala SDK. Exploring Project Structure Now,..App trait. Just type App and space, you even don't need to use code completion, which will work automatically . 35 Commentscomments.show.hide Jun 20, 2009 Anonymous This does not work (IntelliJ 8.2.1 OS-X). There is no Ctrl+Shift+F10nor Cmd+Shift+F10 available at all. menu -> Run is disabled. Jun 25, 2009 Anonymous You must add a target in Run>Configure. This is apparently ignored in the tutorial. Aug 20, 2009 Anonymous Doesn't work on 8.1.3 correctly. I don't get code completion. Jul 19, 2009 Anonymous Small annoyance, but the format coder always inserts a line between every declaration: def a: Int def b: Int def c: Int becomes def a: Int def b: Int def c: Int Jul 21, 2009 Ilya Sergey Hello. Yes, this is a good point. Line spacing should be available to adjust. Jul 21, 2009- Jul 21, 2009 Ilya Sergey Hi. Using instructions from here you can build Scala plugin for IntelliJ which is able to work with Scala 2.8. Jul 21, 2009? Jul 21, 2009 Anonymous oh wait... the page points to a version called "Maia", and i got "Diana", i guess there's the problem... hold on, i will retry... Jul 21, 2009 Ilya Sergey Yep, that's the right point. Jul 21, 2009 Ilya Sergey Hi. Judging by the log you've attached, you have wrong version of IDEA SDK. Are you sure that idea.home property in your case points to the actual installation directory of the last IntelliJ EAP (10558)? Jul 31, 2009 Anonymous Followed all the instructions but trying to compile the plugin for Maia 10597 and 2.8 is giving 2830 errors. Jul 31, 2009 Ilya Sergey Yes, thins is known problem caused by major changes in Scala compiler and related to packaging system. Take a scala compiler version from before 24th of July 2009. Aug 31,!? Aug 31, 2009 Ilya Sergey If you have no problems with compilation, this might be a bug in a type system of the plugin. If your object doesn't inherit the `Application' trait, but uses an explicit main method, put type `Unit' to it signature explicitly. Hope, it helps. Aug 31, 2009? Aug 31, 2009 Ilya Sergey These symptoms look very similar, isn't this your case? Aug 31, 2009 Anonymous Yep that was it. Hadn't realized I installed that other Scala plugin as well. Thanks Ilya. Sep 04, 2009: Feb 21, 2010 Anonymous I had tried to run helloworld in "scala script" run configuration, that was successfully executed with no output. And in compiler output directory there are no files. object HelloWorld def main(args: Array[String]) Please write instructions on run configuration. May 13, 2010 Anonymous No responses in 3 month and it doesn't work so far. This plugin is shit. May 13, 2010. Apr 19, 2010 Anonymous I'm using IntelliJ 9 and all this instructions don't work. I keep getting "class not acceptable". Apr 22, 2010 Anonymous Tried latest IntelliJ CE 9.0.2 and any scala version and I can never get the compiler working. Always gets this: Scalac internal error:... Apr 29, 2010 Anonymous I have the same problem. Bummer, looks like a cool plugin but if HelloWorld doesn't work on a Mac and it's tough to diagnose, then it will likely be a tough call to use this plugin on a much larger project. May 07, 2010 Anonymous I had a similar problem. The problem I found was that it is compiling Java 1.6 by default. You need to tell it the source or target is 1.5. Not sure which one is important or where I found the option. Works now though. Have fun. Jun 20, 2010 Anonymous Thanks, switching to 1.5 did the trick for me. May 03, 2010 Anonymous Got the same problem. Fix: Open "Module Settings", select the project and go to the "Dependencies" tab. Check the box before "scala-2.8.0.Beta1" (or the scala version you selected when you created the project) May 03, 2010. May 21, 2010 Anonymous Thanks a lot ! Jun 25, 2010. Jul 09, 2010? Permalink Reply Jul 26, 2010 Anonymous Pl update your walkthru: Feb 24, 2011 Marcos Ackel Is there a forum to discuss the Scala Plugin for Idea? Feb 15,
http://confluence.jetbrains.com/display/SCA/Getting+Started+with+IntelliJ+IDEA+Scala+Plugin?focusedCommentId=33456959
CC-MAIN-2014-52
refinedweb
935
76.32
Introduction PDB PGS IntroductionPyPact provides access to PACT from Python. This is provided as a package with two modules. The package is pact and the modules are pdb and pgs. The pdb module provides access to Score, PML and PDBLib. The pgs module provides access to Score, PML, PDBLib and PGS. Only one module should be used at a time. No access is provided to Scheme, PPC or Panacea at this time. TODO If you are using a PACT distribution: (The user needs to know how to build the shared objects.) If you see the error message: ImportError: No module named _pdb then you need to build the shared objects. END OF TODO If you are using your own private version of PACT built from a PACT distribution, e.g. in ~/pact, then you can do the following in your Python code: Exampleimport os import sys site_packages = os.path.expanduser( "~/pact/python" ) if os.path.isdir( site_packages ) : sys.path.append( site_packages ) else : print "No PACT python support on this platform." sys.exit( -1 ) import pact.pdb as pdb Putting the modules in a package helps keep the namespace clean and avoids confusion with the other pdb module - the Python Debugger. To import the library:import pact.pdb as pdbTo import the PDB library AND use the Python debugger: or import pact.pgs as pgsimport pact.pdb import pdb Recall that the PACT tools fit in the following hierarchy: ULTRA SX PANACEA PGS SCHEME PPC PDB PML SCORE Score and PML are not provided as stand alone modules since PDB is the first level that Python users are usually interested in using. Much of Score functionality such as memory allocation, hash tables and association lists are accessable from Python. However the module also depends on PDBLib's functionality to store arbitrary data in Score's hash tables and association lists. In the C library this is implemented by associating a type with each haelem or pcons. In PyPact the type must be defined in a PDB file. PyPact uses a virtual internal file to store the type information. It is accessed as the module variable vif. It is also the default file argument for many methods. Many structures in PACT are represented as classes in PyPact. Most structures have a function in the C API that returns a pointer to a new structure and several support functions that receive the structure pointer as one of the arguments (usually the first). This maps directly to a constructor and methods. The hash table functions follow the typical pattern. C Bindings: With typical usage:With typical usage: - hasharr *SC_hash_alloc() - int SC_hasharr_install(hasharr *self, char *type, void *key, void *obj) - void SC_free_hasharr(hasharr *self)int ierr, ival1; char one[] = "one"; hasharr *ht; ht = SC_hash_alloc(); ival1 = 1; iok = SC_hasharr_install(ht, "int", "one", &ival1); if (iok == 0) { errproc("Error inserting one\n";); } SC_free_hasharr(ht);In PyPact SC_make_hasharr is replaced by the hasharr class constructor and SC_hasharr_install becomes a method of the instance. SC_hash_free is called by Python's garbage collector when there are no more references to the instance.import pact.pdb as pdb ht = pdb.hasharr() ht.install("one", 1)PACT errors are trapped by raising Python exceptions. Where natural, types also use standard protocols. For example, both hash tables and association lists use the mapping protocal.ht = pdb.hasharr() ht["one"] = 1 PDB This section focuses on how to use the PDB module. The pdbdata ObjectThe pdbdata object is the only object in PyPact that does not map directly to a structure in PACT. It is used to fully describe a piece of memory and acts as a middle-man between the C and Python type systems. It consists of a pointer to memory and sufficient information to describe the memory. This includes the type and dimensions. This also includes a pointer to a PDBfile that is used to look up the type. With this information Python is able to access the memory as the user expects including accessing members of a derived type as attributes of an object. Python provides int and float objects. The Python implementation uses a C long for int and and C double for float. The pdbdata constructor allows the default types to be overridden. pdbdata(1, 'int') Since Python does not support pointers directly, a sequence of Python objects will match several C declarations. [ 1, 2, 3, 4, 5] can be both int[5] and int *. In one case, it is clear that there are 5 integers (int[5]). In the other, we only know that it points to an int. By default, a pdbdata object will be explicit about lengths and use int[5]. However, if it's necessary to match a specific type, then int * can be specified. The pdbdata type requires that pointers be allocated by Pact. This allows it to find out how much memory is allocated which allows a pdbdata to be converted back into Python objects. Nested sequences are represented as multiply dimensioned types. ([[1,2,3],[4,5,6]] is long[2][3]. If the array is not regular, then it is treated as an array of pointers. [[1,2,3],[4,5]] is long *[2]. It is also possible to convert Python class instances into pdbdata object. See the register_class method of PDBfile object below. None is treated as NULL and results in a pointer type. No type at all defaults to int [None] is int *[1] Constructorpdbdata(type, data, file)data -- data of type type to be encapsulated. type -- string name of the data type of the pdbdata. file -- define the types to this PDBfile. (This argument is optional and the virtual internal file is used by default.) Module Methods These module methods take a pdbdata object and return the individual fields. In addition to using the constructor, a pdbdata can be returned by any method that returns user data; for example, pdbfile.read.In addition to using the constructor, a pdbdata can be returned by any method that returns user data; for example, pdbfile.read. - getdefstr(obj) - returns a defstr object. - gettype(obj) - returns a string. - getfile(obj) - returns a PDBfile object. - getdata(obj) - returns a CObject object. It is controlled by the setform method.setform(array, struct, scalar)With no arguments the current values of setform are returned as a tuple. array, struct and scalar should be one of the following values, and reflect how reads and writes handle arrays, structs, and scalar data, respectively. Not all constants are valid for all forms.Not all constants are valid for all forms. - AS_NONE - Keep existing value. - AS_PDBDATA - return as a pdbdata - AS_OBJECT - return as object - AS_TUPLE - return as a tuple - AS_LIST - return as a list - AS_DICT - return as a dictionary - AS_ARRAY - return as a numpy array unpack(data, array, struct, scalar)Unpack a pdbdata object into more Python friendly types. If pdbdata represents a structure then the members can be accessed as attributes of object. If pdbdata represents an array then the sequence protocol is supported. Examples>>> import pact.pdb as pdb >>> d = pdb.pdbdata(4.0, 'double') >>> d data = 4.0000000000000000e+00 >>> r = pdb.unpack(d) >>> type(r) <type 'float'> >>> r 4.0 >>> d = pdb.pdbdata((4.0, 5.0), 'double[2]') >>> d data(0) = 4.0000000000000000e+00 data(1) = 5.0000000000000000e+00 >>> r = pdb.unpack(d) >>> type(r) <type 'list'> >>> r [4.0, 5.0] >>> pdb.setform(array=pdb.AS_TUPLE) (3, 3, 2) >>> r = pdb.unpack(d) >>> type(r) <type 'tuple'> >>> r (4.0, 5.0) >>> d = pdb.pdbdata([None, [4., 5.]], 'double **') >>> d data(0) = (nil) data(1)(0) = 4.0000000000000000e+00 data(1)(1) = 5.0000000000000000e+00 >>> r = pdb.unpack(d) >>> r [None, [4.0, 5.0]] >>> print r[0] None >>> print r[1] [4.0, 5.0] File ObjectThere are a few module variables that are used to access files. files is a dictionary of opened PDBfile instances indexed by file name. It is used to store references to files to avoid garbage collection until the close method is explicitly called. vif is the virtual internal file. It is used as the default file for many other methods. PDBfile(name[, mode]) name is the name of the file to open/create. mode is the file mode - r read, w write, a append The default is r. open is an alias for PDBfile. Attributes - object - name - type - symtab - chart - host_chart - attrtab - previous_file - date - mode - default_offset - virtual_internal - system_version - major_order MethodsThe ind argument is used to index arrays. If it is a scalar, it must be the number of items. If it is a sequence, then each member applies to a dimension. If a scalar, then it is the number of items. If length is 1, it is interpreted as (upper, ). If length is 2, it is interpreted as (lower, upper). If length is 3, it is interpreted as (lower, upper, stride). The following examples use f90 array notation.When writing data, PyPact will try to determine the type of the data if outtype is not specified. Python reals map to doubles. strings map to char * - flush() - write(name, var[, outtype, ind]) - name is the name of the variable to write. - var is the variable object to write. - outtype optional, is the type of variable. - ind optional, indexing information. - write_raw(name, var, type[, ind]) - name is the name of the variable to write. - var is the variable object to write. It must support the buffer interface. - type is the type of variable. - ind optional, indexing information. - read(name[, intype, ind]) - name is the name of the variable to read. - intype optional, type of data desired. - ind optional, indexing information. - defent(name, type) - name name of variable. - type type of data in file. - defstr(name, members) - name name of new type - members optional, sequence of types. If members are defined a new type is created. Otherwise name is looked up and returned. - cd(dirname) - dirname Name of directory. - mkdir(dirname) - dirname Name of directory. - ln(var, link) - var - link - ls([path, type]) - path optional - type optional - pwd() - register(cls, type [, ctor]) - cls The Python Class object - type The name of the pdblib defstr. - ctor This function is used during read. It accepts a dictionary of structure members and returns an object of class cls. ExamplesOpen a file.Write four doubles to a files as a 2-d double array and as a 1-d float arrayWrite four doubles to a files as a 2-d double array and as a 1-d float array>>> import pact.pdb as pdb >>> fp = pdb.open("xxxx", "w") >>> type(fp) <type 'PDBfile'> >>> pdb.files {'xxxx': <PDBfile object at 0xb3f7bb40>} >>> fp.close() >>> pdb.files {} >>> ctrl-DWrite a class instanceWrite a class instance%python >>> import pact.pdb as pdb >>> fp = pdb.open("xxxx", "w") >>> ref = [2.0, 3.0, 4.0, 5.0] >>> fp.write("d2", ref, ind=[2,2]) >>> fp.write("d3", ref, "float") >>> fp.close() >>> ctrl-D %pdbview xxxx PDBView 2.0 - 11.22.04 -> ls d2 d3 -> d2 /d2(0,0) = 2.0000000000000000e+00 /d2(0,1) = 3.0000000000000000e+00 /d2(1,0) = 4.0000000000000000e+00 /d2(1,1) = 5.0000000000000000e+00 -> d3 /d3(0) = 2.0000000e+00 /d3(1) = 3.0000000e+00 /d3(2) = 4.0000000e+00 /d3(3) = 5.0000000e+00 -> desc d2 Name: d2 Type: double Dimensions: (0:1, 0:1) Length: 4 Address: 108 -> desc d3 Name: d3 Type: float Dimensions: (0:3) Length: 4 Address: 140 -> quit%cat user.py class User: def __init__(self, a, b, c): self.a = a self.b = b self.c = c def __repr__(self): return 'User(%(a)d, %(b)d, %(c)f)' % self.__dict__ def makeUser(dict): return User(dict['a'], dict['b'], dict['c']) fp = pdb.open("user.pdb", "w") fp.defstr( "user", ("int a", "int b", "float c")) fp.register_class(User, "user", makeUser) v1 = User(1,2,3) fp.write("var1", v1) v2 = fp.read("var1") fp.close() print "v1 =", v1 print "v2 =", v2 %python user.py v1 = User(1, 2, 3.000000) v2 = User(1, 2, 3.000000) %pdbview user.pdb -> var1 /var1.a = 1 /var1.b = 2 /var1.c = 3.0000000e+00 Defstr ObjectA defstr type is used to define and create structures. defstr(name, members[, file]) The returned instance is also a constructor for instances of a defstr.The returned instance is also a constructor for instances of a defstr. - name name for defstr. - members sequence of type names. - file PDBfile instance. optional defaults to vif Attributes - dp - type - size_bits - size - alignment - n_indirects - is_indirect - convert - onescmp - unsgned - order_flag MethodsA defstr supports the mapping protocol plus some methods usually associated with mappings. - has_key Not Implemented - items Not Implemented - keys - values Not Implemented - get Not Implemented Examples>>> import pact.pdb as pdb >>> d = pdb.defstr('struct', ('int i', 'float j')) >>> type(d) >>> print d Type: struct Alignment: 4 Members: {int i; float j;} Size in bytes: 8 >>> a = d((3,4)) >>> a data.i = 3 data.j = 4.0000000e+00 >>> a.i 3 >>> a.j 4.0 >>> a.i = 5 >>> a.j = 6 >>> a data.i = 5 data.j = 6.0000000e+00 ----------------- >>> import pact.pdb as pdb >>> d = pdb.defstr('struct', ('int i', 'float j')) >>> a = d((3,4)) >>> fp = pdb.open('yyyy', 'w') >>> fp.defstr('struct', d) Type: struct Alignment: 4 Members: {int i; float j;} Size in bytes: 8 >>> fp.write('aaa', a) >>> fp.close() >>> ctrl-D % pdbview yyyy PDBView 2.0 - 11.22.04 -> ls aaa -> aaa /aaa(1).i = 3 /aaa(1).j = 4.0000000e+00 -> desc aaa Name: aaa Type: struct Dimensions: (1:1) Length: 1 Address: 108 -> struct struct Type: struct Alignment: 4 Members: {int i; float j;} Size in bytes: 8 Memdes Object Attributes - desc - member - cast_memb - cast_offs - is_indirect - type - base_type - name - number MethodsNone Examples SCOREhasharr and assoc both seem very similar at the Python level. Both implement the mapping protocol. The chief difference is in the data structures they build in memory. This allows the user to build the type of data structure required by PACT. For example, many graphics routines take or return an association list to describe plotting options. The application can treat the association list in a Pythonic manner by treating it as a dictionary. Memory AllocationPyPact provides a way to allocate and check memory using PACT's memory allocation routines. The void * pointer is contained in a CObject. There is no PyPact specific type/class for memory. All methods are module methods, not class methods. The CObject is a convient way to pass C pointers around and is generally only useful to methods that know what to do with it. AttributesNone Methods - zero_space(flag) - alloc(nitems, bytepitem, name) - realloc(p, nitems, bytepitem) - sfree(p) - mem_print(p) - mem_trace() - reg_mem(p, length, name) - dereg_mem(p) - mem_lookup(p) - mem_monitor(old, lev, id) - mem_chk(type) - is_score_ptr(p) - arrlen(p) - mark(p, n) - ref_count(p) - set_count(p, n) - permanent(p) - arrtype(p, type) Examples>>> p = pdb.alloc(2, 8, "array1") >>> type(p) <type 'PyCObject'> >>> pdb.arrlen(p) 16 Hash Table AttributesNone Methods - install(key, obj, type) - def_lookup(key) - clear() - has_key(key) - items - not implemented - keys() - update(dict) - values - not implemented - get - not implemented Examples>>> ht = pdb.hasharr() >>> ht["one"] = 1 >>> ht.keys() ('one',) >>> ht["one"] 1 >>> pdb.vif.chart.keys() ('defstr', 'syment', 'symindir', 'symblock', 'memdes', 'dimdes', 'hasharr', 'haelem', 'PM_mapping', 'PM_mesh_topology', 'PM_set', 'PG_image', 'pcons', 'SC_array', 'Directory', 'function', 'REAL', 'double', 'float', 'u_long_long', 'long_long', 'u_long', 'long', 'u_integer', 'integer', 'u_int', 'int', 'u_short', 'short', 'u_char', 'char', '*') >>> pdb.vif.symtab.keys() ('/', '/&ptrs/') Association List AttributesNone Methods - clear - not implemented - has_key(key) - items() - keys() - update(dict) - values - not implemented - get - not implemented Examples PMLTODO Mapping Object Attributes Methods Examples Set Object Attributes Methods Examples Field Object Attributes Methods Examples Mesh Topology Object Attributes Methods Examples PGS APIPyPact has some user callable routines to allow the developer to define their own types to PyPact. This will allow PyPact to return an instance of the correct class when reading from a file. typedef int (*PP_pack_func) (void *vr, PyObject *obj, long nitems, int tc) typedef PyObject *(*PP_unpack_func) (void *vr, long nitems) typedef PP_descr *(*PP_get_descr)(PP_file *fileinfo, PyObject *obj) PP_descr *PP_make_descr( PP_types typecode, char *type, long bpi ) PP_type_map *PP_make_type_entry( PP_types typecode, int sequence, PP_descr *descr, PyTypeObject *ob_type, PP_pack_func pack, PP_unpack_func unpack, PP_get_descr get_descr ) void PP_register_type(PP_file *fileinfo, PP_type_entry *entry) void PP_register_object(PP_file *fileinfo, PP_type_entry *entry) Developer NotesThis section focuses on areas that developers using PyPact and developers of PyPact might be interested in. Generating SourceMuch of the source code for PyPact is generated using the modulator tool from Basis. This tool generates the boiler plate that the Python API requires to connect functions and data structures together into an extension module. This tool generates new style classes. The input consists of an IDL file (interface definition file). It also reads any previously generated code to preserve changes made to certain sections of the generated source. These sections are contained between DO-NOT-DELETE splicer.begin and DO-NOT-DELETE splicer.end comments. Each generated file starts with the comment This is generated code. InstallationPyPact will be installed by dsys if shared libraries are defined. PACT's autoconf/automake system will also build the modules. Finally, a setup.py script is provided to build the module. The default method of building the extension will load the PACT libraries into the extension. This allows things to work as expected when importing PyPact from the Python executable. If, instead, Python is imbedded into an application which already has the PACT libraries loaded, then importing PyPact will result in two copies of PACT being in memory. This is not a Good Thing. In this case, the application developers will have to rebuild PyPact without loading the PACT libraries. One way to accomplish this is by editing the setup.py script to remove the libraries argument from the Extension constructor. User Defined ClassesTODO For questions and comments, please contact the PACT Development Team. Last Updated: 03/03/2007
https://wci.llnl.gov/codes/pact/pypact.html
CC-MAIN-2018-05
refinedweb
2,972
60.41
setAttribute('style', ...) workaround for IE 08 January 2007 JavaScript I knew had I heard it before but I must have completely missed it anyway and forgotten to test my new Javascript widget in IE. None of the stylesheet worked in IE and it didn't make any sense. Here's how I did it first: var closer = document.createElement('a'); a.setAttribute('style', 'float:left; font-weight:bold'); a.onclick = function() { ... That worked in Firefox of course but not in IE. The reason is that apparently IE doesn't support this. This brilliant page says that IE is "incomplete" on setAttribute(). Microsoft sucked again! Let's now focus on the workaround I put in place. First I created a function to would take "font-weight:bold;..." as input and convert that to "element.style.fontWeight='bold'" etc: function rzCC(s){ // thanks\ // retrieving-css-styles-via-javascript/ for(var exp=/-([a-z])/; exp.test(s); s=s.replace(exp,RegExp.$1.toUpperCase())); return s; } function _setStyle(element, declaration) { if (declaration.charAt(declaration.length-1)==';') declaration = declaration.slice(0, -1); var k, v; var splitted = declaration.split(';'); for (var i=0, len=splitted.length; i<len; i++) { k = rzCC(splitted[i].split(':')[0]); v = splitted[i].split(':')[1]; eval("element.style."+k+"='"+v+"'"); } } I hate having to use eval() but I couldn't think of another way of doing it. Anybody? Anyhow, now using it is done like this: var closer = document.createElement('a'); //a.setAttribute('style', 'float:left; font-weight:bold'); _setStyle(a, 'float:left; font-weight:bold'); a.onclick = function() { ... and it works in IE! node.style.cssText = "..." usually does the trick for me Really? I'll give that a try. Hooray! Thank-you. In my case, involving styles of a div element, this worked only after I append the div to the body node, but yes! Yes, this is a really short solution! Thank you all for not giving up on this topic. By the way - it's not possible to code a lot of JavaScript for HTML using the DOM only, is it? Nice !!! Thx thnx...it worked!!! thanks, it works well! BEFORE var closer = document.createElement('a'); //a.setAttribute('style', 'float:left; font-weight:bold'); _setStyle(a, 'float:left; font-weight:bold'); a.onclick = function() { ... } ---------------------- AFTER var closer = document.createElement('a'); //closer.setAttribute('style', 'float:left; font-weight:bold'); _setStyle(closer, 'float:left; font-weight:bold'); closer.onclick = function() { ... } If type 'closer' it's work Thanks Peter :D Just what I was looking for. Thanks a lot! Wow that was great buddy ! You saved me a lot of weeks. I need to personally thanks you too. Hi, it helped me to fix appending of new style values, without overwritting all previously declared ones (just those that are meant to change). Thanks. If you still don't like eval(), try this: element.style[k]= v; You know objects, arrays, objects... Thanks a lot! perfect code!!! This is great! I've improved it just a bit: _setStyle: function (aElement /* object */, aDeclaration /* CSS Declaration */) { try { if (aElement) { aDeclaration = aDeclaration.replace(/\s+/g,''); // remove all white spaces if (document.all) { // IE Hack if (aDeclaration.charAt(aDeclaration.length-1)==';') aDeclaration = aDeclaration.slice(0, -1); var k, v; var splitted = aDeclaration.split(';'); for (var i=0, len=splitted.length; i<len; i++) { k = rzCC(splitted[i].split(':')[0]); v = splitted[i].split(':')[1]; eval("aElement.style."+k+"='"+v+"'"); } return (true); } else { // The clean way aElement.setAttribute ('style', aDeclaration); return (true); } } } catch (e) { return (false); } } Hope you like it. Good job mate ;) I forgot to tell why I decided to "improve" it: if you put a white space in the css declaratio, such: background-color: #FFFFFF; the original code will miss it. You had to put it together for it to work, like: background-color:#FFFFFF; Oh, and the function declaration in my version is for prototype. If you don't use this technique just change the declaration to: function _setStyle (aElement /* object */, aDeclaration /* CSS Declaration */) That's it. Cheers! I found myself having issues with this same problem today and have found out a few interesting things. In IE (they just have to be different don't they) the style attribute is actually treated as an Element. You can set the different style properties by using the syntax shown below. oNewDiv = createElement('div'); oNewDiv.style.setAttribute('border', '1px solid #000'); oNewDiv.style.setAttribute('backgroundColor', '#fff'); Of course, this fails terribly in firefox :( However, I have always been able to set styles without the setAttribute function in a cross browser supported way like: oNewDiv.style.backgroundColor = '#fff'; This won't work at all for me, using IE 7 or 8.. eval() is devil. this workaround is not going to help. infact it will hang your IE and fill your memory with bunch of variables. If you code little smart using conditions if(document.all) { code here }else{ code here } then everything will be cool. I've tried and it's working in all browsers. Try using cssText for ie. Element.style.setAttribute('cssText', 'left:150px;......... you could create function if you wanted. thanks very very very much! I have added this code: if(k=='class') { eval("element.className='"+v+"'"); } @ivo van der Wijk=You're a genius man!!! I know it sounds very exagerrated but what the hell... u just saved me a couple of hours of searching Hi, Try this: var closer = document.createElement('a'); a.style.float="left"; a.style.fontWeight="bold"; a.onclick = function() { ... It works on all browsers !! Enjoy it !! Hi Quiquelie, Your code is cool thanks :) i was literally searching for onclick cross browser functionality Hi, how is this? element.style[k]= v; instead of eval(...) Cool!! thxs! Works like a charm! I definitely needed this dynamic!! Thanks so much! I like how you automatically escaped the newline in the commented code ;-P set one or more objects to one or more styles {obj1,obj2...},{"color":"red","fontSize":"small","fontFamily":"Cursive"...} works in FF,IE,Safari function a_obj_setstyle(a_obj,a_prop){ for (ko in a_obj){for(kp in a_prop){ eval('a_obj[ko].style.'+kp+'="'+a_prop[kp]+'"'); }} } OMG, your a very smart, you just saved my ass, my client was going to kill me ,, lol Thanks a lot body ;) This is how it works in IE oImg.style.cssText="float:left;margin-right:7px;margin-bottom:7px"; The simple solutions are always the best. Thanks NICE! THAAAAANXXXXXX!!!! You're the best web programmer!!!!! I hate IE... Thanks a lot!!!! Hello guys, If you have short form in your style like : font: normal normal bold xx-small verdana, serif; This cut function will cut the spaces and mix the css --> font:normalnormalboldxx-smallverdana,serif; Oh thats work great... thankssssssss..... I had a similar issue with setAttribute not working on IE. I put it in a try block, and in the catch block I used outerHTML for the IE version. outerHTML is read/write, so my function could dynamically get the code of the existing control, and then replace whatever had to change. One quirk is that IE rewrites the control's code in outerHTML, so I had to work around that a little, but it worked. thanks ur code, but if i want to remove one of css that i added, how can i do that???? document.getElementById('name').className = "yourClass"; People, DO NOT USE eval(). Especially not in such an easy cases. eval("element.style."+k+"='"+v+"'"); is almost identical (I'll explain) to this: element.style[k] = v; When you create an object: var obj = { a: 1, b: 2, c: 3 }; You can (get or) set the values like: obj.a = 10 which is identical to: obj["a"] = 10 As to where that eval("element.style."+k+"='"+v+"'"); differs from the direct method is that if you'd try to set for example a background image, this'd be the css: background-image: url('/images/someImage.png') If you use that in the eval, this is the code that'll be evaluated: element.style.backgroundImage='url('/images/someImage.png')' Which obviously results in a syntax error because of the single quotes. Of course that could be solved by first replacing \ into \\ and then ' into \'. Eval is evil, there are rarely ever situations where there's need for eval, and even if there are try your absolute best to find a way around. Such a small change avoids: 1. The performance hit you have from using eval() 2. Making your code less secure (for example, if some 3rd party code executes: _setStyle(someElement, "width: 10px' alert('My evil message, muauauauaua') var rndDump = '; height: 10px;"), it would of course run the injected code) 3. Spreading bad code like this across other people's sites, possibly harming the identity and privacy of people browsing the web. It's been many years since I wrote that but I think the point is that the stupid eval was necessary because of IE. Then again, I've stopped caring about it working in IE. Unless you're doing commercial work that's always a good choice :P. Nevertheless even in IE this eval wasn't necessary :). And I also know that this is an old article, but these are still the articles beginners find when they run into this issue, and that's why I made the comment. Event at my old company where I had co-workers who all finished collage for web development, and they still didn't know how to write proper javascript and had all sorts of hacky scripts like this one in their code.
http://www.peterbe.com/plog/setAttribute-style-IE/
CC-MAIN-2014-10
refinedweb
1,593
68.06
This is a very basic question, but I can't seem to find the answer anywhere. In a Scala method with no return value, how can I exit the method prematurely? For example, def printPositiveNumbersSum (n1: Int, n2: Int) = { if (n1 < 0 || n2 < 0) // How do I break out of this method here? println(n1 + n2) } return printPositiveNumbersSum Basic questions have a habit of being more interesting than they look. There are a couple of ways to approach this which are possibly worth considering as alternatives. The foundation though, is that everything returns a value of a certain type, and the compiler tries to figure out what that type is. In your case printPostiveNumbersSum returns something of a certain type. Unitmeans a function, or piece of executable code. This answer has already been mentioned. Consider returning an Option[Int] for the sum. If the validation succeeds, you return Some(sum) and if it fails you return None. The caller can then decide what to do in the case of failure, perhaps using a match { case Some(sum)... construct. def positiveNumbersSum (n1: Int, n2: Int): Option[Int] = { if (n1 < 0 || n2 < 0) None else Some(n1 + n2) } But in more complex cases, when you may have more rules to consider, it can be handy to return the reason for the failure rather than just returning a None. In this case, I find Either handy. You get to specify two return types. Again, the caller can differentiate with a match { case Left(reason)... case Right(sum)... construct. def positiveNumbersSum (n1: Int, n2: Int): Either[String,Int] = { if (n1 < 0 || n2 < 0) Left("One of the numbers is negative") else Right(n1 + n2) }
https://codedump.io/share/Cc0q63J96AsK/1/how-to-break-out-of-or-exit-a-void-method-in-scala
CC-MAIN-2017-47
refinedweb
280
72.46
04 October 2012 04:12 [Source: ICIS news] SINGAPORE (ICIS)--The fire at ExxonMobil's complex at ?xml:namespace> The US-based oil and gas company did not elaborate on which unit was affected. The fire started at around 17:00 hours local time (22:00 hours GMT) on Wednesday, it said in a statement. No injuries were reported and everyone is accounted for, according to ExxonMobil. The complex has a 584,000 bbl/day refinery and two chemical plants that make butyl rubber and polypropylene (PP). ExxonMobil has been conducting air quality monitoring around the refinery complex and in the community and results revealed there was no adverse impact to the site and surrounding community. “We deeply regret any disruption or inconvenience that this incident may have caused the community,” ExxonMobil said. “A thorough investigation will be carried out to determine the cause of this incident,” it added. With
http://www.icis.com/Articles/2012/10/04/9600883/fire-at-us-exxonmobils-baytown-complex-limited-to-a-process-unit.html
CC-MAIN-2014-42
refinedweb
150
53.61
Pidgin is a multi-protocol instant messaging client.: To install the port: cd /usr/ports/net-im/pidgin/ && make install cleanTo add the package: pkg install pidgin cd /usr/ports/net-im/pidgin/ && make install clean pkg install pidgin PKGNAME: pidgin ONLY_FOR_ARCHS: nil NOT_FOR_ARCHS: nil distinfo: TIMESTAMP = 1489472185 SHA256 (pidgin-2.12.0.tar.bz2) = 8c3d3536d6d3c971bd433ff9946678af70a0f6aa4e6969cc2a83bb357015b7f8 SIZE (pidgin-2.12.0.tar.bz2) = 9270704 NOTE: FreshPorts displays only information on required and default dependencies. Optional dependencies are not covered. This port is required by: ===> The following configuration options are available for pidgin-2.12.0_2: BONJOUR=on: mDNS support CAP=on: Contact Availability Prediction plugin DBUS=on: D-Bus IPC system support GNUTLS=off: Use GNUTLS for encryption support GSTREAMER=on: Use GStreamer for playing sounds GTKSPELL=on: Spell checking support IDN=on: International Domain Names support NSS=on: Use Mozilla NSS for encryption support PERL=off: Perl scripting language support SASL=off: Cyrus SASL support (for jabberd) TCLTK=off: Tcl/Tk GUI toolkit support VV=on: Video and voice support ====> Options available for the group PROTOCOLS AIM/ICQ/Oscar protocol QQ=on: The Tercent QQ chat protocol SIMPLE=on: The SIMPLE chat protocol ZEPHYR=on: The Zephyr chat protocol ===> Use 'make config' to modify these settings python:build cpe gettext gmake libtool pathfix pkgconfig tar:bzip2 ncurses gnome Number of commits found: 69 Update to 2.12.0. See for a list of changes in this release. Update to 2.11.0. See for a list of changes. Remove ${PORTSDIR}/ from dependencies, categories m, n, o, and p. With hat: portmgr Sponsored by: Absolight Grrr, remove an .endif no longer needed. Use a better Perl fix. PR: 205951 Submitted by: Piotr Kubaj Only do the Perl fix if Perl is enabled. Reported by: Mike Harding <mvharding@gmail.com> Update to 2.10.12. See for changes in this release. 2.10.11 and fix the build with the ncurses port. Submitted by: Matthias Apitz <guru@unixarea.de> (ncurses fix) 2.10.10 With hat: ports-secteam Security: d057c5e6-5b20-11e4-bebd-000c2980a9f3 Finish stage support Bump more ports that depend on libsqlite3.so: - ports that set USE_SQLITE with the *_USE option helper - ports that depend on libsqlite3 indirectly as reported by pkg rquery Approved by: portmgr (implicit) Fix gettext detection. PR: 190299 Strip libraries. Requested by: mand. USES_GNOME=gnomehack -> USES=pathfix Approved by: marcus@ (maintainer) Update to 2.10.8. See for a list of changes in this release. While here, convert to STAGE and update LIB_DEPENDS. - Remove manual creation and removal of share/applications, as it's now in the mtree (categories starting with [np]) Approved by: portmgr (bdrewery) Add NO_STAGE all over the place in preparation for the staging support (cat: net-im) Fix a crash with the cap plugin. PR: 176851 Submitted by: Ivan Klymenko <fidaj@ukr.net> Update to 2.10.6. - update png to 1.5.10 Update Pidgin and friends to 2.10.0. See for a list of changes in this release. Fix a bug where chat rooms/channels can appear multiple times. This is taken from . PR: 158814 Submitted by: Armin Pirkovitsch <armin@frozen-zone.org> Update Pidgin and friends to 2.9.0. See for a list of changes in this release. Update to 2.8.0. See for a list of changes. Update to 2.7.8, and modify plist to play nicely with net-im/mbpurple. PR: 153417 Submitted by: dougb Update to 2.7.4. See for a list of changes. Update to 2.7.3. See for a list of changes. Update to 2.7.1. See for a list of changes. [1] Also, add a patch to fix compatibility with ICQ 6. [2] PR: 147758 [1] Submitted by: pluknet <pluknet@gmail.com> [1] (based on) Eugene Dzhurinsky <bofh@redwerk.com> [2] Obtained from: [2] Bump PORTREVISION and add USE_GETTEXT where missing. PR: 147257 Remove the NLS hooks I missed in the initial commit. NLS support is required. Update Pidgin and friends to 2.7.0. See for the list of changes. Also, enable Tcl 8.5 support. PR: 146607 Submitted by: dougb - update to 1.4.1 Reviewed by: exp8 run on pointyhat Supported by: miwi Updat to 2.6.6. See for a list of changes. Feature safe: yes - update to jpeg-8 Update to 2.6.4. See for a list of changesi n this release. PR: 141082 Submitted by: doubg (based on) Update to 2.6.2. See for a list of changes in this release. Allow these ports to report the correct set of protocol modules. PR: 138042 Submitted by: Naram Qashat <cyberbotx@cyberbotx.com> Update to 2.6.1. See for a list of changes. Correct plist when dbus is not installed. PR: 137670 - bump all port that indirectly depends on libjpeg and have not yet been bumped or updated Requested by: edwin Update to 2.5.4. * Add OPTIONS for all of the dynamic chat protocol modules * Add plist support for WITHOUT_GNUTLS * Add the myspace chat protocol * Install the man pages See for a list of release changes. PR: 130488 Submitted by: dougb Update to 2.5.3. See for a list of changes. Update to 2.5.1. See for a list of changes in this release. Update to 2.5.0. See for a list of changes in this release. Update to 2.4.3. See for a list of changes. Submitted by: dou libSM. Reported by: Kris Moore <kris@pcbsd.org> * Update distinfo with new checksum. This distfile was re-rolled to fix a configure script generation problem * Add a missing dependency on xscrnsaver for pidgin [1] Reported by: pointyhat via pav [1] Update to 2.4.2. See for the list of changes. Update to 2.4.0. See for a list of changes. Update pidgin to 2.3.1, and chase the shared lib version bump. See for the list of changes. Update to 2.2.2. See for all of the.) Update to 2.1.0. fficiency. ) * Update to 2.0.2 * Make GnuTLS the default SSL provider (over NSS) to avoid crashes reported by some users Remove some leftover directories. Reported by: pointyhat via kris pidgin after a repocopy from net-im/gaim-devel. Pidgin is the new name for the Gaim instant messenger client. See for more details on the name. This is a direct upgrade for gaim-devel users from 2.0.0.b6 to 2.0.0.b7. Servers and bandwidth provided byNew York Internet, SuperNews, and RootBSD 13 vulnerabilities affecting 73 ports have been reported in the past 14 days * - modified, not new All vulnerabilities
http://www.freshports.org/net-im/pidgin/
CC-MAIN-2017-26
refinedweb
1,107
70.29
Native Cross-Platform Apps with Tabris Tabris is the first Java toolkit for the cross-platform development of native mobile applications. It combines native user experience with tailor-made, native controls and functions. But what exactly does native mean? The wide range of existing platforms available poses a genuine problem when currently developing mobile applications. These are a dream for end-users who can access a wide range of hardware and software, but a nightmare for developers. As soon as mobile App developers have to develop an App for more than one platform, they face a wide range of challenges. One of the most difficult challenge is fulfilling the necessary expertise. Even if we “only” consider both of the market-leading platforms, iOS and Android, this means the following: - Being proficient in 2 programming languages: Java and Objective-C. - Mastering two platforms with different APIs. - Planning one (or two) application design(s) that take both platforms into consideration. In brief, if you develop ‘natively’ separately for each platform, the effort required to develop a mobile application more or less increases with the number of platforms supported. Luckily, cross-platform toolkits provide an excellent alternative. Currently, there are two different types of cross-platform toolkits. On one hand, the HTML-based toolkits and, on the other, toolkits based on the cross-platform compilation or interpretation of native controls and functions. PhoneGap clearly dominates the first category and uses HTML to display the UI. The unquestionable charm of this solution is the speed with which a simple App can be developed. However, the HTML5 trend has lost some of its appeal lately, mainly because of dissatisfied end-users and prominent failures, such as Facebook. As far as user experience is concerned, HTML5 can easily become a burden when developing mobile Apps. Unlike Web applications, mobile applications are usually equipped with highly-sophisticated controls (widgets). Although HTML5 toolkits such as JQuery Mobile offer similar features to operating system widgets, for this purpose they require a composition of several elements for each widget. In the case of more complex user interfaces, this leads to a multitude of DOM elements and may negatively influence the App’s performance. Widget-oriented or not, most HTML-UIs do not provide a satisfactory user experience, as the application generally looks and feels unfamiliar. This lack of familiarity ranges from the look and feel of the widgets to unfamiliar navigation concepts and animations. The second category of cross-platform toolkits uses operating system widgets, hence avoiding look&feel problems. Apps created with this kind of technology are visually much closer to the native interface than HTML-UIs. However, these solutions also pose various challenges. To successfully develop a native App, it is not enough to display native widgets. The user navigation must also reflect the platform-specific concepts. In the case of native App development, the developer has access to the relevant platform concepts for designing the application. In the case of iOS, this is the ‘ViewController’ principle, for Android ‘Activities’ and the ‘ActionBar’. Only a few cross-platform toolkits abstract these concepts and unify them. This is exactly where Tabris comes in. Basically, Tabris falls into the second category of cross-platform toolkits. It abstracts native controls and their functionality with a Java-API. These include simple elements, such as buttons or text fields, but also more complex elements such as a tree/list or a swipe-widget. In addition to the controls, it also provides Java-APIs for controlling the device's camera or getting geolocation information. Another fundamental feature of Tabris is the abstraction of native navigation concepts, called the Tabris UI. The UI is kept very simple and consists of just two core components. These are the Page and Action types. The best way to explain these types is using a screenshot. (Click on the image to enlarge it) This image shows how the same application is displayed on an iOS and an Android device. The actual content of the application is identical. Only the integration with the platform-typical framework is different. The area marked in red represents a Page. A Page is a kind of container for controls. The area marked in green represents two Actions. Conceptually, an Action represents a possible user interaction that is in relation to the application or to a Page. To create a complete application with these types, they have to be connected to one another. The first connection is the so-called flow. The flow describes a chain of pages that can be put together in various ways. To create this kind of a flow, a Page has to take on a role. Possible roles are top-level page and normal page. A top-level page marks the start of a flow and does exist only once. A normal page can exist once or several times within the flow, but not at the start. This is easily explained using the following diagram. (Click on the image to enlarge it) The above diagram shows a typical application flow. In this case, the application consists of three top-level pages and several normal pages. A user can now navigate between the individual pages, e.g by using an Action. At this stage it is important that flows can be traversed in different orders, as explained in the following example. Let's assume that you wish to develop a “Book Shop App”. In this case, a book is the central element of the application. Hence, the user must be able to easily navigate between different books. A feature that has helped Amazon generate considerable additional revenue is collaborative filtering. i.e. “Customers that bought this book, also bought these other books”. With this functionality a user can navigate from book to book. The length of this navigation chain is thereby not restricted. However, what is required is the ability to navigate backwards, either to the previous book or back to the start page. The flow of the Tabris UI enables this kind of navigation. A flow can have any, non-fixed depth. A forward navigation is possible at any time. However, this means that the start of a flow has to have a fixed definition. In our book sample, that would be, for example, a list of bestseller books. The second concept, the Action, is also connected to the pages. Typically, an action encapsulates application functionality. In the book example, this could be adding a book to the shopping basket or a search. These two activities also directly describe the possible action scope: an Action has either Page or global scope. It is also connected with a Page or with the whole application. A search is an example of a global action as it should be accessible from everywhere in the application. Unlike that, it should only be possible to add a book to the shopping basket when the user is on a book page. A complete application-flow for a book shop could look like this: (Click on the imge to enlarge it) The screenshots show the same application both for Android and iOS. The App consists of three top-level pages: “All Books, Popular and Favorites”. Each of these top-level pages shows a list of books. Upon selection, one of the books is shown in the detailed view. From there, the end-user can either access further books or a sneak preview. The code of this application is available on GitHub. To see this application in action you can also take a look at this video. After we have discussed the navigation concepts of the Tabris UI, we want to also discuss the widgets that make up the intrinsic part of the application. In the process, Tabris makes use of the API of the established cross-platform widget-toolkit SWT (Standard Widget Toolkit). SWT is lightweight, widespread, open source and uses JFace to provide a powerful MVC framework. The list view of the bookstore shown above can, for example, be implemented with just a few lines of code. public class BooksListPage extends AbstractPage { public void createContent( Composite parent ) { TreeViewer viewer = new TreeViewer( parent, SWT.V_SCROLL ); viewer.setContentProvider( new BooksContentProvider() ); viewer.setLabelProvider( new BooksLabelProvider() ); addBookSelectionListener( viewer ); ... public class BooksContentProvider implements ITreeContentProvider { public Object[] getElements( Object inputElement ) { return books.toArray(); } ... public class BooksLabelProvider implements ITableLabelProvider { public String getColumnText( Object element, int columnIndex ) { String result = null; if( columnIndex == 0 ) { if( element instanceof Book ) { result = ( ( Book )element ).getTitle(); ... As well as the conciseness of the API, further advantages of using the SWT are the availability of documentation, examples and support in the Eclipse Community. The handling of big data, the modular design of the application with OSGi and the integration of model-based user interfaces are all part of Tabris’s standard repertoire. The underlying architecture enables the simple integration with established Java technologies. The thin-client architecture of Tabris can certainly be compared with a Web server and a Web browser, with the Web application logic being executed on the server side. The accompanying UI is delivered in HTML and rendered in the browser. In the case of Tabris, the application logic is also executed on a server, e.g on a JEE application server. A native client, for example, a tablet is connected to the server and receives the representation of the UI in the form of JSON. But instead of an HTML-based UI, the Tabris clients render native widgets and hence create a platform-specific user experience. Like Web applications, mobile clients always need to be connected to the server. For some applications this is an unacceptable restriction, but for others this can be a real advantage. Data is only transferred in order to create the interface. The clients do not execute any application logic at all, they merely serve to display the UI. What’s more, this means that no sensitive application data or algorithms are saved on the mobile end devices, protecting these implicitly from theft or other kinds of loss. An additional interesting advantage of the architecture and the underlying open communication protocol 1, is the simple addition of different clients. For example, in addition to the mobile clients there are also open source Web and Desktop clients. Some clients, for example, based on Windows CE or for limited embedded devices such as cash registers can be implemented simply with a reduced widget set, therefore enabling new application and migration paths. Version 1.0 of Tabris has been available since April, 2013. The server components, plus the Web and Desktop client are covered by the Eclipse Public License and can be freely used in commercial products. Only the mobile clients are covered by a commercial license. To personally test and evaluate the wide range of possibilities for Tabris, mobile clients are available for download from the project's website 2. About the Authors Jochen Krause is a member of the Board of Directors of the Eclipse Foundation. He is CEO of EclipseSource, a recognized leader in Eclipse distribution and OSGi runtime technologies. Jochen has had a leadership role in the Eclipse community since its inception in 2002, and has served in many roles from project lead to member of the architecture council and PMC lead. Holger Staudacher works as a software developer and consultant at EclipseSource in Karlsruhe, Germany. He is responsible for Tabris and one of the core team of committers on the Eclipse Remote Application Platform (RAP) project. Holger also authored the popular restfuse framework for testing REST APIs. He is interested in anything to do with Agile, clean code and distributed systems. Its not "the first Java toolkit for the cross-platform development of native mobile applications" by Shai Alm
http://www.infoq.com/articles/tabris
CC-MAIN-2015-14
refinedweb
1,949
56.15
20 February 2008 10:35 [Source: ICIS news] ?xml:namespace> (adds updates throughout) SINGAPORE (ICIS news)--Samsung Engineering has signed additional procurement and construction contracts with Saudi Kayan Petrochemical worth $341m (€232m) to build a polypropylene (PP) plant as part of a new petrochemicals complex at Al-Jubail, a company spokesman said on Wednesday. Its earlier $49m engineering contract for the project had been converted to a lumpsum turnkey basis, the spokesman said, adding that this was the first of seven projects at Kayan to be converted. Samsung signed the other two contracts with Kayan for the project’s construction and procurement, he said. One of the won (W) 239.2bn ($253.3m) orders was signed with the South Korean group, while the other $88m contract was concluded with Samsung’s subsidiary in Saudi Arabia, the spokesman, who declined to be named, added. The 350,000 tonne/year project, which would be based on Basell's technology, would be completed by the end of August 2009, he said. Samsung also won a contract in May last year to build an amines plant for Kayan and both were in talks to convert this to lumpsum turnkey basis, he added. The PP plant will form part of Saudi Kayan’s $10bn petrochemicals complex at Al-Jubail, which is slated to make 4m tonnes/year of chemicals, including propylene, PP, ethylene glycol and butane-1. Saudi Basic Industries Corp (SABIC) owns a 35% stake in Saudi Kayan, while Kayan has 20%. The remaining 45% is held by public shareholders. ($1 = W944.23/€0.68)
http://www.icis.com/Articles/2008/02/20/9102144/samsung-wins-341m-saudi-pp-plant-deal.html
CC-MAIN-2015-06
refinedweb
261
65.96
The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. Adds a node to the end of the list of children of a specified parent node. .attributes is a collection of all attribute nodes registered to the specified node. .attributes is a collection of all attribute nodes registered to the specified node. It is a NamedNodeMap,not an Array, so it has no Array methods and the Attr nodes' indexes may differ among browsers. To be more specific, attribute is a key value pair of strings that represents any information regarding that node; it cannot hold Object. Attribute can hold additional data/information that is required while processing custom JavaScript. There are many predefined attributes for different nodes used for binding events, validations, and specifying layout informations that are handled by browser (may vary from browser to browser). MDN Returns a live NodeList containing all the children of this node. Clone a Node, and optionally, all of its contents. Compares the position of the current node against another node in any other document. Returns a Boolean value indicating whether a node is a descendant of a given node, i Returns the node's first child in the tree, or null if the node is childless. hasAttributes returns a boolean value of true or false, indicating if the current element has any attributes or not. hasChildNodes returns a Boolean value indicating whether the current Node has child nodes or not. Inserts the first Node given in a parameter immediately before the second, child of this element, Node. isDefaultNamespace accepts a namespace URI as an argument and returns true if the namespace is the default namespace on the given node or false if not. If #targetElm is first div element in document, "true" will be displayed. Tests whether two nodes are the same, that is they reference the same object. The Node.isSupported()returns a Boolean flag containing the result of a test whether the DOM implementation implements a specific feature and this feature is supported by the specific node. Returns a Node representing the last direct child node of the node, or null if the node has no child. Returns a DOMString representing the local part of the qualified name of an element. Returns a DOMString representing the local part of the qualified name of an element. In Firefox 3.5 and earlier, the property upper-cases the local name for HTML elements (but not XHTML elements). In later versions, this does not happen, so the property is in lower case for both HTML and XHTML. Though the specification requires localName to be defined on the Node interface, Gecko-based browsers implement it on the Element interface. MDN Takes a prefix and returns the namespaceURI associated with it on the given node if found (and null if not). Returns the prefix for a given namespaceURI if present, and null if not. The attribute's name. The attribute's name. MDN The namespace URI of this node, or null if it is no namespace. The namespace URI of this node, or null if it is no namespace. In Firefox 3.5 and earlier, HTML elements are in no namespace. In later versions, HTML elements are in the namespace in both HTML and XML trees. Though the specification requires namespaceURI to be defined on the Node interface, Gecko-based browsers implement it on the Element interface. MDN Returns the node immediately following the specified one in its parent's childNodes list, or null if the specified node is the last node in that list. Returns a DOMString containing the name of the. MDN The read-only Node.nodeType property returns an unsigned short integer representing the type of the node. Is a DOMString representing the value of an object. Is a DOMString representing the value of an object. For most Node type, this returns null and any set operation is ignored. For nodes of type TEXT_NODE (Text objects), COMMENT_NODE (Comment objects), and PROCESSING_INSTRUCTION_NODE (ProcessingInstruction objects), the value corresponds to the text data contained in the object. MDN Puts the specified node and all of its subtree into a "normalized" form. Returns the Document that this node belongs to. The element holding the attribute.. MDN Returns a Node that is the parent of this node. A DOMString representing the namespace prefix of the attribute, or null if no prefix is specified. Returns the node immediately preceding the specified one in its parent's childNodes list, null if the specified node is the first in that list. Removes a child node from the current element, which must be a child of the current node. Removes the event listener previously registered with EventTarget.addEventListener. Removes the event listener previously registered with EventTarget.addEventListener. MDN Replaces one child Node of the current one with the second one given in parameter. This property now always returns true. This property now always returns true. MDN Is a DOMString representing the textual content of an element and all its descendants. The attribute's value. The attribute's value. MDN. MDN
https://www.scala-js.org/api/scalajs-dom/0.9.5/org/scalajs/dom/raw/Attr.html
CC-MAIN-2022-33
refinedweb
845
57.37
working trafficlight! Kelsey kelskjs Ranch Hand Joined: Nov 07, 2003 Posts: 36 posted Feb 09, 2004 13:45:00 0 Hello. I am new to JAVA and I am really confused by this problem that I am trying to work on..I am supposed to write a program using BlueJ to create a stoplight with a black rectangle as its base and three individual lamps inside, a red, yellow and green lamp that each turn on and off and when they turn off and another color turns on...they must return to being black. I have no idea how to go about this...all I know is that these methods should be used..can someone please help me get on the right track? I am supposed to create a Lamp class and a TrafficLight class...and the MyApp class is as below: import OOPS.SP.*; public class MyApp extends OOPS.SP.Frame { private Simulation _light; public MyApp() { // initialize instance variables _light = new Simulation(); _light.runSimulation(30); } /** * Method to run the program */ public static void main( String [] argv) { new MyApp(); } } And this is the Simulation class... public class Simulation { // instance variables private TrafficLight _light1; private TrafficLight _light2; /** * Constructor for objects of class Simulation */ public Simulation() { int startCycleTime, timeLightStaysOn; // initialize instance variables _light1=new TrafficLight(50,50); _light2=new TrafficLight(250,50); _light1.setCycleTimes(7,2,5); _light2.setCycleTimes(10,3,7); } /** * An method to run the simulation for the specified time * * @param time amount of time to run simulation */ public void runSimulation(int time) { int startCycleTime, timeLightStaysOn; for (int currTime=1; currTime<time; currTime++) { startCycleTime = _light1.getWhenLastChanged(); timeLightStaysOn = _light1.getTimeOn(); if ((currTime-startCycleTime) >= timeLightStaysOn) _light1.cycle(currTime); startCycleTime = _light2.getWhenLastChanged(); timeLightStaysOn = _light2.getTimeOn(); if ((currTime-startCycleTime) >= timeLightStaysOn) _light2.cycle(currTime); } } } Now I am supposed to create a Lamp class with the following in it... Class Lamp Instance variables: � The color of the light bulb, or glass cover of the light bulb. It should be of type java.awt.Color . � The circle that represents the light bulb. It will be black when turned off and the specified color when turned on. � An int to specify how long the light should stay on. Note: for realism the time the red lamp is on should be the sum of the times for the yellow and the green lamps. Methods: � Lamp() � A default constructor which places the lamp at the center or the frame. The lamp is red, and the lamp is set to off. The time on is set to 1. � Lamp(int x, int y) � A constructor, which sets the lamp to an arbitrary color, instantiates the circle, specifies that the lamp is off, and that the time on is 1, and the next lamp to itself, or 0. The lamp is placed at position (x,y), where x,y defines the position of the upper left corner of a square which circumscribes the circle. � Lamp( java.awt.Color , int x, int y) - A constructor, with a parameter for the color which stores the color of the lamp, and creates a lamp which is on and of that color, the time is again set to 1, and the next lamp is set to itself or 0. � void turnOn() - A method to turn the lamp on. � void turnOff() - A method to turn the lamp off. � void setTimeOn(int) - A method to set the value of the time the light is on, again it will take one parameter, which is the time to be used. � int getTimeOn() - A method to return the time the light is to be on And then the trafficLight class with the following... Class TrafficLight The traffic light consists of a black box that holds three lamps (from top to bottom: red, yellow, green). Instance variables: The black box for the traffic light. The three instance variables of type Lamp, one for the red light, one for the yellow light, and one for the green light. The time the light last changed, which is an int. The lamp that is on, which can be an int, a java.awt.Color , or a Lamp. Methods: � TrafficLight() - The default constructor, which will construct the light with its three lamps in their correct position based on the lamp being in the center of the screen. It will also set the red light on, and the time the light last changed to 1. � TrafficLight(int x, int y) - The default constructor, which will construct the light with its three lamps in their correct position based on the upper left corner of the lamp being at position (x,y) on the center of the screen. It will also set the red light on, and the time the light last changed to 1. � void cycle(int) � This method will cycle the lights, by turning the current light which is on to off, and turning the next light that should be turned on to on. Note: It will enforce the cycle pattern : red ->green; green -> yellow, and yellow -> red. It will also store the int into the time when the light last changed. � int getWhenLastChanged() � This method will return the time when the light last changed. � int getTimeOn() � This method will return the time the light which is currently on is supposed to stay on. � void setCycleTimes(int red, int yellow, int green) � This method will set the instance variables for the time the lamp is to be on, in each instance of the lamps, to the appropriate values. The time on for the red lamp will be set red. The time on for the yellow lamp will be set to yellow, and the time on for the green lamp will be set to green. Please help me understand how to implement these all together and how to create a class based on the definitions above. I am not asking for the answer necessarily, I just need a frame to work from...please help me... Kelsey kelskjs Ranch Hand Joined: Nov 07, 2003 Posts: 36 posted Feb 09, 2004 14:14:00 0 I'm sorry I didn't know I couldn't post in more than one forum to get help...its just that I'm really worried about this and I can't figure it out...I just wanted someone to help me...please....I'm sorry I didn't know the rules of this site, I guess... Mark Vedder Ranch Hand Joined: Dec 17, 2003 Posts: 624 I like... posted Feb 09, 2004 20:52:00 0 Kelsey You are asking quite a lot in your post. As a result many people here are not going to want to tackle it all. Also since this is a homework assignment, for obvious reasons, no one is going to do the all work for you. I know you said I am not asking for the answer necessarily, I just need a frame to work from , but we need you to provide something that you have done and we can help guide you with problems you run into. Why don�t we start with one thing and go from there... Let�s start with the Lamp class since the TrafficLight class needs do have instance variable of type Lamp. Try creating a skeleton of the class with the information/requirments you have, post it and I or someone else can help you fine-tune it. For example, lets say I was told to create a Line class that has two instance variables of type Point and a default constructor of Line(), a constructor which takes the two points, a method to set & get each point, and getLength() method to get the length of the line. A skeleton of the class would look like this: import java.awt.Point; public class Line { //instance variables Point startPoint; Point endPoint; //default constructor public Line() { } //constructor using points public Line (Point startPoint, Point endPoint) { } public Point getStartPoint() { } public void setStartPoint(Point startPoint) { } public Point getEndPoint() { } public void setEndPoint(Point endPoint) { } public double getLength() { } } Try reading through your requirements for the Lamp class and create a skeleton and then post it for review. If you run into problems, post what you have so far and what problems you are encountering and I or someone else can help you out. Regards, Mark Jeroen Wenting Ranch Hand Joined: Oct 12, 2000 Posts: 5093 posted Feb 10, 2004 00:57:00 0 Of course the traffic light itself is relatively simple... Where it gets interesting is in the interaction between all the traffic lights on an intersection. Make sure the correct ones are triggered in the correct sequence with some interval to make sure no collisions occur. Then add some traffic... 42 Ben Dover Ranch Hand Joined: Jan 30, 2004 Posts: 91 posted Feb 11, 2004 07:26:00 0 It sounds like your problem is not the traffic lights, but your general Java / OOD knowledge. Focus on learning these basic principles and then come to the problem with a fresher perspective. I agree. Here's the link: subject: Creating a working trafficlight! Similar Threads Images don't show up with first click Creating a working traffic light!! Reg Assertions javadoc format colors Creating a working traffic light! All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter JForum | Paul Wheaton
http://www.coderanch.com/t/372865/java/java/Creating-working-trafficlight
CC-MAIN-2014-52
refinedweb
1,549
70.53
In our previous tutorial we learnt how to install python on our windows machine and how to interface Arduino with python using a simple LED control project. If you are new, I would strongly recommend you to fall back to the previous tutorial since this tutorial is a continuation of the same. You might have already started to wonder why we would need python with Arduino if all that it could do is simply communicate over serial port. But, Python is very strong development platform on which a lot of cool applications in which machine learning, computer vision and much more can be integrated. In this tutorial we will learn How we can Create a Small Graphical Interface Using Python. To do this we will need a module called Vpython. The following tutorial is applicable only for windows user since for Mac or Linux user, the procedure is different. At the end of this tutorial we will learn how we can create simple GUI using Python. We will make a small animation which responds to the value of Ultrasonic sensor that is attached to the Arduino. This application tracks the object using Ultrasonic sensor and displays it in Graphical form on computer using VPython. As we move the object, Ultrasonic sensor senses the distance and sends this information to Python program using Arduino and it will move the object in the computer too. Sounds interesting right! So let get started... Pre-requisites: - Arduino (Any version) - Ultrasonic Sensor HC-SR04 - Connecting Wires - Computer with Python - Knowledge on previous tutorial Installing VPython on your Computer: In our previous tutorial we have already learnt how to install python on your machine and how to move around it and create a simple program with Arduino. Now we have install Visual Python (VPython) on top of this so that we can create cool Graphics using Python for Arduino. For the simple steps below to get started with VPython Step 1. Make sure Python is already installed as per previous tutorial guidelines. Step 2. Click on VPython to download the exe file for Visual Python. Do not opt to install a 64–bit version even if your machine runs on 64-bit. Just follow the link given. Step 3. Launch the exe file and follow the setup. Do not change the default directory path and make sure you have selected “full installation”. Step 4. Once installed, you should find a new application named “VIDLE(VPython)” on your desktop or application panel as shown below. Note: VIDLE for VPython is different from IDLE for python Step 5. Launch the application and you should get a window as shown below. Step 6. This is the window where we will be typing in the program for VPython. But, for now let us check if Vpython is working by opening an example program. To do this select File->Open->Bounce Step 7. You should get an example program opened. Try launching the program using Run -> Run Module. If everything is working as expected you should get the following screen. You should see the Shell window (left) with two >>> indicating successful compilation and the actual window (front) which shows a ball bouncing. Step 8. You can also try other example programs to discover the power of VPython, for instance the example program called “electric-motor” will astonish you by the following screen. Step 9. This means that your VPython is ready for use and you can fall down to the “Programming your Vpython” topic. Step 10. Else if you are like one among the many who get a “numpy Error” don’t lose hope for we will be sorting out that issue in the further steps Step 11. Open My computer -> C drive -> Python 27 -> Scripts -> local.bat. This will launch a command prompt as shown below Step 12. Now type “pip install --upgrade numpy” and press enter. The new version of Numpy should get installed on your machine. You might have to wait for some time if your internet connection is slow. Step 13. Once done you can fall back to step number 4 and try an example program and you should be able to get it working. Programming VPython: Next we start programming into our VPython window. In this program we will create two 3D rectangular objects one will be placed in the centre of the screen reference to the stationary Ultrasonic sensor and the other will be at a dynamic location based on the distance between the US sensor and the object (paper). The complete Python code can be found at the end of this page. Further down, I have explained this python code by splitting them into small meaningful junks. The first line would be to import the visual Library so that we can create 3D objects. The below line does the same. from visual import * You should be familiar with the next four lines, since we have used them already in our previous tutorial. They are used to import Serial and time library and also establish a serial connection with Arduino at COM18 with 9600 as baudrate import serial #Serial imported for Serial communication import time #Required to use delay functions ArduinoSerial = serial.Serial('com18',9600) #Create Serial port object called arduinoSerialData time.sleep(2) #wait for 2 secounds for the communication to get established Now, it is time to create objects. I have created two 3d rectangles named as obj and wall. The wallL is a stationary wall in cyan colour placed at the centre of the screen and the obj is the movable object in white colour. I have also placed a text “US sensor” near the wall object. obj = box(pos=(-5,0,0), size=(0.1,4,4), color=color.white) wallL = box(pos=(-1,0,0), size=(0.2,12,12), color=color.cyan) text(text='US sensor', axis=(0,1,0) , pos=(-2,-6,0), depth=-0.3, color=color.cyan) I am sure that the above three lines would have appeared as Greek and Latin for most of the first time readers, but with time you would be able to understand it. Everything that is mentioned inside brackets is (x,y,z) co-ordinates. And these co-ordinates are very similar to the ones that we find in our high school geometry class as shown below. Now, the graphics and serial port is ready all that we have to do is read the data and place the “obj” (white rectangle) in a place according to the data coming from the Arduino. This can be done by the following lines, where obj.pos.x controls the X co-ordinate position of the object (White rectangle). t = int (ArduinoSerial.readline()) #read the serial data and print it as line t= t* 0.05 obj.pos.x = t Getting your Arduino Ready: The Python script is ready to listen for values from COM port and animate the graphics accordingly, but our Arduino is not ready yet. First we have to connect the Ultrasonic sensor to the Arduino according to the following Circuit Diagram. If you are completely new to US sensor and Arduino, then you have to fall back to Arduino & Ultrasonic Sensor Based Distance Measurement tutorial. Then upload the Arduino Program given at the end of this page. The program is self explained using comment lines. We know that ultrasonic sensor works by calculating the time taken for the pulse to hit an object and return back. This value is calculated by using the PulseIn function in Arduino. Later the time taken is converted into distance using the below line. dist = (timetaken/2) / 2.91; Here the distance is calculated in terms of millimetres (mm). Working: The working of the project is simple. Launch the Python program and place an object before the US sensor as shown below: Now launch the python program and you should be able to notice the white rectangle move along with your paper, the distance between your paper and sensor will also be displayed in the shell window as show in the image below. This is how we can track the motion of object using Ultrasonic sensor and Python with Arduino. Hope you understood the project and enjoyed building one. This is just one subtle step towards python but you can build a lot more creative things using this. If you have any idea of what to build with this post them on the comment section and use the forums for technical help. See you with another interesting python project. Python Code: from visual import * import serial #Serial imported for Serial communication import time #Required to use delay functions ArduinoSerial = serial.Serial('com18',9600) #Create Serial port object called arduinoSerialData time.sleep(2) #wait for 2 secounds for the communication to get established obj = box(pos=(-5,0,0), size=(0.1,4,4), color=color.white) wallL = box(pos=(-1,0,0), size=(0.2,12,12), color=color.cyan) text(text='US sensor', axis=(0,1,0) , pos=(-2,-6,0), depth=-0.3, color=color.cyan) t = 0 while 1: rate(100) t = int (ArduinoSerial.readline()) #read the serial data and print it as line t= t* 0.05 obj.pos.x = t print(t) Arduino Code: #define Trigger 2 #define Echo 3 int timetaken, dist; int sendv; void setup() { Serial.begin (9600); pinMode(Trigger, OUTPUT); pinMode(Echo, INPUT); } void loop() { timetaken=dist=0; //initialize the variable to zero before calculation //request the US to send a wave digitalWrite(Trigger, HIGH); digitalWrite(Trigger, LOW); timetaken = pulseIn(Echo, HIGH); //calculate the time taken for the wave to return dist = (timetaken/2) / 2.91; //formulae to calculate the distance using time taken if (dist <= 200 && dist > 0)//send the value to python only if it ranhes from 0-20 cm sendv = dist; Serial.println(sendv); delay(200); }
https://circuitdigest.com/microcontroller-projects/interfacing-arduino-with-vpython-creating-graphics
CC-MAIN-2019-47
refinedweb
1,642
63.09
On Sun, Dec 27, 2020 at 11:36 AM Greg Ewing greg.ewing@canterbury.ac.nz wrote: On 27/12/20 10:15 am, Christopher Barker wrote: It does seem like ** could be usable with any iterable that returns pairs of objects. However the trick is that when you iterate a dict, you get the keys, not the items, which makes me think that the only thing you should *need* is an items() method that returns an iterable (pf pairs of objects). It seems to me it would be more fundamental to use iteration to get the keys and indexing to get the corresponding values. You're only relying on dunder methods then. But that would mean that a lot of iterables would look like mappings when they're not. Consider: def naive_items(x): ... return [(key, x[key]) for key in x] ... naive_items(range(9, -1, -1)) [(9, 0), (8, 1), (7, 2), (6, 3), (5, 4), (4, 5), (3, 6), (2, 7), (1, 8), (0, 9)] ChrisA
https://mail.python.org/archives/list/python-ideas@python.org/message/7BO62PFYBMXYPJFB6V4YBMMK774SGBY7/
CC-MAIN-2021-43
refinedweb
168
79.5
Hello! I am starting a small text based game, I have created my set and get methods for my player class: import java.util.*; public class player extends main{ /* * Player attributes: * Name * Weight * Morale * Money */ //PLAYER ATTRIBUTES private String name; private int weight; private int morale; private int money; private int exp; //CREATES OBJECT OF PLAYER public player(String sName, int iWeight, int iMorale, int iMoney, int iExp) { name = sName; weight = iWeight; morale = iMorale; money = iMoney; exp = iExp; } //GET AND SET NAME public void setName(String sName) { name = sName; } public String getName() { return name; } //GET AND SET WEIGHT public void setWeight(int iWeight) { weight = iWeight; } public int getWeight() { return weight; } //GET AND SET MORALE public void setMorale(int iMorale) { morale = iMorale; } public int getMorale() { return morale; } //GET AND SET MONEY public void setMoney(int iMoney) { money = iMoney; } public int getMoney() { return money; } //GET AND SET EXP public void setExp(int iExp) { exp = iExp; } public int getExp() { return exp; } } and then create an object of the player class in my main class: public class main { public static void main(String args[]) { /* * Creates a object of player with the pre-determined values, name is added later. * Weight starts at 150lbs, 20/100 Morale, $100 and 0 Exp */ player newPlayer = new player("", 150, 20, 100, 0); player. } Now, my problem is how do I 'progress' the game? Would this all be done sequentially through the main method? E.G: public static void main(String args[]) { SYSOUT:("Hello Welcome To The Game"); player newPlayer = new player("", 150, 20, 100, 0); SYSOUT("What is your name?"); name = scanner.nextLine(); player.setName(name); SYSOUT("Hello " + player.getName); SYSOUT("You eat 5 cheeseburgers and gain 10lbs"); player.getWeight(); player.setWeight(weight+10); SYSOUT("You have gained 10exp from eating 5 cheeseburgers"); player.getExp(); player.setExp(exp+10); [eat another meal] [event happens] [eat another meal] etc etc } Would this all have to be pre-designed sequentially? I cannot wrap my head around how I approach this. If someone could give a brief overview of how I get the game rolling (and keep rolling) once the user runs the program that would be fantastic
https://www.daniweb.com/programming/software-development/threads/425792/text-based-game-question
CC-MAIN-2017-22
refinedweb
356
60.79
Light on theory and long on practical application, “Mono: A Developer’s Notebook” book bypasses the talk and theory, and jumps right into Mono 1.0. Here is a PDF sample chapter of the newly released Mono book (we will have a review in a couple of weeks). Mono: Core .NET 2004-08-12 Mono 19 Comments This is good. But if you want to make Mono more popular, you have to provide free complete tutorial online or something like e-book just like Sun did: 1.0 has only recently been released. I’m sure that given a little time a wealth of tutorials will start to appear. The book looks great, a nice refreshing design. But if Mono is the implementation of .Net, why not just buy a book on .Net? Indeed, the free handbook in Monodoc and on the site is still not accurate or complete! And this notebook from O’reilly is too short to spend money on IMHO (I’d wait for the ‘the complete Mono reference’ or something like that). But if Mono is the implementation of .Net, why not just buy a book on .Net? Yes, Mono implements System.* et al, but the Mono.* and other libraries (ByteFX for e.g.) are not included in Microsoft’s .Net “Yes, Mono implements System.* et al, but the Mono.* and other libraries (ByteFX for e.g.) are not included in Microsoft’s .Net” So that opens the door for a “Portable .Net” book then …. Is it just me or are the classes being used to read/write files totally different from the ones used under MS.Net? Is it just me or are the classes being used to read/write files totally different from the ones used under MS.Net?, System.IO is a MS.Net namespace. All examples in the chapter use namespaces in System, except the Mono specific namespaces, for e.g. Mono.Posix I received this book yesterday by mail and it really kicks ass. I doesn’t go really deep on C# or Gtk# but it gets you on track very fast. Great work by Ed & Niel and a great new O’Reilly concept! This is good. But if you want to make Mono more popular, you have to provide free complete tutorial online or something like e-book just like Sun did. Well, duh. Because this book comes from O’Reilly and from not Ximian/Novell. O’Reilly is commercial publisher. i’ve had little to no issues with mono as of yet (coming from a long .net background), however, i am quite surprised that they would ship v 1.0 w/ such sparse documentation. a major release (especially the first one) usually implies documentation along with the bits. i know they were in a rush to get it out the door, but IMO that’s no excuse. overall, i’m quite pleased with mono though. This chapter is a good advertising for the book. It shows an interesting style, and seems very to the point. I will try to get one. I bought “C# in a Nutshell”, and I was quite impressed with how easy the book was to read . I’d definitely recommend it to anyone who’s planning on doing cross-platform development with Mono/.Net. Looks like I’ll be up this book, too… -Erwos >This is good. But if you want to make Mono more popular, you >have to provide free complete tutorial online or something >like e-book just like Sun did. The book is pretty cheap as it is, why must everything be ‘free’? Someone put a lot of work into writting this book, I see no problem in them charging the small amount they do. OK, sorry… this is a little OT, but I gotta ask: (coming from a long .net background) how can anyone come from a “long .NET background” when .NET is so new? or did you help write it? The betas were out a couple of years ago, so yes its possible to have a long .net background. i’ve been writing software targeting .Net since beta 1 (circa summer of 2000). the company i was with began writing production software as of beta 2 (circa early 2001) i have been writing nothing but .Net code since. .Net is anything but new, and i know of at least a few fortune 100 companies who were writing production software as of beta 2. 4 years isn’t long by some standards, but by computer standards it’s almost ancient. get yer facts straight. “production software as of beta 2” Why does that and the fact that your domain is bankofamerica.com worry me so much… Bank of America was gunna go under the litigous knife of SCO, but somehow that decision got buried in MS Word metadata… gotta wonder what made McBride changed his mind (early .NET adoption is probably not the reason).
https://www.osnews.com/story/8014/mono-core-net/
CC-MAIN-2021-31
refinedweb
823
76.22
Red Hat Bugzilla – Bug 642248 avogadro SIGABRT from __cxa_rethrow of boost::python::error_already_set - The _C_API object in the sip python module is invalid Last modified: 2010-11-24 17:39:40 EST abrt version: 1.1.13 architecture: x86_64 Attached file: backtrace cmdline: /usr/bin/avogadro component: avogadro crash_function: __gnu_cxx::__verbose_terminate_handler() executable: /usr/bin/avogadro kernel: 2.6.34.7-56.fc13.x86_64 package: avogadro-1.0.1-6.fc14 rating: 3 reason: Process /usr/bin/avogadro was killed by signal 6 (SIGABRT) release: Fedora release 14 (Laughlin) time: 1286888373 uid: 500 How to reproduce ----- 1. Just run it. Created attachment 452958 [details] File: backtrace *** Bug 646375 has been marked as a duplicate of this bug. *** *** Bug 649236 has been marked as a duplicate of this bug. *** Bug 649236 has more information about what exactly is being rethrown: comment ----- Eventually this is not an avogadro bug. here is the console output The _C_API object in the sip python module is invalid. Could not initialize SIP API ! terminate called after throwing an instance of 'boost::python::error_already_set' Aborted (core dumped) *** Bug 650943 has been marked as a duplicate of this bug. *** *** Bug 653547 has been marked as a duplicate of this bug. *** Package: avogadro-1.0.1-6.fc14 Architecture: x86_64 OS Release: Fedora release 14 (Laughlin) How to reproduce ----- 1.Just started the program 2. 3. *** Bug 655079 has been marked as a duplicate of this bug. *** *** Bug 655848 has been marked as a duplicate of this bug. *** Created attachment 462431 [details] possible fix The problem appears to be avogadro being incompatible with sip + python 2.7, because sip started using PyCapsule (sip 4.10.4 NEWS). I don't know python, the patch is entirely based on Hmmm, I wonder if bug 646375 is actually a different issue, because that one is on F13, which doesn't have Python 2.7. All the others are on F14, which makes sense. Have you tested this patch? Yes, it appears to work - open a sample file, then in the python console: import Avogadro Avogadro.molecule.clear() And, avogadro also starts up. avogadro-1.0.1-10.fc14 has been submitted as an update for Fedora 14. avogadro-1.0.1-10.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.
https://bugzilla.redhat.com/show_bug.cgi?id=642248
CC-MAIN-2017-13
refinedweb
393
66.64
/* * . */ /* * Release: "cancel" a checkout in the history log. * * - Enter a line in the history log indicating the "release". - If asked to, * delete the local working directory. */ #include "cvs.h" #include "save-cwd.h" #include "getline.h" #include "yesno.h" static const char *const release_usage[] = { "Usage: %s %s [-d] directories...\n", "\t-d\tDelete the given directory.\n", "(Specify the --help global option for a list of other help options)\n", NULL }; #ifdef SERVER_SUPPORT static int release_server (int argc, char **argv); /* This is the server side of cvs release. */ static int release_server (int argc, char **argv) { int i; /* Note that we skip argv[0]. */ for (i = 1; i < argc; ++i) history_write ('F', argv[i], "", argv[i], ""); return 0; } #endif /* SERVER_SUPPORT */ /* Construct an update command. Be sure to add authentication and * encryption if we are using them currently, else our child process may * not be able to communicate with the server. */ static FILE * setup_update_command (pid_t *child_pid) { int tofd, fromfd; run_setup (program_path); #if defined (CLIENT_SUPPORT) || defined (SERVER_SUPPORT) /* Be sure to add authentication and encryption if we are using them * currently, else our child process may not be able to communicate with * the server. */ if (cvsauthenticate) run_add_arg ("-a"); if (cvsencrypt) run_add_arg ("-x"); #endif /* Don't really change anything. */ run_add_arg ("-n"); /* Don't need full verbosity. */ run_add_arg ("-q"); /* Propogate our CVSROOT. */ run_add_arg ("-d"); run_add_arg (original_parsed_root->original); run_add_arg ("update"); *child_pid = run_piped (&tofd, &fromfd); if (*child_pid < 0) error (1, 0, "could not fork server process"); close (tofd); return fdopen (fromfd, "r"); } static int close_update_command (FILE *fp, pid_t child_pid) { int status; pid_t w; do w = waitpid (child_pid, &status, 0); while (w == -1 && errno == EINTR); if (w == -1) error (1, errno, "waiting for process %d", child_pid); return status; } /* There are various things to improve about this implementation: 1. Using run_popen to run "cvs update" could be replaced by a fairly simple start_recursion/classify_file loop--a win for portability, performance, and cleanliness. In particular, there is no particularly good way to find the right "cvs". 2. The fact that "cvs update" contacts the server slows things down; it undermines the case for using "cvs release" rather than "rm -rf". However, for correctly printing "? foo" and correctly handling CVSROOTADM_IGNORE, we currently need to contact the server. (One idea for how to fix this is to stash a copy of CVSROOTADM_IGNORE in the working directories; see comment at base_* in entries.c for a few thoughts on that). 3. Would be nice to take processing things on the client side one step further, and making it like edit/unedit in terms of working well if disconnected from the network, and then sending a delayed notification. 4. Having separate network turnarounds for the "Notify" request which we do as part of unedit, and for the "release" itself, is slow and unnecessary. */ int release (int argc, char **argv) { FILE *fp; int i, c; char *line = NULL; size_t line_allocated = 0; char *thisarg; int arg_start_idx; int err = 0; short delete_flag = 0; struct saved_cwd cwd; #ifdef SERVER_SUPPORT if (server_active) return release_server (argc, argv); #endif /* Everything from here on is client or local. */ if (argc == -1) usage (release_usage); optind = 0; while ((c = getopt (argc, argv, "+Qdq")) != -1) { switch (c) { case 'Q': case 'q': error (1, 0, "-q or -Q must be specified before \"%s\"", cvs_cmd_name); break; case 'd': delete_flag++; break; case '?': default: usage (release_usage); break; } } argc -= optind; argv += optind; /* We're going to run "cvs -n -q update" and check its output; if * the output is sufficiently unalarming, then we release with no * questions asked. Else we prompt, then maybe release. * (Well, actually we ask no matter what. Our notion of "sufficiently * unalarming" doesn't take into account "? foo.c" files, so it is * up to the user to take note of them, at least currently * (ignore-193 in testsuite)). */ #ifdef CLIENT_SUPPORT /* Start the server; we'll close it after looping. */ if (current_parsed_root->isremote) { start_server (); ign_setup (); } #endif /* CLIENT_SUPPORT */ /* Remember the directory where "cvs release" was invoked because all args are relative to this directory and we chdir around. */ if (save_cwd (&cwd)) error (1, errno, "Failed to save current directory."); arg_start_idx = 0; for (i = arg_start_idx; i < argc; i++) { thisarg = argv[i]; if (isdir (thisarg)) { if (CVS_CHDIR (thisarg) < 0) { if (!really_quiet) error (0, errno, "can't chdir to: %s", thisarg); continue; } if (!isdir (CVSADM)) { if (!really_quiet) error (0, 0, "no repository directory: %s", thisarg); if (restore_cwd (&cwd)) error (1, errno, "Failed to restore current directory, `%s'.", cwd.name); continue; } } else { if (!really_quiet) error (0, 0, "no such directory: %s", thisarg); continue; } if (!really_quiet) { int line_length, status; pid_t child_pid; /* The "release" command piggybacks on "update", which does the real work of finding out if anything is not up-to-date with the repository. Then "release" prompts the user, telling her how many files have been modified, and asking if she still wants to do the release. */ fp = setup_update_command (&child_pid); if (fp == NULL) { error (0, 0, "cannot run command:"); run_print (stderr); error (1, 0, "Exiting due to fatal error referenced above."); } c = 0; while ((line_length = getline (&line, &line_allocated, fp)) >= 0) { if (strchr ("MARCZ", *line)) c++; (void) fputs (line, stdout); } if (line_length < 0 && !feof (fp)) error (0, errno, "cannot read from subprocess"); /* If the update exited with an error, then we just want to complain and go on to the next arg. Especially, we do not want to delete the local copy, since it's obviously not what the user thinks it is. */ status = close_update_command (fp, child_pid); if (status != 0) { error (0, 0, "unable to release `%s' (%d)", thisarg, status); if (restore_cwd (&cwd)) error (1, errno, "Failed to restore current directory, `%s'.", cwd.name); continue; } printf ("You have [%d] altered files in this repository.\n", c); if (!noexec) { printf ("Are you sure you want to release %sdirectory `%s': ", delete_flag ? "(and delete) " : "", thisarg); fflush (stderr); fflush (stdout); if (!yesno ()) /* "No" */ { (void) fprintf (stderr, "** `%s' aborted by user choice.\n", cvs_cmd_name); if (restore_cwd (&cwd)) error (1, errno, "Failed to restore current directory, `%s'.", cwd.name); continue; } } else { if (restore_cwd (&cwd)) error (1, errno, "Failed to restore current directory, `%s'.", cwd.name); continue; } } /* Note: client.c doesn't like to have other code changing the current directory on it. So a fair amount of effort is needed to make sure it doesn't get confused about the directory and (for example) overwrite CVS/Entries file in the wrong directory. See release-17 through release-23. */ if (restore_cwd (&cwd)) error (1, errno, "Failed to restore current directory, `%s'.", cwd.name); #ifdef CLIENT_SUPPORT if (!current_parsed_root->isremote || (supported_request ("noop") && supported_request ("Notify"))) #endif { int argc = 2; char *argv[3]; argv[0] = "dummy"; argv[1] = thisarg; argv[2] = NULL; err += unedit (argc, argv); if (restore_cwd (&cwd)) error (1, errno, "Failed to restore current directory, `%s'.", cwd.name); } #ifdef CLIENT_SUPPORT if (current_parsed_root->isremote) { send_to_server ("Argument ", 0); send_to_server (thisarg, 0); send_to_server ("\012", 1); send_to_server ("release\012", 0); } else #endif /* CLIENT_SUPPORT */ { history_write ('F', thisarg, "", thisarg, ""); /* F == Free */ } if (delete_flag) { /* FIXME? Shouldn't this just delete the CVS-controlled files and, perhaps, the files that would normally be ignored and leave everything else? */ if (unlink_file_dir (thisarg) < 0) error (0, errno, "deletion of directory %s failed", thisarg); } #ifdef CLIENT_SUPPORT if (current_parsed_root->isremote) { /* FIXME: * Is there a good reason why get_server_responses() isn't * responsible for restoring its initial directory itself when * finished? */ err += get_server_responses (); if (restore_cwd (&cwd)) error (1, errno, "Failed to restore current directory, `%s'.", cwd.name); } #endif /* CLIENT_SUPPORT */ } if (restore_cwd (&cwd)) error (1, errno, "Failed to restore current directory, `%s'.", cwd.name); free_cwd (&cwd); #ifdef CLIENT_SUPPORT if (current_parsed_root->isremote) { /* Unfortunately, client.c doesn't offer a way to close the connection without waiting for responses. The extra network turnaround here is quite unnecessary other than that.... */ send_to_server ("noop\012", 0); err += get_responses_and_close (); } #endif /* CLIENT_SUPPORT */ if (line != NULL) free (line); return err; }
http://opensource.apple.com/source/cvs/cvs-42/cvs/src/release.c
CC-MAIN-2016-22
refinedweb
1,276
55.03
This article is adapted from my online course Intro to The Serverless Framework. There are times when you may want one Lambda in your project to invoke another Lambda. Although it is wise to keep your code modular and decoupled, thus not tying two Lambdas together as a functional unit, there are exceptions. In the past, I've made good use of the 'lambdas-invoking-lambdas' pattern by setting up one Lambda function as a cron task that launches multiple instances of another Lambda function that does some work. This use-case could easily be implemented as one cron Lambda that fires off a normal (i.e. non-Lambda) function multiple times, but this means the function performing the action can't be consumed by other clients. Keeping the cron Lambda separate from the action Lambda means other clients can call/invoke the action Lambda, too. Web scraping comes to mind here. Function #1 (Scraper) is a web scraper that scrapes data from a website, the url of which is passed to it by function #2. The results of the scrape job are then saved to a database. Function #2 (Cron) makes a database call that results in a list of website urls to scrape, and it makes this call at a set interval (e.g. on the first of every month). Function #2 then iterates over the array of urls and invokes the second (scraper function #1) Lambda function with a url as an argument. This pattern as two advantages: - If your working in an async environment (Node by default, and Python using an async library), multiple scrapers can work in parallel rather than launching them sequentially. - If you need an on-demand scrape job, your scraper Lambda can be invoked ad hoc. To implement this pattern using the Serverless framework, you need to do two things: - Set up the proper permissions in your serverless.ymlfile. - Use the aws-sdkof your preferred language (Node and Python 3 examples are provided) to invoke the second function from the first. Permissions (iamRoleStatements) Invoking a Lambda from another Lambda can't be done without some configuration. In your serverless.yml file, permission must be specified in order to invoke another Lambda. This can be accomplished by adding an iamRoleStatements section under the provider property (lines 4-8 below). provider: name: aws runtime: <runtime goes here> # e.g. python3.6 or nodejs6.10 iamRoleStatements: - Effect: Allow Action: - lambda:InvokeFunction Resource: "*" On StackOverflow and other tutorials, you may also see - lambda:InvokeAsync in addition to what you see above (under Action). The InvokeAsync API is deprecated (see for yourself here), so you can exclude it from your serverless.yml file. Invocation Once the proper permissions are set up in serverless.yml, invoking one Lambda from another requires no tricks – you use the aws-sdk as you would normally. Regardless of your runtime, the functions section of your serverless.yml file should look something like this: functions: print_strings: handler: handler.print_strings cron_launcher: handler: handler.cron_launcher events: - schedule: rate(1 minute) The print_string function has no event property, because it will be invoked directly via the aws-sdk. The cron_launcher function has an event property, where the event is defined as a cron schedule. Node Here's what the handler looks like in a Node project. "use strict"; const AWS = require("aws-sdk"); const lambda = new AWS.Lambda({ region: "us-west-2" }); // The action lambda module.exports.print_strings = (event, context, callback) => { const response = { statusCode: 200, body: JSON.stringify({ message: `${event} - from the other function` }) }; callback(null, response); }; // The cron Lambda module.exports.cron_launcher = (event, context, callback) => { const fakeDBResults = [ "Good morning.", "How are you?", "May I pet your dog?", "Oh, that's nice" ]; fakeDBResults.forEach(message_string => { const params = { FunctionName: "lambda-invokes-lambda-node-dev-print_strings", InvocationType: "RequestResponse", Payload: JSON.stringify(message_string) }; return lambda.invoke(params, function(error, data) { if (error) { console.error(JSON.stringify(error)); return new Error(`Error printing messages: ${JSON.stringify(error)}`); } else if (data) { console.log(data); } }); }); }; At the top of the file, import the aws-sdk and then initialize it with the region in which your Lambdas reside (lines 3-7). The print_string function returns a callback with a status code and a JSON body with a message property. The interesting bits are in the cron_launcher function. Here you have an array of messages ( fakeDBResults), and then a .forEach() (starting on line 29 above) method that invokes a print_string function for every message in the array (starting on line 36 above). Interlude: Public Lambda Names The cron_launcher is straightforward except for the FunctionName property in the params constant. This name is printed in the terminal after deploying your service. If you forget what the Lambda name is, with your terminal navigate into your root project folder and enter sls info -s <stage_name>. stage_name is typically something like dev, qa, staging, or production, depending on your deployment pipeline. Here's an example output: Service Information service: your-service-name stage: dev region: us-east-1 stack: your-service-name-stage_name api keys: None endpoints: None functions: thing: your-service-name-dev-thing In the output above, the function name within the service is thing but the public name – the name you need to invoke it – is your-service-name-dev-thing. AWS's pattern for generating the public name ofyour function is service_name-stage-function_name. For a detailed overview of useful terminal commands, see my other post Serverless Framework Terminal Commands. Python Here's the same logic expressed in Python 3. import json from boto3 import client as boto3_client lambda_client = boto3_client('lambda', region_name="us-west-2",) def print_strings(event, context): print(event) body = { "message": "{} - from the other function".format(event), } response = { "statusCode": 200, "body": json.dumps(body) } return response def cron_launcher(event, context): fakeDBResults = [ "Good morning.", "How are you?", "May I pet your dog?", "Oh, that's nice" ] for message in fakeDBResults: response = lambda_client.invoke( FunctionName="lambda-invokes-lambda-python3-dev-print_strings", InvocationType='RequestResponse', Payload=json.dumps(message) ) string_response = response["Payload"].read().decode('utf-8') parsed_response = json.loads(string_response) print("Lambda invocation message:", parsed_response) At the top of the file, import the boto3 (the Python AWS SDK) and then initialize it with the region in which your Lambdas reside (lines 1-4). The print_string function returns a reponse with a status code and a JSON body with a message property. In the cron_launcher function there's a list of messages ( fakeDBResults), and a for loop that invokes a print_string function for every message in the list of messages. The Lambda response is then decoded (line 36), parsed (line 38), and printed out.
https://lorenstewart.me/2017/10/02/serverless-framework-lambdas-invoking-lambdas/
CC-MAIN-2018-51
refinedweb
1,098
57.67
31 Days of Mango | Day #15: The Progress Bar Join the DZone community and get the full member experience.Join For Free This article is Day #15 in a series called 31 Days of Mango, and was written by guest author Doug Mair. Doug can be reached on Twitter at @doug_mair or at doug.mair@gmail.com. Any time you have a operation that will take more than a couple of seconds to complete, it’s a good idea to let your users know that your application is still making progress and is not just stuck in a loop forever. How should you let your user know what’s happening? Well you can show them a text message with actual numbers of bytes downloaded or seconds left for an operation. But often the user is not concerned with that level of detail. Progress Bars are a great way to show your users that an operation is making progress, without overloading them with too many details. A progress bar can show this information in two different ways: indeterminate and indeterminate mode. Indeterminate Mode Indeterminate mode is when you cannot determine how long the operation will take to complete. For example if you are connecting to a server, you do not know when or if the operation will complete. Indeterminate mode Progress Bars show their status by having dots move from left to right in an animation. This is great for showing that something is happening, but it doesn’t give the user an indication of the amount of progress. To make a progress bar show the indeterminate mode, check the IsIndeterminate checkbox of the progress bar. Determinate Mode If you can determine approximately how long an operation takes to complete, use the Determinate mode to let the user know the percentage that is left in the operation. For example, if you are downloading a file, you know the total file size, and as the download continues, you get updates that tell you the number of bytes downloaded so far. You can then divide the Total File Size by the Current Bytes Downloaded to get the percentage completion. This code shows an example of how this could be done. If you want to show your user the percent of progress an operation is taking, you display that information in a Progress Bar. To show the Determinate mode, uncheck the IsIndeterminate checkbox and set the value to correlate to the percentage completion. With Windows Phone 7.5 Mango, you have 2 choices for Progress Bars: 1) Progress Bar – A control that you can put anywhere in your Silverlight page. 2) Progress Indicator – A control which lives in the System Tray. Let’s start off by talking about the ProgressBar. Progress Bar The Progress Bar is not in the Visual Studio ToolBox by default, so, you will have to add it to the ToolBox in Visual Studio. To do this, Right-Mouse Click on the ToolBox and select “Choose Items…”. Then find “ProgressBar” and check its checkbox. After a short delay, you will see the “ProgressBar” in the toolbox Now you can drag the ProgressBar control into your XAML Windows Phone pages. This will add code like the following to your XAML file. <ProgressBar Name="progressBar1" Value="0"></ProgressBar> You can then set the properties of the control as needed: To use this new ProgressBar in Determinate mode, make sure the IsIndeterminate checkbox is unchecked. Then you can set the Minimum, Maximum and Value properties of the control. In the code behind as your operation is making progress, you change the Value property to the desired value between Minimum and Maximum. The Progress Bar will make sure the Value is always between the Minimum and the Maximum. You can fill up the Progress Bar simply by increasing the Value based on the progress of your operation. Progress Indicator Another way to show progress is by using a Progress Indicator. This control appears in the SystemTray as shown below. Here are pictures of the SystemTray and the Progress Indicator in the SystemTray. To use the Progress Indicator you must add this using statement to your code behind. using Microsoft.Phone.Shell; You can then create a Progress Indicator and add it to the System Tray like this. ProgressIndicator progressIndicator = new ProgressIndicator() { IsVisible = true, IsIndeterminate = false, Text = "Downloading file ..." }; SystemTray.SetProgressIndicator(this, progressIndicator); Note that the Value property of the Progress Indicator must always be between 0 and 1. Where as for the ProgressBar, the Value property must be between the Minimum and the Maximum. Sample App Day15-ProgressBar is an App which tests both of these controls: Here’s an overview of the code: The XAML code below show all of the controls we will use in our test. There is a ProgressBar to show the progress, a couple of buttons to Start or Stop a timer for the simulation, and a Slider which will be used to change the ProgressIndicator’s Value. <phone:PhoneApplicationPage x: <TextBlock x: </StackPanel> <!--ContentPanel - place additional content here--> <Grid x: <StackPanel> <TextBlock FontSize="36" Foreground="#FFDBE6FF" Name="textBlock3" Text="Progress Indicator" TextWrapping="Wrap" FontWeight="Bold" /> <TextBlock Name="textBlock1" Text="Drag the Slider to see the Progess In System Tray." FontSize="20" TextWrapping="Wrap" Foreground="#FFDBE6FF" /> <Slider Name="slider1" Width="Auto" Maximum="1" LargeChange="0.1" SmallChange="0.01" ValueChanged="slider1_ValueChanged" Margin="50,0" /> <TextBlock FontSize="36" Name="textBlock2" Text="Progress Bar" TextWrapping="Wrap" Foreground="#FFDBE6FF" Margin="0,50,0,0" FontWeight="Bold" /> <Button Name="StartButton" Content="Start the Timer" Click="Button_Click"></Button> <Button Name ="StopButton" Content="Reset the Timer" Click="Button_Click_1"></Button> <ProgressBar Name="progressBar1" Value="0" IsIndeterminate="False" Height="50" SmallChange=".5" LargeChange="10"></ProgressBar> </StackPanel> </Grid> </Grid> </phone:PhoneApplicationPage> Here’s the C# Code Behind. Let’s walk through what the code to see what it is doing. To begin with, we set up the using statements for the controls we are going to use. For the ProgressIndicator, we must use Microsoft.Windows.Shell. Then inside the class that was created for the page, we declare our global variables. A ProgressIndicator is created which we will later put into the SystemTray. A DispatcherTimer called timer is created which will be used to simulate a deterministic operation. In the constructor we put the newly created progressIndicator into the SystemTray and setup the timer to call the timer_Tick method every 5000 ticks. using System; using System.Windows; using System.Windows.Threading; using Microsoft.Phone.Shell; namespace Day15_ProgressBar { public partial class MainPage { ProgressIndicator progressIndicator = new ProgressIndicator() { IsVisible = true, IsIndeterminate = false, Text = "Downloading file ..." }; DispatcherTimer timer = new DispatcherTimer(); // Constructor public MainPage() { InitializeComponent(); SystemTray.SetProgressIndicator(this, progressIndicator); timer = new DispatcherTimer {Interval = new TimeSpan(5000)}; timer.Tick += timer_Tick; timer.Stop(); } } } When the timer fires and the timer_Tick method is called, we add a value to the ProgressBar’s Value Property to make it seem like the operation is making progress. Below that method is the Button Click event handlers. They start and stop the timer, so that we can simulate a long operation deterministic operation. Pressing the Start button resets the progressBar1’s Value property to 0 and starts the timer. Pressing the Stop button also resets the progressBar1’s Value property to 0, but this time we Stop the timer from progressing. The last method in the class is the event handler slider1_ValueChanged that is called when the slider is moved. We will use the slider value to position the ProgressIndicator. using System; using System.Windows; using System.Windows.Threading; using Microsoft.Phone.Shell; namespace Day15_ProgressBar { public partial class MainPage { // Constructor ProgressIndicator progressIndicator = new ProgressIndicator() { IsVisible = true, IsIndeterminate = false, Text = "Downloading file ..." }; DispatcherTimer timer = new DispatcherTimer(); public MainPage() { InitializeComponent(); SystemTray.SetProgressIndicator(this, progressIndicator); timer = new DispatcherTimer {Interval = new TimeSpan(5000)}; timer.Tick += timer_Tick; timer.Stop(); } void timer_Tick(object sender, EventArgs e) { progressBar1.Value += progressBar1.SmallChange; } private void Button_Click(object sender, RoutedEventArgs e) { progressBar1.Value = 0; timer.Start(); } private void Button_Click_1(object sender, RoutedEventArgs e) { timer.Stop(); progressBar1.Value = 0; } private void slider1_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) { progressIndicator.Value = e.NewValue; } } } Summary So that’s how you use Progress Bars in a Windows Phone Mango application. In a few lines of code you can quickly add full featured Progress Bars to any Silver Light Windows Phone application. You can create a ProgressIndicator which you can put into the SystemTray, or you can create a ProgressBar which you can display anywhere on the applications page. Progress Bars are essential to applications with lengthy operations. It gives the user a feeling that the application is working for them and will be back to them when the operation completes. Your users will feel better about waiting when they are informed on the applications progress. To download a working version of the application that was built in this article, please click the Download Code button below: Tomorrow, we are going to look at the Isolated Storage Explorer, which allows you to look at and inspect the data you have stored in Isolated Storage in your emulator. Samidip Basu will show you the hows and whys of this new feature. See you then! Source: Opinions expressed by DZone contributors are their own.
https://dzone.com/articles/31-days-mango-day-15-progress
CC-MAIN-2020-45
refinedweb
1,525
55.84
Go to the first, previous, next, last section, table of contents.. The functions described in this section are declared in the header file `gsl_qrng.h'. GSL_ENOMEM. void * state = gsl_qrng_state (q); size_t n = gsl_qrng_size (q); fwrite (state, n, 1, stream); The following quasi-random sequence algorithms are available, The following program prints the first 1024 points of the 2-dimensional Sobol sequence. #include <stdio.h> #include <gsl/gsl_qrng.h> int main (void) { int i; gsl_qrng * q = gsl_qrng_alloc (gsl_qrng_sobol, 2); for (i = 0; i < 1024; i++) { double v[2]; gsl_qrng_get (q, v); printf ("%.5f %.5f\n", v[0], v[1]); } gsl_qrng_free (q); return 0; } Here is the output from the program, $ ./a.out 0.50000 0.50000 0.75000 0.25000 0.25000 0.75000 0.37500 0.37500 0.87500 0.87500 0.62500 0.12500 0.12500 0.62500 .... It can be seen that successive points progressively fill-in the spaces between previous points. The implementations of the quasi-random sequence routines are based on the algorithms described in the following paper, Go to the first, previous, next, last section, table of contents.
http://linux.math.tifr.res.in/programming-doc/gsl/gsl-ref_18.html
CC-MAIN-2017-39
refinedweb
183
68.6
Hey Guy’s, Welcome to PracticeHouse. The house is full of exercises program to increase our skill level up. In this post I am going to share our first exercise program for python is – Create a program that takes the name and the age from the user as input and then send them a message that which year they will be 100 years old. pretty cool !!! isn’t it. Let’s see our code for the program to take user input and calculate their age. okay let’s see the code first if you are a beginner then don’t worry down there i will explain the code also and if you are familiar with python code then you good to go. Sample Code: Here is the sample output : Explanation : Okay folks, Let me explain this program if you didn’t understand. it’s a very simple program in python. first of all, you can see that i saved this in a file called exercise1.py So .py is the file extension for the python script file. To run a python script in a shell or CLI you have to open the CLI into that respective folder or you can navigate through CLI into that folder then use python and then your filename. Then we use input() function to take user input. So by default, it returns us String. To Convert the string into integer we used int() function for our age variable. To get the current date and time we import a library called datetime by using import datetime. then we use datetime.datetime.now() function to get the current date and store into a variable called today. then use today.year to get the current year. then we just did a small calculate when the user will be 100 years old. Then in python, we use print() function to printout something to our console. That’s it. So if you have any other way to show us. you are most welcome to share your code down there.
https://practicehouse.com/python-exercise-programs-001-create-a-python-program-to-take-user-input/
CC-MAIN-2019-22
refinedweb
339
81.73
Results 1 to 1 of 1 hi there, I am writing a simple char device that generates pseudo-random numbers, the problem is when I try to read from that char device, i.e when I write this ... - Join Date - May 2009 - 35 writing a simple char device, help needed I am writing a simple char device that generates pseudo-random numbers, the problem is when I try to read from that char device, i.e when I write this command "cat (device's dictionary)" it reads 3 times which is really weird. anyone can help me out please. here is some of my code Code: unsigned int random_seed; char msg[256]; int msg_len; unsigned char rg_hw() { random_seed = random_seed * 1103515245 + 12345; return (unsigned char)((unsigned int)(random_seed / 65536) % 256); } ssize_t read(struct file *file, char __user *buf, size_t len, loff_t *offset) { printk(KERN_ALERT "reading a char device, seed = %d\n", random_seed); sprintf (msg, "%d", rg_hw()); msg_len = strlen(msg); if (*offset >= msg_len) { return 0; } if (*offset + len >= msg_len) { len = msg_len - *offset; } if(copy_to_user(buf, msg + *offset , len)) { printk(KERN_EMERG "loool\n"); return -EFAULT; } *offset += len; return len; } Code: Starting char device allocated a new major, 248 opend the char device, with minor 0 reading a char device, seed = 0 reading a char device, seed = 12345 reading a char device, seed = -740551042 releasing the char device. EDIT: upon further testing, i think i found out what is the problem, i made a tester from user space and used the functions open and read, now the problem is that reads only one random number then stops, is there a way to make it read as many times as the buffer's size?
http://www.linuxforums.org/forum/kernel/148435-writing-simple-char-device-help-needed.html
CC-MAIN-2014-52
refinedweb
279
50.43
Walkthrough: Creating a Basic Control Designer for a Web Server Control This walkthrough demonstrates how to create a basic control designer to provide a design-time user interface (UI) for a Web server control. When you create a custom ASP.NET server control, you can create an associated designer to render the control in a visual design tool such as Microsoft Visual Studio 2005. The designer enables the host environment to render a design-time UI for the control, so that developers can easily configure the control's properties and content. For more information about designer features and the various designer classes you can associate with a custom control, see ASP.NET Control Designers Overview. During this walkthrough, you will learn how to: Create a standard composite control designer and associate it with a composite control. Create a resizable composite control designer and associate it with a composite control. Create a basic container control designer with an editable region, and associate it with a WebControl control. This designer enables you to add text to the editable region on the design surface, and you can also drag additional controls into the region. Reference the custom controls (and their associated designers) on a Web page. Work with the Web page in Design view in Visual Studio 2005. In order to complete this walkthrough, you will need: Visual Studio 2005, which you will use to create a Web page that hosts your custom controls and their associated designers. An ASP.NET Web site, for the page that hosts the controls. If you have a site already configured, you can use that site as a starting point for this walkthrough. Otherwise, for details on creating a virtual directory or site, see How to: Create and Configure Virtual Directories in IIS. In this section, you create three basic Web server controls and an associated custom control designer for each of them. To create a file for the code In an editor, create a new file named SimpleControlDesigners with the appropriate extension for the language you are working in. For example, in Visual Studio 2005, create a new class file named SimpleControlDesigners.vb or SimpleControlDesigners.cs. Add the following namespace references that are necessary for working with the designer classes. Also add a namespace to contain your controls and the associated designers. Save the file. Now you are ready to create a composite Web server control and an associated designer. A designer can be in the same assembly as the control or in a different one; in this walkthrough, you create them in the same code file and assembly for convenience. To create a composite control and an associated designer Within the namespace you declared in the SimpleControlDesigners file, create a public declaration for a composite control class that inherits from CompositeControl, as shown in the following code example. Add the public properties shown in the following code example to the class. These will be used to create part of the UI on the Web page. Create a method to add child controls to the composite control. The following method adds two text boxes and a line break that will be visible on the Web page. Create a simple composite control designer class that derives from CompositeControlDesigner to associate with the composite control you just created. Although there are a variety of UI rendering features you could add to the designer, the following code example simply creates the designer and overrides a key property in the base class to prevent the control from being resized in design. The first two controls you created were composite controls that you associated with composite control designers. Now you will create a simple control that derives from WebControl, and associate it with a ContainerControlDesigner class. This type of designer is useful when you want to associate a designer with a single custom Web server control and provide a single editable region on the design surface. The custom control you create here does not implement any actual functionality; it exists only to show the features of the ContainerControlDesigner class. To create a Web server control and a container designer with an editable region Within the namespace you declared in the SimpleControlDesigners file, create a public declaration for a new Web server control class, as shown in the following code example. Create a container control designer class to associate with the custom control. Implement two properties: a FrameStyle property to contain the style for the designer's frame, and a FrameCaption property to contain the frame's header text. These properties provide a frame for the control to be visibly rendered and selected on the design surface. The code for the designer and properties is shown in the following code example. Associate the designer with the control. Immediately above the class declaration for the Web server control, add the Designer metadata attribute. Note that in this case, as shown in the following code example, you also add the ParseChildren attribute with a false parameter. This tells the design-time parser to treat the inner contents of controls as child controls, rather than as properties. In this case, you want to treat the inner contents of this control as child controls so that you can actually drag other server controls into the editable region at design time, and edit their properties as well. With your Web site open in Visual Studio 2005, create a new page called ControlDesigners.aspx. At the top of the page, just under the page declaration, add a Register directive to reference the assembly and controls you created previously, as shown in the following code example. Complete the rest of the page as shown in the following code example, to reference each of the three controls you created previously: SimpleCompositeControl, SimpleCompositeControl2, and SimpleContainerControl. Note that to reference each control, you use the aspSample prefix specified in the Register directive. Save the page. Now you can test the page in Design view to see how the control designers work. Click in the content region of the container control, and type some text content for the control. Switch to Source view, and locate the source code for the container control. Confirm that the text you typed in the region now appears in the source code. Switch back to Design view. Click the frame of the control, position the mouse pointer over one of the resizing icons, and resize the container control. Click in the editable region of the control at the end of the text content, and press ENTER to add a line break. Drag a Button control from the Toolbox and drop it into the editable region beneath the text you entered. Drag a Label control from the Toolbox and drop it next to the button. This demonstrates that you can drag child controls into the editable region. If you want, you can set properties on the child controls at design time, and you can add code for the Button control to update the Label control's Text property at run time. The page with the controls you just added should look similar to the following screen shot. Container control with child controls Save the page. To view the page at run time Load the page in a browser. The controls should appear as you customized them in Design view. Your page should look similar to the following screen shot. Completed control designers Web page This walkthrough has demonstrated the basic tasks involved in creating a custom control associated with a composite or a container control designer. You created custom controls with designers that allowed you to resize the controls and add text in an editable region in the Design view in Visual Studio 2005. Suggestions for further exploration include: Investigate the other powerful new features that are available with control designers. For more information, see ASP.NET Control Designers Overview. Try creating more advanced designer scenarios where you create specialized design-time rendering and take advantage of features such as action lists. For details, see Sample Control Designer with Action Lists and Services.
https://msdn.microsoft.com/en-us/library/12yydcke(v=vs.85)?cs-save-lang=1&cs-lang=fsharp
CC-MAIN-2017-51
refinedweb
1,344
53.21
qRegisterMetaType of custom C-style struct for usae with QSignalSpy in QTest Hi, 1. I have C headers for driver, which contains a lot of structures. I use the structures as signals' arguments. Here is example of a such a like structure (most simple one just for example) typedef struct { uint16_t Capabilities; } PingSrspFormat_t; 2. I've made simplest QTest, and in 'testCase1()' try to get signals from my DUT object this way: // 1. Register custom C-Style struct type qRegisterMetaType<PingSrspFormat_t>("PingSrspFormat_t"); // 2. Connect signal of my DUT object (znpHost) already instantiated above QSignalSpy spy(znpHost,SIGNAL(pfnSysPingSrsp(const PingSrspFormat_t&))); // 3. just in case clear spy list spy.clear(); // 4. issue method of my DUT object to get signal from it znpHost->sysPing(); // 5. wait for a while.. spy.wait(500); // 6. get the signal argument PingSrspFormat_t result = qvariant_cast<PingSrspFormat_t>(spy.at(0).at(0)); // 7. check the argument QVERIFY(result.Capabilities == 0x0000); 3. due compilation get an error: /home/dev/Qt/5.5/gcc_64/include/QtCore/qglobal.h:703: error: invalid application of 'sizeof' to incomplete type 'QStaticAssertFailure<false>' enum {Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, __COUNTER__) = sizeof(QStaticAssertFailure<!!(Condition)>)} ^ Any suggestions how to fix the compilation error are very welcome Thanks - kshegunov Qt Champions 2016 @Vasiliy Hello, Do you have Q_DECLARE_METATYPE(PingSrspFormat_t)at the appropriate place? Kind regards. Hi! - Well, should i put the macros in C headers? - Am I correct if say that for signal/slot usage of qRegisterMetaType is enough? Thanks for reply - kshegunov Qt Champions 2016 @Vasiliy Hello, Usually you put the macro after the declarations, however I believe the mocwill be forgiving enough if you put it into your own header (not to modify the externals). Something like this in mycwrapheader.h: #include <somecheader.h> Q_DECALARE_METATYPE(PingSrspFormat_t) // ... more code Am I correct if say that for signal/slot usage of qRegisterMetaType is enough? Whether or not this is true is besides the point, because you're making a qvariant_castand for that you'd need the Q_DECLARE_METATYPEmacro. Additionally, you need to register the type with the runtime (through qRegisterMetaType) only if you're using queued connections (usually when multithreading is involved). Kind regards. @kshegunov wow! Seems you are right I've just put the macros at hte top of my Unity test *.cpp right after all #includes and the compilation passed! Thanks a lot for the advice! - kshegunov Qt Champions 2016 @Vasiliy No problem, however you should really put that macro in a header .h, not in your source file .cpp. :) @kshegunov yes, you are correct, but for fast issue fix it was ok to put it in *.cpp :) now I can gloss the code with calm after your great advice! Thanks!
https://forum.qt.io/topic/64678/qregistermetatype-of-custom-c-style-struct-for-usae-with-qsignalspy-in-qtest
CC-MAIN-2017-39
refinedweb
443
50.02
Hey there, I'm trying to find out what the best way to create a simple popover is without having to fork out for it. I want to be able to do pretty much exactly what happens on this site, wait for the popover to come down after the page has loaded, I would like something similar to that. I don't even know if this can be done without buying the software but I thought I would ask here to see if any of you guys knew how to do it. Thanks a lot First,Welcome to Sitepoint. It looks as though you've recently joined Second,Don't buy their software. Please. Don't.Third, really? I'd love to help, but I literally can't stand those pop-overs. They do get my attention, and every time they're annoying. However I suppose I'm saying this without any context on what you might be using them for. If it is in fact user initiated, like some sort of dialog component, I can see merit. Nevertheless, here is a [stubbed out 2 minute version I put together using [url=]Yahoo UI](). hi tetley07.you can put anything you want to popin in a div with theese properties: #popup { position:absolute; display:none; top:50px; left:50px; /* you should change left and top */ width:200px; height:200px; } you should put #popup div right after <body> tag (or just before </body> )in header tag, add this: <script type="text/javascript"> window.onload=function(){ document.getElementById('popup').style.display='block'; }; </script> ok, now you have a popIN window Ofcourse, we have to hide the window, right?for that, you should have a button on your page (let's assume we have <a> tag). You have to do this way: <a href="#" onclick="document.getElementById('popup').style.display='none'; return false;">CLOSE</a> And there you go For animation effect you can use either a library (there is A LOT others) like jquery, or, like mister Diaz tell before, with YUI.For jquery, you have to change your css to something like top:-500px. The code for that is: $(document).ready(function(){ $('#popup').animate({top:600}) }) (ofcourse, you MUST include jquery.js I hope this will help you. And DON'T buy that software i0nutzb also nailed it. everything except the animation can be done with some simple logic. Unfortunately, I simply refuse to do animation without a library. As mentioned, jQuery and YUI both do it quite well. Even scriptaculous can do the the top animation with something like Effect.SlideDown. I think your best bet for something like this is jQuery. Nevertheless, there are other factors to take into account, for instance, when a user scrolls down the page, and also at which point do you want to show this popover dialog, and lastly if the user ever wants to see this thing again (if it's an ad) - then you'll want to dive into cookies to store their preference. I used Jim Auldridges Cookie Library for that. It's well-written, namespaced, and abstracts the dirty work for you polvero, the first link you posted points to your desktop :D."...here is a stubbed out 2 minute version." Ahahaha. Awesome! That's too funny. here's where it really is: This topic is now closed. New replies are no longer allowed.
http://community.sitepoint.com/t/how-to-create-popovers/3612
CC-MAIN-2015-06
refinedweb
564
72.36
Hoops~ C I T RU C U N T Y 0 Lecanto gins- :-C basketball : HIGH FORECAST: Mostly beats Wesley- 74 sunny in the morning, *ksChapel in " regional LOW then cloudy. North quarter final 43 winds 5 to 10mph. PAGE -"I --- I PAGE 2A P , - >n ez Bank-bested by 'Band-Aid Bandit' Deputies: Heist is man's 37th incident AMY SHANNON ashannon@chronicleonline.com Chronicle A bank robbery in Inverness triggered a lockdown at area schools Thursday morning while sheriff's deputies searched for a suspect they say is a robbery expert who now has 37 bank heists to his name. And this robber is no stranger to law enforcement "We are of the. belief that this' was the Band-Aid Bandit with yet another bank robbery," sheriff's spokeswoman Gail Tierney said. At 9:24 a.m., a heavy-set man walked into the SouthTrust Bank in Highlands Square plaza and demanded money from three tellers, Tierney said. Tierney said man wore his trademark circular Band-Aid on his left cheek He placed an undisclosed amount of cash into a bag and ran out of the bank, though witnesses did not see him get into a car, she said. YOU CAN HELP I Anyone with information about the robberies should call the Citrus County Sheriff tips line at (888) 269-8477, or Crime Stoppers at (800) 873 8477. Authorities believe the man is responsible for bank robberies in eight Florida counties, dating back as early as December 2000. Out of his 37 attempts, 35 have been suc- cessful. . With such a lengthy record, local officials took precautions. Inverness Primary School, Citrus High School, Pleasant Grove Elementary School, Inverness Middle School, the Renaissance Center and two day- care centers went into lockdown Please see /Page 5A 7 people living at center Official lsinspec find code violations, give warning DAVE PIEKLIK dpieklik@chronicleonline.com Chronicle A collection of couches and chairs usually filled with people looking for help sat empty Thursday at Act II in Inverness, three days after the drug and alcohol counseling provider was warned by city officials it was not complying with the code prohibiting guests from staying overnight Following .an anonymous complaint that guests were sleeping there, Building and Zoning -official Paul Vargoshe and a fire inspector went to the building at 1515 White Lake Drive to con- duct an inspection. Vargoshe said they found seven people living, there, and that the building isn't licensed to house guests. He said people were sleeping on the floor, and were taking showers in the back yard using a garden hose. Though the building is licensed to provide counseling and related services, they 4o not have permission or the ability currently to operate as a halfway house. Although he was not cited for violations, Director Charlie Patterson was warned to Please see CODE/Page 5A Bwiih ODcea n * C 4CS A---- __6 %w& 26U __~j W WO 26 CM., 4L Annie's Mailbox . 7C Movies ......... 8C Comics ......... 8C Crossword ....... 7C Editorial ....... 10A Horoscope . .. 8C Obituaries .. ... 6A Stocks ......... 8A Four Sections S. 26 Con~ut~oh~ti a c MATTHEW BECK/Cnronicle Paul: "Skip" Christensen relaxes with his model railroad set at his Sugarmill Woods home. Christensen led the community on several Issues as president of the Sugarmill Woods Civic Association. Paul Christensen has retired as the voice of Sugarmill Woods residents TERRY WiTT terrywitt@chronicleonline.com Chronicle P aul "Skip" Christensen never set out to be a public figure in Citrus County, but it came with the terri- tory. Christensen, 61, was thrust into the- pub- lic spotlight two years ago as president of the Sugarmill Woods Civic Association when the community filed suit to stop the sale of Florida Water Services to a pair of Panhandle cities. He became the public voice of the asso- ciation in sworn testimony to the Florida Public Service Commission and in com- munications with his fellow Sugarmill res- idents as the legal fight progressed. The sale eventually was stopped. Florida Water sold its 11 utilities in Citrus County, Sugarmill included, to the Florida Governmental Utilities Authority (FGUA). Its other holdings around the state were sold either to FGUA or to city and county governments. As a member of the Suncoast Parkway Advisory Group, Christensen has been active in voicing the opinions of the asso- ciation, but says he is personally neutral on the issue of extending the parkway through Citrus County. Christensen recently retired as Sugarmill's president after four years at the helm. He takes no credit for helping kill the Florida Water deal, but notes that Sugarmill's efforts benefited more than one community. "Everyone who was a customer of Florida Water benefited, including its 14,000 customers in Citrus County," he said. Christensen worked as a Navy cryptolo- gist as a young man, but won't disclose details about what he actually did while anchored off the Vietnam coast during the war. He served in the Navy from 1966 to 1986. Among his posts were the Naval Security Station, Naval Security Group Taiwan, USS Oriskany (CVA 34), Naval Security Group Okinawa, Atlantic Fleet Command Please see CONDUCT/Page 5A Planning board urges dropping exemption Tree ordinance would apply to developers TERRY WTTr terrywitt@chroriicleonline,com Chronicle L Les Githens won an important C political battle Thursday when the county planning board agreed that developments like Citrus Hills should not be exempt from the Citrus County tree ordinance. The Planning and Development Review Board voted 5-2 to recom- i mend removing the exemption for Citrus goes country The Grand 'Ole Opry returns Saturday to Curtis Peterson Auditorium./1C planned developments, or PDs. The recommendation will go to the Citrus County Commission for a final review. Part of the motion recommended that county staff members review the tree ordinance enforcement process to determine whether more code enforcement officers are needed to make the ordinance work Githens, who lives in Citrus Hills, said he got involved when he. saw No more horse and hound Controversial British law banning hunting with hounds takes effect today; opponents vow to fight for repeal./12A large tracts of virgin forest being bulldozed in Citrus Hills to make room for new homes. He researched the tree ordinance and discovered his community and other PDs were exempt As it turned out, Citrus Hills developer Stephen Tamposi was acting legally. The county commis- sion had added a clause to the tree ordinance exempting existing planned developments from the tree protection requirements. PDs are subdivisions that have a master plan. Citrus Hills, Black Diamond, Bring It on, dude A professional wrestler- turned-minis. ter "brings it" to First Assembly of God in Homosassa Saturday and Sunday. /Saturday Meadowcrest, Sugarmill Woods and the Tradewinds are examples of PDs. In exchange for providing the county with a detailed plan showing how development will occur, the county gives the develop- er more design flexibility. Tamposi, through his spokes- woman Avis Craig, has argued that he replants hundreds of trees every year on land cleared for housing. But Citrus Hills residents at the planning board meeting said it was unfair for developers like Tamposi Please see EXEMPT/Page 5A Dollar couple depart Utah for county * The Pine Ridge couple accused of torturing children should arrive in a week./3A * Lecanto man injured in motorcycle accident./3A * Options thin for Schiavo./3A 'Band-Aid Bandit' from security camera. . I I t4 7ml V, n I i i 2A ThrlljrAvkx7 nUUTAtLV R 0l5ETETANEN ITUSCu FL CRNII Florid ES LOTTERIES___ rn Here are the winning numbers selected Thursday in the Florida Lottery: CASH 3 5-3-4 S PLAY 4 6-6-1-7 FANTASY 5 14-16-18-23-28 WEDNESDAY, FEBRUARY 16 Cash 3:4-1-4 Play 4:2-8-2-5 Fantasy 5:5 6 14 20 32 5-of-5 No winner 4-of-5 294. $986.50 3-of-5 10,009 $11 Lotto: 6-7- 8-35-48-52 6-of-6 No winner 5-of-6 57 $6,161.50 4-of-6 3,597 $79 3-of-6 77,567 $5 TUESDAY, FEBRUARY 15" Cash 3:7-7-4 Play4:6-0-0-7 Fantasy 5:12 -,14-15 19 36 5-of-5 2 winners $116,155.29 4-of-5 306 $122 3-pof-5 9,841 $10.50 Mega Money: 6 -25 28-44 Mega Ball: 15 4-of-4 MB No winner 4-of-4 9 $3,350.00 3-of-4MB 102 $646 3-of-4 1,735 $113.50 2nof-4 MB 2,669 $51.50 2-of-4 24,314 $5.50 1-of-4 MB 54,854 $4 MONDAY, FEBRUARY 14 Cash 3:4-1-4 Play4:9-6-2-8 Fantasy 5:7 -9-15 24- 25 5-of-5 5 winners $38,985.08 4-of-5 459 $82Z 3-of-5 12,791 $8 SUNDAY, FEBRUARY 13 Cash 3:8-6-3 Play4:2-8-2-5 Fantasy 5:19 21 23 27 35 5-of-5 1 winner $1'94,370 4-of-5 286 $109.50 3-of-5 8,591' $10 SATURDAY, FEBRUARY 12 Cash 3: 4-4-2 Play 4:3-7-9 0 Fantasy 5:'8- 19 20 22- 28 5-of-5 2 winners $138,227.60 4-of-5 434 $102.50 3=-f-5 12,802 $9.50 Lotto: 3 17 19 28 33 -48' INSIDE THE NUMBERS Toverify the accuracy. of.. wi!rnimg.lQttery numbe'rs;-..,. - playej,.should d9oublecqhck, the numbers printed qbove with numbers officially p6stea by the Florida Lottery. On the Web, go to .com; by telephone, call (850) 487-7777. ! PSSwa l _-_--- 6 f wmwmna it "md ''.--y"ndicated Cc Available from Commercia _^ -_ W ^^^^k 1- __ _^^ -^^^ ^jjr- k^ ., .-.--. AN S. "--' Aft: ~mrn - I~ b~ U,- a U __ a -~ d~ b- ""a - * -a ~- ,Q ',. ~"" .a.- 0...... .~ a - of )tmeni - S ,.~* wa - m 4--AN a. - . ,.... ... ... .. w ,,t , Newsrovidirs, heo __ _- ftmw4004o 04w4 dm ot-qp U -a ft b wm*o 1M -m -mm40 to An____ od e4=01 Aw m a a. - Wa a, -. U- *~. S.. 4 .~4 ~ row .... ... .... :-I *, -0 nip 1 0 S-9 * .-Q I 'W * ~. a - --^ *' "-~ f m, ....\ low-0 , mn.mD . i ll.... -.. . . . . . . . dmmunew - *O a~IIP ll)sr .............. ....... .. .. ... ... .. o Now n-%No. ... 9.0 '-am ~ 0 .. . .. . .. . .. . .. . .. . . 4"- .a pp- *. -m -. AN-V~ .-w *-:l -i -lm Co pyrig ied M erl I .w a **8x * U -~ a - ,~I. ~ - a . .m ..~ of snw amo . ...... . ... . ....... .... .......... CiTRus CouNTY (FL) CHRoNicLE 2AFRMAY. FEBRUARY 18, 2005 ENTEWrAINMENY ,,. I::: ":::: 00 40db XK i Mom i*5 Oc \*1 K V p7~ ~A 3A FRIDAY FEBRUARY 18, 2005 NOW: EEO P"CopyrightedIMaterials t MW%-lwan- -- .. l f_ _.___ Ce n t- - --9 'me .~ a . Syndicate- C et- - Availab le from Commercial News Providers! - a.- a o - Dollars enroute from Utah Should arrive next week AMY SHANNON' ashannon@chronicleonline.com Chronicle A private transportation company began the extradi- tion process Tuesday of a Pine Ridge couple accused of tor- turing and starving five of their seven children. Citrus County Sheriff's offi- cials expect John and Linda Dollar to arrive at the county detention facility sometime t the end of next week The 2,200-mile trip is expect- ed to take a while, as the com- pany will make several drop- offs'and pickups along the way, Sheriff's Office spokeswoman Gail Tierney said. Tierney said the couple is being ground transported, most likely via bus. Once they arrive at the Citrus County jail, Slieriff's Office investigators will inter- view the couple, if they are willing to speak about the alle- gations, Tierney said. John and Linda Dollar each face a charge of aggravated child abuse. Bond is set at $100,000 for each. Inves- tigators might add four more charges for Linda Dollar, to total five charges one for each allegedly abused child, Tierney said. They also might add five more charges for John Dollar, to total six charges one for each allegedly abused child and another for the neck and head injuries that sent his 16- year-old son to the hospital Jan. 21, Tierney said. a -~ - -0911b qas Motorcyclist airlifted in crash BRIAN LaPETER/Chronicle Sharon Baukin, center, Is comforted Thursday while rescue personnel treat her husband, John, after a wreck on State Road 44 at North Maylen Avenue in Lecanto. Lecanto man struck by car, transported to Tampa General Hospital AMY SHANNON ashannon@chronicleonline.com Chronicle A motorcyclist who is known by friends as "Lucky," was just that Thursday afternoon, according to a nurse who stopped to help the man after he collided with a car on State Road 44 in Lecanto. "I think he's very lucky," said Charrington Morell of Homosassa, who was on her way to a bank in Crystal River. "He's doing OK. Breathing well. He's talking." At 3 p.m., a Chrysler Sebring driven salon fta - 4w 4m -.Go .-a a-a mom- 4 4 p- 41 -o -.00 aas. 4ua -a - dM a.- d- ftp a.- a. a. S. - a - - a a. ~ *a-.- * - ~ -a ~ - ~- ___ a a .~ * ~-a ______ -~ a * a. - a - -S. ~ a. a.- ~ - a a. a. - a a - a = a. - - - a. a. -a- - 0. - 0~~ - = by Albert Joseph Harvey, 72, pulled in front of John Walter Baukin, 62, of Lecanto, as he traveled in the inside eastbound lane of the roadway, Deputy Joe Casola said. Casola said Harvey was attempting to make a U-turn into the eastbound lanes, violating the motorcyclist's right of way Baukin ran into the rear of Harvey's car, ejecting Baukin from his Honda Gold Wing motorcycle, Casola said. Nature Coast EMS workers trans- ported Baukin by ambulance to Crystal Glen, where he was airlifted to Tampa General Hospital. Casola said a trauma alert was sent out, though he believed Baukin's injuries were not life threatening. Citrus County Sheriff's Office deputies deterred traffic around the accident, blocking off one lane of traffic with orange cones. Blue glass and motorcycle pieces blanketed the road- way at the accident, across the street from Seven Rivers Presbyterian Church. Along with Sheriff's Office personnel and Nature Coast EMS, Crystal River Fire Department and Citrus County Fire Rescue officials also responded to the crash. Offvilicillk 13M Wbout thkdkh&fdr der dW -MM a-~ a-.- a a. a *. -~ _- - a- a.. .- - a .a a ~ a..-.. - -"a -a - -' a '~ - a a S - a *a a - -- -- S a - a. --ma a -41b.-.00 4WD . 4D 4b - -o a 0 4N- -. -a- 4mb-aft-wa a a ___ a. a.. a- a a a -dumb -S County BRIEF Boosters investigated for missing money A middle school band booster group is being investigated by the Sheriff's Office to determine what happened to $3,600. "We are looking into what was reported as a grand theft ., from Crystal River Middle 3 School," Citrus County Sheriffs Office spokeswoman Gail Tiemey said. The case began Feb. 11 and- no one has been named as a suspect. Investigators believe about $3,600 was taken from - the boosters' account since the start of the school year, Tiemey ? said. Bear Cat Band Inc. raises money for the middle school " band's field trips, uniforms and instruments. The group is made, up of volunteers and parents, , CRMS Principal Gina Tovine said. The group operates inde- , pendently from the both the school and the district. From staff report - a so @e0 e 0 S** 00 - ao 0-- S 4W 4 am o b-4 qdo* dbS o o - 41 Correction Due to an editor's error, a headline on Page 15A of Wednesday's Chronicle, "Author to sign children's books," was incorrect. Evelyn Bash's book, ' "True Dog and Cat Tales," is not a children's book. The Chronicle regrets the error. I-No' - an=a- m - ubag U - - db -. . , . .. - o 0 CrrRus COUNTY (FL) CHRONICLE- vHomelaMd "CofrightedcMaterial pV'i, _^py .-Mb nc a -rw ur-e Glob-- - =e .a SWON.ndicata. -Content- . ----" mm~w w m-w mu . . .. .p.4w - A Ib from Commercial NewsCProviders.: -AValaS-e. 40 dng w 4b ftaft-dft V -U- "D _w 40o ?~_d 4b~mm) ww 4-qm- q_ w 1 a6a 40 O-m ami e- s~ -a. - wwo-we-iosa IAM 400D glno 0ol-so 0 0 muw emd o - -qmw o 4 mm- ONO q im aO 0 p o and a MINEW ow -mmm o,4 49FMINM 010'OE aOM. own an 0 waw wiw-1I - Sowas 004bom, m a.l adhos,0__P w.no ow bw emoswea.a - Own onab = 40 0 a. MM 0 401% so4bco- d 0o sum,* Momi gne40awsmo MO40osopom emoif 0 m 40 -w s 0- S d adb ftw 1 00 0 4a f 0 -1b 00a0m- WA 0. b-M q-O0 N domomp 1D -mo-o am&-. Nm.- 41anow- ft-4mmmm *a am -410 40 -44,- ol- GO O- anum 10s w4m amum0-NMOmom- 41 -..lbi- u a. -glo 0 -48osmab nw qom -m a40M44 - O imoa- .0- -Nao sno am a-umm o l a- 0-mipcp-wa-m OR m -omloo moani ab .-a . 4 W N M W d m = N wom 1D -w4 SO -_.1m walumm.0 ap O.Mb. -. 4 SIMEM WOMOIM a 1b- awmw40 . Q E 0 1 b 0 d I. 40 4 4 - a1w4m D-NI -w a a.. m MIND For the RECORD CItrus County Sheriff ON THE NET ; Arrests SNanette Smith, 19, 5593 For information about Holiday St., Homosassa, at 6:30 arrests made by the p.m. Wednesday on charges of Citrus County Sheriff's possession of marijuana and pos- Office, go to. session of drug paraphernalia. fcitrus.org and click on She was released on her own the link to Daily Reports, recognizance, then Arrest Reports. Richard Scott Hill, 44, 8851 . Mendoza Way, Citrus Springs, at 10 p.m. Wednesday on a She was released on her own charge of criminal mischief. recognizance. BLINDS. I kt11M:M JdKIl(V~iU'iJ:]UJ FVerticals FREE Wood Blinds * In Home Consulting Shutters * Valances * Installation Crystal Pleat th ISilhouette LECANTO TREETOPS PLAZA 1657 W. GULF TO LAKE HWY 527-0012 57 HOURS: MON.-FRI. 9 AM 5 PM Evenings and Weekends by Appointment a.- - a- ~ ~4ma. - a. - -a ~ ~ - - - a.- *~* - - a.~ -~-- a. - MMNU 401a 40m- .4m- mo oepo - op o- --Ma 4D 4004a ft.- gm- a a M-0 atm a0 ---Mm - m ~ 4wa.m a a Ow a. & m40o a.mm a. - p- oo 40- 40 1M -W a. -40 00 . 0--ob m0lm mw -aI al a! a * a a a -a * - a Alle- a- o m am .o o- a .00 ft a.m am- a 411mm- 4- lolo- alois4 o fm bda 6.00. a.- __ pm a. -ma 10- bft- qp -a aaw 0 w * 4 q-mmoa 10-"low o--0 40 a -i ' a 4mww . S N qo am-a41 -wo- -- qm -lob 4110 a m wwaabutbaths.comn All T About W m -. a 091w 4b- 4w 4o a.owm wwqj- m0 am 0 -0 . -~4 IRM quo M 4ua a. qumom- .4d- -a -mp q- -o4NO B m.-.W S- N 40 a w a..w aft 4D S -W -4W a B a. -.- ~ - * ~ a - -a. - a. - -~ ~ ~- a ~ - a~ a. a a. a a. a. a. - - * ~ ~ a - - ~ ~ a.~ a ~ a. m low . ...0 popag 40 --mm & .090-4 - - WW.M- qq-a a - ---q ng fb- dip aP w a. mo 4 - 3 c. D LHRONICLL Fiorida's Best Community Newspaper Seviing Flvridr's 8st Comml i To contact us regarding your sevicer 1888-852-2340 To place a display ad: 563-5592 To place an online display ad: 563-3206 or e-mail us at nccsales@chrnllne.com Newsroom: newsdesk@chronicleonlIne.com Where to find us: Meadowcrest office Inverness office -- 44 J 106 W. MAIN ST., INVERNESS, FL 34450 PERIODICAL POSTAGE PAID AT INVERNESS, FL ~SECOND CLASS PERMIT #114280 a. op w- 4D I First Clas LLC Roll Off Containern 10-40 yds *Land & Lot Clearing *Tree Service 352-527-443( Crystal River Takes Care of its Own A beautiful ending to a terrible tragedy happened the first week in February, in the wonderful town of Crystal River. I, Lisa Marie and my husband Christopher Strickland of Steinhatchee, Florida, Received the tragic news about our loved one, Andrew Richard Bartlett, that he had passed away February 3rd. He was a local musician in Crystal River for 14 yrs. We were called upon by some of his dearest and closest friends to help keep Andy's funeral at home and for a chance to mourn and comfort each other to help all of us find some kind of closure. My husband and I began the hard journey in making the funeral arrangements necessary, according to Andy's wishes, in case of his death. Andy and I were partners in music for over 13 years and were married for 4 years. Though we parted in July of 2000, we stayed the best of friends and continued a musical relationship along with my husband Christopher up until the day we lost Andy. Chris and I would like to thank all the people of Crystal River and the places he played at for giving Andy a send off only topped by royalty and big celebrities. He received a standing ovation at the funeral home during the ceremony. Then musicians and his friends began having benefits to help my husband and I with the costs that have accrued. We would like to thank all who participated and gave, in Andy's honor. It is nice to known matter how big Crystal River grows it still has the heart of a small town and I know Andy is smiling down from heaven at all of us. Sincerely and lovingly, Lisa Marie d*JUL FRIDAY, FEBRUARY It$, /-UL)70 I VFW - W I I I AA lRu,A lRpnRiTARv IS- 2005 I a qmmmpmmw4w t - - 40 law FRIDAY, FEBRUARY 18, 2005 5A CITrRus COUNTY (FL) C BANK Continued from Page 1A mode until 10 a.m., Tierney said. "What it means is that the classroom doors are locked and basically all gates or any- thing that can be secured is secured," Tierney said. "And any visitors are closely moni- tored from the administrator's office." The suspect is described as a Hispanic man in his late 30s, 5-feet-4 to 5-feet-6 and weigh- ing 200 pounds, Tierney said. Through surveillance camera images, he appears to have a skin discoloration on his hands and face, Tierney said. He was wearing a black wig, dark sunglasses and a short- sleeved checkered shirt. . Tierney said four customers and five employees were in the bank during the robbery The man waved a handgun, threatening customers and employees, but never fired it. Tierney said the incident shook up the tellers, but no one was hurt. Sometimes called the "Beer- belly Bandit," the elusive rob- ber has become invisible to law enforcement, even Flori- da Department of Law Enforc- ement officials, who became involved in the man's search two years ago. "We're having a hard time seeing a pattern," said Ray Velboom, an FDLE special agent supervisor "It is frus- trating." Thursday's bank robbery is ithe second time the man has hit Citrus County. Tierney said hte robbed a Capital City bank in Inverness on May 21, 2003. .Special to the Chronicle Volunteer boaters are need- ed for Citrus County's inaugu- ral community derelict crab trap-pulling event scheduled from 9 a.m. to noon Saturday, March 5, at the Crystal River Buffer Preserve State Park. Abandoned or derelict crab traps are hazardous to boaters and other recreational users of Citrus County and are also fatal to marine life caught in these "ghost" traps. ; Once these traps become lost, they are difficult to see from the water surface and can remain for years in aquatic habitats without decomposing. When crab traps are left sitting on the bay bottom, many blue crabs, stone crabs, fish, dia- mondback terrapins and other '4 ,~ ,'~. :~'~ f:' Special to the Chronicle Caught on security camera Thursday, the bank robbery suspect is described as a Hispanic man in his late 30s, 5-feet-4 to 5-feet-6 and weighing abut 200 pounds. The most recent robbery involving the man happened at a Sarasota bank in December, Velboom said. He also is believed to have robbed a Brooksville bank in October and a Hillsborough County bank in September. Before that, he took a 10- month break in November 2003, following a Sarasota bank robbery, where a "sub- stantial" amount of money was taken, Velboom said. Along with Citrus, he's robbed banks in Alachua, Hernando, Hillsborough, Marion, Pinellas, Polk and Sarasota counties. FDLE, the FBI and Crime Stoppers officials are offering a $25,000 award for anyone able to give information that leads to the man's arrest. Anyone with information about the robberies should call the Citrus County Sheriff tips line at (888) 269-8477, or Crime Stoppers at (800) 873-8477. CODE Continued from Page 1A remove guests until he is able to comply with code and get a license allowing him to house people. He may still provide counsel- ing services. "We will make sure no one is spending the night," Vargoshe said. "If they are, the next step may be to tell them they can't occupy the building at all.". . He said along with not hav- ing shower facilities, the kitchen needs to renovated, including adding a hood to the oven. Fire extinguishers also had been moved around. He said the counseling serv- ice was given an exemption to allow one person a security marine life can be caught acci- dentally. These traps continue to bait themselves year after year Reservations are required. Volunteers will assist in the retrieval of premarked traps from specified areas of the; Crystal River and Crystal Bay. Assistance is needed to pick up and transport the marine debris back to Crystal River Preserve State Park for dispos- al.. CONDUCT Continued from Page 1A headquarters, USS Nimitz (CVN 67), Naval Communi- cations State Pain and National Security Agency Christensen earned a bache- lor of science degree at Northern Michigan University, a master's in business adminis- tration from Golden Gate University and a bachelor of science in computer science from the University of Maryland. After leaving the Navy, he was a computer systems engi- neer from 1986 to 1996. He was last assigned as systems administrator for the White House Communications Agency. He also taught comput- er science at the University of Maryland from 1988 to 1996 as an adjunct faculty member In Tallahassee, attorney Mike Twomey, who represent- ed Sugarmill Woods in the Florida Water battle and in other litigation, said Chris- tensen is one of many high- quality presidents he has worked with during the years in Sugarmill Woods. But he said Christensen ranks "right at the top." His intellect and ability to understand complex utility law and communicate those con- cepts to his constituents set him apart, he said. "They're. going to have a hard time filling his shoes," Twomey said. Twomey noted that George Borchers, the new president, will be another quality presi- dent, an assessment echoed by Christensen. MEN When Christensen moved to Citrus County ini1997, e-mail guard to spend nights in the building. Act II office manager Carol Lane said while she under- stdnds the building is not set up for overnight stays, she also is aware how necessary it is for people with addiction prob- lems to get help. "There's security being in a safe environment There's con- sequences, accountability," she said. "They had nowhere else to go." Lane said the center is tak- ing steps to ensure it complies with code, and its continuing efforts to obtain a halfway house license. She said part of the problem is money, saying guests pay what they can for services. She said the center has got- ten close to renovations sever- al times, but plans fell through. Hawaiian Gold- Laya-ay Layaway Available GEMS Established 1985 600 SE HwY. 19, CRYSTAL RIVER 795-5900 to have a hard time filling his shoes. Mike Twomey attorney who represented Sugarmill Woods, and worked with Paul Christensen. was just getting started as a communications tool. After he took office, the asso- ciation started the Sugarmill Woods Bulletin, with 40 to 50 e- mail addresses of members. The Bulletin kept members abreast of issues. By the time Christensen left office, the online bulletin had grown to 1,100 households in Sugarmill Woods. U.. Christensen fills his spare time building model trains in a room separate from the house He grew up in Marquette, Mich., a shipping point for iron ore mined near the towns of Nagaunee, Ishpeming and Republic. He has built replicas of the towns and the ore min- ing facilities he remembers from his boyhood. He said flatly he has no polit- ical aspirations, at least as it concerns government. Com- munity service is another mat- ter. He remembers when he was asked to join the civic associa- tion's board of directors. In a moment of weakness, he agreed, he said, knowing full well he would throw himself into the work "I like to get involved," he said. "I think that's called a Type-A personality. That why I have the train. It gets me out of the Type-A personality." She remains hopeful the build- ing will remain open and allow more people to get help. "When they get here, they've lost everything," Lane said. "We give them a chance to start over." Continued from Page 1A to be given an exemption from the tree ordinance that isn't available to them. They also said clear-cutting trees destroys the natural environment and dislodges the wild animals. Pat Maynard, who lives in one of the original neighbor- hoods constructed in Citrus Hills, said the late Sam, Tamposi, Stephen's father, allowed residents to save the trees they wanted before the home was constructed. She said it added to the beauty of the homes. "You can stand on the hill (being developed now) and look down on our area and you see mostly trees and a few rooftops," Maynard said. "But when you stand at our place and look up at what they are developing, you don't see any- thing but houses and rooftops.". Craig could not attend the planning board meeting, but sent a letter to PDRB Chairmaii Walter Pruss explaining Tam- posi's position. She noted most of the aerial photos used byI Githens in his presentation show the new Hunt Club neigh-, borhood. She said the land was 60 to 70 percent pasture before the site was developed. "Citrus Hills went to great lengths to save as many trees as possible," she wrote. "In fact, more trees were saved (63) than' were removed (55)," she said, noting the majority of saved trees were 19 inches in diame- ter or larger She said no other developer in the county has replanted more trees than Tamposi. She said "literally thousands of pine trees" have been planted.' She said the trees replanted for "streetscaping" in Citrus? Hills include 106 live oaks and magnolias on Terra Vista' Boulevard; 225 live oaks, laurel oaks and magnolias on Fenway Drive; 106 live oaks and magno- lias in Skyview Villas; 190 live oaks and magnolias in Foxfire;: and 176 live oaks, magnolia, river birch and cypress in Hunt Club. Dennis Tim Mike DONT BE FOOLED BY IMITATIONS! Ask for... Solatube- by name. Ch-se * pi4pW Tedn~lqggSets 4.4jtdard OlhW WCat Matal i- tOu reSSjIO st IDS erM arq LEacT~ter. cinILu La roOWiqimof Doign Elinlaltes All Problgms *I prease 70%, Mpre %VplLl4Mit It Your Rooms- Onr Nice Quoted 94 WOOD eaUwn.'*C gpreb=Ke sitWarrquty Assures Peice atfMinO Ll~pWe4 nd lasureg CG(0572(19 , -" SOLATUBE. HIOT ATTIC? The MiracleSkylight SOLAR-POWERED ENERGY EFFICIENT ATTIC FAN Full Solatube Warrarity *2- Hour Professional Installation Hurricane Tested 8 Approved - Great for Bathrooms, Hallways, ' andKithens olatube.com WWCV Saturday, Feb. 19" 2-4pm Center Court Crystal River Mall Over 200 contestants competed Now the five finalists sing to become The first "Nature Coast Idol" * Sarah Bunnell * Suzie Holstead * George Robinson * Anita Soto * Laura Strawn Gold Jewelry: Movie Tickets; Dinners & A Personal Karaoke Machine! CONTINUOUS At Lakeside Parl Saturday, February 26t1 ERTAINMENT 10 A.M. TO 4 P.M Raindate Sun., Feb. 27 Bring lawn chairs and spend the day! Brought o you by Th Visitor and Thl Kitanis of CentralRidi CALL 746-4292 For Information There going EXEMPT Boaters needed to pull crab traps WEEKLY AQUATIC SPRAY SCHEDULE FOR CITRUS COUNTY Citrus County's Aquatic Services Division plans the following aquatic weed control activities for the week beginning February 21, 2005. HERBICIDE TREATMENTS: Floral City Pool Willows/Alligatorweed/Hydrilla/Pennywort/Salvinia Sedges/Tussocks i Hernando Pool Nuphar/Grasses/Water Hyacinth/Lettuce/ Hydrilla/Willows/Trussocks/Sedges Inverness Pool Fanwort/Coontail/Hydrilla/Frogs Bit/ Grasses/Tussocks/Sedges/Water Hyacinth/ Lettuce/Torpedograss/Cobomba/Nuphar MECHANICAL HARVESTING: Crystal River Lyrigbya/E. Mifloil Inverness Pool Tussocks/Coontail/Naiad Hernando Pool I Building Beautiful Homes, I ...and Lasting Relationships! "Join the Winning Team!" 1-800-286-1551 or 527-1988 1!L4637 W Pine Ridge Blvd. STATE CERTIFIED CBC042359 ,HRONICLE -y univrrP I I- I 6A FRIDAY, FEBI CITRUS COUNTY (FL) CHRONICLE' ...., 10 R "nne- Obituaries Steve Butler, 50 FLORAL CITY Steve Butler, 50, Floral City, formerly of Tampa, died Tuesday, Feb. 15,2005. A native of Tampa, he had resided in Floral City for six years. He was preceded in death by his mother, Thelma "Polly" Butler. SSurvivors include his father, Hinton 0. Butler of Floral City; brother and sister-in-law, Stan and Karen Butler of Bushnell; two nephews, Keith Butler and wife, Jennifer, of Riverview and Shane Butler of Bushnell; uncle, John T. Butler of Tampa; aunt, Sheila Stodghill of Tipersville, Miss.; and great- uncle, Thomas Hunnicutt of Fort Valley, Ga. Serenity Meadows Funeral Home, Riverview. Tony Levato, 89 CRYSTAL RIVER Tony Levato, 89, Crystal River, died Thursday, Feb. 17, 2005, at the Life Care Center in Lecanto under the care of their staff, his family and Hospice of Citrus County. Born Feb. 21, 1915, in St. John, Italy, to Phillip and Constance (Marasco) Levato, he came here four years ago from Washington, Pa. Mr. Levato was a retired fore- man in the glass industry for many years and served in the U.S. Navy during World War II, having been honorably dis- charged with the rank of sea- man first class. He was a member of the Immaculate Conception Church and the American Legion Post No. 175, both of Washington, Pa. He enjoyed playing golf. He was preceded in death by an infant son, four sisters and one brother. Survivors include his wife of 69 years, Antoinette Marie (Brach) Levato; daughter, Myra Day and husband, Ted, of Crystal River; brother, Frank Levato of Washington, Pa.; sis- ter, Lucille Spina of Walnut, Calif.; two grandchildren, Lori Shaw-Knight and Ted Day Jr.; two great-grandchildren, Brittany Elizabeth Day and Adam Anthony Hopkins; and several nieces and nephews. Chas. E. Davis Funeral Home with Crematory, Inverness. Beatrice Tokarske, 85 HOMOSASSA Beatrice Eugenia Tokarske, 85, Homosassa, died Wednesday, Feb. 16, 2005, at Life Care Center of Citrus County in Lecanto. Born Oct. 18, 1919, in Steamburg, N.Y, to Earl and Eugenie (Crooks) Jaquay, she moved here 31 years ago from Clearwater. She was Christian. She was preceded in death by her husband, Ernest C. Tokarske, and son, Earl F. Tokarske. Survivors include a son, Ernest C. Tokarske and wife, Barbara, of Largo; daughter, Cookie Meredith of Chassahowitzka; brother, Eugene Jaquay of Randolph, N.Y; sister, Anna-Mary Ireland of Kennedy, N.Y; seven grand- children; 10 great-grandchil- dren; and 10 great-great-grand- children. Wilder Funeral Home, Homosassa Springs. Funeral NOCES Tony Levato. Funeral servic- es will be conducted at 11 a.m. Saturday, Feb. 19, 2005, from the Chas. E. Davis Funeral Home of Inverness with Fr. James Johnson of Our Lady of Fatima Catholic Church offici- ating. Burial with full military hon- ors afforded by the Floral City VFW Post No. 7122 will follow at the Memorial Gardens Cemetery in Beverly Hills. Friends may call at the Chas. E. Davis Funeral Home on Saturday morning from 10 a.m. until the hour of service. Beatrice Eugenia Tokarske. *A memorial service for Beatrice Eugenia Tokarske, 85, Homosassa, will be conducted at 5 p.m. Saturday, Feb. 19, 2005, at Wilder Funeral Home, Homosassa Springs, with Dr. William LaVerle Coats officiat- ing. dom - -m - od LW w 40 4 am w .om 6400*m m m~q imoed mm -00 -am- 40 -m o 4w m-o o- S q m MR 40 mo -oom- amwp - smm- qm pt N- 480- on -ago 40o q. w * - ogmm- -m lom * *.M 0 m IM0- 00 %WMW --*EMR WWNO-f mm 41M-.-01 same Deaths ELSEWHERE Queen Nariman Sadeq CAIRO, Egypt Egypt's for- mer Queen Nariman Sadeq, the ex-wife of the late King Farouk, died Wednesday. She was 70. Nariman had suffered a string of health problems in recent years, including a stroke and a brain tumor. She died in Dar al-Fouad hospital, on the outskirts of Cairo, after suffer- ing a brain hemorrhage, Egypt's semi-official Middle East News Agency reported. Nariman was 16 when she married Farouk in May 1951. She gave birth to Farouk's heir, Ahmed Fouad, in 1952, six months before the monarchy was overthrown by the military in July. The royal couple, their baby, and Farouk's three daughters from a previous marriage fled to Italy Nariman and Farouk later divorced and she returned to Egypt in early 1954. nl- _ 1_J A-1--- A 1 hood since then. Jewel 'Samm' Smith OKLAHOMA CITY - Country singer Jewel "Sammi" Smith, known for her trade- mark ballad, "Help Me Make It Through The Night," and a knack for sharing everyday life in her music, died Saturday She was 61. Smith died at home after a long-term illness. The Guardian West Funeral Home did not release further details. Smith won a Grammy for best country vocal perform- ance-female in 1971 for "Help Me Make It Through The Night," which was written by Kris Kristofferson. Smith produced her first hit, "So Long Charlie Brown," in 1967. Six years later, she moved to Dallas, where she joined the "Outlaw Movement" with Willie Nelson and Waylon Jennings. Marcello Viotti BERLIN Marcello Viotti,, the music director of Venice's La Fenice Theater, died Wendesday night at a German hospital after falling into a coma. He was 50. Viotti succumbed after being in a coma for several days at a clinic in Munich, Germany, his agent, Paul Steinhauser, said by telephone from Vienna, Austria. Viotti, music director at La Fenice since 2002, conducted several renowned orchestras, including the Berlin Phil- harmonic and the English Chamber Orchestra. He also conducted at opera houses around the world, including Milan's La Scala and the Metropolitan Opera in New York He recently conducted a' production of Giuseppe Verdi's, "Aida" at the Met. ; Viotti, an Italian, was born ir1 the French-speaking part of _ _ . . . S- O- -e W W She married Dr. Adham Al- Smitn also round time to cel- Switzerland. =- 4mmom 0aomf tm 1* -- MP Naquib and the couple had a ebrate her Apache heritage. He studied at the Lausanne W PO N* an spn. ft-n - son, Akram, before divorcing. She was a frequent visitor to an Conservatory, and his career, 6 union aw k^ ^hem- -ma% -- 4 The former queen had lived Apache reservation in Arizona, took off in the 1980s as chief o a W 4- -- a e in a small apartment in Cairo's where she made pottery and conductor at the Turin Opera - G m d a, teo 401 upscale Heliopolis neighbor- jewelry. in Italy S-.._- --_"Copyrighted Material Ickfcn, A va la -leW frowomer-.,-oaf Nr ___._. sbOW oft -ao t ow1dll IN llls ,,n/"dl l aII I/ldl I/ -- -- -- --a -- | --OWl......-ma....Synhdicat d onte't ON- 4I0 I -N - -"Availablefrom Commercial News Providers": b ,-mb --ii;--' - - ft &A 40* 0 41 Qw -0 S aw m 0 40 dm- 40a 40__ - -~ * 4w 4D On wF p OE"u w-- a 41- Ow41 -o . 00 ft- IM 0 AMG tea 4 qw-mm- -0 Sa- swo41- do, 44omm * -dpm 40 qm- *pm ow4 4w0- 44p - -ga .4b-owA W* N - m-f -m qw w -- bm-do 40% - 4- b IC' ~ w- 0 f 0MENW- A 41 40 0m- mw ".id Mf -400o - m mm0 soigp" 40 -.db 4E Son -.10 19ft-Imus -00- dsm b - m a d- s 0- QIP qW Smo =0 .0-mm. MMI 0 -bso -.4m 1m -=OM 0 w MNO % -as - m -am owwww,- 4mW f 4W40-mm I -- p * o me "M 0 -00* w-4.M m WEEKLY UNEUP * q o ,* Im 'Funeral -Home -With Cremaory Juanita Boston Private Cremation Arrangements Dorothy Bassett Private Cremation Arrangements Majorie Matson Viewing: Monday 12 Noon Service: Monday 1pm Chapel Burial: Oak Ridge Cemetery Tony Levato Arrangements Pending 726-8323 The Dignity MemorialM mark can bt found only when funeral and cremation providers meet our rigid standards of service. It's a symbol of trust, superior quality standards and attentive care in the funeral, cremation and cemetery profession. With membership A Place for Everyone! . i- I 1U:;U AMr Sunaay on iUI.v wrov-rm , At The Corner Of N. Elkcam Blvd. & N. Citrus Springs Blvd, In The Heart Of Citrus Springs -d . (352) 489-1688 (352) 746-1500 A Southern Baptist Church Stan L. Stewart, Pastor *t -9 U-^**B^^^^^^^^ Imdlo AVy wMA- - SmwAV 00 m ib, Family Owned Service Since 1962. tricdland 1901 SE HY. 19 Funeral Hoe andCrematory CRYSTAL RIVER, 1901 SE HWY. 192-795-2678 CRYSTAL RIVER, FL 34423 352-795-2678 RUARY Id, ZUUo -------- ----------- ldlml IA ut I FRIDAY, FEBRUARY 18, 2005 7A* S .rA rr CITRUS CouNTY (FL) CHRONICLE i^lV thlonnif Ofi! 'O pyrightedaMateral uwuh.la 2.2.- __nn I.- a _ - n AVail ^1b f y ,, 1 1 V able frbm up- 0 - am-No-qu a- 0 --ot U ob. m- --MA - aw - a.q-m a. a C ~ C a _ iin located Content- - --~ - 0 a - MENO w w 1m qw- tm- AN- - 4am 40 eC 4 Commercial NWS Proviclrs __ ,_ _,- ,- -. .- do- a 0MM 4=0 w- om amlw Mm a owqw- - ldm w..me 4 qw - a L- -slw C - -~ ~ - - - a. -~ - -~-0 bO - in" &WOO gm tlks 8ohw 66gmdkfl o' 0bmlw %P .-a- a-mw- 40a4 so ap- 41M UMM.4W - m wo4- a om- 4 -a *.o a -mmp do - b-1O a 4 C C 40go "D -.-0 - ewa a MEOW M- 41 q- 40 0-440--m a bumm - a 0 an 4mpalmm -M a C eaft 0- -NON__ o am mm qw do a -Mm dlw -EO -tw -4f N"e-4 o4b-am -0 0a 1baw-0 a-4 -b qu 40 ob- qa 4 - ab Iu'w~a ~ ~ a m a 40 em ao = emu". a__om 4* opm muam- a 0 omm 4s- * L0=0.:-mmoma--m 400 Golm-mm- %wsmo ONW- - 4M q ww 4w ft amm 0 wm mm di s am a ft a m -- t ap- o amm woia am40-=END. 4D . m.*-M o a Wallpaper & Wge j. window Treatment -- Showroom Designs by Kathy Thrumston Licensed Interior Designer ID0003768 502 Tompkins Street 352-560-03300 eB' go co mm- mb 41 o mow4 46000 WE WANT YOUR PHOTOS 0 Photos need to be in sharp focus. 0 Photos need to be in proper exposure: neither too light nor too dark. 0 Include your name, address and phone number on all photos. 0 When identifying persons in your photo, do so from left to right. N If desired, include the name of the photographer for credit. M Photos cannot be returned without a self-addressed, stamped envelope. N For more information, call Linda Johnson, newsroom coordinator, at 563-5660. 'The Central florida Symphony Orchestra2 S_>...- ,. Under the Direction of Dr, James Plondke, Saturday February 26 at 2 pm Curtis Peterson Auditorium recanto, February with 'The Centraf forda Symphony Chorus Directed by Robert Brouillard S.Voyage to the Orient Polovitsian Dances from Prince Igor Borodin Empress of the Pagodas from Mother Goose Suite Ravel Excerpts from Turandot Puccini Song of India Rimsky-Korsakov Madame Butterfly Concert Extraction Puccini quest Soloists Kaori Sato, Soprano Bruce Reed, Tenor General Admission Tickets $15 at the Door, or Any Citrus County Sun Trust Bank For Reserved Seats or Information, Call 352-746-6382 $7,000 dollars under blue book. For example, 2000 Honda Odyssey EX sedan, Kelly Blue Book retail $19,380 buy it wholesale for only $12,875. That's a $6,505 Advertisement DON'T MISS OUT ! ! PRE-AUCTION SALE CARS AT WHOLESALE This Sunday Only!! &"Pod Aw Auto" sm An I death a( SA FRIDnrAY. FEBRUIARY 18.2005 STOCKS CiTRUS COUNTY (FL) CHRONICLE TH MRKT N EVE MOST ACTIVE (S1 o0 MORE) Name Vol (00) Last Chg Lucent 399766 3.29 -.05 Pfizer 261113 25.06 +.11 HewletP 226691 20.86 -.20 DolbyLabn 215927 24.30 ExxonMbl 185736 58.13 -.35 GAINERS ($2 OR MORE) Name Last Chg %Chg AdvAuto 51.80 +7.29 +16.4 Wellmn 11.92 +1.54 +14.8 Clarkinc 13.91 +1.66 +13.6 ReIStIA 43.40 +4.61 +11.9 INCOwt 16.50 +1.54 +10.3 LOSERS ($2 OR MORE) Name Last Chg %Chg BristolW 18.04 -3.21 -15.1 Adminstf 14.00 -2.20 -13.6 AdMkSvif 7.80 -1.15 -12.8 RadioShk 29.93 -3.44 -10.3 StarGsSr 2.62 -.24 -8.4 DIARY Advanced Declined Unchanged Total issues New Highs New Lows Volume 1,093 2,203 145 3,441 283 16 1,958,685,470 MOST ACTIVE (S1 OR MORE) Name Vol (00) Last Chg SPDR 558805 120.23 -.96 SemiHTr 294119 33.25 -.51 iShRs2000 85599 125.86 -1.12 iShJapan 76386 10.54 -.06 DJIADiam 57081 107.72 -.73 GAINERS ($2 OR MORE) Name Last Chg %Chg FusionTIn 7.24 +1.15 +18.9 SherwdB 2.75 +.37 +15.5 MCShp 5.90 +.60 +11.3 CmsffotR 15.33 +1.48 +10.7 AXS-One 3.20 +.30 +10.3 LOSERS (S2 OR MORE) Name Last Chg %Chg TnrValey 12.68 -1.82 -12.6 AlisCh n 4.74 -.56 -10.6 GnEmp 2.08 -.22 -9.6 TetonPet 2.18 -.22 -9.2 SecCapCp 8.53 -.83 -8.9 DIARY Advanced Declined Unchanged Total issues New Highs New Lows Volume 352 549 112 1,013 60 11 225,577,970 MOST ACTIVE ($1 OR MORE) Name Vol (00) Last Chg Nasd100Tr1117917 37.47 -.51 JDSUniph 1007516 1.80 -.11 Intel 795051 23.63 -.51 Microsoft 653935 25.65 -.14 SunMicrao 482171 4.15 -.10 GAINERS ($2 OR MORE) Name Last Chg %Chg VeIclyE h rs 9.75 +1.50 +18.2 Flowint 3.70 +.56 +17.8 Conolog 3.73 +.56 +17.7 Stamps rs 18.18 +2.58 +16.5 Option 11.33 +1.43 +14.4 LOSERS ($2 OR MORE) Name Last Chg %Chg AdvNeuro 29.37 -8.23 -21.9 eCostcmn 9.18 -1.87 -16.9 BioLogics 6.02 -.98 -14.0 AmritrnsC 5.14 -.80 -13.5 GevityHR 18.10 -2.82 -13.5 DIARY Advanced Declined Unchanged Total issues New Highs New Lows Volume , 1,007 2,124 127 3,258 103 35 1,938,300,751 tor 50 most active on NYSE and Nasdaq and 25 most active on Amex Tables show name. pnce lisL Last, Price stock was trading at when exchange dosed for the day. Chg: Loss or gain for the day. No change indicated by . *.~ LW .Iai Stock Footnotes: cc PE ptater manr, 99cla iue ra ben ra6le for r a ipirrc by o 'n '', -- C coort8ny. a J -Nw U-w li o da -es L"in ,Wl \ 12 rrA c C40miany formerly 151d A a.: i . on mea Amerian E.cangb's Emerging Company Marerplaue g Dividends and earn ,:.: . rigs ir. Carnadian oder n rirporary ampl frrI Nagdaq rcaou i anr surpus firlr . qjua ftalon n Slaoc was a rw issua In ia Jae ya'r Tine 52 weeagr .n aind I.) fig- ursa dami only rom f t beginning, d Irmaling p P.afrm O st s-JBoc .e- p. Prafansrica s IW pp Hoi owes installments of ppri.as pnre. q Costo-erdl mutual cid rno PE P cai- cuiled. n Right o10 by Le un i al spedCfBad pc s .oi5n. lna split by at ea 20 u.. ,, kr.j percent strain me m at yaxr. ai Trad&e mwil w .Ettid when meiri oaoc. iuii l wl ,. V ,L a i Whsndr.t iid la.-Warranr allowlngapurcasefasatlsi u.Nwr?-uih uw 'n *' ': . * Unh, incldudln moreIrian one aixinny i .Company In 59lni.nkrtityv recer.fiip. m ;i'; ,; Deinrg re rgsjnino unb f.ie ba Erh.plcy law ApDprs in Ir1rt4 of ime rabn... "" .':4.'. Dvildend Footnotes: a Eilra vlidenas were paidl but aie nor Irciudel D Annual rae plus EVk. c Lrildatng d udlM a A Amouni declared or paid .n laal 12 mc.r.dt I - Cmrr'.- annual rate. which was incr'aso by mo.nia recenrt Senilrd ardnsur.eir .i Sum olfdslUpand lp.ld r al o. npir no regular ral.) I Sum of diddend palon ms year '- -a Mrh recent olvidand was milled or dianread k Declared .r paid nEs ear, a cumula- 'L ' ive siup ]wirn, dile. ildl inio arar m Cuneni annual ra6e wrnich wia o lcresate y -,,:. .'.. ' mal. reaci dlviMlnd announcaneni p Innii dividend annual r me noi known. y1iad ro , E Dnsn r DmjBrerpald in preiealng 12 ntrrhns pluB Lto.k alviaond i Paid air, 9,Y .: orTpAklmal5c ctPash llu on r.-dlsaiiuilon date s. source: The Associated Press. Sales figures are unofficial. I ~STOCS O OAS ITRS Name DIv Yld PE Last AT&T .95 4.9 ... 19.42 AmSouth 1.00 3.9 15 25.46 BkofAms 1.80 3.9 13 46.36 BellSouth 1.08 4.2 10 25.70 CapCtyBk .76 1.9 18 39.16 Citigrp 1.76 3.6 15 48.80 Disney .24 .8 26 29.35 EKodak .50 5 .5 16 34.15 ExxonMbI 1.08 1.9 15 58.13 FPL Gp 2.72 3.4 16 79.64 FlaRock .80 1.3 24 61.75 FordM .40 3.1 8 13.00 GenElec .88 2.4 23 36.03 GnMotr 2.00 5.4 6 37.21 HomeDp .34 .8 19 41.81 Intel .32 1.4 19 23.63 IBM .72 .8 19 93.75 YTD Chg %Chg Name DIv YId LowesCos .16 McDnlds .55 Microsoft .32 Motorola .16 Penney .50 ProgrssEn 2.36 Sears .92 SpmtFON .50 TimeWam .. UniFirst .15 VerizonCml.54 Wachovia 1.84 WalMart .52 Walgm .21 -.03 +1.9 -.35 -1.7 -.41 -1.3 -.45 -7.5 -1.39 -6.3 -.38 +1.3 +.02 +5.6 -.19 +5.9 -.35 +13.4 -.34 +6.5 -.19 +3.7 -.25 -11.2 -.19 -1.3 +.03 -7.1 -.56 -2.2 -.51 +1.0 -.87 -4.9 YTD PE Last Chg %Chg 22 59.13 -.38 +2.7 18 32.29 -.31 +.7 27 25.65 -.14 -4.0 24 15.56 -.17 -9.5 ... 43.83 -.67 +5.9 16 44.25 +.10 -2.2 33 51.32 -.35 +.6 ... 22.92 -.49 -7.8 25 18.05 -.01 -7.2 21 39.90 -.54 +41.1 30 35.68 -.44 -11.9 14 54.02 -.52 +2.7 22 52.70 +.10 -.2 31 42.94 -.64 +11.9 52-Week Net % YTD 52-wk High Low Name Last Chg Chg % Chg % Chg 10,868.07 9,708.40 Dow Jones Industrials 10,754.26 -80.62 -.74 -.27 +.84 3,823.96 2,743.46 Dow Jones Transportation 3,604.19 -18.49 -.51 -5.10 +24.59 356.84 259.08 Dow Jones Utilities 356.20 -.49 -.14 +6.34 +30.30 7,315.70 6,211.33 NYSE Composite 7,272.54 -34.22 -.47 +.31 +8.30 1,505.26 1,150.74 Amex Index 1,497.77 +.95 +.06 +4.42 +20.44 2,191.60 1,750.82 Nasdaq Composite 2,061.34 -26.09 -1.25 -5.24 +.75 1,217.90 1,060.72 S&P 500 1,200.75 -9.59 -.79 -.92 +4.68 656.11 515.90 Russell2000 631.14 -7.71 -1.21 -3.14 +8.33 12,024.36 10,268.52 DJ Wilshire 5000 11,841.36 -92.51 -.78 -1.08 +5.94 I NEW YORKSTOKEXHNGS YTD Name Last Chg +4. ABB ULd 5.93 +20 - +6.9 ACE Ld 4526 -.65 +2.8 ACMInco 8.39 -.01 420.6 AESCo u16.48 +.43 -2.7 AFLAC 38.76 -23 -13.0 AGCO 19.05 +.35 +5.7 AGLRes 35.14 -.46 +16.2 AKSleel u16.82 -.48 -9.6 AMURS 28.92 -.13 8.0 AMR 8.98 +.02 -1.1 ASALtd 39.99 +.2b .1.9 AT&T 19.42 -.03 7.0 AUOptron 15.32 -.54 +1.6 AXA u25.15 +.22 15.0 A "eslnvn 9.10 +.19 -.2 AbtLab 46.56 -.27 14.8 AberFtc 53.88 +1.18 -9.2 Accenture 24.51 -.54 -.8 AdamsEx 13.01 -.06 412.0 Adesan 21.65 -.52 11.0 Admknsf 14.00 -2.20 8.6 AdvAuto u51.80 +729 -3.0 AdvMOpt 39.91 +.06 622.5 AMD 17.06 -.39 54.5 Aerop as 30.75 -.37 .12.6 Aetna u140.41 -.14 10.8 AfCmpS 53.70 +23 16.1 Agere 1.59 14.8 AgereB 1.55 -.01 -1.7 Agilent 23.70 -.23 4,1.7 Agnicog 13.99 +.42 13.9 Ahold 8.85 -.06 43.6 AirProd 60.05 -.50 24.3 AirTram 6.10 -.02 -2.9 A beratn 23.18 -.14 c-3.7 Albrtsnun 24.45 -.12 11.5 Alcan 38.60 +.81 -1.2 Alcoa 31.04 +.44 .+1.6 AIIgEngy 20.02 -.09 i+4.9 AllegTch 22.73 -.82 .- er Allergen 74.50 +.46 1ir 9 Alletea 41.11 -29 .6.0 AICap u48.73 +1.06 9'-9,9 AIIIGamn 11.06 +.06 .+3.1 AIIWrld2 12.76 -7.2 AldWaste .61 -.11 +8.7 AlmkrFn 35.69 -.51 +3.4 Alstate u53.49 -.06 -4.0 Alel 66.43 -.17 1--4.5 Allelun 60.50 t10.2 AlphaNRsnu25.00 +.40 _15.8 Alpharna 1428 -.03 -._5.9 Alria 64.72 -.79 '3-2.9 AmBey 29.15 +.03 -5.7 AmbacF 77.46 -.42 t+12.8 Amdocs 29.60 -.07 +15.5 AmnHess 95.15 -1.86 +2.3 Ameren 51.30. +.01 1+11.6 Amerigrpsu42.20 -.96 +8,2 .AMvil. 056.65 -.29 -13.5 ArnAxle 26.51 -.65 +.2 AEP 34.42 -.07 -3.2 AmiExp 54.50 -.12, -2.3. AFclRT 15.81 -.18 +46.1"AmniatGp 6968 -.92 +9.1 AmStds u45.10 -.51 -1.1 AmSIP3 12.18 +.09 -.5 AmTower 18.30 -.13 +.6 Amerdcdt 24.60 -21 +1.7 AmensBrg 59.69 -1.54 +10.3 Amnphenols40.54 -.27 S -1.7 AmSouth 25.46 -35 +6.8 Anadrk 68.55 -1.45 -.6 AnalogDev 36.70 -.43 -1.9 AnglogklA 35.65 +S8 -5.4 Anheusr d48.00 -.38 +2.3 AnnTaylrs 22.02 -20 -1.9 Annaly 1925 -.04 +2.7 Aon Coip 24.50 -.59 +14.0 Apache u57.65 -1.94 -1.2 Aptnv 38.07 +.28 +1.0 AquaAm 24.84 -.15 -1.6 Aquila 3.63 -.07 -4.0 Aracuz 3620 +.25 +4.3 Aramark 27.64 -.42 +9.2 ArchCoal 38.81 -.99 +11.1 ArchDan 24.79 -.15 -9.7 ArchstnSm 34.57 +.37 -16.4 AnnorH 39.33 +.27 +8.8 Ashland 63.52 -.58 -1.9 AsdEstat 10.03 +.08 +10.3 Assuwant 33.70 +.21 +7.6 AstraZen 39.16 +.01 +4.3 ATMOS u28.52 -.57 +2.7 AutoNatn 19.73 +.06 -4.4 AutoData 42.38 +.16 +5.1 AutoZone u95.94 44.6 -21.4 Avaya 13.52 +.36 +21.0 Aviall 27.80 -.34 +12.1 Avons 43.40 -1.14 +4.2 AXIS Cap 28.52 .-.02 -5.5 BB&TCp 39.74 -.41 +17.5 BHPIBILt u28.23 +29 -12.8 BISYS 14.35 -.14 +2.0 BJ SvCS 47.49 -.685 -16.8 BMCSft 15.48 -.07 +7.9 BPPLC u62.99 -28 +24.0 BP Pru u59.90 -3.00 +.1 BRT 24.37 -.09 +8.1 BakrHu u46.11 -1.24 +1.5 BallCps 44.62 -.06 -1.3 BkofAms 46.36 -.41 -11.0 BkNY 29.75 -.65 -.9 Banknorth 36.26 -.11 -.7 Banta 44.46 -.18 -1.0 BarrickG 23.98 4.71 +11.4 BauschL 71.78 -20 -.4 Baxter 34.40 +.10 -2.0 BearSt 10027 -1.47 -3.7 BearingPt 7.73 +.14 +14.3 BeazrHm 167.05 +3.47 +22 BectDck 58.07 -.32 -75 BelSouth 25.70 -.45 -7.4 BestBuy 54.93 -.16 +313 Bevery 12.01 -.10 +2.9 BkHICp 31.57 -.39 +.9 BIFLO8. 15.99 +.14 -2.0 B6ockHR 48.00 -.10 -4.8 Biocdtr 9.08 -.14 -12 BkdkbrtBn 8.70 -.14 -1.0 BlueChp 6.61 -.02 +3.7 Boeing 53.66 -.26 +2.0 Borders 25.81 -.14 +14.6 BostBeer 24.37 +.07 -4.5 BoslProp 61.76 +.56 -6.3 BostonSd 33.30 +.03 +7.2 Brinker 37,60 -.68 -9.8 BdistolW 1.04 -3.21 -6.6 IrMyS 23.92 -09 -7.4 Brunswick 45.82 +1.88 -6.4 BungeLtl 3.35 -.36. +1.3 BurNSF 47.94 +.26" +7.4 BurlRscs u46.71 -1.33 -1.7 CH Engy 4725 -.90 +8.7 CiGNA 88.70 -1.00 -9.7 CfTGp 41.38 -.51 * +8.1 CKERst 15.68 +.07 +20.2 CMSEng 12.56 -22 -12.1 CNFInc 44.04 -.49 -1.7 CSKAto 16.45 +.48 +3.7 CSSInds 32.94 +.15 -1.3 CSX 39.56 +.04 +82 CVSCp 48.77 -.08 -2.6 Cabelasn 22.16 -.34 +112 CaSvshNY 27.70 +.35 -2.0 Cadence 13.54 -.06 +3.0 Caesars u20.75 -.4 Callolf 13.44 -.10 -15.7 Calclne 3.32 -.18 +25.4 Camecogsu43.84 +.91 -1.3 CampSp 29.49 +.64 -7.5 CapOne 77.88 -.75 -4.8 CapiSnce 24.45 -.10 +.1 CapMpftB 13.61 -.12 -1.3 CardnlHIh 57.40 +.02 +.5 CaremkFlh 39.63 -.32 +3.0 CarMax 31.99 -.65 -2.7 Carmlval 56.06 -.29 -5.8 Caterpillr 91.82 -.72 +3.1 Celanese nul6.50 +.40 -1.9 Cendant 21.86 -.42 +9.1 CenrerPnt 12.33 +6.2 Centexs 62.68 -.23 -5.8 CnryTel 33.40 -.15 -2.9 Ceridlan 17.75 +.12 -8.6 ChmpE 10.80 -21 +3.8 ChRvLab 47.75 -2.12 -82 Checkpnt 16.57 -.09 +14.9 ChesEng u168.96 -.60 +11.6 ChevTes u56.61 -.89 -6.8 ChlMerc 213.04 -3.07 +25.5 ChloosFASu57.168 -.04 -4.0 ChoicePt 44.13 -1.41 +2.1 Chubb 78.52 -29 -19.0 CIBER 7.81 -.19 -1.5 CImarex 37.34 -.09 +7.5 CocBell 4.46 -.19 -.5 CINergy 41.43 -.15 +2.9 CIrcCity 16.10 -.09 +1.3 Cftap 48.80 -.38 -4.5 CbzComm 13.17 -.13 +6.2 ClalresStrs 22.57 -.11 +2.3 ClearChan 34.26 -.09 +2152 CleCffs 68.51 -5.44 +3.3 Clorox u60.87 -.23 -2.6 Coach 54.91 +.51 +3.3 CocaCI 43.00 -.30 +6.1 CocaCE 22.12 -6.88 +3.1 Coeur 4.05 +.13 +5.4 ColgPal 53.92 -.06 -2.5 CollnSin 8.96 -.04 -3.8 Comerica 68.70 -.01 -1.7 ComfrtS 7.55 -.09 -7.8 CmxaNJ 59.37 +1.19 +292 OmdMdts 32.05 -.19 -21.9 ComScop 14.76 +.06 +10.1 CmlyHIt 30.70 -.75 +7.7 CVRDs u31.23 +.85 4+62 CVRDpfs 25.90 +.52 -13.7 ComnpAs 26.80 -.13 -18.0 CompSd 46.25 -.45 -3.5 ConAgra 20.43 -.43 +19.8 ConocPhilul14.00 -.31 +2.1 ConsolEgy 41.91 -1.10. +.5 ConEd 43.98 -.13 +17.0 ,ConstellA 54.41 -1.64 -24.2 CtlIAB 10.26 -.17 -2.2 CnvTgys 14.66 +.07 +5.8 .CoopQam 56.93 -1.19 -12.8 CooperIre 18.80 -.70. -.4 Coming 11.72 -.12 -2.6 CntwdFns 36.05 -.76 +12.6 Coventry 59.75 -.62 +10.3 Crompton 13.02 -.04 ... CrwnCsle u16.64 +.05 +15.7 CrownHoldul5.90 -.15 -13.1 Cummins 72.81,-1.24 +11.6 CypSem 13.09 -.38 -.9 DNPSeat 11.81 +2.6 DPL 25.76 -.69 45.7 DRHortn 42.62 +.17 +3.7 DTE 44.71 -.27 -3.7 DalmIrC 46.26 +.05 -11.0 DanaCp 15.42 -.18 -4.4 Danahers 54.88 -25 ... Darden 27.73 -.16 +6.9 DaVitas 42.25 -.69 +4.7 DeanFds 34.50 -.03 -11.5 Deere 65.85 -.85 -21.5 Delphi d7.08 -.01 -27.8 DetaAIr 5.40 -.23 +9.4 DevonEis u42.9 -1.02 +17.4 DaOffs U47.00 -.79 -6.1 DIlsids 25.24 -.21 -9.2 DIrecTV 1520 -.07 +5.6 Disney 29.35 +.02 ... DolbvLabn 24.30 +5.5 DollaiG 21.92 -.19 +6.3. DomRes u72.01 +.32 -9.2 Dover 38.09 -.71 +8.2 DowChm u53.55 -.32 +6.6 DuPont u52.31 -.14 +6.6 DukeEgy 27.01 -.34 +3.1 DuqpfA 37.10 +.20 +.6 DuqUght 18.96 +.03 +.6 Dynegy 4.65 -.05 -112 ETrade 13.27 -.08 +1.5 ECCCap n 6.85 -13.0 EMCCo 12.94 -.22 +17.1 EOGRes u83.56 -1.43 -2.3 EastChm 56.38 -.01 +6.9 EKodak 34.15 -.19 -5.1 Eatons 68.65 -.87 -10.0 Ecolab 31.63 -.51 +2.4 Edisonlnt 32.79 -.13 +24.9 EIPasoCo u12.99 +.45 +5.1 EIPasoEI 19.90 -.29 +1.8 Elan 27.75 +.21 -13.3 EDS 20.02 -.03 -4.5 EmrsnEl 66.95-1.23 +3.0 EmpDist 23.37 -.07 -.3 Emulex 16.79 -.61 +6.0 EnbrEPtrs 54.64 -.35 +8.8 EnCanag u62.07 -1.88 +5.8 EndurSpecu36.20 +.16 +20.5 EngyPt u24.43 +.45 -1.7 EnPro 29.06 -.06 +21.0 ENSCO u38.42 -.30 -17.2 Enterasys 1.49 -.01 +4.5 Enlergy 70.65 -.14 +4.6 EntPrPt 27.05 +.01 -.6 Entravisn 8.30 +.38 -2.8 Eqtyinn 11.41 -.15 +32 EqOffPT 30.05 -.26 -7.3 EqlyRsd 33.55 +.33 -2.3 EsleeLdr 44.70 +.22 +2.0 Exelons 44.94 -.47 +13.4 ExxonMbl u58.13 -.35 +6:5 FPLGp 79.64 -.34 -.6 FalrchldS 16.17 -.42 +3.8 FamDIr 32.43 -.78 -14.9 FannlMae d60.61 -1.41 -1 F.3b.,O 97.75 -.60 -17.6 FedSgnl d14.56 -.76 -.7 F -., "57.37 2 -2.6 FW.,.'.. 29.60 -.06 .5.4 Fewrr,; 21.40 - Fe18.8 4Frr 18.84 -27 +1.3 FldelIRn 46827 -.26 -4.5 FirsData 40.64 -.47 -10.9 FFlnFds 19.14 -.02 +5.0 FstEngy 41.50 +.48 -2.6 FishrScl 60.78 +.25 -272 FleaeEn 9.80 -.10 + i.7 FlaRock 61.75 -.19 -11.2 FodM 13.00 -25 -7.1 ForestLab 41.67 +22 +14.6 FoamsOil u36.36 -.79 +8.6 FortuneBr 83.80 -.68 +9.1 Fox Ent 34.10 -.02 +1.4 FrankRes 70.65 -.25 -13.3 FredMac 63.90 -1.99 -3.8 FMCG 39.70 +.53 +5.1 Freescalen 18.72 -.02 +3.1 FrescBn 18.93 -.01 +.7 FriedBR 19.52 +.17 +22.0 Frontlines 48.26 -.66 -1.3 GATX 29.17 -.63 +1.8 QabelllET 9.18 -.05 -2.9 Gannett 79.34 -.21 +.1 Gap 21.15 -.32 -23.1 Gateway 4.62 -.02 -13.5 Genentchs 47.10 -.23 +12 GenDyn 105.90 -.45 -1.3 GenElec 36.03 -.19 +3.6 GnGrthPrp 37.47 -.07 +20.2 GnMart 48.01 -1.30 +4.9 GenMilis 52.17 -.53 -7.1- GnMoIr 37.21 +.03 -6.8 GaPacif 34.93 -.11 +13.0 Gillette 50.60 +.09 +1.6 Glamis 17.43 +.23 -.5 GlaxoSKin 47.13 -.30 +12.7 GloatSFe u37.33 +.01 -5.8 GoldFUd 11.75 +.40 -11.2 Golderpg 13.36 +.06 +1.1 GoldWFs 62.11 -1.39 4+6.3 GodmanS 110.60 -1.67 +10.6 Goodrich 36.11 -.30 -6.5 Goodyear 13.70 -.21 -25.0 vjGrce 10.21 -.65 -11.9 GrafTech 8.33 +.03 +13.8 GrantPrde u22.81 -.57 +4.3 GtAtPc u10.69 +.46 +4.0 GtPlainEn 31.50 -.11 +1.6 GMP 29.30 -13.0 Griffon 23.50 -.25 -7.8 Gtechsa 23.93 +.07 -52 GuangRy 19.40 -.13 +1.4 Guldant 73.10 +.34 +15.2 HCAInc 46.04 +.18 +11.0 HCCIn u36.76 +.26 -.1 HRPTPrp 12.82 -.06 4+.5 Halilban 41.79 -.67 +1.7 HanJS 15.95 -.05 -3.5 HanPIDIv 9.65- -.03 +4.4 HanPtDv2 12.02 -.01 -2.8 Hanover 13.73 -96 +1.5 HarleyD 61.68 -.39 -12.5 HarmonyG 8.11 +.07 +3.8 HairahE u69.43 +.10 +2.8 HartfdFn 7127 -.43 -22.6 HarvNRes 13.36 -.46 +3.2 Hasbro 20.00 -.04 +.5 HattSe u14.71 +.01 -6.2 HawallE s 27.63 -.12 -6.9 HthCPs 25.78 -.22 -7. HItCrREIT 35.46 +.31 -2.7 HItMgt 22.11 +.03 -6.4 HIhcrRhy 38.10 -.13 -10 HecM : 6.77 -.01 -5.1 Heinz 37.01 -.29 +8.3 HelnTel u9.53 +.30 -6.1 Hercules 14.10 -.34 +10.8 Hersheys 61.63 -.38 -.5 HewlettP 20,86 -20 -10.9 Hibem 26.28 -.65 -3.4 HIghwdP 26.76 -.31 -5.7 Hilton 21.45 -.26 -2.2 HomeDp 41.81 -.56 +19.7 HomexDn 28.32 -1.48 +7.1 Honwillnt 37.92 -.57 -7.5 HostMarnr 16.00 -.02 +6.5 HovnanEs 52.73 +.09 -7.0 HughSups 30.10 -.45 +13.4 Humana 33.67 +.26 +5.5 Huntsmnn 25.85 -.12 +3.5 IMS Hih 24.03 -.02 -1.2 ING 29.89 +22 -2.8 Idacorp 29.72 -.59 -1.6 ITW 91.16 +227 +6.4 Imation 33.88 -.62 -11.7 ImpacMig 20.02 +.10 +.3 INCO 3985 +2.10 -10.4 Inflneon 9.77 -.08 +.9 IngerRd 81.00 -.62 -28.9 InputOul 6.55 -41 -4.9 IBM 93.75 -.87 -10.0 InlGame 30.93 -.24 -9.5 IntPap 3800 +.45 +1.1 IniSteel 41.02 +.10 -1.8 Inlerpublc 13.16 -.20 +1.3 tonics 43.92 -10.1 IronMtns d27.40 -.20 -5.7 JPMorqCh 36.78 -.55 -4.6 JablI 24.41 -.40 -14.2 JanusCap 14.43 -.43 +3.5 Jarden 44.97 -2.13 +3.0 JohnJn 65.35 -.39 -8.7 JohnsnCU 57.92 -.85 .+11.3 KBHome 116.16 +.59 -4.5 Kaydon 31.53 +27. -.8 Kellogg 4429 -.55 -18.2 Kellwood 2823 -.39 +19.7 KerrMc 69.18 -2.44 +7.6 KeyEnglf 12.70 -.28 -1.4 Keycoap 33.42 -.24 +.1.6 KeySpan 40.10 -.37 ... KImbCk 65.78 -.16 -12.8 KInercCn 66.56 +.72 -18.5 KIngPhrm 10.10 -.17 -11.1 Kfnrossg 626 -.14 -4.6 Kohis 46.91 -1.07 +6.7 KoreaEl 14.13 -.23 -5.6 Kraft 33.62 -.14 -52.7 KrspKrm 5.96 +.01 +.7 Kroger 17.66 -.33 S.3 L-3Com 73.46 +.29 +14.1 LLERy u7.13 +.15 +13.5 LSILog 6.22 -.15 -7.0 LTCPip 18.51 -.34 -1.4 LaZBoy 15.15 -.05 ... LabCp 49.60 -.30 -1.4 Laclede 30.70 -.35 +4.5 LVSandsn 50.15 +.43 -18.4 LeapFrog 11.10 +20 +4.8 LehmBr 91.65 -1.12 +3.3 LennarA 58.55 +.50 -7.6 Lexmark 78.52 -3.53 -3.0 LbtyASG 6.41 -.05 -6.3 LUbyMA 10.29 -2.9 UilyEII 55.13 -.30 44.5 Limiled 24.15 -.11 +2.5 UncNat 47.83 -.66 -10.0 Undsay 23.06 +.01 +14.4 Unens 28.36 -35 "6.8 LockhdM 59.30 -.65 +2.7 Loews 72.20 -.24 +31.1 LoneStTch u43.86 +.16 -1.7 LaPac 26.29 -.75 +2.7 LowesCos 59.13 -.38 -12.5 Lucent 329 -.05 +10.9 Lyondel u32.06 -.12 -7.2 M&TBk 100.11 -1.03 -8.7 MBNA 25.73 -.43 +342 MDU Res u7.54 -.07 -9.5 MEMC 11.99 +.36 +.7 MCR 8.88 +.01 -9.6 MGIC 62.30 -.10 +7.9 MGM Mr 78.50 +.70 -10.8 MSCInd 32.10 +.35 -5.5 Madeco 10.01 +.10 -8.3 Magnalg 75.67 -.30 +19.5 MagnHunt u15.41 +.02 -1.4 MgdHI 6.48 +.02 -8.9 Manpwl 43.99 -.86 +2.0 Manullg 47.11 +.34 +15.6 Marathon u43.48 -.40 +13.6 MarineMx u33.80 +.84 +1.5 MarintA 63.93 -.87 -6.1 MarshM 30.90 -.86 +19.7 MStewrt 34.73 -.79 +1.0 Masco 36.91 -.03 +20.7 MasseyEn 42.20 -.73 -15.3 MatScl 15.24 -.05 +9.0 Mattel u21.25- +.50 +12.2 MavTube 34.01 +1.16 +9.1 Maxtor 5.78 -.02 +7.2 MayDS 31.52 -.41 -25.8 Maytag 15.65 -.27 +.7 McDnids 32.29 -.31 +16.7 McKesson 36.71 +.13 +1.3 McMoRn u18.95 -.32 -14.6 McAfee 24.72 -.71 +7.5 MedcoHSth 44.70 +.09 -1.3 Medicts 34.64 -.57 +7.2 Medtmic 53.26 +1.46 -6.8 MellonFno 29.01 -.42 -10.2 Merck 28.85 -.17 +.5 MeridG1d 20.21 +.33 +.3 MenidlLyn 59.97 -.30 -.2 MetUfe 40.42 -.95 +6.9 MtchStrs 32.04 -.20 -6.9 MIcronT 11.50 -.30 -6.5 MkAApt 38.56 .-.25 +7.4 Midas 21.49 -.31 -11.8 Milacron 2.99 -.17 -12.6 Mllpore 43.51 -.41 -9.3 MilsCp 57.80 -.10 +2.7 MitalSt 39.70 -.95 +7.6 MoblleTels 37.25 -.65 -6.6 MolsCoorsB 70.70 -.85 +.6 Monsnto 55.90 -.58 +4.3 Montpelr 40.09 -1.78 -1.7 Moodys 85.34 -.48 +7.4 MorgStan 59.61 -.12 +11.6 MSEmMkt 19.61 +.06 -9.5 Motorola 15.56 -.17 +1.4 MunlenhFd 11.00 -.11 -10.1 MylanLab 15.90 +,01 +8.7 NCRCps 37.63 -.63 44.8 NRGEgynu38.49 +23 -4.4 Nat)CIy 35.90 -24 +1.6 NatFuGas 28.80 -.30 +7.6 NatGrid 51.65 -.41 +15.2 NatOllwl u40.65 -.44 +4.4 NatSemls 18.74 -.53 -13.3 Navisltar 38.12 -.70 +2.7 NewAm 2.25 -.01 -17.8 NwCentFn 52.54 -.76 +1.6 NJRscs 44.03 -.15 -12.7 NYCmtys 17.95 -.15 -6.3 NewellRub 22.67 -.04 -4.0 NewmtM 42.63 +.09 +20.8 NwpkRs 622 +.11 -9.1 NewsaCAn 16.97 +.02 -8.6 NewsCpBn 17.55 -.06 +.4wNiSource 22.86 -20 +1.9 Nicor 37.64 -.51 -6.1 NkeB 85.20 -23 +12.8 NobleCorpu56.12 -.77 +3,0 NobleEngy 63.50 -.860 +.4 NoadaCo 15.73 -.11 +14.8 Nordatr u53.65 +1.39 -3.8 NoiliSo 34.80 +.15 -11.8 NortalNIt 3.06 +.4 NoFrkBos 28.97 -26 +.9 NoestUt 19.02 -.01 +6.4 NoBordr 50.76 -1.18 -1.9 NorthrpGs 53.31 -.68 -4.7 Novadis 48.15 -.35 +6.2 NSTAR 57.64 -.15 +12.3 Nucors 56.77 -.91 +2.9 NvFL 15.65 -.05 -1.3 NvIMO 15.56 -.06 +.8 OGEEngy 26.71 -.13 +9.7 OMICp 18.48 -.32 +12.9 OcciPet u65.91 -.69 +7.3 OlfcDpt 18.63 -.10 -1.8 OfficeMax 30.81 +.48 .+9.9 Olin 24.20 -.42 -7.2 Omncre 32.12 +.01 4+6.3 OppMS u9.42 +.73 +26.9 OreSt 25.75 -.68 +8.6 OshkshTrk 7426 -.42 -1.4 OutbkSIk 45.15 -.82 +8.2 PG&ECp u36.00 +.02 -7.2 PHHCpn 22.00 -.15 -7.7 PMIGrp 38.55 +.15 -8.9 PNC 52.35 +2.3 PNM'Ress 25.87 -29 +4,6 PPG 71.32 -.11 +3.7 PPLCorp 55.23 -.14 -9.1 Pactiv 23.00 -.19 +41.2 ParkDr u5.55 -.05 -13.7 ParkHan 65.37-1.33 +1.8 Patinas 38.19 .-.58 -1.3 PaylShoe 12.14 +13.0 PeabdyE u91.45 -56 +4.3 Pengrthg 21.71 -.69 +5.9 PenVaRsf 55.15 +5.9 Penney 43.83 -.67 -3.9 Pentairs 41.86 +.32 +2.1 PepBoy 17.43 +29 +2.9 PepsICo 53.73 -.81 +7.5 PepslAw 22.84 -21 +3.6 Pe4kElm 23.30 +23 +2.7 Prmlan 14.33 -.04 +10.2 PebrsA u39.89 -.34 +12.7 Petrobrs 44.85 -23 -6.8 Pizer 25.06 +.11 +.1 PhelpD 99.00 +1.96 +2.6 PhlpsEI 27.18 -.05 +.9 PiedNGa 23.46 -.45 +25.9 PlgrimsPr u38.63 +.68 +6.0 PimcoStrat 12.79 -.11 +13.0 PioNd1 u39.65 -.65 ... PInyBw 4628 -37 -2.7 PlacarD 18.36 +.44 +19.2 PlansEx u31.00 -.17 -2.5 PiUmCrk 37.46 -.36 -7.4 PogoPd 44.88 -.97 -3.8 PoslPWp '33.56 -.21 +1.9 Praxair 45.00 -.16 +27.1 Premcor 53.59 -1.32 +17.6 PridelntI 24.16 -.67 +9.5 PrdmeGp u7.04 +.46 -3.6 PrnFnd 39.45 -.51 -., Z F-, rc 31J ,,C2 -22 ProgrssEn 44.25 +.10 +3.1 ProgCp 87.51 +1.07' .+82 ProsStHIIn 3.84 -.06 +5.0 Provndlan 17.30 +.05 +5.7 Prudentl 58.12 -.92 44.1 PSEG 53.90 -.43 -4.3 PugetEngy 23.63 -.05 +102 PulteHm 7028 +.22 +2.1 PHYM 6.79 +.01 +2.5 PIGM 9.78 +1.4 PPriT 6.67 -01 +192 Quanexs 54.50-1.04 +1.3 QuantaSvc 8.10 -.30 -13.5 Qwea.Cm 3.84 -.13 -3.7 RPM 18.93 -.06 S-9.0 RadloShk 28.93-3.44 +10.2 Ralooip 46.19 -.30 -.3 RJamesFa 30.89 -.50 -6.1 Rayonler 46.40 -.53 -1.0 Raytheon 38.48 +.19 -2.1 Rlylncos 24.77 -.25 -1.7 Reebok 4325 -.54 -8.3 RegionsFn 32.63 -.12 +114 RelStA u43.40+ 4.61 -4.4 RellantEn 13.05 -.34 -5.7 RenaesRe 49.12 -.78 +1.6 Repsol u26.51 +.18 -7.5 RepubSv 31.02 +.12 +2.8 RetallVent 7.30 -.01 +22 Revlon 2.35 -.04 +3.7 ReynkdsAm 81.52 -1.18 +15.6 Rhodla 3.12 +.12 -3.8 RIeAld 3.52 -.06 +20.9 RockwlAut 59.90 -.08 +18.5 RockColl U46.73 +.22 +9.1 RoHaas 48.24 -.75 +18.5 Rowan U30.69 -.34 -12.2 RylCarb 47.80 -.48 +6.0 RoylDut 60.84 +.10 -12 Royce 20.19 -.03 -7.8 RubyTues 24.05 -31 .-112 RyermTul 13.94 +.43 +168 Rylands 67.19 +.89 -9.7 SAPAG 39.94 -.38 -5. SBCCom 2425 -26 -5 SCANA 3920 -.09 -8.7 SKTIcm 20.31 -.11 -6e9 SLMCp 49.68 +.01 -12.2 STMIcro 16.97 -.30 -3.7 SabreHold 21.33 -.25 -6.7 Safeway 18.61 -.41 +15.8 SUJoe- 74.35 -.10 -4.7 SUudes 39.98 +.19 +3.8 StPaulTra 38.47 +.17 -16.8 Satesforcn 14.10 +.10 +2.0 SalEMInc2 16.79 +.03 -1.6 SalmSBF 12.79 -.08 +16.5 SJuanS u34.29 -.11 -2.8 SaraLee 23.47 +26 -8.7 ScheTgPI 19.07 +.02 +8.1 SchImb u72.38 -1.51 -9.1 Schwab 10.87 -.02 -6.4 SdAtanta 30.89 -.61 +4.6 ScottPw 32.90 -.04 -8.4 ScottshRe 23.73 +.13 +2.4 SeagateT 17.68 +.33 +.6 Searm 51.32 -.35 +9.1 SempraEn 40.00 -.33 -:7.4 Senslent 2221. -25 +9.5 ShawGp u19.55 +.52 +.7 Sherwin u44.93 -.67 -6.4 ShopKo 17.48 -.45 -3.0 Shurgard 42.70 -.18 +23.6 SIderNaosu23.64 +1.08 +.1 SlenPac u10.51 +.15' -272 SIIcnGph 126 -.02 -1.0 SImonProp 64.05 -.07 -9.8 SmllhAO 27.00 -.67 +15.6 SmilhntI u62.90 -.73 +13.4 SmthfF u33.56 -.08 -7.9 Solectm 4.91 -.05 -1.6 SouthnCo 32.97 -.18 -12.6 SwslAId 1423 -.07 +3.7 SovrgnBcp 23.38 -.06 -78 SomtFON 22.92-.49 +19.8 SIdPac u7681 -.44 +.5 Standex 28.62 -.54 +.8 StadH l 58.86 -.60 -10.6 StateStr 43.92 -.52 +2.7 Staes 2436 -.20 +.3 SlorTch 31.70 -28 -2.4 sTGoldn 42.73 +21 +42 Stykers -50.30 -.27 -11.8 SturmR 7.96 -.04 -8.3 SunCmts 36.89 -.22 +5.9 Suncorg 37.50 -.99 -8.4 SunGard 25.96 +.49 +17.2 Sunoco u95.78 -.80 -1.6 SunTrst 72.70 -.17 -10.5 SwflEng 25.89 -.20 -5.3 Sybase 18.89 -.16 +2.1 SynmbIT 17.67 -.54 -9.3 Sysco 34.62 -.33 -16.0 TCFFnds 27.01 -.71 +6.6 TECO u16.21 +.02 +.6 TJX 25.28 +.03 -13.6 TVAzteca 8.88 -.41 +20.8 TXUCorp u78.01 +.05 +4.2 TaIwSemi 8.85 -.29 +23.9 Tallsmgs u33.39 -.54 -3.4 Target 50.16 +1.09 +9.6 Teekays 46.15 -2.92 -4.3 Tektronx 28.92 -.23 +.8 TelNorL u17.01 +.69 +20.9 TlOArg u13.25 +.95 +2.9 TelMexL 39.43 -.32 +10.6 TelspCel 7.52 +.33 +11.3 Templelnl 76.10 -.69 -32 TenetHIt 10.63 +.11 +5.7 Teppco 41.62 -.38 -11.2 Teradyn 15.15 -.59 -11.1. Terra 7.89 -.07 +11.4 TerraNhtro 24.86 +.36 +5.6 Tesoro u33.65 -1.00 +6.9 TetraTech 30.25 -.07 +3.5 Texinst 25.48 -.61 +3.7 Texton u76.55 -.34 -11.1 Theragen 3.61 -.06 -8.8 ThermoBE 27.54 +.04 +1.0 ThmBet 31.05 -.56 +4.4 3M Co 85.71 -1.09 +15.0 Tkdwr u40.96 -.53 -4.3 Tiffany 30.59 -.52 -72 TimeWam 18.05 -.01 +7.3 Timken 27.91 -.12 +4.8 TtanCp 16.97 -.27 +31.7 Todco u24.26 -.05 -2.4 ToddShp u17.66 -.50 +23.8 TolBros 84.91 +.81 -2.5 THilgr 11.00 -.25 +7.9 Toolnc 26.40 +.29 +11.5 TorchEn 725 +.07 -5.2 Trchmrk 504.04 -.67 +3.3 TolalSA ul13.44 -.28 +2 TotalSys 24.35 +.11 -32 TwnCty 26.75 -.35 +8.7 ToyRU d22.25 -.13 +12.0 T n u47.47 -.98 -16.4 Tre a" 16.90 -29 -1.6 TdContI 17.98 -.12 -1.1 Tribune 41.66 -.32 +1.7 TrizecPr u19.24 +.21 -7.2 Tvcolxa 33.18 -.53 -9.3 Tyson 16.68. -.04 -2.9 UILHold 49.83 +.32 +48.4 USEC u14.38 -.20 -23.4 viUSG 30.86 +1.00 +8.3 USTInc 52.10 -.92 +41.1 UnlFist 39.90 -.54 -9.9 UnionPac 60.62 +1.01 -25.7 Unisys 7.56 -.09 +12.2 UDefnse u53.00 +1.83 -9.1 UDomR 22.55 -.04 .. UldMicr 3.53 -.10 -9.1 UPSB 77.67 -.87 -5.1 US Bancp 29.71 -24 +7.6 USSteel 55.16 -1.39 -1.8 UtdTech 101.50 -1.35 +1.1 UdhnhGp 89.02 -.85 -6.4 Univison 27.70 +.10 +17.7 Unocal u50.88 -.54 -3.3 UnumProv 17.35 -.05 -9.5 ValeantPh 23.85 +.05 +37.5 ValeroEs u62.44 -.97 +.5 VKHilncT 4.11 +.02 +16.6 Varco u33.98 -.10 -15.8 VarianMs 36.40 -.99 +2.2 Vectren 27.38 -.28 -11.9 VerizonCm 35.68 -44 +.8 ViacomB 36.69 -.37 +1.3 VimpeiCs 36.60 -.22 +19.3 VintgPt u27.08 +.02 -13.6 Vishay 12.98 -.19 -2.1 Vodafone 26.80 +.18 +2.8 W&TOffn 19.02 +.31 -11.8 WMS 29.57+1.56 -1.1,Wabash 26.63 +.28 +2.7 Wachoia 54.02 -52 -.2 WalMart 52.70 +.10 +11.9 Walgm 42.94 -.64 -1.5 WAMull 41.63 +.08 +.2 WsateMInc 30.01 -.03 -9.8 WatenPh 29.58 -.09 +13.8 Weathilnt u58,37 -.25 +7.3 WtWatch 44.06 -1.44 +11.5 Wellmn u11.92 +1.54 +6.0 WelPolnt 121.95 -1.60 -2.8 WellsFrgo 60.40 -.36 -3.9 Wendys 37.72 -1.03 +3.4 WestaEdi u23.64 -.11 +5.5 WAstTIP2n 13.52 -.09 +4.0 WDigil 1127 -.04 +13.0 WstoGRs 33.05 -.56 -7.6 WestwOne 24.87 -.13 -4.1 Weyedh 64.49 +.39 -9.8 Whripl 62.46 -1.34 +4.3 WilmCS 16.65 -.03 +14.3 WmsCos ul18.62 -.13 -6.4 WlllsGp 38.54 +.46 -28.1 WllsonGr 16.11 -.90 -65.9 WInDIx 1.55 -.03 -9.1 Winnbgos 35.51 -21 +5.8 WiscEn 35.65 -.35 +7.1 Worthgtn 20.97 -.12 +.9 WrightExnd17.25 +.15 -1.4 Wrigley ,6820, -.47 -6.6 Wyeth 39.80 +.60 -1.6 XLCap 76.44 +.10 '+11.6 XTOEgysu39.50 -1.33 -.5 XcelEngy 18.10 -.11 -10.9 Xerox 15.15 -.19 -9.5 YankCdl 30.04 +.44 +11.3 Yorldn 38.45 +.10 +1.9 YumBrds 48.08 +.07 -9.8 ZaleCps 26.95 +.04 +7.5 Zimmer 86.12 +1.72 YTD Name Last Chg '-43.2 ACTTele .75 -.05 1-13.8 ADOCTa 2.31 -10 +35.6 AMXCp 22.34 +.04 1-13.6 ASETst 5.84 -.26 +10.9 ASMLHId 17.65 -.03 -11.6 ATITech 17.15 -.47 +17.8 'ATMIInc 26.54 -1.07 '+18.7 ATPaO&G 22.06 +.06 -21.7 ATSMed 3.65 -.05 +1.3 AVIBIo 2.38 +.09 +121.1 Aastrom 3.14 +.27 ,-17.4 Abgenix 8.54 -.25 ,-17.6 AccHme 40.93 -1.23 S+8.4 Accredo 30.06 +.09 S+.8 Activlnsa 21.55 -.21 '-15.4 Acadom 22.25 -.05 463.8 ADAM 6.12 -.43 '-29.8 Adaptec d5.33 -.09 +.5 AdobeSy 63.07-1.53 -18.4 AdolorCp d8.09 -.13 -4.0 Adtran 18.37 +.10 +2.3 AdvDiginf 10.25 -.17 -9.6 AdvEnId 825 +.01 -25.6 AdvNeuro 29.37 -8.23 I -2.6 Advanta 22.04 -29 -1.5 AdvantB 23.90 -.19 1-14.9 Aeroflex 10.31 -.33 +13.7 Affymet 41.55 -.12 +8.9 Agilysys q18.67 +.37 +13.9 AlrTInc 20.69 -.05 [-17.4 AkamalT d10.76 -.22 +4.6 Akzo u44.46 -.09 +1.9 Alamosan 12.71 -.27 +7.5 Aldilars 16.40 -.20 -26.7 AlIggnach 7.88 -.43 '-17.9 Alkenrm 11.57 -.23 +3.4 AMscripts 11.03 -.09 S-82.8 AlphaTch .15 +55.7 AlalrNano 422 -.06 i -2.4 AearaCp 2020 -.18 I -24.4 Alvarlon 10.03 +33 -19.4 Amazon 35.69 +.03 -32.0 AmrBlo wt .17 S+.0 AmCapSIV r U.03 -.49 +12.0 AEagleO 52.75 +.09 +3.2 AmHnIhwys 34.11 +1.06 I -2.2 AmrMed 40.90 -.12 +33.7 AmPhram io.00+3.77 +1.3 APwCnv 21.67 -.71 -21.7 ArnTrde 11.13 -.14 -2.8 Amqen 62.35 -.99 -37.9 AmkorT 4.15 -.15 I -6.0 Amylin 21.97 +.02 S-6.9 Anioglc 41.72 -.38 -4.7 Analysts 3.81 -.08 -25.1 AnlySur 2.51 -.32 1-10.8 Andrew 12.16 -.31 I -3.7 AndrxGp 21.03 +.13 i +1.9 AngloDynn 22.57 -.83 +6.9 AngtoAmn 26.42 +21 -19.9 Antgncs 8.11 +21 -60.5 Aphton dl.54 -.10 I -6.1 ApolloG 75.80 -.62 +36.4 AclC 4u67.81 -2.32 S+3.6 Applebeess27.40 -.60 -25.9 ApplDigIra 5.00 -.13 +9.8 ApIdinov 381 +.21 +1.3 AkidMaS 17.33 -.17 -14.7 AMCC 3.59 -.12 +19.0 aQuandve 10.64 +.34 -27.7 Aradigm 125 -.04 -9.7 AnadP 6.71 -.22 -44.9 Aribars 9.15 -.17 -4.4 ArmHId 5.91 -.09 -11.1 Arotech 1.44 -.03 -98.2 Arns .46 -.19 -20.1 AmrTech 1.20 -.03 -6.1 ArthroCr 30.11 -.59 -4.8 AscentSoft 16.53 -.61 -11.3 AskJvs 23.74 -.41 -1.7 AspectCm 10.95 -.18 -1.2 AsdBncs 32.84 -.36 -34.0 AtRoad 4.56 -.19 1-11.3 Atari 2.60 -.12 -24.1 AthrGnc 17.88 -.73 +29.3 Athern 13.25+1.14 -18.4 Almel 3.20 -.03 -36. Audiblen 18.46 -.86 -4.6 Audvox 15.05 -.46 +12.5 AugsftT 11.86 -.10 -21.3 Authenidle 4.87 -.34 -24.8 Autodsks 28.53 -.68 -44.4 Avanex 1.84 -.05 +4.6 AvidTch 65.81 +.40 -14.0 AvoctCp 34.94 +.06 +27.2 Aware 6.17 -.01 -10.8 AxcanPh 17.23 -.18 +9.3 Axcelis 8.89 -.46 -74.6 Axonyx. 1.58 -.11 -2.3 BEAero 11.37 -.12 -9.3 BEASVs 86.04 -.05 -17.3 BallardPwd5.61 -.56 -1.1 BankMuU 12.04 -.02 +17.3 BeaconP 1.08 -.01 -3.1 BeaslayB 16.99 -.07 -2.7 BedBath 38.76. 71 -12.3 BellMic 8.44 -.38 -43.6 Blolmaging 3.09 +.09 +1.4 Bloenldc u67.57 +.28 -14.2 BloMarin 5.48 -.02 -3 Blomet 43.28 -.73 +.4 Blomra 2.42 +.04 -26.4 Blooure .44 +.01 -209 BlackBx 37.98 -1.08 -12.8 BobEvn .22.79 -.22 -23.6 Borland 8.92 -.30 -192 BoasnCom 747 -.18 +.3 Brdcom 32.37 -.39 -2.9 Broadwing 639 +.69 -16.4 Br1deCm 6.39 +27 +4.5 BrooksAut 18.00 -.61 +2.9 BusnObj 26.08 -.53 -18.6 C-COR 7.58 +.03 +1.2 CBRLGrp 42.37 +20 -13.0 CDWCorp 57.75 -1.84 -3.5 CHRobn 53.57 -.47 -25.9 CMGI 1.89 -.04 -13.0 CNET 9.77 -.11 -6.3 CSGSys 17,53 -.25 +22.6 CTIMole 17.39 -.11 -.8 CVThea 22.81 +.47 -18.7 CabolMIc 32.56 -1.08 +18.8 CalDive u48.34 -.36 -22.4 Candeas .832 -.93 -863 CapCtyBk 39.16-1.39 -19.6 CardlacSd 1.72 -.05 -25.5 Cardilma .38 +.02 -6.3 CareerEd 36.69 -.50 -31.9 CanrAcc 727 +.03 +34.5 Carrizo u15.20 +.75 +4.0 Celgenes 27.59 -1.02 -19.4 CollGens 6.53 +.06 +24.4 CeMThera u10.13+1.09 +40.6 CentCom 11.15 +.04 +3.4 CentAI 27.16 +.94 +.2 Cephin 50.96 -.56 -21.4 Ceradynes 29.97 -.80 +.62.4 CerusCp 4.79 -.04 +11.3 CharlRse 11.24 -.08 .-14.3 ChrmSh 8.03 -.12 -27.7 ChartCm 1.62 -.03 -8.4 ChlkPdont 22.57 -.52 +1. ChlkFree 38.78 -.92 +8.7 Checkers 14.56 -.13 +3.0 Cheesecks 33.45 -.68 -20.8 chndnm 3.65 -.07 +3.3 Chiron 34.44 -.69 +2.3 ChrchllD 45.71 -.05 -22.5 ClenaCp 2.59 -.13 -.4 Cntas 43.67 -1.02 -13.6 CtIus 4.75 -.15 -9.7 Cisco 17.46 -.26 -122 CIpdxSy 21.48 -.19 +19.6 CleanH 18.05 -.05 -13.9 CllckCm 13.64 -81 -14.2 CoStar 39.64 -.86 -2.3 Cogent n 32.24 +.18 +6.2 CogTecha 44.63 -.59 -.1 Cognosg 44.01 +.25 -.8 Conarco B.53 +.4 -1.9 Conmcast 32.64 -.30 -2.3 Comnsp 32.10 -.23 -6.7 CmrdCaps 21.17 '-.28 -5.4 CompsBc 46.03 -.75 +10.0 CompCrd u30.07 +.92 +10.1 Compuwre 7.08 -.09 -5.6 Comvers 23.09 +.12 -38.5 ConcCm 1.76 -.01 -12.1 Conexant 1.76 -.11 +2.1 Conmed- 29.02 -.69 -7.2 Connetics 22.63 -.44 -16.2 Conolog 3.73 +.56 -33.9 Codillan d3.25 -7.3 CorirthCa 17.47 -.64 -16.1 CostPlus 26.95 -.44 -4.8 Coatco 46.10 -.84 -23.0 Crayino 3.59 -.14 -2.8 CredSys 8.89 -.26 -41.4 Cree Inc 23.50 -.58 +3.4 Cresud 15.40 -.38 -8.4 CublstPh 10.84 +.04 -1.1 CumMed 14.91 -.09 +892 Cyberonic 39.20 +1.79 -48 Cymer 28.11 -.89 +18.0 Cytogenr 13.59 -.33 -11.9 Cytyc 24.30 -.16 -.6 DRDGOLD 1.53 +.08 -342 Danka 2.08 +.03 -4.3 Dellno 40.34 -.26 +69.0 delltthree 5.61 +.12 -26.8 Dndreon 7.89 -.16 -23.7 Dendrite 14.81 -.13 +1.7 Denltply 57.17 -.24 ... DIgtlQen 1.25 +.15 -24.2 DigLght 1.00 -05 -20.7 DigRiker 32.99 -.99 +3.1 DIglts 9.85 +.01 -37.3 DirectGen 20.13 -.62 -18.2 DIscLeabs 6.49 -.02 -6.5 DItechCo 13.98 +.15 +14.5 DobsonCm 1.97 +.01 -9.5 DilTrwe 26.05 -.59 -23.3 DotHil 6.01 -.10 -4.2 DbieCIck 7.45 -.08 -23.5 drugre 2.60 +.04 +4.0 DryShipsn 21.01 +.651 -1.8 E-loan 3.32 +.41 -26.6 eBavy 42.72 -.33 -4.5 ECITel 7.80 +.01 +2.2 EGLInc 30.54 -.73 +1.9 eResrch 16.15 -.44 -20.3 ESSTech 5.67 +.1lb +6.4 EVCICCg 10921 +1.16 -22.5 ErthLnk 8.93 -.03 -27.8 EasyLnk d1.04 -.21 -10.1 EchoStar 29.90 -.60 -22.2 Edlpsys 15.90 -.53 -42.4 eCostacmn 9.1 -1.87 +43.1 EdgrOnI u2.19 +.25 -6.5 EducMgt 30.86 -.86 +1.6 EduDv 10.47 -.08 -33.7 8x8 Inc 2.70 -.06 4+.4 EleclSc 20.44 -.51 -7.2 Eltrgis 4.37 +.02 +3.1 ElecArts 63.61 -1.27 -32 EFII 16.86 -.03 +7.9 BIzArden 25.82 -.42 -252 eMrgelnt 1.19 +.04 -.8 EmmiC 19.03 +.25 +13.1 EncysiveP 11.23 -.17 +1.0 EndoPhtm 21.21 -.25 +244 EnbtSMd 4.03 +.33 -62 EnvoyCmnrs 2.89 -.06 -14.0 EnzonPhar 11.80 -.05 +4.6 EonLabsa 28.26 -.50 -25.5 E.piphany 3.60 -.14 -60.4 EptxPhar 8.88 -.17 -9.3 EricsnTI 28.55 -.69 -24.3 eSpeed 9.36 -.43 -9.1 Euronet 23.65 -.14 +20.1 EvrgrSir 5.25 +.28 -26.0 Exelixas 7.03 +.03 +8.9 ExldeTcn 15.01 -.05 -2.1 ExpdInt 54.71 -1.07 +.4 ExpScript 76.75 -.50 -4.8 ExtNew 6.25 -.19 IA ME I AN T5 E C aN EI YTD Name Last Chg 1+24.5 AXS-One 320 +.30 +3.7 AbdAsPac 6.72 +.03 +35.9 AdmRsc 23.98 +.32 -2.2 ApexSIlv 16.80 +.60 -7.3 AvanlrPh 3.16 -.02 -31.3 Avitar .11 ... -2.3 BemaGold 2.98 +.11 -5.6 BatlechT 144.30 -.67 +26.4 BootsCts 1.15 +.12 !-10.3 CalypteBn .35 -.01 -3.7 Camblorg 257 +.06 +19.4 CdnSEng 1.91 +.11 +36.1 CanAroon 1.47 +.06 -5.3 CarverBop 18.95 +.04 +1.5 CFCdag 5.55 +.03 +.7 ComSys. 12.09 +.14 -14.6 CmsfTobtR 15.33 +1.48 -13.0 ComerStrt 7.40 +.43 +1.1 Crystalxg 3.63 +.07 -22.7 DHBInds 14.72 -.27 +.2 DJIADiam 107.72 -.73 -30.4 DSLnet h .16 +86.2 DanlHd u15.73 -.28 -7.3 Darling 4.04 -.03 -10.5 EZEM 13.06 -.14 -37.9 EaaleBbnd .41 -.02 +1,9 EVUdDur 19.20 ... +7.5 EldoGQldg 3.17 +.11 -1.4 Eiswth 7.97 +.02 -6.2 Everlnco 15.15 -.11 -4.4 FTrVLDv 14.76 -.04 -4.3 FlaPUIII 18.32 +.02 +9.4 Friedmlnd 11.80 -.55 -11.5 GasoEnn 3.77 -.13 -22.7 GoldStIr 3.10 -.08 +12.7 GrevWolf 5.94 -.09 +156.0 Gurunetn 22.27 -.99 -7.7 Harken .48 +.03 -1.5 IN GGREn I4.l ... -8.3 ISCOInd .33' +.01 +7.9 IShBrazxl u23.99 +.40 +.5 IShCanada 17.38 +.05 -4.2 IShHK 11.58 -.15 -3.5 IShJapan 10.54 -.06 +.7 IShMalasla 7.20 -.04 +4.0 IShSing 7.46 -.04 -1.6 IShTalwan 11.87 -.28 -.5 IShSP500'120.36 -.99 +3.5 ISh20TB 91.68 -.58 -.3 IShl-3TB 81.22 +.04 +.4 IShEAFE 160.90 +.33 -6.4 16nNq8o 70.61 -.24 +.9 IShR10OV 66.97 -.42 -2.3 ISbR100G 48.01 -.33 . -3.4 IShR20000 65.03 -.85 -2.8 IShRs2000125.86 -1.12 -5.3 IShDJTel 23.02 -.33 -2.8 IShREst 119.73 -.07 -.1 IShSPSmI 162.47 -1.48 +30.7 InltgSys 2.64 -.07 -26.9 IntrNAP .68 -.02 +11.6 IntarOllgnu42.24 +3.40 +32.1 Investools 4.49 +.15 -26.5 IslandPac .36 -.02 -l.u IvanCps 16.66 -.4 +3.2 KFXInc 14.99 -.02 -41.4 UfePolnt .17 +.01 .. Merrimac 9.04 +.29 +4.9 MetroHItn 2.97 +.10 +7.8 NTNCon 3.44 -.14 +7.9 Nabors u55.35 -.21 -.7 NOrion gn 2.89 +.01 -8.8 NthgtMg 1.55 +.09 +22.8 NovaGldg u9.52 +.28 +10.9 OIISvHT u94.31 -1.43 +14.3 On2Tech .72 +8.6 PacRIm .63 +.04 +19.2 PainCare 3.67 -2., +10.8 PetrofdEg 14.45 +.08 -3.6 PhmHTr 70.08 -.07. +17.6 PlonDril u11.67 +.57 -2.6 PwShHIYn 14.87 -.11 +6.1 ProvETg 10.06 -.03 -7.5 Onstakegn .37 +.02 -7.9 RaeSyst 6.72 +.42 -3.5 RegBkHT 137.05 -1.28 -14.3 Rentech 1.92 -.18 -.6 RetailHT 98.05 -.53 -29.3 Rewards 4.95 +.04 -.4 SemlHTr 33.25 -51 +620 mrnmWres 2.66 -.02 -12.7 SoflHTr 35.12 -.41 -.5 SPDR 120.23 -.96 +2 SPMid u121.22 -.69 +1.7 SPMals u30.24 -.11 -3.4 SPConsum34.08 -.17 +13.3 SPEncv u41.14 -.56 -1.4 SPFnd 30.11 -.27 -5.6 SPTech 19.92 -.33 +5.3 SPUtI u29.32 -.06 -20.0 Stonepath .96 +.08 -19.2 Tasekon 1.39 +.05 -7.2 TelcHTr 27.09 -27 -9.0 Takonm 6.06 ..07 +14.1 Terremark .73 -.01 +43.4 TelonPet 2.18 -22 +389.1 TransGb U7.12 +28 +31.3 Transmont 8.05 -.15 +3.7 TrValeey 12.68 -1.82 +13.4 UWaPtg u54.56 -1.64 +5.3 UtIHTr 0102.85 -.35 -15.0 VIragenra .85 +.02 +1.4 Wstmlnd 30.90 +.78 +2.8 WhealitRa 3.35 -25,2 Wyndham .89 -.01 +22.8 Yamanag U3.71 +21 -21.6 Eyetech 35.69 +.42 +32.5 Ezcorp 20.42 +.07 +6.0 F5Natw 51.62 -1.19 +17.5 FFLCBcp 4124 +.12 -4.9 Fastenal 58.52 -1.09 -13.5 FleldInvn d14.70 -.20 -2.0 FIfhThIrd 48.34 -.48 -7.2 RieNet 23.90 -.06 -23.7 FndWhat 13.53 -.07 -33.3 Finlsar 1.52 -.03 -6.0 FstMertI 26.79 -.20 -6.2 Fiserv 37.68 -.48 -1.1 Flextrn 13.67 -.35 +23.7 Flowint u3.70 +.56 -16.9 FLYI 1.47 -.07 .. FocusEn 1.14 -.04 -6.4 Fonar 1.47 -.04 -13.3 FormFac 23.54 -.07 -22.3 Foundiy 10.23 -.32 -2.9 Fredsinc 16.90 -.46 +4.6 FuelCell 1.36 -62 -29.6 FRnmdia .60 -.03 -9.7 Garmln 54.91 -.27 -6.3 Genmsar 5.55 -.13 +13.1 OenProbeu51.13 +3.22 -29.2 GeneLTc .85 -.03 -11.7 GnCom 9.75 -.31 -13.7 GenesMcr 14.00 -.30 -16.5 Genta 1.47 +.12 -9.2 Gentex 33.60 +.11 -2.6 Genzyme 56.64 -1.26 -2.6 GeronCp 7.76 ^.01 -12.0 GevityHR 18.10-2.82 -3.6 GliseadScs 33.73 +.11 +64 Globind u8.74 +.46 +64.2 Qlowpoint 2.39 -.11 +2.7 oGoalen 197.90 -.51 -4.9 GrtrBay 26.52 -.54 +7.9 GrpoRn 9.25 +.01 -1.8 HMNFn 32.40 -8.5 HainCelest 18.91 -.29 +12.0 Hansen 40.78 -1.55 -3.5 HadrxFL 33.40 -1.06 +39.1 Harmonic 11.60 -.25 -12.8 HarisHa 1429 +.15 -37.5 Harrisint 4.94 -.10 +14.3 Headwatra 32.8 +.91 +3.1 HSchein 71.79 -.48 +5.8 HIywdE 13.85 -.04 +32.6 Hologic 36.42 -.24 -31.9 HrznOff 1.13 -.01 +16.8 HotTopic 20.08 -.37 -3.7 HumGen 11.57 -.09 +.7 HuntJB 45.15 -.30 -8.6 HuntBnk 22.61 -.27 +5.2 Hurco 17.35 +.45 -3.7 HutchT 33.30 -1.30 +30.5 Hyddril 59.39 -1.78 44.0 HyperSolu u49.40 -.35 -20.3 IAC Interac 22.02 -.53 +6.5 ICOInc 328 +.28 -18.7 ICOS 22.99 -.07 +10.0 IDBio 16.44" +.62 -43.6 IPIXCp 327 -.08 -13.2 IPas 6.42 -.20 ... Icoria .665 -.03 -13.8 Identx 636 +.03 +40.1 ImaxCp 11.56 -.20 -7.3 Imclone 42.71 +.36 -26.7 ImunPRspr 1.18 +.01 -2.8 Imunmd 2.96 -.10 +.7 ImpaxLab 15.99 -.32 -16.1 Incyte 8.38 -.29 -32.7 IndevusPh 4.01 -.12 +26.6 Induslnll 2.71 +.10 +62.0 Infinity U12.40 +.51 -10.6 InfoSpce 42.50 -1.84 +12.0 Infcrassing 18.96 -.34 -.1 Informnat 8.11 -.22 *7.3 Infosyss 74.38 -.32 +79.8 Innovo 4.55 +.09 -49.7 InspPhar 8.43 -.08 -.5 Instinet 6.00 -.08 -6.1 InteagCrc 19.85 -.15 +3.6 IntgDv 11.98 -.41 -24.4 ISSI 6.20 -.03 +1.0 Intel 23.63 -.51 +23.5 Intelllsync 2.52 +.09 +19.1 Interchgn 21.60 -.20 -20.8 InterDIg 17.51 -.41 -13.5 InterMune 11.47 +.20 +5.2 ntlSpdw 55.53 -.47 -17.2 ItmtCprs 7.45 -.38 -13.2 InrntSec 20.17 -.83 -.1 Intersll 16.70 -.05 +7.1 Intrado 12.96 -.41 -8.9 Intuit 40.11 +.06 +19.2 IntSurg u47.70 -.99 -.4 InvFnSv 49.80 -.62 4.3 Invlltrogn 70.05 -.88 -24.9 Isis 4.43 -.20 -14.6 slonics 4.69 -.21 +9.8 Itron 26.25 +.36 -8.0 IvanhoeEn 2.37 -.06 45.7 xia 17.77 -28 +8.8' 2Glob 37.55'-1.00 -14.6 JDASof 11.63 -.18 -432 JDSUnIph d1.80 -.11 -7.6 JkksPac 20.43 -.86 -18.9 JetBlue 18.84 -.15 .. JoyGIbs 28.94 -.41 -17.4 JnprNIw 22.45 -.51 -41.2 JupOtrmed 13.99 -.71 +8.3 K Swiss 31.54 +.81 +8.4 KLATno 49.68 -.60 -11.1 KenseyN 30.68 -.29 +1.6 Kmart 100.52 -1.19 -3.7 KnghtTrd 10.54 -.06 +20.0 KnIghtT 40.11 -22 +6.4 KopinCp 4.08 -.02 +4.8 Kronos 53.60-125 -22.3 Kullckde 6.70 -.33 -5.6 Kyphon 24.32 -.68 -4.8 LCCInt 5.55 +.05 -9.3 LKQCp 186.20 -.07 +.4 LSIInds 11.50 -.46 -33.0 LTX 6.15 -79 -15.0 LaJolPh 1.42 -.04 +13.1 LakesEnts 18.42 +.65 +3.8 LamRsch 30.00 -.58 -3.1 LamarAdv 41.45 -22 -6.8 Landstars 34.70 -1.08 -15.7 Lasrcp 3026 +.05 -12.6 Lattice 4.98 -.09 -434 Level 1.92 -.11 -47.4 LexarMd 4.12 -.03 -4.5 LibMIntAn 44.15 -.76 +14.6 UfePtH 39.90 -.30 -13.9 UgandB 10.02 -.20 -6.4 Uncare 39.91 -.05 -8.4 LIncEl 31.64 -2.59 -1.3 UneaiTch 38.25 -.55 -1.4 LodgEnt 17.44 +.05 -60.7 LookSmart 1.08 -.04 -9.3 Loudeye 1.86 +.11 +19.1 M-SysFD 23.48 -.46 +1.9 MCGCap 17.48 +.07 +25 MCIIncn 20.66 -21 -11.8 MGIPhrs 24.71 +.12 +24.1 MIPSTech 1222 -.31 +5 MRVCm 3.69 -.05 -3.0 MTS 3281 -.92 +122 Macrmdia 34.91 -1.78 +7.7 Magma 13.47 +.12 +10.5 MagnaEnt 6.65 +.34 -10.4 Majescon d10.99 -.48 -28.6 Mamma 4.44 +.19 +8.3 MarchxB n 22.75 +.36 +222 .Martek 62.55 -.32 43.1 MarveKlTs 36.56 +.10 -15.1 MetrtO 556 -.34 -14.0 Mattson 9.64 -.25 -.7 Maxim 42.10 -.67 -3.0 MaxwIlT 9.84 -.18 -28.8 6 McLeoA .51 -.02 -30.5 McDalaA 4.14 -.04 +31.9 MeadowVly .25 +AO -10.6 Medlmun 24.24 -18.0 Medarex 8.84 -.35 -45.2 MedlaBay .85 +.03 -3.6 MedAct 19.00 -.43 -10.1 MedICo 25.89 -.25 -8.2 MentOr 14.03 -.37 -8.8 Mercerind 9.71 +.43 +2.9 MercIntr 48.89 -.93 -6.2 MesaAlir 7.45 -.17 +10.5 MetalMgsau29.70 +1.20 -22.8 MetalStm 3.21 -.03 +3.7 MetalsUSA 19.24 +.37 -19.9 Micrel 8.83 -.27 +2.7 Microchp 27.30 -.96 -10.3 Mcromse 4.98 -.14 -1.4 MIcSemIs 17.11 -.26 -4.0 Microsoft 25.65 -.14 +17.6 McroStr 70.87 -.72 -28.8 MIIIPhar 8.64 +.05 -4.7 MIIcmlnts 21.67 -.29 -3.6 Mlndspeed 2.68 -.05 -9.8 MIsonIx 5.87 -.16 +16.6 MlisnRes 6.81 -.04 -16.4 Molexlf 25.08 -.61 -14.6 MolexAIf 22.75 -.40 -14.5 MnstrWw 28.76 -.32 +13.5 MovieGal 21.65 -.20 -44.0 MulrmG s 8.83 -.07 -14.8 NABIBlo 12.48 -.41 -2.1 NEC 6.00 +.01 -8.6 NETgear 16.60 +.03 +18.2 NIIHIdgs u56.07 -.35 -19.3 NPSPhm 14.76 +.32 -8.7 NTLInc 66.61 -.89 -13.6 NVECorp 24.05 -.81 -36.3 Nanogen 4.69 -.11 -14.0 Napster 8.05 -.31 -6.1 NasdI00Tr 37.47 -.51 -7.3 Nasdaq n 9.85 -.30 -13.2 Naslech 10.50 -.10 -44.8 Navare 9.72 --.40 -3.4 NeighCar 29.68 -.10 -14.0 NeklarTh 17.41 -.11 -29.2 NeoseT d4.76 -.64 -11.7 NetBank 9.19 -.08 -25.0 Net2Phn 2.55 -.09 -25.3 Netease 39.2 +.02 -14.8 NebEli 10.50 -.45 -29.4 NetWolv .82 -.03 -6,9 NetwkAD 3126 -.47 -17.1 Neurcrine 40.85 -1.14 -7.8 NewFmt 7.30 -.12 -4.7 NexteC 28.59 -39 +2.1 NexilPrt 19.96 -.09 -7.3 NhroMed 24.71 -.15 -1.2 NoblyH 23.20 +.01 -11.4 NorTrat 43.02 -.68 -35.1 NwstAid 7.09 -.09 -63.4 Novatel 20.68 +.38 -38.8 NvlWri 12.26 -.64 -13.5 Novell 5.84 +.08 +4.1 Novlus 29.03 -.45 -9.8 NuHodz 720 -28 -18.8 NuanceC 3.36 -.11 -23.8 Nuvelo rs 7.51 -.14 +83 Nvkia 25.51 -23 +4.1 OCharleys 20.36-1.00 +8.8 ORellyA u49.03 +1.46 -23.0 OSIPhrm 57.66 -.19 -20.1 OdysseyHl 10.93 -.16 +2.9 OhloCas 23.88 -.15 -6, OlyOpSti 24.72 +.55 +4.0 OmnlVisn 19.08 +.65 +A4 OnAss gn 521 -.34 +56.7 OnSmcnd 4.80 -10 -11.5 1800Flows 7.43 -.13 -1.7 OpenTxt 19.70 -.18 -13.9 OpmnwSy 13.31 -23 -26.9 OplnkC 1.44 -04 -23.0 Opswae 5.65 +.11 -11.0 optXprsn 18.06 +.54 -6.6 Oracle 12.96 -.37 +1.0 Orthfx 39.49 -.36 -20.5 Oslent 2.90 -.18 -1.7 OtterTall 25.10 -.21 -18.9 Oversok 5.95 -1.40 -11.0 PDIInc 19.83 -25 -2.4 PFChng 55.00 -.00 -15.5 PMACap 8.75 -.25 -8.4 PMCSra 10.30 -.49 -19.4 PPTVis .79 -11.9 Paccar 70.90 -1.25 .+13.9 Pacednt u24.21 +.22 +11.5 PacSunwr 24.83 -.14 -16.6 PalmSrie 10.64 -.32 -26.1 palmOne 23.32 -.63 +2.7 PalmrM 26.77 -.08 +3.3 PanASIh 16.51 +.39 +34.3 PaneaBrdu54.15 46.02 +15.8 Pantry u34.84 +.17 +24.6 ParPet u6.71 +.30 -.7 ParmTc 5.85 -.08 -7.0 PirTrFnls 10.83 -.07 +10.5 Pattersons 47.96 -.63 +16.2 PattUTIs u22.60 -.03 -9.2 Paychex 30.96 -.32 +7.5 PennNGm 65.08-1.87 +12.0 Pemgrine 1.31 +.04 -5.9 PerFood 25.32 -.48 +3.7 Perigo 17.91 +.13 +18.0 PetrohawkU10.10 +.26 +10.8 PetDv 42.74 -.06 +35.5 PtroMqE u6.72 +.31 -10.6 PetsMait 31.78 -.51 -45.1 Phanios .78 -.04 -19.5 Pharmlon 34.00 -.53 -24.2 PhaseFWn 6.19 -.11 -69.3 Phazar 19.95 -.65 -1.9 Photon 23.76 +.12 +7.2 PhotIn 17.69 -.59 -24.0 PinnacdA 10.59 +.11 -28.7 PinnSyst 4.35 -.12 +4.6 Pixar .89.53 +.46 -14.6 Pxfwrks 9.69 -.19 -19.7 Plexus 10.45 -.15 +3.1 PlugPower 6.30 +.20 -27.7 Polycom 16.87 -.08 -21.6 PortPlayn 19.35 -.64 -12.8 PortfRec 35.93 -.81 +2.8 Powrintg 20.34 -.86 -272 Power-One 6.49 -.16 -13.1 Powrwav 7.37 -28 -18.6 Prestek 7.88 -.04 -1.7 PrieTR 61.12 -.30 -10.4 pricelhe 21.14 -.64 -40.3 PrimusT 1.90 -.11 +25.8 ProgPh 21.58 -.07 -15.6 ProtlDg 17.44 -.02 -20.9 ProvdCom 2937 -1.90 -12.1 QCHIdgsn 186.85 -.18 +13.7 QIAGEN 12.45 +.41 -4.3 OLT 15.39 -.03 +13.3 Qlogic 41.63 -1.11 -16.6 Quatoms 35.35 -.64 -12.6 QuanFuel 5.26 +.06 -9.9 QuestSftw 14.37 -.28 -1.4 Ouldel 5.01 +.30 -16.7 RFMICD 6.70 -20 -19.0 RSASec 1624 -.12 -23.1 RadiSys 15.03 -.06 -13.5 ROneD 13.95 -.44 -59.7 Ralnmkr .50 -.01 -22.5 Rambus 17.82 -.41 +34.7 RandgExs 2.33 +28 +83 Randgolds12.42 +.70 -7.4 RareHosp 29.60 -126 -3.0 ReatNwk 6.42 -.20 -125 RedHat 11.68 -1.00 +39.6 Redback 7.48 -.32 -10.0 Remec 6.49 -.12 -2.6 RentACt 25.83 -.15 -4.7 RepubArn 12.65 +.15 -3.9 RepBcp 14.68 -.16 -8.3 RschMols 75.54 -1.84 +12.0 RescAm 36.40 -.93 +11.1 Reapim u60.39 +.94 -3.3 Retek 5.95 -.30 -9.7 RIgsNt 19.20 -.14 -12.7 RPtaMed 3.38 +.09 -3.7 RosaStrs 27.81 +.10 +15.6 Ryanair 47.09 -.43 -4.5 SBACom 8.86 -16.1 SIInt 25.81 +.46 -452 SMTCgrs d126 -.05 -7.9 Safeco 48.13 -.60 4+32 SanDisk 25.76 -.61 -29.6 Sanwtna 5.96 -.17 -12.1 Saplent 6.95 +.02 -21.8 SaxonCpn 18.75 +.22 +8.2 Schnitzers 36.71 -1.42 -13.6 Schulmn 18.50 -.04 +10.3 SclGames u26.30 +.03 -20.9 SeaChng 13.79 -.19 -23.1 SeattGen 5.02 -.35 +12.3 SelCmfrt 20.15 -.85 +5.3 Selain 46.58 -.81 -13.3 Semlaech 18.93 -.53 +38.2 Snoayxn 11.44 4+86 +7.1 SeopracO u63.860 44 +3.5 Serolog 22.90 -30.5 Shandan 29.56 -.23 -17.5 Shiplm 15.66 +.03 -.3 ShmrPh 31.86 -.41 -1.5 ShufaMsts 30,93 -.70 -133 SIRFTchn 11.03 -,81 -16.7 SlebeloSv 8.74 -.28 -46.7 SleraWr 9.43 -.02 +16.0 SigmDg 11.52 +.06 +2.0 SIgmAI 61.64 -.51 +172 SigmaTel 41.63 +.67 -50.4 Silcnimg 11.45 -.35 -3.0 SIlonLab 34.26 -.78 -21.3 SST 4.68 -.18 +5.1 Slcnwars 431 -.13 +18.0 S9vStdg 14.02 +.30 -27.7 SIna 23.18 -.09 -21.4 SldusS 5.99 -.05 -20.4 SIdISoft d4.60 -16.5 SkyWeast 16.76 -.36 -22.0 SkywksSol 7.36 -.22 -13.2 SmurfStne 16.22 +.34 -11.3 Sohu.cm 15.70 +.12 -30.1 SonlcSol 15.68 +.02 -4.0 SncWal 6.07 -.15 -14.0 SonoShet 2920 -4.37 -159 SortraMd 1.80 +.06 -72 Sonaun 5.32 -.16 -72 SouMoBc 17.16 -192 SwBcpTXs 18.81 -57 +47.9 SprtnStr u9.82 +39 +14.8 samprnul&r118 +2.58 -5.9 Staples 31.71 -.68 +21.1 StaiScien 6.16 -.11 -20.1 Starbucks 49.80 -.59 +1.3 STATS'Chp 621 +.03 +7.1 StIDyna 40.57 -.93 +94 SteefTch 30.22-1.02 +15.6 StemCells 4.89 +.29 -.6 Stcycle 45.67 -.38 +2.3 StedBcsh 14.60 -.15 -9.0 SlewEnt 6.36 -.08 +9.6 SlotOfsh 7.10 -.05 -6.5 Straasys 31.72 +.62 -13.7 StrtDlag 3.02 -.06 +2.3 Siralosinri 4.49 +.01 -23.0 SunMico 4.15 -.10 -28.8 SupTech .99 -.01 -1.4 SusqBnc 24.60 -.38 4+9.9 SwitTm u23.61 +.11 -13.8 Sycamre 3.50 -.07 -13.7 Smantec a22.23 -.53 +7.1 Symetic 10.40 -27.1 Synaps 22.30 -39 -5.3 Synopsys 18.51 -29 +.0 Synovis 11.68 +.61 +18.3 THOInc 27.14 -.59 +16.7 TOPTankn 1929 -.34 -7.1 TTMTch 10.986 -.18 +5.9 TakeTwo 36.86 -.89 -54.6 TASERa 14.38 -.10 -8.8 TechData 41.41 -20 -362 Tegal 1.04 -.05 -7.8 Tekelec 18.85 -.01 +31.1 Telesys 14.87 -.33 -6.6 TelwestQIn 16.42 -.23 -6.6 Telkinc 186,06 -27 -17.0 Tellabs 7.13 -.01 +24.4 Terayon 3.37 -.08 +11.0 TesseraT 41.32 -.19 ... TetraTc 16.74 +.14 -9.8 TevaPhs 26.92 -1.02 +15.5 Thorate 12.03 -.17 -12.5 3Com 3.66 -.07 -13.6 TbooSft 11.52 -.07 -38,3 TIVoIno 3,62 -01 +23.2 vJTrc5hOff 1.70 +.59 +12. TractSupp 41.98 -.83 +17.7 TnSyA 23.36 +.16 -9,8 TMrsk"y 22.91 -23 -28.8 Tmrimeta 1.16 -.02 -21.4 TmSwtc 121 -.05 -35.1 Travelzso 61.94 +2.09 +7.4 Tmbles 36.50 -.98 -10.3 Timerds 12.71 -.56 -4.8 TrpathT 1.19 -05 -24.7 TirQunt 3.35 -13 -125 TrstNY 12.07 -21 -11.2 Tr11 27.59 -.19 -15.1 UAPHIdg n 14.7 10 +A4 USXp 22642as -2S +22.7 USANAH 41.9B-4.8 -9.9 USFCOp 34,19 +.59 +11.1 UTllWld uT.U .tU97 -37.7 UTStr 13.80 -.66 -.8 UbIquiT 7.08 -.25 +56,7 vUIElec 1.30 +.16 -16,6 unmratch 16.90 -.23 +3.7 UtdNirlFa 32.28 -1,61 -5.0 UtdOnIn 10.95 -23 44.7 'USEnr 3.10 +.07 -1.1 UtdGblCm 9.56 -28 -7.9 UnivFor 39.99 -1,57 -1.6 UlbnOutl .43.68 +06 -22.4 VASftwr 1.94 -01 -3.1 VCAAnts 18.94 -08 -6.8 VWGch 2.90 -.08 -4.7 V\ueCkk 12.70 +.02 +5.3 VarinS 38.80 -.74 +17.8 VacoDia 7.80 -37 +2.3 Veslera 2.69 +.02 -28.3 Veeoolt d15.11 -.64 -19.3 VSeln 27.11 -43 -13.9 Verias 24.69 -.59 -43.1 VaeroTch .41 -.01 +8.8 Ve txPh 11.60 +068 +17.7 Vic eln 1022 +.19 -.6 V1mron 17.30 -20 -12.9 Vignette 1.21 -.04 -36.7 ViSage 5.70 -.08 -30.9 VlonPhm 324 -.15 -9.6 Vite SM 3.19 -.10 +2.8 Wavmaco 2221 -.07 +242 WairanRnull.30 +.30 +5.5 Wasint 43.63 -.15 -19.6 Wihlrd d3,.6 -28 -48 WebMD 7.77 -23 -3.2 WebEx 23.01 -.53 +13.6 Webeenee u57.61 -.60 -10.5 WemerEnt 20.26 -20 +31.4 WWhiet 38.50 -.13 +25.6 WetSea 2.85 +.20 +6.6 WholeFd U101.65 -.43 -112 WresFac 8.38 -.01 +8.8 WRnSys 10.96 -.88 +10.9 Wrkstream 3.77 +.30 +21.4 WoddAIr u7.71 -.13 -144 WorkdQWel 427 -21 -11.0 WrightM 25.37 +.19 40.4 Wynn 7323 -.67 -11.6 XMSat 33.25 -.61 -46.9 XOMA d.A40 -1.3 inx 2927 -.28 -252 Xybmaut .92 +.07 +14.7 Xyratexn 18.92 -.34 -10.2 Yahoos 33.82 -.60 +2.5 YelowRd u57.08 -.17 -9.0 ZebraTe 5120 -.43 +7.7 ZhoneTch 2.79 -2.1 ZiCop 7.10 +.02 -.7 ZIonBcp 67.55 -.93 -40.4 Z1xCorp d3.07 -.20 -7.5 Zoran 10.71 +.15 Request stocks or mutual funds by wmning the Chronicle. Attn: Stock Requests. 1624 N. Meadowcrest Blvd., Crystal River, FL 34429: or phoning 563-5660. For stocks. include the name of the slock, its market and its ticker symbol For mutual funds. list the parent company and the exact name of the fund. Yesterday Pvs Day Australia 1.2674 1.2737 Brazil 2.5705 2.5962 Britain 1.8947 1.8860 Canada 1.2291 1.2364 China 8.2781 8.2781 Euro .7648 7672 Hono Kong 7.7996 7.7994 Hungary 187,16 187.55 India 43.740 43.660 Indnsia 9290.00 9285.00 Israel 4.3649 4.3668 Japan 105.55 10536 Jordan ,70907 .70907 Malavsia 3.7999 3.7999 Mexico 11.0900 11.1510 Pakistan 59.42 59.42. Poland 3.06 3 Russia 27.9650 27.99T7 SDR .6584 ,659S Singore 1,6399 1. Slovak Rep 29.22 2925 So. Africa 5.9116 M _ So. Korea 1 I02490 I ,10 Sweden 69506 6971 Switzerind 1 .1828 j Taiwan 31.55 31.56 U.A.E. 3.6728 3.67 British pound expre ed In U.S. dollar All IWhor %hlw dollar in foreign currency. Yesterday Pv My Prime Ralod 550 __525 DISCOUntRalto 350 _.50 Feduroi Nr-iM'. 410 250 2 50 Ireasuns% 3-month 253_ .._7 6-monin 2 7"' jT 1 5-year .. .3 .7 -_. % .... 10-year 4 l8_ 4 0 30-yrdl 458 447_ FUTURES Exch Contract Settle Chg Lt Sweet Crude NYMX Apr05 48.22 -.64 Corn 51BOT Mar05 1991/ 4 Q+ Wheat CBOT May 05 30314 +31h Soybeans CBOT May05 553 +101/4 Cattle CME Apr05 87.30 -.37 Pork Bellies CME Mar05 85.97 +.02 Sugar (world) NYBT May 05 9.30 +.06 Orange Juice NYBT Mar05 83.50 -.30 SPOT Yesterday Pvs Day Gold (troy oz., spot) $427.30 $417.20 Silver (troy oz., spot) $7.365 $6.956 Copper(pound) $1.bU3ob $1 .4/UU NMER = New York Mercantile Exchange. CBOT = Chicago Board of Trade. CMER = Chicago Mercantile Exchange. NCSE = New York Cotton, Sugar & Cocoa Exchange. NCTN = New York Cotton Exchange. I NASDAQ N 5ATOAMRKT1 1 CITUSCOUTY(FL CtooNIEFRIDAY, FEBRUARY 18, 2005 9A: MTAL FND 5-Yr. Name NAV Chg %Rtn AARP Invst: Balanced 17.51 -.09 NS CapGr 43.23 -.34 -29.5 GNMA 1520 ... +38.2 Global 27.13 -.03 NS Gltinc 21.78 -21 NS Inl 44.45 +.06 NS PthwyCn 11.72 -.04 NS PthwyGr 13.08 -.08 NS ShTmBd 10.17 +.01 NS SmCoStk 25,04 -.31 +65.5 AIM Investments A: Agrsvp 10.18 -.09 -31.2 BalAp 25.25 -11 -15.2 BasValAp32.25 -22 +43.6 Char Ap 12.77 -.10 -25.9 Cons p 22.50 -.21 -35.6 HYdAp 4.58 +.01 -4.7 IntlGrew 20.35 .., -21.8 MdCpCEq 28.71 -.19 +46.7 MuBp 8.22 -.01 +35.6 PrmEqty 9.79 -.08 -33.8 SelEqty 17.40 -.14 -33.0 Sumit 10.91 -.10 -42.8 WeingAp 12.83 -.10 -63.1 AIM Investments B: CapOBt 16.99 -.10 +2.4 PrmEqty 9.07 -.07 -36.3 AIM Investor Cl: Energy 31.57 -.37+131.7 HId 4920 -.14 -16,3 SmCoGlp12.16 -.13 -39.1 ToIRMn 24.31 -.12 +8.3 Uitles 12.52 -.05 -26.9 AIWMNVESCO Invstr: CoreS 10.58 -.08 -2.8 AMF Funds: A4Mig 9,80 ... +20.3 Advance Capital 1: Balancpn17.85 -,11 +31.1 Retncn 10.22 -02 +49.6 Alger Funds B: SmCapGrt 426 -.05 -50,2 AllianceBem A: AmGrincA 7.51 -.02 +57.4 BalWA p 17.32 -11 +46,0 GbTc p 5379 -.6 -60.4- GdrncAp 3.78 -.04 +31.6 SmCpirA22.77 -20 -12.0 AllanceBem Adv: LgCpGrAd18.18 -.18 -43.2 AllianceBem B: AmGvncB 7.51 -.01 +51.6 CorpBdBp 12.52 -.01 +40.8 GbTchB 148.74 -.61 -61.9 GrwthBt 22.89 -.18 -33.6 SCpGrBt 19.24 -.18 -15.4 USGovBp7.08 -.01 +30.7 AlleanceBem C: SCpGiCt 19.29 -.17 -15.3 AmSouth Fd Cl I: Value 16.82 -.13 +23.4 Amer Century Adv: EqGmropn22.08 -.17 -2.8 Amer Century Inv: Balancedn16.54 -.08 +14.8 Eqlncn 8.11 -.05 +96.0 Giowtlhn 19.30 -.16 -33.5 Heitageln12.11 -.08 -11.4 IncGmrn 30.52 -26 +3.4 IntDiscrn 13.49 ... -18.9 IntlGroln 9.06 +.01 -31.9 LifeSdn 4.92 -.02 -NS New Oppr n5.37 -.06 -54.5 RealEs9 n 24.25 -.05+168.0 Selecdtn 37.22 -.30 -22.6 Utiran 28.70 -.26 -25.9 AfIn 12.48 -.07 -8,5 Valukielnvn 7.386 -.06 +91.2 Amer Express A: Cal 5.26 -.01 +37.7 Discover 8.66 -.08 +9.7 DEI 11.23 -.08 +52.2 DivrBd 4.91 ... +33.4 DvOppA 7.31 -.05 -8.0 EqSel 12.61 -.11 -11.4 Growth 2621 -22 -47.9 HiYld 4.48 -.01 +35.1 Insr 5.50 .., +36.3 MgdAllp 9.55 -.06 +11.0 Mass .44 -.01 +35.1 Midch 5.35 -.01 +35.8 VMmn 5.36 ... +36.8 Mutual p 9.82 -.05 -8.2 NwD 23.66 -.18 -23.3 NY 5.17 ... +37.0 Ohio 5.34 ... +33.4 PreMt 9.26 +.16+101.6 Sel 8.71 -.01 +29.4 SDGovt 4.79 +.01 +23.7 Stockp 19.31 -.15 -15.2 TEBd 3.92 ... +37.6 ThdInli 5.68 -.03 -31.5 ThdIlint 7.29 +.01 -33.1 Amer Express B: EqValp 10.26 -.08 +14.1 NwDt 22.41 -.17 -26.2 Amer Express Y: NwDn 23.77 -.18 -22.8 American Funds A: AmcpAp 18.08 -.12 +15.5 AMulIAp 26.35 -.16 +50.5 .rM P 1" 'i; .-.09. +85.3 3 '.- i[. 1I6.i .,," +43.6 :..016A6p ,:' :16 -.08'+76.1 .-arWAp 19', +.0 '61.8 CapWGAp34.24 -084+51.2 EupacAp 35.94 -.10 -2.4 FdlnvAp 3221 -.14 +17.9 GwthAp 27.21 -.18 -0.7 HITrAp 12.61 -.01 +42.7 IncoAp 18.55 -.06 +64.7 IntBdAp 13.68 ... 4+32.5 ICAAp 30.70 -.17 +21.6 NEcoAp 20.45 -.19 -25.8 NPerAp 27.49 -.12 +9.1 NwWrIlA 33.33 -.02 +25.6 SOmCpAp 31.49 -24 -18.4 TxExAp 12.58 -.02 + .2 WahAp 30.67 -21 +42.8 American Funds B: BalBt 17.91 -.08 NS CapBBt 53.18 -.08 NS GrwthBt 26.43 -.17 NS IncoBt 18.46 -.05 NS ICABt 30.56 -.17 NS WashBt 30.48 -22 NS Ardel Mutual Fds: Appiec 46.47 -25+104.2 Aiel 52.86 -.39+152.4 Artisan Funds: Int 22.15 -.05 -18.6 MidCap 29.06 -.26 +20.1 Baron Funds: Asset 53.23 -.49 +23,2 Growlh 46.27 -.44 +67.8 Bernstein Fds: IntDur 13.45 ... +37.3 DivMu 14.24 -.01 +29.9 TxMgIntV 22.68 +.10 +30.1 BlackRockA: AuroraA 39.45 -.41 +99.3 Legacy 13.07 -.12 -17.2 Bramwell Funds: Growp 19.52 -.13 -16.9 Brandywine Fds: Bmdywnn27.22 -.15 -6.7 Brinson Funds Y: HdiYldlYn 7.52 ... +40.3 CGM Funds: CapDvn 30.73 -.64 +16.7 Mutin 26.68 -.19 +11.6 Calamos Funds: Gr&lncAp29.44 -.15 +32.6 InlEqAp 19.19 +09 -13.0 MBCAI 10.40 -.01 +25.7 Munint 10.96 -.02 +32.9 SodalAp 27.45 -.14 44.8 SocBdp 16.14 ... +47.7 SocEqAp 33.65 -.32 +22.8 TxFLU 10.61 ... +152 TxFLgp 16.81 -.02 +40.3 TxFV" 16.07 -.03 +34.7 Clipper 87.44 -.55+90.9 Cohen & Steers: RilyShrs 67.39 +02+158.9 Columbia Class A: Acomt 25.81 -.19 NS Columbia Class Z: AcomZ 26.34 -20 +69.1 AosmlntZ 30.18 +`07 -6.6 LargeCo 27.67 -.22 -7.7 SmaKlCo 21.26 -23 +67.6 Columbia Funds: ReEsEqZ 25.86 -.04+141.0 Davis Funds A: NYVenA 31.18 -21 +21.8 Davis Funds B: NYVenB 29.89 -21 +16.9 Davis Funds C&Y: NYVenC 30.08 -21 +17:1 Delaware Invest A: TxUSAp 11.68 -.03 +43.5 Delaware Invest B: DeldB 3.40 +.01 +8.6 SelGrBt 20.11 -.16 -50.6 Dimensional Fds: IntSmVan 1626 +05+139.2 USLgVan20.05 -.14 +77.5 USMvicron14.61 -.16 +51,9 USSmaln19,05 -22 +414.3 USSmrVa 26.31 -26+123.9 Emgttn 17.32.+.04 +31.7 IntVan 16.66 +.07 +66.0 DFARIEn 22.31 -.01+164.4 Dodge&Cox: Balanced 79.34 -21 +81.3 Income 12.92 -.01 48.8 IntfSI 31.63 +.05, NS Stock 129.76 -.52 +92.2 Dreyfus: Aprec 39.19 -.30 +1.5 Discp 31.95 -23 -15.6 Dreyf 10.16 -.08 -14.3 DrS001nt 35.01 -.28 -8.9 EmgLd 43.22 -.51 +10.0 FLIntr 13.46 -.03 +31.0 InsMutn 18.09 -.04 +37.8 SIrValAr 28.81 -.18 +49.0 Dreyfus Founders: GrmwhBn 9.92 -.08 -49.6 GrwhFpnlO.36 -.09 -47.5 Dreyfus Premier: CoreEqAt 14.68 -.11 -4.6 CorIvp 30.39 -21 +22.3 LdHYdAp 7.61 ... +17.9 TxMgGCt 15.72 -.12 -7.8 TchGroA 21.56 -27 -65.8 Eaton Vance Cl A: ChlnaAp 13.84 -.09 -12.1 GlwlhA 7.14 -.02 -8.2 InBosA 6.57 ... +29.3 SpEqtA 4.69 -.05 -43.4 MunBdl 10.79 -.01 +52.6 TradGvA 8.76 ... +30.8 Eaton Vance Cl B: FLMBt 10.98 -.01 +37.8 HIIhSBt 10.61 -.01 +14.6 NatlMBt 10.48 -.01 +49.8 Eaton Vance Cl C: GovtCp 7.55 +.01 +25.8 NatIMCI 9.98 -.01 +47.3 Evergreen B: BalanBI 8.43 -.04 -0.4 BlChpBi 123.86 -.19 -26.9 DvrBdBt 15,19 -.01 +35.9 FoudB 16.88 -.09 -7.4 MuBdBt 7.56 -.01 +35.2 Evergreen I: CorBdl 10.71 -.01 +45.6 Evrgml 12.95 -.10 -&7 Foundl 16.99 -.09 -2.7 SIMlIul 10.08 -.01 +25.3 Excelsior Funds: Energy 21.90 -25+104.7 HiYleklp 4.80 -.01 NS ValRestr 42.08 -.36 +38.1 FPA Funds: Nwlnc 11.19 ... +42.2 Federated A: AmLdrA 24.84 -.23 +13.4 CapApA 25.36 -.19 -3.4 MidGrStA 30.37 -.27 -32.2 MuSecA 10.86 -.01 +39.6 Federated B: StrlncB 8.92 ... +432 Federated Instl: Kaumn 5.31 .. +28.6 Fidelity Adv Foe T:+ HICarT 19.98 -.01 +5.6 NatResT 35.61 -.30 +76.7 Fidelity Advisor I: EqGrin 47.07 -.45 -33.4 Eqlni n 28.75 -.22 +4.0 IntBdln 11.13 ... +42.4 Fidelity Advisor T: BalancT 16.21 -.08 +8.2 DIvGrTp 11.54 -.09 +17.1 DynCATp 13.40 -.16 -30.9 EqGrTp 44.75 -.43 -35.3 EqlnT 28.41 -.21 +44.0 GovinT 10.10 -.01 +39.7 GrKppT 30.15 -25 -20.7 HilnAdTp 10.03 -.09 +39.9 IntBdT 11.11 -.01 +40.4 MidCpTp 24.11 -.22 +22.7 MulncTp 13.26 -.01 +43.8 OvrseaT 17.64 -.03 -15.6 STFiT 9.51 ... +28.3 Fidelity Freedom: FF2010n 13.62 -.05 +11.6 FF2020n 13.93 -.06 +2.7 FF2030n 14.04 -.07 -3.1 Fidelity Invest: ' AggrGrrn 16.20 -.15 -70.7 AMgrn 16.14 -.07 +11.0 AMgrGrn 14,68 -.08 +1.5 AMgrInn 12.68 -.03 +28.2 Balancn 17,97 -.10 +47.1 BlueChGrn40.96 -.33 -26.7 Canadan 34,91 +.16 +70,0 CapApn 25.33 -.20 -4.5. Cplncrn 8.53 -.01 +34.1 ChinaRgn 16.98 -.13 -2.3 CngSn 394.61 -2.07 +8.2 Contran 57.32 -.42 +9.7 CnvScn 21.19 -.11 +16.1 Destl 12.65 -.10 -28.5 Destll 11.34 -.08 -14,5 DisEqn 25.71 -.22 +0.3 Divlntln 28.96 +.05 +23.9 DiNGtlhn 28.08 -.23 +19.2 EmrMkn 13.60 +.01 +11.0 Eqlncn 52.67 -.37 +36.1 EQIIn 23,62 -.20 +31.6 ECapAp 22.37 +.06 +11.7 Europe 35.04 +.15 +6.4 Exchn 268.73-1.42 +10.4 Export n 19.92 -.20 +30.7 Fideln 29.80 -24 -14.3 fty rn 20.31 -.11 +6.5 FrdnOnen 25.05 -.14 +2.2 GNMAn 11.10 ... +39.3 Govtlncn 10.25 -.01 +41.5 GroCon 54.43.-.47 -41.5 Grolncn 37.82 -.25 -0.2 Grolndln 9.55 -.07 -0.4 Highlncrn 9.09 ... +17.7 Indepnn 17.64 -.10 -26.0 IntBdn 10.50 ... +41.6 IntGovn 10.20 ... +37.3 IntlDiscn 28.52 +.01 +8.6 IntISCprn24.59 +.11 NS InvGBn 7.56 ... +45.0 Japan n 12.55 -.06 -38.5 JpnSnimn 12.44 -.04 -19.3 LatAnn 22.81 +.23 +48.0 LevCoStkn23.66 -.36 NS LowPrn 40.28 -.16+144.1 Magellnn03.30 -.90 -14.6 MidCapn 23.11 -.16 -2.4 MtgSecn 11.25 ... +42.5 NwMktrn 14.20 +.03 +95.8 NwMilln 31.01 -.30 -22.7 OTCn 33.24 -.40 -46.2 Ovrsean 35.21 ..07 -13.8 7'5.PsLr. ,Uoo 1 ) C, 'ur.n 189: -8 *3" 1 :5 .J"i .' .' I ,r' : I " STBFn 8.96: ... +30.4 SmCaplndn19.77-.19 +34.1 SmllCpSrn17.96 -.14 +45.5 SEAsian 17.18 -.07 +0.4 SOkSoIn 22.83 -.17 -8.7 Sttlncen. 10.72 +.01 +58.7 Trendn 53.33 -.40 -10.3 USBIn 11.16 ... +46.1 Uliyn 13.60 -.11 -30.3 ValSta In 3608 -.35 +63.2 Value n 7223 -.43+104.7 Wrildwn 1824 -08 +9.7 Fidelity Selects: Airn 33.38 -25 +49.6 Autonn 33.92 -.12 +75.3 Bankingn 38,.37 -35 +81.1 Biotchn 54.11 -.09 -46.5 Brokrn 55.47 -.37 +54.9 Chemn 69.47 -.26+106.0 Compn 34.36 -.56 -60.6 Conlndn 24.35 -.09 +9.9 CslHon 45,46 -.12+166.7 DfAern 67.03 -.37+111.5 DvCmnn 17.91 -.26 -64.1 Electrn 38.17 -.66 -56.1 Enrgyn 36.64 -.42 +87.5 EngSvn 47.36 -.64 +71.7 Envirn 13.80 -.07 +36.8 FinSvn 116.29 -.96 +71.0 Foodn 51.08 -.43 +80.4 Goldrn 26.90 +34+103.8 Heallhn 126.49 -.04 +9.0 HomFn 60.11 -.79+147.3 IndMtn 39.52 +.15+101.9 Insurn 62.71 -.45+134.8 Leisrn 76.08 -.54 +6.9 MedDIn 46.50 -24+182.0 MdEqSysn23.75 -.02+101,0 Multtdn 44.04 -26 -0.8 NtGasn 32.78 -.54+123.9 Paper 31.38 +.06 +41.9 Pharmn 8.66 +.03 NS Retal n 50.83 -.42 +25.8 Soltwrn 47.99 -.80 -28.1 Tedhn 57.44 -.87 -63.4 Telcmn 34.4 -.49 -60.6 Trasn 40.9 -.21 +98.4 UfMGrn 40.00 -.35 -30.8 Wirelessn 5.66 -.06 NS Fidelity Spartan: CAMunn 12.65 -.01 +41.7 CTMunrn11.72 -.02 +40,0 Eqldxn 42.56 -.34 -72 300lnrn 82.79 -.66 -7.1 FLMurn 11.77 -.02 +40.9 Govlnn 11.07 -.01 +43.7 InvG odn 10.70 ... +46.9 MDMurn11.09 -.01 +39.0 MAMunn 12.19 -.02 +42.4 MIMunn 12.11 -,01 +41.7 MNMunn11.66 -.01 +38.9 MuniTlncn 13.14 -.02 +45.9 NJMunrn1.81 -.01 +41.4 NYMuAn 13.15 -.02 +45.2 PAMunrnll.07 ... +40.6 StinlMun 10.34 ... +25.0 ToVlfukInn32.79 -.26 -6.3 First Eagle: GbIA 39.40 +.02+121,2 OverseasA 22.39 +.08+121.8 Firet Investors A GovtAp 11.08 ... +35.6 IncoAp 3.24 ... +30.4 InvGrtAp 210.06 -.01 +42.9 NYTFAp 14.69 -.02 +37.9 SpSitAp-19.16 -.10 -26.4 TxExAp 10.29 -.02 +37.7 Firsthand Funds: GbTech 3.94 -.03 NS 'TectlVal 27.28 -.46 -75.8 Frenk/Temp Fmk A: AGEAp 2.17 ... +41.5 A4USp 9.02 ... +20.6 ALTFAp 11.68 -.01 +40.4 AZTFAp 11.27 -.01 +40.5 Ballnvp 58.28 -.23+118.5 CallnsAp 12.83 -.02 +41.6 CAIntAp 11.69 -.01 +33.9 CarrFAp .7.37 -.01 +42.6 CapGrA 10.67 -.10 -29.3 COTFAp 12.13 -.01 +42.2 CTTFAp 11.18 -.01 +41.2 CvtScAp 16.11 -.05 +40.9 DblTFA 12.06 -.01 +40.4 DynTchA 23.28 -.23 -19.0 EqlncAp 20.81 -.13 +46.5 FedIntp 11.60 -.02 +36.3 FedTFAp 12.25 -.01 +39.9 FLTFAp 12.08 -.01 +42.5 GATFAp 12.26 -.02 +41.5 GoldPrM A 18.34 +.26+103,4 GrwthAp 33.09 -.25 +3.4 HYTFAp 10.85 -.01 438.7 IncomAp 2.50 ... +76.0 InsTFAp 12.49 -.01 +41.7 NYlTFp 11.13 -.02 +37.3 LATFAp 11.77 -.01 +42.7 LMGvScA 10.14 +.01 +28.4 MDTFAp 11.87 -.01 +41.8 MATFAp 12.04 -.01 +42.1 MITFAp 12.42 -.01 +40.1 I~ ~ *-OIoREDTEMUULFNDTBE Here are the 1.000 biggest mutual funds listed on Nasdaq Tables show the fund name. sell price or Nel Asset Value (NAV) and dally net change as well as one total retum figure as follows Tusa: 4.-wk total return (%) Wed: 12-mo total relum ('l) Thu: 3-yr cumulatrve total return ('ol FrI: 5-yr curriulatve lotai return (.l Name: Name ol mutual fund and family NAV: Net asset value. Chg: Net change In price of NAV. Total return: Percent change in NAV for the time period shown, with dividends reinvested if period longer than 1 year, return is cumula- tive Data based on NAVs reponed to Lipper bj 6 p.m. Eastern Footnotes: e Ex-capital gains distribution I Previous day's quoie. n No-load fund p Fund asseLs used to pay distribution costs r Redemption fee or conungeni deilered sales load may apply. s Slock dividend or split I Both p and r x Ex-cash divi- dend. NA No information available NE Dala in question. NN - Fund does not wish to be tracked NS Fund did not exist at start date. Source: LIUner. Inc. and The Associated Press MNInsA 12.30 -.01 +40.0 MOTFAp 12.40 -.01 +43.6 NJTFAp 12.26 -.01 +42.2 NYInsAp 11.76 -.01 +38.8 NYTFAp 12.00 ... +39.6 NCTFAp 12.44 ... +43.5 OhiolAp 12.72 -.02 +40.2 ORTFAp 11.98 -.01 +41.1 PATFAp 10.55 ..: +41.3 ReEScAp 26.09 -.04+160.9 RisDvAp 31.90 -.26 +86.6 SMCpGrA 33.78 -.18 -33.6 USGovAp 6.65 ... +38.6 UtilsAp 11.45 -.05 +72.7 VATFAp 11.98 -.01 +41.4 Frank/lTenp Frnk B: IncoimB p 2.50 ... +71.6 IncoomeB 2.49 .., NS FranklTemp Frnk C: IncomnCt 2.51 ... +71.2 Frank/Temp MII A&B: QualidAt 19.37 -.01 +70.9 SharesA 23.03 -.03 +64.1, Frank/Temp Temp A: , DvMktAp 19.23 ... +34.2 ForgnAp 12.42 +.05 +35.6 GIBdAp 10.94 +.03 +77,3 GlwthAp 23.07 +,08 +57.0 IntxEMp 15.00 +.08 +34.7 WorldAp 18.01 +.07 +26.6 Frank/Temp Tmp B&C: DevMktC 18.90 ... +30.0 ForgnCp 12.27 +.04 +30.6 GE Elfun S&S: I S&Slnc 11.55 ... +45.2 S&S PM 44.84 -.32 +3,2 GMO Trust III: EmMkr 18.12 +.03 +77.4 For 15.03 +.02 +44.5 GMO Trust IV: EmrMkt 18.09 +.03 +76.9 Gabelll Funds: Asset 41.37 -.25 +32.2 Gartmore Fds D: Bond 9.77 -.01 +45.3 GvtBdO 10,35 ..., +43.4 GrowthO 6.63 -.05 -44.3 NaoewOD 20.32 -.18 +5.3 TxFrr 10.69 -.01 +40.2 Goldman Sachs A: GdncA 25.26 -.19 +16.8 SmCapA 41.67 -.40+1422 Guardian Funds: GBG InGrA 13.30 +.06 -28.5 PaikAA 31.00 -.24 -40.1 Harbor Funds: Bond 11.87 ... +49.8 CapAplnst27.75 -.26 -36.8, Inlr 43.37 +.09 +34.8 Hartford Fds A: AdvrsAp 15.12 -.07 +3.9 CpAppAp34.09 -.26 +15.8 DivGtihA3 18.88 -.14 +35.6 SmICoAp 16.14 -.11 -22.7 Hartford HLS IA: Bond .12.03 -.01 +51,7 CapApp 53.29 -.42 +31.7 Div&Gr 20.80 -.15 +39.1 Advisers 23.11 -.11 +4.2 Stock 45.74 -.29 -13.7 Hartford HLS IB : CapAppp 53.03 -.41 +30.3 HollBalFd n15.53 -.08 40.8 ISI Funds: NoAmnp 7.44 ... +41.5 JPMorgan A Class: CapGro 38.40 -.23 +242 GroInc 32.76 -27 +6.4 Janus: 6oaro. i2 11 i t 4 S I i, -16 r ,'"M ittr -i6 --3 FedTEn- 7.08 -.01 +312- Fxmncn 9.71 ... +37.1 Fundn 24.05 -.17 -40.7 GIUifeS rn17.47-.08 -31.8 GIrechrn1028 -.13 -71.5 Grinc 32.05 -.32 -20.5 Mercury 20.96 -.17 -49.1 MdCpVal 21,92 -.13+121.5 Olympusn27.90 -.28 -53.2 Orion n 7.00 -.01 NS Ovrseasr 24.57 -.01 -31.7 ShTmBd 2.90 ... +25.4 Twenty 41.75 -.42 -46.9 Venturn 57.30.-.72 -45.8 WrldWr 41.13 -.07 -43.0 JennisonDryden A: HiYldAp 5.92 -.01 +27.7, InsuredA 11.07 -.02 +37.7 UiltyA 12.19 -.09 +43.6 JennisonDryden B: GowthB 12.73 -.12 -41.3 HiYIdBt 5.92 ... +24.8 InsuredB 11.09 -.02 +36.1 Jensen 24.23 -.15+30.0 John Hancock A: BondAp 15.37 -.01 +43.8 StdnAp 7.10 +,02 +43.2 John Hancock B: StdncB ,7. +02 +38.4 Julius Baer Funds: InlEqA 32.18'+.11, +7.7 InlEqlr 32.74 +.12 +10.1 Legg Mason: Fd OpporTrt 14.51 -.07 +53.5 Splnvp 44.42 -26 +42.8 . VaTrp 62.61 -.41 +17.7 Legg Mason InstI: VaLTlns 68.34 -.45 +23.7 Longleaf Partners: Partners 31.28 -.12 +91.6 Intl 15.72 -.04 +84.8 SrmCap 29.41 -.17 +97.9 Loomis Sayles: LSBondl 13.89 +.03 +72.0 Lord Abbett A: AifAp 14.56 -.08 +32.3 BdDebAp 8.14 -.01 +34.4 GIIncAp 7.51 +.01 +45.5 MidCpAp 21.88 -.12+135.7 MFS Funds A: MITAp 17.24 -.14 -6,6 MIGAp 12.05 -.09 -3608 GrOpAp 8.64 -.06 -36.7 HilnAp, 4.02 .. +27.5 MFLAp 10.24 -.01 +41.5 ToIRAp 15.94 -.08 +51.7 ValueAp 23.32 -.14 +60.0 MFS Funds B: MIGB 11.07 -.08 -38.8 GvScBt 9.71 ... +33.8 HilnBt 4.03 ... +23.2 MuInBt 8.72 -.01 +34.0 TotRBt 15.94 -.07 +46.9 MainStay Funds B: BIChGBp 9.33 -.08 -41.1 CapApBt 26.43 -.18 -42.8 ConvBt 12.84 -.08 +10.2 GovtB t 8.37 ... +31.8 HYIdBBt 6.51 ... +40.3 IntEqB 12.86 +.07 +1.0 ResValBt ... ... NA SmCGBp 14.57 -.08 -43.8 TotRpBt 18.55 -.11 -15.1 Mairs & Power: Growth 68.87 -.26 +93.5 Managers Funds: SpdEqn 89.24 -.89 -1.4 Marsico Funds: Focusp 16,16 -.09 -19.5 Merrill Lynch A: GIAIAp 16.56 -.01 +61.8 HeallhAp 6.22 -.04 +17.6 NJMunBd 10.71 -.02 +41.4 Merrill Lynch B: BalCapBt 25.97 -.13 +14.5 BaVIBt 31.13 -21 +28.4 BdHilInc 5.33 -.01 +25.0 CalnsMB 11.80 -.02 +38.5 CrOPtBt 11.83 -.01 +36.2 CplTBt 12.01 -.01 +37.0 EquilyDiv 14.78 -.04 +48.4 EuroBt 15.02 +.10 +31.2 FcValt 12.54 -.09 +23.7 FndlGBt 15.66 -.13 -36.1 FLMBt 10.43 -.02 +39.4 GIAIBt 16.24 -.02 +55.7 HealthBt 4.71 -.03 +13,1 LatABt 2507 +.24 +60.1 MnlnBt 7.97 -.01 +382 ShTUSGt 9.24 ... +19.1 MuShtT 10.01 ... +14.9 MulntBt 10.69 -.02 +34.6 MNUBI 10.61 -.01 +41.3 NJMBt 10.71 -.02 +38.6 NYMBt 11.15 -.02 +37.7 NatRsTBt 35.58 -.30+135,8 PacBt 18.89 -.09 -16.6 PAMBt 11.44 -.02 +38.7 ValueOpp 124.09 -.22 +69.1 USGvMtgt1029 .. +34.4 USlTIcmt 11.02 -.04 -1.8 WIdlnBt 6.60 +.02 +87.2 Merrill Lynch I: BalCapl 26.75 -.14 +20.5 BaVIl 31.84 -.21 +35.1 BdHIInc 5.33 ... +29.9 CalnsMB 11.79 -.02 +41.9 CrBPt 11.83 -.01 +41.5 CplTI 12.01 -.01 +40.5 DvCapp 17.81 -.07 +13,4 EquityDv 14.74 -.04 +56.1 Eurolt 17.45 +.11 +38.1 FocVall 13.72 -.11 +30.0 FLMI 10.43 -.02 +43.0 GIAIIt 16.61 -.01 +63.9 Health 6.74 -.04 +19.2 LatAl 26.24 +.26 468.8 MnInI 7.97 -.02 +43.5 MnShtT. 10.01 ... +17.0 MulTI 10.69 -.02 +36.8 MNatll 10.61 -.02 +46.8 NatRsTrt 37.48 -.31+148.4 Pad 20.54 -.09 -12.2 ValueOpp 20.73 -.24 +78.0 USGvtMtg 10.29 -.01 +39.6 UtScmllt 11.05 -.05 +2.1 Widlncl 6.60 +,02 +63.1 Midas Funds; Midas Fd 2.11 +.04 +77.3 Monetta Funds: Monettan 10,34 -.08 -38.7 Morgan Stanley B: AmOppB 22,.58 -.15 -40.7 DMvGiB 37.14 -.30 +16.9 GtbDIB 13,87 -01 +26,6 GrwYhB 11.73 -.09 -31.6 StratB 17,70 -.12 -1.8 USGvtB 9.20 -.01 +38.8 MorganStanley Inst: GIValEqAn17.77 -.01 +31.4 InEqn 21.19 +.03 +59.6 Under Funds: NetNetAp 16.59 -.23 -81.4 Mutual Series: BeacnZ 16.03 -.03 +68.7 DiscZ 24.56 +.03 +62.4 QuafdZ 19.46 -.01 +73.9 SharesZ 23.16 -.02 +67.1 Nations Funds Inv B: FocEqBt 17.10 -.09.-20.1 MarsGrBt 16.48 -.07 -18.2 Nations Funds Pri A: IntVIPrAn 22.96 +.09 +53.1 Neuberger&Berm Inv: Focus 36.93 -.41 +21.2 Intir 19.12 +.10 -2.9 Neuberger&Berrn'Tr: Genesis 43.14 -.37+126.7 Nicholas Applegate: EmgGrolnlO.04 -.09 -60.6 Nicholas Group: Nichn 61.02 -.26 +3.3 Nchin n 2.24 ... +17.7 Northern Funds: SmCpldxn 9.95 -.13 +15.7 Techrilyn 10.85 -.16 -73.5 Nuveen CI R: InMunR 11.08 -.02 +39.1 Oak Assoc Fds: WhiteOkG n3.84 -.27 -51.7 Oakmark Funds I: Eqtylncrn 23.48 -.14 +88.2 Globalln 22.14 -.02+157.2 Intrn 21.58 +.08 +68.1 Oaklmarkrn41.13-.25 +88.0 Selectrn 33.18 -.11+103.3 One Group I: Bondn 10.88 ... +46.8 Oppenheimer A:. AMTFMu 10.06 -.02 +44.1 AMTFrNY 12.80 ... +42.2 CAMuniAp11.22 -.01 +51.1 CapApAp 40.58 -.30 -16.8 CaplncApl12.50 -.04 +49.9 ChincAp 9.74 ... +29.2 DvMktAp 28.16 +.13 +75.2 Discp 42.18 -.31 -32.9 EqultyA 10.77 -.09 -3.7 GlobAp 59.40 -.17 +5.0 .,IU.r 30.36 -0 -102 LriiT."i u -.r, -.3 ,,4 .i> MnStFdA 3516 -30 -4.44 MidCapA 16.28 -08 -48.4 PAMuniAp 12.57 -.02 +54.2 StilnAp 4.33 ... +47.9 USGvp 9.76 -.01 +39.8 Oppenheimer B: AMTFMu 10.03 -.02 +38.7 AMTFrNY 12.80 ... +36.8 CplncBt 12.37 -.04 +44.0 ChlncBt 9.73 ... +24.6 EquityB 10.43 -.09 -7.7 HiYIdBt 9.65 +.01 +23.0 StOncBt 4.35 ... +42.4 Oppenhelm Quest: -QBalA 17.2 -.07 +34.0 QBalB 17.68 -.08 +29.4 Oppenhelmer Roch: RoMuAp 18.00 -.02 +46.7 PBHG Funds: SelGrwthn20.70 -.27 -71.9 PIMCO Admin PIMS: TotRtAd 10.67 ... +48.9 PIMCO Instl PIMS: AIlAsset 12.80 -.02 NS ComodRR15.14 +.01 NS HiYId 10.01 ... 42.5 LowDu 10.16 +.01 +31.7 RealRtil 11.49 -.01 +69.7 ShortT 10.02 ... +21.3 TotRt 10.67 ... +50.8 "PIMCO Funds A: RenalsA 25.30 -.25+131.6 RealRtAp11.49 -.01 +6.0 TotRtA 10.67 ... +47.3 PIMCO Funds C: GwthCt 17.27 -.16 -46.5 TargtCt 15.68 -.12 -36.4 TotRtCt 10.67 ... +41.9 Phoenix Funds: BalanA 14.87 -.05 +17.8 StrAllAp 15.69 -.05 +17.7 Phoenix-Aberdeen: InlIA 10.28 +.05 -15.7 WIdOpp 8.51 ... -5.6 Phoenlx-Engemann: CapGrA 14.59 -.14 -49.8 Pioneer Funds A: BalanAp 9.76 -.04 +13.6 BondAp 9.42 ... +48.4 EqlncAp 29.14 -.18 +38.9 EuropAp 30.94 +.15 -24.9 GlWthAp 11.98 -.08 -33.2 HIYIdAp 11.61 +.01 +65.3 IntlValA 17.55 -.02 -302 MdCpGrA 14.84 -.11 -22.2 MdCVAp 24.80 -.14 +91.8 PionFdAp41.74 -26 +2.8 TxFreAp 11,75 -,01 +39.5 ValueAp 17.77 -.15 +31.5 Pioneer Funds B: HiYIdBt 11.65 ... NS MdCpVB 22.26 .-.13 +84.0 Pioneer Funds C: HIYIdCt 11.76 ,... NS Price Funds: Balance 19.78 -.06 +24.4 BIChipn 30.15 -.26 -10.9 CABondn 11.16 -.02 +39.6 CapAppn 19.53 -.10+105.7 DivGron 22.75 -.15 +292 Eqlncn 26.60 -.16 +60.9 Eqlndexn 32.33 -.26 -7,8 Europe n 20.23 +.14 -3.7 FLInlmn 11,02 -.02 +32.1 GNMAn 9.66 ..: +40.3 Grwtlhn 26.16 -.19 -0.9 Gr&lnn 22.24 -.18 +22.8 HlhScin 22.36 -.05 +18.7 HirYldn 7.20 ... +43.5 ForEqn "15.52 +.03 -18.3 IntlBondn 10.28 +.05 +53.3 IntDisn 33.70 +.07 -7.3 IntlStkn 13.00 +.03 -20.1 Japann 8.35 -.05 -38,5 LatAmn 17.19 +11+55.6 MDShin 5,17 -.01 +18.5 MDBondn10.83 -.02 +39.9 MidCapn 48.92 -.39 +32.8 MCapValn22.59 -.11+127.7 NAmern 32.37 -.30 -11.6 NAsian 10.27 -.07 -32 NewEra n35.90 -.15+111.8 NHoiizn 29.06 -.24 +5.7 NIncn 9.14 -.01 +44.0 NYBondn 11.47 -.02 +41.2 PSIncn 14.84 -.04 +37.8 RealEstn 17.34 -.01+1722 ScTecn 18.31 -.28 -69.2 ShtBdn 4.74 ... +30.3 SmCpStkn31.02 -.35 4+56,0 SmCapValn35.22-.35+135.5 SpecGrn 16.77 -.08 +13.1 Specinn 12.06 -.01 +51.3 TFIncn 10.12 -.02 +41.5 TxFrHn 11.91 -.01 +40.5 TFInrn 11,32 -.02 +33.6 TxFrSIn 5.41 -.01 +24.8 USTlntn 5.45 ... +40,5 USTLgn 12.08 -.04 +52.7 VABondn 11,82 -.02+42.0 Valuen 22,81 -.14 +59.2 Putnam Funds A: AmGvAp 9.07 -,01 +34.8 AZTE 9.38 -.01 +37.9 ClscEqAp12.73 -.11 +18.1 Convp 17.31 -.08 +11.7 DiscGr 16.96 -,10 -57.4 DvrlnAp 10,34 ... +44.6 EuEq 21.18 +.15 -10.9 FLTxA 9,34 -.01 +38.3 GeoApx 18.05 -.18 +35.3 GIGvApx 13.04 ... +50.2 GbEqtyp 8.46 -.02 -19.7 GflnAp 19.41 -.16 +25.7 HIIhAp 58.40 -.17 -4.5 HiYdAp 8.24 ... +32.3 HYAdAp 6.20 ... +31.9 IncmAp 6.86 -.01 +38.1 InllEqp 23.80 +.08 -12.3 InlGrlnp 11.97 +.07 +17.4 InvAp 12.55 -.11 -30.4 MITxp 9.11 ... +36.6 MNTxp 9.12 -.01 +37.4 MunlAp 8.81 -.01 +34.8 NJTxAp 9.31 -.01 +36.5 NwOpAp 40.96 -.33 -53.1 OTCAp 7.27 -.03 -79.2 PATE 9.22 -.01 +39.8 TxExAp 8.93 -.01 +38.1 TFInAp 15.19 -.03 +39.8 TFHYA 12.92 -.01 +30.4 USGvAp 13.27 +.01 +35.6 UtilAp 10,38 -03 +6.1 VstaAp 9,44 -.09 -38.7 VoyAp 16,16 -.16 -42.4 Putnam Funds B: CapAprt 17.48 -.15 -18.0 ClscEqBt 12.61 -.12 +13.7 DiscGr 15.73 -.09 -59.0 DvrlnBt 10.27 ... -392 Eqlnct 17.40 -.15 +45.0 EuEq 20.47 +.14 -142 FLTxBt 9.34 -.01 +33.9 GeoBtx 17,89 -.15 +30,3 GllncBtx 13.00 ,. +44.8 GbEqt 7,74 -.01 -22.4 GINtRst 24,61 -.15 +77.2 GrnBt 19.11 -.16 +21.0 HithBt 53.38 -.16 -8.0 HIYIdBt 8.20 ... +27.5 HYAdBt 6.13 .. +26.6 IncmBt 6.82 -.01 +33.1 lntGInt 11.77 +.07 +132 IntNopt 11.18 +.04 -47.6 InvBt 11.54 -.11 -33.0 MuniBt 8.80 -.01 +30.9 NJTxBt 9.30 -.01 +32.1 NwOpBt 36.97 -.30 -54.7 NwValp 17.63 -.14 +69.5 NYTxBt 8.86 -.01 +34.6 OTCBt 6.46 -.02 -80.0 TxExBt 8.93 -.01 +33.7 TFHYBt 12.94 -.01 +26.8 TFlnBt 15.22 -.02 +36.1 USGvBt 13.20 ... +30.6 UIBt 10.32 -.03 +2.3 VistaBt 8.28 -.08 -41.0 VoyBt 14.13 -.14 -44.5 Putnam Funds M: Dvrincp 10.26 ... +42.8 Royce Funds: LwPrStkr 14.99 -.11+103.0 MitoCapl 15.60 -.04+104.4 .Premierlr 15.02 -.15+109.7 TotRetir 12.24 -.09+110.4 Rydex Advisor: OTCn 9.87 -.15 -67,1 SEI Portfolios: CoreFxAnlO.59 -.01 +45,1 IntlEqAn 11.10 +.04 -16.3 LgCGroAn17.96 -.16 -44.9 LgCValAn21.67 -.16 +42.4 STI Classic: CpAppLp 11.32 -.08 -8.4 CpAppAp11.96 -.09 -6.3 TxSnGrTp24.46 -.19 -25.8 TxSnGd.Lt22.96 -.17 -29.6 VllnSIkA 12.67 -.10 +48.1 Salomon Brothers: BalaBp 12,84 -.05 +27.2 Or(qt 4747 -.22 +41,5 Schmao Funds. iswC r.:3 -.26- -6.1 'I Au,', I. 0 -.15. -8.0 ,&PSeln 18.56 -.15 -7.2 YdPIsSI 9.69 ... +21.4 Scudder Funds A: DrHiRA 4.10 -.45 +99.8 FlgComAp16.76 -.15 -68.1 USGovA 8.65 ... +37.6 Scudder Funds S: BalanS 17.50 -.09 +0.9 EmMkIn 10.98 +.02+106.2 EmMkGrr 18.30 -.01 +19.3 GbBdSr 10.38 ... +44.8 GGbDis 35.53 -.05 -4.9 GlobalS' 27.09 -.04 +5.3 Gold&Prc 16.97 +.22+209.4 GrEuGr 27.95 +.14 -21.6 GrolncS 21.74 -.22 -6.0 HiYidTx 12.87 -.02 +42.0 IncomeS 13.07 ... +39.8 IntTxAMT 11.47 -.02 +32.9 Intl FdS 44.50 +.06 -24.6 LgCoGro 23.34 -.19 -43.4 LatAmr 34.43 +.31 +52.0 MgdMuniS9.26 -.01 +40.1 MATFS 14.71 -.02 +40.6 PacOppsr 13.45 -.09 -18.0 ShtfmBdS 10.17 ... +24.9 SmCoVeSr 26.41 -.30+114.8 Selected Funds: AmShSp 37.38 -.24 +20.5 Sellgman Group: FfontrAt 13.02 -.13 -22.5 FronirOt 11.52 -.12 -25.5 GbSmA 15.51 -.04 -18.5 GbTchA 12.05 -.10 -55.8 HYdBAp 3.51 ... -6.6 Sentinel Group: ConS A p 29.56 -.20 +24.8 Sequoia n155.94 -.45+77.4 Sit Funds: LrgCpGr 33.70 -.28 -39.2 Smith Barney A: AgGrAp 93.72 -.86 +1.0 ApprAp 14.78 -.08 +16.7 FdValAp 14.81 -.10 +13.0 HilnrAt 7.10 ... +18.1 InAICGAp 13.74 +.04 -43.2 LgCpGAp21.12 -.19 -16.0 Smith Barney B&P: FVaBI 13.97 -.09 +8.5 LgCpGBt 19.98 -.18 -19.1 SBCplnct 16.25 -.05 +32.2 Smith Barney 1: DvStrl 17.47 -.08 -23.8 GSnc1 15.12 -.10 -84 St FarmAssoc: Gwth 48.90 -.32 +0.9 Strategic Partners: EquityA 15.11 -.11 +13.2 Stratton Funds: Dividend 35.41 -.12+148.6 Growth 41.83 -.34+118.0 SmCap 39.98 -.26+143.8 Strong Funds: CmStk 22.48 -.08 +19.1 Discov 20.84 -.18 +39.2 Giwthlnv 18.73 -.22 -46.7 LgCapGr 21.98 -.20 -47.2 Opptylnv 45.37 -.32 +21.5 UltSlnv 9.20 ... +16.9 SunAmerica Funds: USGvBt 9.54 -.01 +38.8 SunAmerica Focus: FLgCpAp 16.95 -.11 -29.6 TCW Galileo Fds: SelEqty 18.03 -.15 -21.0 TD Waterhouse Fds: Down 10.81 -.09 +11.3 TIAA-CREF Funds: BdPlus 10.37 ... +46.3 Eqlndex 8.52 -.06 NS Grolnc 12.10 -.09 -12.6 GroEq 8.92 -.07 -43.9 HiYIdBd 9.53 +.01 NS IntlEq 10.78 +.09 -22.8 ModAlc 11.10 -.03 +2.3 ShtTrBd 10.52 +01 NS SocChEq 9.06 -.08 NS TxExBd 10.98 -.02 NS Tamarack Funds: E.SorCp 33.33 -25 +93.9 Value 45.88 -.30 +51.6 Templeton Instlt: FOrEqS 20.69 +.10 +27.6 Third Avenue Fds: RIEslVIr 27.47 -.02+185.4 Value 53.27 -.18 +72.8 Thrivent Fds A: HiYtd 5.28 ... +6.1 Incom 8.85 -.01 +40.5 LgCpSlk 25.52 -.19 -7.7 TAIDEXA: FaT"EAp 11.90 -.02 +38.4 JanGrowp22.90 -.18 -49.4 GCGIobp 24.41 -.06 -45.3 TiCHYBp 9.39 ... +39.4 TAFlinp 9.69 ... +38.1 Turner Funds: SmCpGrn23.19 -.25 -34.5 Tweedy Browne: GlorVal 24.86 +.03 +43.5 US Global Investors: Adlmn 23.77 -.18 -29.9 GbRs 12.10 +.11+252.0 GIdShr 8.01 +.12+124.0 USCina 6.64 -.03 +5.7 WIdPrcMn 16.30 +.29+144.8 USAA Group: AgvGt 28.31 -.13 -57.9 CABd 11.32 -.02 +42.5 vt', .*o..A... iv,. ..~ .5, 5,. Am. *.a, C'a Ft v Ar. ALA r,0 .0t .A,-L.s :.~j ~ CmslStr 26.64 -.06 +26.5 GNMA 9.80 -.01 +39.3 GrTxStr 14.59 -.04 +5.4 Grwth 13.52 -.10 -41.7 Gr&lnc 18.35 -.12 +14.7 IncS*k 16.69 -.13 +29.9 Inco 12.48 ... +45.4 Intl 21.85 +.07 +7.8 NYBd 12.14 -.03 +46,2 PrecMM 15.26 +,27+187.1 SdTech 9.06 -.09 -58.2 ShtTBnd 8,93 ... +18.5 SmCpSik 13.47 -.08 -13.6 TxEIt 13.40 -.02 +38.2 TxELT 14.28 -.02 +47.0 TxESh 10.74 ... +22.4 VABd 11.82 -.02 +43.0 WidGr 17.84 -.01 -7,5 Value Line Fd: LevGtn 25.54 -.34 -26.1 Van Kamp Funds A: CATFAp 19.06 -.04 +42.2 CmstAp 18.33 -.09 +71.2 CpBdAp 6.80 -.01 +42.1 EGAp 37.95 -.36 -56.1 EqlncAp 8.64 -.04 +47.3 Exch 352.34-3.19 -4.1 GrinAp 20.23 -.12 +41.7 HarbAp 14.64 -05 -14.1 HiYldA 3.75 ... +11.3 HYMuAp 10.81 -.01 +37.7 InTFAp 19.09 -.03 +41.7 MunlA p 14.92 -.03 +36.4 PATFAp 17.59 -.03 +36.3 StrMunnc 13.24 -.01 +32.3 US MtgeA 13.93 -.01 +37.5 UlilAp 17.35 -.10 +1.8 Van Kamp Funds B: CmstBt 18.32 -.09 +65.0 EGBt 32.56 -.31 -57.7 EnteipBt 11.06 -.07 -43,2 EqlncBt 8.50 -.04 +41.3 HYMuBt 10.82 -.01 +32.7 MulB 14.90 -.03 +31.3 PATFB 17.54 -.03 +31.1 StMunInc 13.23 -.01 +27.3 US MIge 13.88 ... +32.2 UiB 17.32 -.10 -2.0 Vanguard Admiral: 500Admln110.88 -.88 NS GNMAAdn.47 ... NS HIthCrn 53.11 -.04 NS ITAdinmn 13.59 -.03 NS LtdTrAdn 10.86 -.01 NS PrmCaprn63.,54 -.38 NS STsyAdmln10.43 ... NS STIGrAdn 10.62 ... NS TIIBAdmIn1O.28 -.01 NS TStkAdmin28.52 -.22 NS WellnAdmin52.39-.24 NS Windsorn 60.28 -.36 NS WdsillAdn54.95 -30 NS Vanguard Fds: AssefAn 24.49 -.20 +18.2 CALTn 11.90 -.02 +432 CapOppn 29.92 -.28 +20.5 Convitn 12.99 -.06 +13.3 DivdGron 12.13 -.06 +2.6 Energyn 44.08 -.32+170.5 Eqlncn 23.57 -.14 +46.2 ExpIrn 73.53 -.64 +16.1 FLLTn 11.94 -.02 +45.7 GNMAn 10.47 ... +42.8 Grolncn 30.72 -.30 -1.1 GrIhEqn 9.39 -.07 -49.4 HYCorpn 6.44 ... +33.9 HlthCren125.87 -.09 +68.7 InflaPron'12.62 -.02 NS IntlExplrn 16.96 +.08 +11.2 IntlGrn 18.93 +.06 -5.4 IntlValn 31.56 +.12 +31.2 ITIGraden 10.06 -.01 +49.9 ITTsryn 11.24 -.01 +49.3 ULifeConn 15.26 -.06 +23.4 UfeGron 19.99 -.11 +6,3 Ufelncn 13.56 -,04 +32.6 UfeModn 17.90 -,08 +16.1 LTIGraden 9.77 -.04 +65.0 LTTslyn 11.76 -.05 +59.8 Morgn 15.99 -.13 -16.0 MuHYn 10.91 -.01 +42.2 MulnsLgn12.90 -.03 +44.6 Mulntn 13.59 -.03 434.4 MuUdn 10.86 -.01 +24.1 MuLongn 11.54 -.02 +44.4 MuShitdn 15,60 ... +16.5 NJLTn 12`15 -.03 +42.5 NYLTn 11.59 -.03 +44.9 OHLTTEn12.31 -.03 +44.3 PALTn 11.64 -.02 +43.5 PrcMir ln17.52 +.21+181.3 Pnmcprn 61.24 -.37 +0.9 SelValurn18.36 -.09+128.9 STARn 18.78 -.06 +41.4 STIGraden10.62 ... +30.6 STFedn 10.38 +.01 +32.0 StratEqn 21.24 -.17 +73.9 USGron 15.79 -.15 -52.6 USValuen 13.77 -.11 NS Welslyn 21.82 -.06 +60.4 Wellin 30.33 -.13 +53.4 Wndsrn 17.86 -.11 +61.9 Wndslln 30.95 -.17 +59.1 Vanguard dx Fds: 500n 110.86 -.88 -7.0 Balancedn19.40 -.10 +13.7 EMIdn 15.31 +.05 +33.5 Europe n 26.47 +19 +4.2 Extend n 30.84 -23 -3.8 Growthn 25.91 -21 -28.7 ITBndn 10.67 -.01 +53.4 MidCapn 15.64 -.11 +59.5 Pacilicn 9.26 -.01 -14.4 REITrn 18.23 -.01+154.0 SmCap n 26.32 -.27 +24.3 SmCpVIni 13.74 -.14+103.0 STBndn 10.09 ... +32.0 TotBndn 10,28 -.01 +42.4 Totllntn 12.76 +.06 +0.9 TotStkn 28.51 -.23 -5.9 Value 21.46 -.16 +21.8 Vanguard Instl Fds: Inslldxn 109.95 -.88 -6.4 InsPIn 109.96 -.87 -62 TBIstn 10.28 -.01 +43.3 TSlnstn 28.52 -23 -5.3 Vantagepoint Fds: Growth 8.11 -.06 -19.7 Waddell & Reed Adv: CorelnvA 5.70 -.04 -6.8 Wasatch: SmnCpGr 38.59 -.28 +642 Weltz Funds: PartVal 23.22 -.14 +50.5 Vaue 36.56 -.22 +56.8 Wells Fargo Instl: Index I 48.21 -.38 -7.1 Western Asset: CorePlukis 10.69 ... +58.6 Core 11.48 ... +53.0 William Blair N: GrewthN 10.39 -.09 -21.7 Yacktman Funds: Fundp 15,09 -.06+138.9 S "Cpyri Material - 4-i-- Syndicated Content m1 Sil ~ m - m~ ma ~0 0- - *0~ - 0~ - ________ m a - -~r ~.. ~ ~u ~- 2006 BRIDAL & PROM. -~ 1:;- ) /1 ~u .4 i nA~ h -Li a- W .v:~ to e-~ I s 'r I\\ m\l\\ CiJ NL iCH~pN~. Sigaalare Plantation Inn Golf Resort Romano's Restaurant & Catering Chocolate Fountains By Annamaria Jamz-r-us Mobile Disc Jockeys Waverley Florist Crystal River Waverley Florist Homosassa Springs Citrus Cleaners & Formal Wear Executive Formal Wear Patricia's Boutique Suregrip Enterprises A Bella Spa & Wellness Center American Mortgage Lenders Ocala Carriages Kenneth Charles Jewelers Curves Homosassa Springs Curves Crystal River Curves Beverly Hills, Curves-- Inverness Curves Dunnellon All For You Limousine Mary Kay Cosmetics KaCy's Portrait Studio & Video Dove Photography Citrus 95.3 / Country Fox96.3 Plantation Realty Taylor Rental Center Crystal River Taylor Rental Center Inverness Caribbean Tan Decent Exposures Airbrush Tanning Cruiseone Kash-n-Karry Homosasso Springs Lifeplan Weight LOSS Clinic 2005 BRIDAL & PROM ExPO PLANTATION INN HWY. 19 CRYSTAL RIVER FEBRUARY 20 11 AM 5 PM For More Information Call 563-5267 Female_ m m ~ q -g 400 40 f- 'o 4 di 40 4b 0440 omqo lm- 11m- w 1b4f aow-mb 0m- .4w.--w 41 fomsm t Wm- -qb 40 ow 0 -49 41 -mm me ..410 - 0 __ -=No ____ 0 o Aluminum, Inc. COMPLETE ALUMINUM SERVICE DECORATOR SCREEN ENTRIES Choose from Efegance, Durabifity & Qua1ity different models! F :r om- o u r D e s ig n e r Co I le c ti on 29 Years As Your St Visit us online at Hometown Dealer! BS wy. 44 Crystal River 795-9722 Licensed & Insured* Lic. #RR0042388 1-888-474-2269 UV^^^^ ^^ IVyWVVW ^^ ^ 0-M w qW- 0-a q~s 4000- 4000---& Choose from 12, 20, Free 48 or 100 Drawing for Schwinnur SMountain Bike!!! mile routes! Ride begins at the Ridge Manor Trail Head of the Withlacoochee State Trail and winds through Pasco, Hernando and Citrus Counties. The Trail Head is one mile. east of 1-75 at State Road 50 (exit 301) -"- i .- - -' - -' --- - To register, please mail to Clean Air Bike Ride, 110 Carillion Parkway, St. Petersburg, FL 33716. Or, you may fax your registration to (727) 345-0287. NAME: ADDRESS: Home Phone:______ Work Phone: Please circle one: MC VISA AMEX DISCOVER CHECK MONEY ORDER Cardholder Name: Credit Card# Exp. Date:-__________ T-Shirt Size (circle one): small medium large x-large Age (circle one): under 18 18-30 31-45 46-55 over 55 Male Plan to ride (circle one): 12 20 48 92 miles Emergency contact: I certify that my level of physical conditioning is appropriate to compete in the Clean Air Bike Ride and that there equipequipment,. Date IParental Parent signature or Minor HERNANDO TODAY . . ... . WCTh You C- rln' e bt tr. Efa .a",) 771-5863 alagf@alagf.org m -o 0 Name & Phone Number: CFMUS COUNTY (FL) CHRONICLE -- -0 Signature > "Child abuse casts a shadow the length of a lifetime." Herbert Ward EDITORIAL BOARD Gerry Mulligan .......................... publisher Charlie Brennan ............................ editor 'Neale Brennan .....promotions/community affairs Kathle Stewart ....... advertising services director Steve Arthur ................ Chronicle columnist Mike Arnold ...................... managing editor S Jim Hunter ........................... senior reporter. Founded in 1891 by Albert M. Curt Ebitz .......................... citizen member Williamson Mike Moberley .................... guest member 'TYou may differ with my choice, but not my right to choose." David S. Arthurs publisher emeritus TORTURE CASE I Abused teens need much support to heal children 'are our future. "home." They are our greatest The Department of Children jC. assets and they are totally and Families cannot possibly dependent on the adults that have a plan yet. These children surround them to provide them need extensive, lifelong therapy. W'ith nurture, discipline, self- They need love and safety. They esteem and love. need nourishment, both physi- And yet, they are sometimes cally and emotionally and yet treated as yesterday's garbage. the very nature of the lives they i No child deserves to be treat- have lived would cause them to 'd the way John and Linda pull away from the very things Dollar have allegedly treated they need most. DCF can only their children. Even the two provide them the services avail- children who were able in an over- not tortured and THE ISSUE: worked, underfund- starved, nor the ed system. The older daughter who The Dollar kids. shortage of foser has moved out of families in this area the home, did not OUR OPINION: make providing the deserve the envi- Protect the needed environ- i'onment in which children at all ment a challenge they were allegedly, costs, that must be met. raised nor the It will be a long impact that behav- time before these ior will have on them for the rest children can begin to accept any- 6ftheirliyes. thing other than what they had, ",Thet'rgedy of the alleged as normal. Trupt is hard to earn abuse i.s compounded by the sep- when former trust has been mis- aration of these children from placed. Everyone involved must the only family they know. They move slowly, and methodically. have no friends because they The decision by Circuit Judge were held in captivity. They have Ric Howard to deny the children no extended family that they unsupervised contact with their have ever met. The older sister elder sister was appropriate. is a victim of abuse herself and Authorities just don't know exhibits fundamental problems enough yet to ensure the chil- as a result. They are virtually dren's safety in that setting. alone. Supervised visits were offered These children find them- but rejected by the sister. selves in the midst of a huge tor- Protection of these children nado. They have had their lives must be the top priority when completely turned inside out making those decisions. and while many people may Everyone must be careful. The think they should be relieved to opportunity exists to help these be away from the abuse,. the children ease out of the storm abuse was all they knew. and move toward healing. But i While the culture these chil- the road will not be. quick and it dren were allegedly raised in is will not be simple. DCF and abominable to most, it .was Judge Howard are right to move "home" and all kids want to be with caution. Phone charges 0 I'm a resident of Citrus County, the city of 1 Hernando. I have been a resident for six years. To this day I have had no problems. I now regret liv- ing in Citrus County. Something needs to be CALL done about the Sprint phone service in the north- 563- ern part of Citrus County. that is considered Marion County phone service. This is get- ting outrageous when they're charg- ing you triple for phone calls that should be considered local. Raise traffic fines I think the minimum fine for any traffic violation should be $500, with at least half of that going to the police officer making the arrest. Maybe this will slow down the jerks that are driving around in this neighborhood. Pick up trash Quit blaming the commissioners? Why not blame the commissioners? Do you think the people that threw that trash out are going to be responsible enough to go back and pick it up? Do you think the trucks that it flies out of that are hauling trash away are going to stop to pick it up? No. But this county has not been that dirty since the new com- missioners came in. You can find dirt on almost every major road. No, we're not blaming the commis- sioners. We're telling them to pick it up because as your prop- erty rates go down, the Dumpster piles higher. Yes to skate park .( This is in response to the comment made about. how much it costs taxpay- k o ers for a skateboard (park) in Beverly Hills ... I'd S rather pay for the skate 0579 park for the children than for prisoners in-jail in our own county. Yes for the skate park. Building tip If you are having your house built, make sure the builder uses a septic company that will pay for the sod and sprinkler system to be replaced under the five-year warranty... Grazing sheep It's getting so you can't eat any- thing anymore without thinking about how much vitamins and min- erals and water-soluble fiber and lycopene and Omega-3 fatty acids and micro and macro nutrients you're getting, from all the ads on TV. We're all being brainwashed. Whatever happened to "Eat our product, it tastes good?" We're all like a bunch of dumb sheep. Phone manners Last week I had three phone calls asking for people and I tell them, "l"m sorry, you have the wrong number, they don't live here," and all they say is, "Oh well," and hang up. What happened to "I'm sorry?" Bwh gets - 40M s V qu 40 aM* os .0~O.-- -aw pq- INW 40~sid~w 0 -vl a qu- ft ...41og ~~ - a.dmms tw qu a- -o AtA-m= C0 o iili ma ""_@py!ighledMatewaI q - 0 .0 0 - -.0 - 0 - a -e -~ - 4 --- 0- ~ -4 - --4 0 4 4 1 4MIINM-a qq 4- 0 saw0 ana m am *f q a. lml4b MO N- 40 .4 ___ 10-m 4 - ow 40 0 f0w0 - M - a.. -000 4mommo .wpmpm a ap.p 40M m -04o -n* l qw 400 4-qm- 0 ft 4 a -4 o MENW- 4I-INOWIPd~ MO - mm- lw-o p 0 4di S o0 a0 o*41 OE qm -m4 LETTERS to Thanks for voter support Thank you to the Chronicle and to all my friends, neighbors and the resi- dents of Inverness for your votes and your support during my recent cam- paign for the Inverness City Council Seat 2. Together we can continue to enhance the city and to ensure the quality of life for its residents. Committed to a bright and positive future for the city, I look forward to turning the challenges into opportuni- ties and our goals into realities. With town meetings to discuss issues such as transportation, parking, infrastruc- ture, growth and business support, together we will develop the best strategies to meet all of our needs. Again, thank you for your support; I look forward to working with you. Bill Sheen Inverness Council was rewarding I would like to thank all my sup- porters for their help during my cam- paign. You are all a blessing to me, you'll never know how much, as words seem inadequate. Thank you to the Chronicle for the endorsement, and thanks to the wonderful staff at the city of Inverness for eight years of the OPINIONS INVITED M The opinions expressed in Chronicle edi- torials are the opinions of the editorial board of the newspaper. Viewpoints depicted in political car- toons, columns or letters do not neces- sarily represent the opinion of the edito- rial board. lettersechronicleonllne.com. making dreams into reality. I had the rare fortune and honor to serve on what was probably the most produc- tive council/manager partnership in city history. Thanks guys, ya'll were great to work with. You will always have my love and respect I pray the vision continues, and again, thanks to my a - do- .o q '0 h0 M. -.qw- -0- .NGP- -4ilo 10 mm - dlAIP0-- 41b f-mma0* a b. a4Do.s -~ 4b Editor supporters, and, to my family who shared me with the city for the past eight years. It was a wonderful and rewarding experience. Thank you all, and may God continue to bless Inverness. Jacquie Hepfe, Inverness Whole truth not told Do I laugh or do I cry? You have found a remarkable subject to features on the front page of your newspaper Feb. 7, which might seem to appear that the Arrowhead home featured had perhaps more difficulties than "just" four hurricanes. I searched the masthead of your newspaper to see if it bore any such slogan as "merely to tell the truth," q etc., but did not find such a saying. : In the interest of balanced journal- ; ism, could you please also feature * some of the $200,000 and up homes in Arrowhead? People are endlessly loyal to living in Arrowhead. There y must be a reason? (I'm a) former owner of Arrowhead property. Marilyn M. Bootlf Invernesi record. re purely those of the callers. 10A FRIDAY FEBRUARY 1 8, 2005 CITRUS COUNTY CHRONICLE S- - -. m. vntllr lT t nnT n -- -.- Availab le ro omerca ews rOvers 4W a 4 A m4 tomow ftpqVON- wom.m -- Of-- -g AiliabI# f[OMCommIcial News P~ovid I . I I Ak - jjag^ --- w p . "in i A 1 120 WIMA CveT' Cni;vrv (FL) CHRONICLE FRIDAY, FEBRUARY 18, 2005 hA 'lr VI b S II Sola * 4eR~de4e4t* Ne F. T. 40,K ON Sleeper available at $999.95 Queen Sleeper available at $999.95 Monarch Oak Dining Room Your Choice Table and 6 Chairs or China $99 $99 Courtey -Vis6 Memor Foa $999 Lifestyle 11 .$299 ocleen Set Twin Set ....... A 59 F(III Set ....... -199 King Set .... 3 1 Sims Furniture Galleries, LLC 205 E. Gulf to Lake Hwy. Lecanto 352-726-8282 OPEN: MON.-SAT. I OAM-6PM; SUNDAY I PM-5PM @home with BERKLINE S& Broyhillo If anyone deserves it youdo. Sims Furniture Galleries, LLC Sims Furniture Galleries, LLC Sims Furniture Ga Lecanto 352-726-8282 Hudson 727-861-2589 Leesburg 352-3 Bassett Sims Furniture, LLC Sims Furniture Galleries, LLC Sims Furniture Ga Ocala 352-401-0477 Ocala 352-291-2563 Brooksville 352- f',? galleries, 323-1734 alleries, 796-545 Furniture Galleries, tic LLC Bassett Sims Furniture, LLC 6 Lakeland 863-815-4400 LLC Sims Furniture Galleries, LLC 50 Clermont 352-242-6350 4, FRiDAY, FEBRUARY 18, 2005 IIA RTIC US COUNTY (FL Hailey Pillow Top $499 Quoen Sol Twin Set ....... 1,319 Full Set ......... 1,399 King Set ....... %99 . Redatm * 12A FRIDAY FEBRUARY 18, 2005 Nation & World %d msoo, JAA .4 momomob -Raf ow 40-m *gb mlw. 4opwo 4w a. - 40 -m a "n Gom- ow no- M - a .q.m 4W a qq mp0 w -mmo- 40mo- 0m qww 4 m a omsm-f w 0 owftq S -- ow a lom - 4m "Mm- ma 4 -o* S e 0 om Sme*b -Nom S ft tf s a"o - so on mo - ft m 00 400 m mom -" -p a dwm f m Sm 4 f S 2m ow -qq a .ono m -oft m - 0 -.0 40 w 46 -6 =om eomo -Me 4r 4 mmgm -ft__ W 1EVIPMN 0 - 4b--M MOFM 41-qmw m .02i 41om41 400 40 0 o -Now bom -6 --um Odm 0--0 It.. I-M .000-- I L ** - "W rM qm- -w qq m- d- ---- b . A f - 40omom" 11PN.46-mb M-0 U-rn- ~mo M-- - a copio romommeroffi eWsoi am 40a quaA ft Aft 4 do- am -no -mmam-w as 0 "wi p q 0 ft gb 4anw b -0%4D4 -do amq 4 - mm -p qp40mm 4 - ~__ - 0 OW0 apdam mmn a an 1m OGN MMNMPa 4D dp 00m go--wido anoma simomimo- om me 411ab -oma moD 1MN dMM *m mm do INO -mms do4moit 0 dm 4 - TVI- am- 40-om -omo -m w fm ao Wm * o 1omo-m- b- aa S m m m 0 - ft- S -m- - q- b w so4b- N 40 4m mome mu-o *p qm of 4om- o 0w-~ mmw 4w4 0-p oo 0 do.om 0 VMWM - ommw- -a-mum- om- a -. ..a. *-.. -qm- a. aw - - C 4w a ARM-p 5- -a -w - - - 4ow.- - - - -a .- - -- -Ic..-. a a * -- '- -5- - a - - - - * - S a - - - - * loo 4 m 04 4 - W -MON 4b - -WW- W, AW ,ira ,m, DA FEBRUARY 18, 2005 Wayward crab traps targeted Volunteers will assist in the retrieval of premarked traps from specified areas of the Crystal River and Crystal Bay. Assistance is needed to pickup and transport the marine debris back to Crystal River Preserve State Park for disposal.. I IF YOU GO Crab traps and marine debris will be retrieved from specified areas of the Crystal River and Crystal Bay from 9 a.m. to noon Saturday, March 5. Reservations are required. Sign up by calling the St. Martins Marsh Aquatic Preserve at 563-0450, or by e-mail to Melissa.Zirhut@dep.state.fl.us or Chad.Bedee@dep.state.f I.us. Pageants ready to roll Special to the Chronicle It's time to register for the children. There is a $25 entry fee, and preregistration is required. All contestants are awarded prizes. Applications must be in the Fair Office or postmarked by Feb. 18. For more information, call 726-2993. Special to the Chronicle Volunteer boaters are needed for Citrus County's inaugural community derelict crab trap-pulling event sched- uled from 9 a.m. to noon Saturday, March 5, at the Crystal River Buffer Preserve State Park , Abandoned or derelict crab traps are hazardous to boaters and other recre- ational users of Citrus County, and are also fatal to marine life caught in these Enjoy island fare Special to the Chronicle Enjoy Island food, island music and entertainment as the Dunnellon Christian Women's Club welcomes all to its annual guest luncheon at noon Wednesday at Rainbow Springs Country Club. Special "Luau" feature will be an impromptu hat show by Gaye Martin. Former air traffic controller "Majestic Aloha" guest speak- er, Phil Martin from Summerfield, will share how wrong headings and mid-air collisions are avoided when listening to the controller. A buffet lunch will be served. Enjoy it all for $12, inclusive. For reservations, call Shirley at 465-9037 or Diana at 489-2927. Reservations essential by today. Cancellations accepted until Monday. Banquet scheduled Special to the Chronicle True Love Waits is hosting a banquet at 7 p.m. today in Victory Hall at the First Baptist Church of Crystal River, 700 Citrus Ave. True Love Waits is a national move- ment toward abstinence before marriage. The feature presentation is by the Heirborne Drama Team. Donations will be received. Witness the ring cer- emony of students who are totally committed to honoring God. The banquet will be catered by Romano's Fine Italian Dining, and the cost .is $8 per person. The menu is salad, roll, penne pasta, meatballs, Italian sausage, drink and dessert. All junior and senior high students are welcome to attend. Call 795-3367. "ghost" traps. Once these traps become lost, they are difficult to see from the water sur- face, and can remain for years in aquat- ic habitats without decomposing. When crab traps are left sitting on the bay bot- tom, many blue crabs, stone crabs, fish, diamondback terrapins and other marine life can be caught accidentally These traps continue to bait themselves year after year. Reservations are required. Boaters needed to pull derelict crab traps Special to the Chronicle Angel the Yorkle lives with Rufus and Margie Johnson In Inverness. News NOTES Seventh day Adventists to meet The Hernando Seventh-day Adventist Church offers a free seminar from Saturday, Feb. 26, by Dr. Philip G. Samaan, "Christ's Way to Pray." The seminar runs from 11 a.m. to noon, followed by a free vege- tarian luncheon. The seminar restarts at 2:30 p.m. At a special presentation at 6 p.m., Samaan will share his experiences of the Middle East. The Hernando Seventh-day Adventist Church is at 1880 N. Trucks Ave., Hemando. Call 726-3571. Computer club to meet today The Citrus County Computer Club (CCCC) will meet at 7 p.m. today at The Shepherd of the Hills Church in Lecanto, on County Road 486, one-quarter mile east of County Road 491. There will be a demonstration about tax preparation on your computer. There will be computers avail- able at the meeting to help with problem solving. Guests are always welcome. The next meeting will be March 4, same time, same place. Call Elaine Quarton at 637-2845 or Lee Nowicke at 746-5974. Senior club airs today on WYKE 'The Senior Club," is a week- ly one-hour live television pro- gram is something you don't want to miss. The television show airs at 9 a.m. Friday mornings. This week's show will include a guest appearance with Citrus County Commissioner Joyce Valentino. The tip of the day pro- vided by the Central Florida Community College will offer tips for interior decorating with local designer Marge Copley. Flossie Benton-Rogers from the Citrus County Library System will discuss Library Appreciation Month and the special events going on in the Citrus County libraries. Group to stage pet adoption Adopt A Rescued Pet Inc. will host a pet adoption from 9 a.m. to 3 p.m. today at AmSouth Bank, 6730 W. Gulf-to-Lake Highway, Crystal River. We will be outside the main entrance with cats, dogs and kit- tens looking for loving perma- nent homes. All pets available for adoption have been spayed or neutered and are current on inoculations. Dogs have been screened for heartworms and cats have been tested for feline leukemia and AIDs. Looking for a pet? Check out the free ad section in the Chronicle or our Web site - or call us at 795-9550. Orchid lovers to gather Saturday The Orchid Lovers Club will meet at 1 p.m. Saturday in the Enrichment Center Inc., at Oak Hill Hospital, 11375 Cortez Blvd. (State Road 50) behind the hos- pital in Brooksville. Paul Phillips of Ratcliff Orchids will be the guest speak- er. He will discuss Paphiopedilums and will have plants for sale. Newcomers are welcome. For information, call 597-1826. Pet ;;, :. Heaven-scent They're all winners BRIAN LaPETER/Chronicle Health Occupation Students of America (HOSA) members from Crystal River High School recently won awards in a regional com- petition. Winners from the Academy of Health Careers at CRHS are: Stacey Kubovec, second place medical technology; Rachelle Watson, third place medical spelling; Alex Bennett, first place, Elizabeth Hesten, second place, dental terminology; Danlelle Richey, first place, knowledge test-basic concepts of health care; Kayla Houts and Savannah Clark, first place, Richard Bennett and Kyle Martin, second place, first aid/CPR; Brittany Cruz, second place, nursing assisting; Jennifer Viverito, third place, extemporaneous writing; Steven Lazio, second place, prepared speaking; Dominica Castoro, Hal Jaquith, Christopher Kaiser, Jordan Loriss, third place, Kayla Bryan, Neyda VanBennekom, Stephen Ricci, fifth place, creative problem-solving. January's best Special to the Chronicle From left: Ella Floyde, CMH volunteer of the month for January, Barbara Whittemore, SHARE Club coordinator, and Bill Floyde, CMH volunteer of the month for January. Author speaks RUTH LEVINS/Special to the Chronicle Seeth Miko Trimpert, author, holds her books, "Bear Crossing" (set on the Withlacoochee River) and "The Monastery." She was the guest speaker at the Jan. 3 meeting of the Crystal River Woman's Club. She is shown with Barbara Stewart, program chairwoman. Flotilla honors bestowed PATTI RAY/Special to the Chronicle Members of United States Coast Guard Auxiliary Flotilla 15-4 from Homosassa recently pre- sented a plaque to the Citrus County Chronicle In appreciation of their efforts to support and promote the auxiliary. From left, are: Charlie Brennan, Chronicle editor-in-chief; Mike Arnold, Chronicle managing editor; Wilbur Scott, assistant public affairs officer for the auxiliary; and Pim Miranda, public affairs officer for the auxiliary. I LAA FRIDAY.FInDTTARY 18, 2005 S I c DOWN DOWN 04 OPTIMA EX 05 SORENTO EX M Leather, Leather, ABS, Sunroof. Luxury Pkg. M SRP....................................20,265 Rebate...................................3,000 J- dohnsons Discount......... 1,060 S 'fn nO wN 04 KIARIO Automatic, C1K r!ZI A/C, CD M SRP.................................. 13,200 - Rebate.................................. 900 - Johnsons Discount.................499 SfDn nOwN MSRP.........15 -, Rebate................................ 1,400 -.ohnsons Discount................. 81& $0 DOWN Loaded, Leather, Sunroof , -6 11,11 .I . MSRP.................................. 25,585 - Rebate.... .......................2,500 - Johnsons Discount.............1,000 0O DOWN 04 SPECTRA LX 04 AMANTI Automatic, Leather, Loaded, AIfCID Stability Pk ," : MSRP.................................. 15,175 - Rebate................................. 2,000 - Johnsons Discount.................488 S0 DOWN MSRP.... .............................27,990 - Rebate................................ 3,000 - Johnsons Discount.............1,000 fAn nOWNM * 'Il 2005 SUZUKI RENOLX Automatic MSRP ........1...............;., 1 69 - Rebate...... .........1,000 - Johnsons Discount.............. 694 $0 DOWN 9a4t ,4.0aac611 SODOWN ~bFiY9~ .ODOWN WAG 05 FORENZA LX Auo a M SRP ................... ........... 16,694",> -Rebate................................ 1,0.00 " - Jbhnsons Discount ...0. 694L $0 DOWN IPAYMEmr 2450" 05 VERONA S Automatic MSRP.................................. 17,994 - Rebate............................... 1,000 - Johnsons Discount.................994 $0 DOWN "9M WAW.* j pL PAYMENT $277 33* * PAYMENT $391 I 04 AERIO SX MSRP................................. 16,044 ,: - Rebate............................... 1,500 - Johnsons Discount...................776 0o DOWN HW50 I- ro 1 8 1 r [(17j L-A I! CITRUS COUNTY (FL) CHRONICLE Good Credit, Bad Credit,j No Credit, No Problem! J64WAft rKIIJAY, m | pj:/ kI uIr~Ric Ctsrvl Y(F! t Cj-wINILcf FIAFBURY1,20 MOTIVE GROUP 0 PAYMENT s$274 9c^4t $j J5~J1JDOWN ,;05 SUNFIRE 05 GRAND AM Economical, 5 Sporty Coupe, Power Package, S..Speed, A/C, Chrome Stereo Wheels, V6 ,RP ................................. 5,737 7 6bate.................................. 3,000 An sons Discount...:............. 567 f' nnOWM ,05 GRAND PRIX 4 Door Sedan, Power Package, V6, ,,_Stereo MSRP............................... 23,560 -jRebate.............................. 3,000 -'Johnsons Discount........... 1,222 $0 DOWN 05 AZTEK - V6,.4 Door, SUV, SPower P'- ckage ISRP........................... ..... 22,085 Rebate...............................3,000 Johnsons Discount............. 1,128 dat%.r%^i..y.a MSRP.................23,915 - Rebate.................................. 3,000 -Johnsons Discount.............. 1,271 0 DOWN 05VIBE Sporty Wagon, 5 Speed, A/C,l, Stereo MSRP...................,17,690 -I Rebate................................2,500 - Johnsons Discount.................. 505 0 DOWN ^^^*41 fia 05 MC 7 Passenger, Rear A/C, Loaded Sv6 MSRP.............." 26,690 - Rebate................1,500 - Johnsons Discount.............1,704 fln "DOWN ninglis Crystal River Homosassa Springs 2005 MRSUBISHI ENDEAVOR MSRP ............................. 27,194 - Rebate........................... 2,000 - Johnsons Discount..........1,080 - Owner Loyalty.................. 1,000 $0 DOWN 05 GALLANT [PAYMENT $680 1 05 ECLIPSE COUPE! M SRP.................................. 20,044 - Rebate................................2,000 - Johnsons Discount................. 579 - Owner Loyalty........................ 500 $0 DOWN fPAYENTl24-87.A PAYMENT 270o MSR ......19,594 -Rebate............................... 1,000 - Johnsons Discount..................583 - Owner Loyalty................. 1,000 $0 DOWN T . PAYMENT Z36 1 BEST BACKED CARS IN THE WORLD MOM 9 NJE AM ITSUBISHI wk MaOTORS wake up and drive Mow Purchase.* 1 JA1 TURN YOUR W-2 _ 1 INTO A NEW CAR Must qulf fo wepoat nMtuih ehce.**Sm oesecue PotacVbadG inld cop ettv rebate A e.f. k FRiDAY, FEBRUARY 18, 2005 ISA RriC us CouNTY (FL E IL IQQ5 PUNTIAl 66 CITRUS COUNTY (FL) CHRONICLE I a .--. TTW. R 2Cna RUTH LEVINS/Special to the Chronicle. Ruth Levins, president of Crystal River/Springs AARP Chapter 2978, far right, presents a cer- tificate of appreciation to Habitat for Humanity speakers at the Jan. 20 final meeting of the membership. From left: Terry Steele, executive director; Bonnie, director; Norm Peterson, president of Habitat for Humanity of Citrus County; and Levins. 'I 4 Featured speakers Special to the Chronicle Ryan Beaty, CEO, Citrus Memorial Hospital, and Rusty Harry, emergency management coor- dinator, Citrus County Sheriff's Office, were the featured speakers at the annual meeting Jan. 18 at St. Thomas Catholic Church In Homosassa. During the meeting, the board of directors of the Sugarmill Woods Civic Association elected George Borchers to serve the coming year as president. Other officers elected were Bob Hettrlch, vice president; Roland Aberle, treas- urer; and Norm Wagy, secretary. Three new board members were selected for three-year terms: Madelyn McCorkle, Pat Schuessler and Norm Wagy. Skip Christensen will serve anoth- er three years on the board as Immediate past-president. The civic association has more than 2,000 family memberships, and represents the community of Sugarmill Woods with state and local governments and agencies that serve its residents. WIN DIXIE Reaeadl I 50 VALUE: COUPON MUST CONTAINo ff BARCODETO BEVALO Any order of $30 or more C RREffectiveft alcohol, to I WiN DIXA B kete, or i1y per ord I11 chase. Cao ..ur |111 Customer u 0stome 0 00000 9 4 94 COPIES. |iemdrCaurd W M COUPON MUST CONTAIN BAR CODETO BEVAULID S1Off VALUE: . Any order of $50 or more Effective through February 20, 2005. Excludes alcohol, tobacco, gift certificates, mon cate per amly per order. Must be presented at time of purchase. Cannot be combined with any other Customer Reward Certificate NO PHOTOCOPIES. L r.. .6r. through February 20, 2005. Excludes bacco, gift certificates, money orders, amps, pharmacy prescriptions, event I Lottery. Limit one certificate per fam- er. Must be presented at time of pur- nnot be combined with any other r Reward Certificates. NO PHOTO- Select either coupon based upon the amount of your purchase. Coupon must contain bar code to be valid. Get up to $150 in Rebates! L A B O Y" Chilean white seedless grapes $ save up to $2.72 lb. 6 pack 24 oz. bottles or 12 oz. cans 12 pack Pepsi products All,!$099 ~N I)C'ZI2'. wG~ fresh Iceberg lettuce "690 Save up to $1.00 Winn-Dixie grade A dozen - WM large eggs 790 ea. save up to $1.30 .4 Oe a selected varieties 12 oz. Ruffles and 10-13.5 oz. Doritos 16 oz. pkg. EZ peel VD Fisherman's Wharf 51-60 ct. medium white shrimp Rebate offer ends February 23. Not valid on previous sales or orders. L A9B FURNITURE GA I @[ UjB 90 days same as cash. 2530 SW 19th Ave. Rd., Ocalo, FL (on Easy Street next to Walmart), 861-3009 - Mon.- Fn. 10 AM- 7 PM Sat. 10 AM- 6 PM, Sun. NOON- 5 PM O Y SL L ER I E S - save up to $1.58 on 2 S ave up to $7.99 on 2 Priesand em good Friday Uxrough Tueday Fdmuay 18thrMough F~Wuary 2W5OO wwwwmnn-dixiexcom QUANrrryRn=PJEISHSEVDCOPYMIHr w V72N-OD= CE 500. INC. Saving s just got bigger at Winn-Dixie! Don't miss this opportunity to save even more on your next shopping trip with the certificate below. Habitat speakers M45A FRiDAY, FEBRUARY 18, ZUUP m ....j L NOW!,, o v Contact Us | Permissions | Preferences | Technical Aspects | Statistics | Internal | Privacy Policy © 2004 - 2010 University of Florida George A. Smathers Libraries.All rights reserved. Acceptable Use, Copyright, and Disclaimer Statement Last updated October 10, 2010 - - mvs
http://ufdc.ufl.edu/UF00028315/00049
CC-MAIN-2017-34
refinedweb
31,138
90.26
Explore Python Gensim Library For NLP In this tutorial, we will focus on the Gensim Python library for text analysis. Gensim is an acronym for Generate Similar. It is a free Python library for natural language processing written by Radim Rehurek which is used in word embeddings, topic modeling, and text similarity. It is developed for generating word and document vectors. It also extracts the topics from textual documents. It is an open-source, scalable, robust, fast, efficient multicore Implementation, and platform-independent. In this tutorial, we are going to cover the following topics: Installing Gensim Gensim is one of the powerful libraries for natural language processing. It will support Bag of Words, TFIDF, Word2Vec, Doc2Vec, and Topic modeling. Let install the library using pip command: pip install gensim Create Gensim Dictionary In this section, we will start gensim by creating a dictionary object. First, we load the text data file. you can download it from the following link. # open the text file as an object file = open('hamlet.txt', encoding ='utf-8') # read the file text=file.read() Now, we tokenize and preprocess the data using the string function split() and simple_preprocess() function available in gensim module. # Tokenize data: Handling punctuations and lowercasing the text from gensim.utils import simple_preprocess # preprocess the file to get a list of tokens token_list =[] for sentence in text.split('.'): # the simple_preprocess function returns a list of each sentence token_list.append(simple_preprocess(sentence, deacc = True)) print (token_list[:2]) Output: [['the', 'tragedy', 'of', 'hamlet', 'prince', 'of', 'denmark', 'by', 'william', 'shakespeare', 'dramatis', 'personae', 'claudius', 'king', 'of', 'denmark'], ['marcellus', 'officer']] In the above code block, we have tokenized and preprocessed the hamlet text data. - deacc (bool, optional) – Remove accent marks from tokens using deaccent() function. - The deaccent() function is another utility function, documented at the link, which does exactly what the name and documentation suggest: removes accent marks from letters, so that, for example, ‘é’ becomes just ‘e’. - simple_preprocess(), as per its documentation, to discard any tokens shorter than min_len=2 characters. After tokenization and preprocessing, we will create gensim dictionary object for the above-tokenized text. # Import gensim corpora from gensim import corpora # storing the extracted tokens into the dictionary my_dictionary = corpora.Dictionary(token_list) # print the dictionary print(my_dictionary) Output: Dictionary(4593 unique tokens: ['by', 'claudius', 'denmark', 'dramatis', 'hamlet']...) Here, gensim dictionary stores all the unique tokens. Now, we will see how to save and load the dictionary object. # save your dictionary to disk my_dictionary.save('dictionary.dict') # load back load_dict = corpora.Dictionary.load('dictionary.dict') print(load_dict) Output: Dictionary(4593 unique tokens: ['by', 'claudius', 'denmark', 'dramatis', 'hamlet']...) Bag of Words The Bag-of-words model(BoW ) is the simplest way of extracting features from the text. BoW converts text into the matrix of the occurrence of words within a document. This model concerns whether given words occurred or not in the document. Let’s create a bag of words using function doc2bow() for each tokenized sentence. Finally, we will have a list of tokens with their frequency. # Converting to a bag of word corpus BoW_corpus =[my_dictionary.doc2bow(sent, allow_update = True) for sent in token_list] print(BoW_corpus[:2]) [[(0, 1), (1, 1), (2, 2), (3, 1), (4, 1), (5, 1), (6, 3), (7, 1), (8, 1), (9, 1), (10, 1), (11, 1), (12, 1)], [(13, 1), (14, 1)]] In the above code, we have generated the bag or words. In the output, you can see the index and frequency of each token. If you want to replace the index with a token then you can try the following script: # Word weight in Bag of Words corpus word_weight =[] for doc in BoW_corpus: for id, freq in doc: word_weight.append([my_dictionary[id], freq]) print(word_weight[:10]) [['by', 1], ['claudius', 1], ['denmark', 2], ['dramatis', 1], ['hamlet', 1], ['king', 1], ['of', 3], ['personae', 1], ['prince', 1], ['shakespeare', 1]] Here, you can see the list of tokens with their frequency. TF-IDF - In Term Frequency(TF), you just count the number of words that occurred in each document. The main issue with this Term Frequency is that it will give more weight to longer documents. Term frequency is basically the output of the BoW model. - IDF(Inverse Document Frequency) measures the amount of information a given word provides across the document. IDF is the logarithmically scaled inverse ratio of the number of documents that contain the word and the total number of documents. - TF-IDF(Term Frequency-Inverse Document Frequency) normalizes the document term matrix. It is the product of TF and IDF. Word with high tf-idf in a document, it is most of the time that occurred in given documents and must be absent in the other documents. Let’s generate the TF-IDF features for the given BoW corpus. from gensim.models import TfidfModel import numpy as np # create TF-IDF model tfIdf = TfidfModel(BoW_corpus, smartirs ='ntc') # TF-IDF Word Weight weight_tfidf =[] for doc in tfIdf[BoW_corpus]: for id, tf_idf in doc: weight_tfidf.append([my_dictionary[id], np.around(tf_idf, decimals = 3)]) print(weight_tfidf[:10]) Output: [['by', 0.146], ['claudius', 0.31], ['denmark', 0.407], ['dramatis', 0.339], ['hamlet', 0.142], ['king', 0.117], ['of', 0.241], ['personae', 0.339], ['prince', 0.272], ['shakespeare', 0.339]] Word2Vec. There are two main methods for woed2vec: Common Bag Of Words (CBOW) and Skip Gram. Continuous Bag of Words (CBOW) predicts the current word based on four future and four history words. Skip-gram takes the current word as input and predicts the before and after the current word. In both types of methods, the neural network language model (NNLM) is used to train the model. Skip Gram works well with a small amount of data and is found to represent rare words well. On the other hand, CBOW is faster and has better representations for more frequent words. Let’s implement gensim Word2Vec in python: # import Word2Vec model from gensim.models import Word2Vec # Create Word2vec object model = Word2Vec(sentences=token_list, # tokenized sentences size=100, window=5, min_count=1, workers=4, sg=0) # CBOW #Save model model.save("word2vec.model") # Load trained Word2Vec model model = Word2Vec.load("word2vec.model") # Generate vector vector = model.wv['think'] # returns numpy array print(vector) In the above code, we have built the Word2Vec model using Gensim. Here is the description for all the parameters: - min_count is for pruning the internal dictionary. Words that appear only once or twice in a billion-word corpus are probably uninteresting typos and garbage. - workers , the last of the major parameters (full list here) is for training parallelization. - window: Maximum distance between the current and predicted word within a sentence. - sg: stands for skip-gram; 0- CBOW and 1:skipgram Output: [-0.27096474 -0.02201273 0.04375215 0.16169178 0.385864 -0.00830234 0.06216158 -0.14317605 0.17866768 0.13853565 -0.05782828 -0.24181016 -0.21526945 -0.34448552 -0.03946546 0.25111085 0.03826794 -0.31459117 0.05657561 -0.10587984 0.0904238 -0.1054946 -0.30354315 -0.12670684 -0.07937846 -0.09390186 0.01288407 -0.14465155 0.00734721 0.21977565 0.09089493 0.27880424 -0.12895903 0.03735492 -0.36632115 0.07415111 0.10245194 -0.25479802 0.04779665 -0.06959599 0.05201627 -0.08305986 -0.00901385 0.01109841 0.03884205 0.2771041 -0.17801927 -0.17918047 0.1551789 -0.04730623 -0.15239601 0.09148847 -0.16169599 0.07088429 -0.07817879 0.19048482 0.2557149 -0.2415944 0.17011274 0.11839501 0.1798175 0.05671703 0.03197689 0.27572715 -0.02063731 -0.04384637 -0.08028547 0.08083986 -0.3160063 -0.01283481 0.24992462 -0.04269576 -0.03815364 0.08519065 0.02496272 -0.07471556 0.17814435 0.1060199 -0.00525795 -0.08447327 0.09727245 0.01954588 0.055328 0.04693184 -0.04976451 -0.15165417 -0.19015886 0.16772328 0.02999189 -0.05189768 -0.0589773 0.07928728 -0.29813886 0.05149718 -0.14381753 -0.15011951 0.1745079 -0.14101334 -0.20089763 -0.13244842] Pretrained Word2Vec: Google’s Word2Vec, Standford’s Glove and Fasttext - Google’s Word2Vec treats each word in the corpus like an atomic entity and generates a vector for each word. In this sense Word2vec is very much like Glove – both treat words as the smallest unit to train on. - Google’s Word2Vec is a “predictive” model that predicts context given word, GLOVE learns by factorizing a co-occurrence matrix. - Fasttext treats each word as composed of character ngrams. So the vector for a word is made of the sum of this character n-grams. - Google’s Word2vec and GLOVE do not solve the problem of out-of-vocabulary words (or generalization to unknown words) but Fasttext can solve this problem because it’s based on each character n grams. - The biggest benefit of using FastText is that it generate better word embeddings for rare words, or even words not seen during training because the n-gram character vectors are shared with other words. Google’s Word2Vec In this section, we will see how Google’s pre-trained Word2Vec model can be used in Python. We are using here gensim package for an interface to word2vec. This model is trained on the vocabulary of 3 million words and phrases from 100 billion words of the Google News dataset. The vector length for each word is 300. You can download Google’s pre-trained model here. Let’s load Google’s pre-trained model and print the shape of the vector: from gensim.models.word2vec import Word2Vec from gensim.models import KeyedVectors model = KeyedVectors.load_word2vec_format('GoogleNews-vectors-negative300.bin', binary=True) print(model.wv['reforms'].shape) Output: (300,) Standford Glove GloVe stands for Global Vectors for Word Representation. It is an unsupervised learning algorithm for generating vector representations for words. You can read more about Glove in this research paper. It is a new global log-bilinear regression model for the unsupervised learning of word representations. You can use the following list of models trained on the Twitter dataset: - glove-twitter-25 (104 MB) - glove-twitter-50 (199 MB) - glove-twitter-100 (387 MB) - glove-twitter-200 (758 MB) import gensim.downloader as api # Download the model and return as object ready for use model_glove_twitter = api.load("glove-twitter-25") # Print shape of the vector print(model_glove_twitter['reforms'].shape) # Print vector for word 'reform' print(model_glove_twitter['reforms']) Output: (25,) [ 0.37207 0.91542 -1.6257 -0.15803 0.38455 -1.3252 -0.74057 -2.095 1.0401 -0.0027519 0.33633 -0.085222 -2.1703 0.91529 0.77599 -0.87018 -0.97346 0.68114 0.71777 -0.99392 0.028837 0.24823 -0.50573 -0.44954 -0.52987 ] # get similar items model_glove_twitter.most_similar("policies",topn=10) Output: [('policy', 0.9484813213348389), ('reforms', 0.9403933882713318), ('laws', 0.94012051820755), ('government', 0.9230710864067078), ('regulations', 0.9168934226036072), ('economy', 0.9110006093978882), ('immigration', 0.9105909466743469), ('legislation', 0.9089651107788086), ('govt', 0.9054746627807617), ('regulation', 0.9050778746604919)] Facebook FastText FastText is an improvement in the Word2Vec model that is proposed by Facebook in 2016. FastText spits the words into n-gram characters instead of using the individual word. It uses the Neural Network to train the model. The core advantage of this technique is that can easily represent the rare words because some of their n-grams may also appear in other trained words. Let’s see how to use FastText with Gensim in the following section. # Import FastText from gensim.models import FastText # Create FastText Model object model = FastText(size=50, window=3, min_count=1) # instantiate # Build Vocab model.build_vocab(token_list) # Train FastText model model.train(token_list, total_examples=len(token_list), epochs=10) # train model.wv['policy'] Output: array([-0.328225 , 0.2092654 , 0.09407859, -0.08436475, -0.18087168, -0.19953477, -0.3864786 , 0.08250062, 0.08613443, -0.14634965, 0.18207662, 0.20164935, 0.32687476, 0.05913997, -0.04142053, 0.01215196, 0.07229924, -0.3253025 , -0.15895212, 0.07037129, -0.02852136, 0.01954574, -0.04170248, -0.08522341, 0.06419735, -0.16668107, 0.11975338, -0.00493952, 0.0261423 , -0.07769344, -0.20510232, -0.05951802, -0.3080587 , -0.13712431, 0.18453395, 0.06305533, -0.14400929, -0.07675331, 0.03025392, 0.34340212, -0.10817952, 0.25738955, 0.00591787, -0.04097764, 0.11635819, -0.634932 , -0.367688 , -0.19727138, -0.1194628 , 0.00743668], dtype=float32) # Finding most similar words model.wv.most_similar('present') Output: [('presentment', 0.999993622303009), ('presently', 0.9999920725822449), ('moment', 0.9999914169311523), ('presence', 0.9999902248382568), ('sent', 0.999988317489624), ('whose', 0.9999880194664001), ('bent', 0.9999875426292419), ('element', 0.9999874234199524), ('precedent', 0.9999873042106628), ('gent', 0.9999872446060181)] Doc2Vec Doc2vec is used to represent documents in the form of a vector. It is based on the generalized approach of the Word2Vec method. In order to deep dive into doc2vec, First, you should understand how to generate word to vectors (word2vec). Doc2Vec is used to predict the next word from numerous sample contexts of the original paragraph. It addresses the semantics of the text. - In Distributed Memory Model of Paragraph Vectors (PV-DM), paragraph tokens remember the missing context in the paragraph. It is like a continuous bag-of-words (CBOW) version of Word2Vec. - Distributed Bag of Words version of Paragraph Vector (PV-DBOW) ignores the context of input words and predicts missing words from a random sample. It is like the Skip-Gram version of Word2vec documents=text.split(".") documents[:5] from collections import namedtuple # Transform data (you can add more data preprocessing steps) docs = [] analyzedDocument = namedtuple('AnalyzedDocument', 'words tags') for i, text in enumerate(documents): words = text.lower().split() tags = [i] docs.append(analyzedDocument(words, tags)) print(docs[:2]) from gensim.models import doc2vec model = doc2vec.Doc2Vec(docs, vector_size=100, window=5, min_count=1, workers=4, dm=0) # PV-DBOW vector=model.infer_vector(['the', 'tragedy', 'of', 'hamlet,', 'prince', 'of', 'denmark', 'by', 'william', 'shakespeare', 'dramatis', 'personae', 'claudius,', 'king', 'of', 'denmark']) print(vector) Output: [-1.5818793e-02 1.3085594e-02 -1.1896869e-02 -3.0695410e-03 1.5006907e-03 -1.3316960e-02 -5.6281965e-03 3.1253812e-03 -4.0207659e-03 -9.0181744e-03 1.2115648e-02 -1.2316694e-02 9.3884282e-03 -1.2136344e-02 9.3199247e-03 6.0257949e-03 -1.1087678e-02 -1.6263386e-02 3.0145817e-03 9.2168162e-03 -3.1892660e-03 2.5632046e-03 4.1057081e-03 -1.1103139e-02 -4.4368235e-03 9.3003511e-03 -1.9984354e-05 4.6007405e-03 4.5250896e-03 1.4299035e-02 6.4971978e-03 1.3330076e-02 1.6638277e-02 -8.3673699e-03 1.4617097e-03 -8.7684026e-04 -5.3776056e-04 1.2898060e-02 5.5408065e-04 6.9614425e-03 2.9868495e-03 -1.3385005e-03 -3.4805303e-03 1.0777158e-02 -1.1053825e-02 -8.0987150e-03 3.1651056e-03 -3.6159047e-04 -3.0776947e-03 4.9342304e-03 -1.1290920e-03 -4.8262491e-03 -9.2841331e-03 -1.4540913e-03 -1.0785381e-02 -1.7799810e-02 3.4300602e-04 2.4301475e-03 6.0869306e-03 -4.3078070e-03 2.9106432e-04 1.3333942e-03 -7.1321065e-03 4.3218113e-03 7.5919051e-03 1.7675487e-03 1.9759729e-03 -1.6749580e-03 2.5316922e-03 -7.4808724e-04 -7.0081712e-03 -7.2277770e-03 2.1022926e-03 -7.2621077e-04 1.6523260e-03 7.7043297e-03 4.9248277e-03 9.8303892e-03 4.2252508e-03 3.9137071e-03 -6.4144642e-03 -1.5699258e-03 1.5538614e-02 -1.8792158e-03 -2.2203794e-03 6.2514015e-04 9.6203719e-04 -1.5944529e-02 -1.8801112e-03 -2.8503922e-04 -4.4923062e-03 8.4128296e-03 -2.0803667e-03 1.6383808e-02 -1.6173380e-04 3.9917473e-03 1.2395959e-02 9.2958640e-03 -1.7370760e-03 -4.5007761e-04] In the above code, we have built the Doc2Vec model using Gensim. Here is the description for all the parameters: - dm ({1,0}, optional) – Defines the training algorithm. If dm=1, ‘distributed memory’ (PV-DM) is used. Otherwise, distributed bag of words (PV-DBOW) is employed. - vector_size (int, optional) – Dimensionality of the feature vectors. - window (int, optional) – The maximum distance between the current and predicted word within a sentence. - alpha (float, optional) – The initial learning rat Summary Congratulations, you have made it to the end of this tutorial! In this article, we have learned Gensim Dictionary, Bag of Words, TFIDF, Word2Vec, and Doc2Vec. We have also focused on Google’s Word2vec, Standford’s Glove, and Facebook’s FastText. We have performed all the experiments using gensim library. Of course, this is just the beginning, and there’s a lot more that we can do using Gensim in natural language processing. You can check out this article on Topic modeling.
https://machinelearninggeek.com/explore-python-gensim-library-for-nlp/
CC-MAIN-2022-40
refinedweb
2,733
57.77
Your Account by Robert Cooper Looking at the short example: 1. The "binding" is one way, perhaps only the call to new SwingBinder(this, new LoginForm()). I would expect a binding framework to allow for propertyChangeEvents. If you had: LoginForm login = new LoginForm(); SwingBinder binder = new SwingBinder(this, login); bind.bind(); login.setUsername( "FOO" ); I expect nothing would happen. 2. It requires that the "Model" be altered. @Form public class LoginForm ... or it looks like optionally, and perhaps better: /** * @Form */ public class LoginForm Still, that means I have to edit the form level code, which is something I would want to explicitly never have to do. Model code is often (usually in my experience) something that is generated (via xjc/something-web-service-ish or from an ERD), and frequently shared across projects. 3. While I assume @Action methods can be separated out into something with a cleaner MVC type separation of concerns by doing something like: UserBean user = new UserBean(); SwingBinder binder = new SwingBinder(this, user); bind.bind(); LoginProcessBean login = new LoginProcessBean(user); // @Actions declared here binder = new SwingBinder(this, login); bind.bind(); It seems a big... basic. In terms of invoking controller/logic operations, I would really rather use something better anyway (read: GUICommands). Genesis has some interesting ideas in terms of Gui development, but I expect that actually using it, you end up doing things the way a lot of Struts developers do: creating "Form Beans" then mapping those back to the "Real" model, instead of just using the "Real" model from the beginning. Sorry for taking so long to reply. 1-) genesis has been conceived to avoid coding PropertyChangeListeners and all this stuff. We intended to make the framework as easy for developers as possible. If you modify a bean in response to any view event, all changes will be detected by genesis. In our experience, it is very rare to change a bean property outside of this context, so we were not concerned about it. It is possible to update the view in these rare situations by using ActionInvoker.refresh(form), but for genesis 3.1 we intend to support it as described in issue 385. ActionInvoker.refresh(form) 2-)@Form is no longer needed since 3.0-EA5. However, the form class usually is a subclass of a model class, as there is usually a lot of presentation logic that belongs to the view tier. @Form 3-)If you want to decouple actions from the model, you are going against a core principle in genesis: object-orientation. We believe data and operations belong together, as a rich domain model. I really value your feedback, so if you can come up with a few use cases for which genesis would not be appropriate, please let me know. Hi Vinícius, genesis works on a UI-toolkit independent way, so its programming model is quit similar for SWT as well. © 2014, O’Reilly Media, Inc. (707) 827-7019 (800) 889-8969 All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.
http://archive.oreilly.com/pub/post/thoughts_on_data_binding_and_s.html
CC-MAIN-2014-35
refinedweb
510
55.74
This is your resource to discuss support topics with your peers, and learn from each other. 11-29-2010 02:42 PM I have a .png, how do I set it to be the background image of a textinput? Also, how do I set the 9-cell grid to define how the .png will stretch according to the size of the textinput? I've tried wrapping the .png in a class in a swc, and then referencing that swc with setSkin, like so: textinputInstance.setSking(swcPackage.backgroundIm age)age) but my app crashes. 11-29-2010 03:07 PM this isnt really the answer but here's something that can give you a good start. at the moment it looks like the textinput only has one skin called teh TextInputSkin. Documentation can be found here: the method you are invoking setSkin only accepts a class that implements the ISkin class. So it does not accept images such as PNG (i really wish it was that easy). i havent fully figured out how to skin in the bb playbook (not for the lack of trying) because of the lack of documentation for it. so its kind of trial and error. here is the link to the skinning page if you need to look into this deeper: good luck! 11-29-2010 04:56 PM Thanks for the reply JRab. I've found some more info, but I'm still having the same problem. There's a demo of skinning buttons at about -9:00 here: Apparently you need to have a separate class than extends UISkin (and hence implicitly implements ISkin). To skin a textinput, you'd apparently have to do something like this public class TxtInputSkin extends UISkin { private var skin:DisplayObject = new DisplayObject(); public function TxtInputSkin() { super(); } override protected function initializeStates():void{ skin = new BkgInput(); showSkin(skin); setSkinState(SkinStates.UP,skin); setSkinState(SkinStates.FOCUS,skin); } } where BkgInput is a class that's been exported from a swc But this still doesn't work! Anyone know what's going wrong here? Is it how the swc has been compiled, somehow? 11-29-2010 05:18 PM hey oh22, i've been at it for a couple of hours and this is what i've found. RIM has a page set up for all of its skinning "assets" here: now i've been using the following code to test everyting out: package com.rabcore.ui.skins { import flash.display.Sprite; import qnx.ui.skins.SkinAssets; import qnx.ui.skins.SkinStates; import qnx.ui.skins.UISkin; public class CustomTextInputSkin extends UISkin { /**@private**/ protected var upSkin:Sprite; /**@private**/ protected var focusSkin:Sprite; /**@private**/ protected var downSkin:Sprite; /** *Create a custom button skin */ public function CustomTextInputSkin() { super( ); } override protected function initializeStates():void { upSkin = new SkinAssets.TextInputUp(); downSkin = new SkinAssets.TextInputDown(); focusSkin = new SkinAssets.TextInputFocus(); setSkinState(SkinStates.UP, upSkin ); setSkinState( SkinStates.DOWN, downSkin ); setSkinState( SkinStates.FOCUS, focusSkin ); showSkin( upSkin ); } } } and this is my main class: package { import com.rabcore.ui.skins.CustomTextInputSkin; import flash.display.Sprite; import qnx.ui.display.Image; import qnx.ui.skins.SkinAssets; import qnx.ui.text.TextInput; // The following metadata specifies the size and properties of the canvas that // this application should occupy on the BlackBerry PlayBook screen. [SWF(width="1024", height="600", backgroundColor="#cccccc", frameRate="30")] public class TextInputTest extends Sprite { public function TextInputTest() { var textInput:TextInput = new TextInput(); textInput.setSkin(CustomTextInputSkin); addChild(textInput); } } } all this is similar to what you found. i went back to the video you also posted. now the swc file he imported was his PNG files that he embedded into class using Flash Pro. (They didn't show that part... its funny how they skip over the important parts.) what they are doing here skin = new BkgInput(); what they are doing is getting their embedded class with the PNG and setting as a display object that can be used to skin what ever it is that you are skinning (in our case the TextInput object.) you can use this as a reference for embedded files:- if you look at the code i posted you'll notice im using the default skin files that RIM provided us. i tested it out and the output is a little weird but aside from the placement of hte background, it works. so if we can embed files like they do we will in essence be able to skin everything we want in the same manner. so basically create your images and save them through Flash Pro or embed your files using the code in the link and you can theoretically begin skinning. im not done with all this yet. ill continue going at it and report back. good luck! 11-29-2010 06:14 PM JRab, thanks for your reply. Good news: That's exactly right. The flow seems to be: In the class class from step 5, I had the asset from the swc defined as a DisplayObject, but as soon as I switched it to type Sprite, like in your example, it started working. Bad news: 11-29-2010 06:47 PM 12-02-2010 01:26 PM This is the code you are looking for to do images with slice 9 scaling. The trick is to provide scaleGrid values in the Embed metadata. You can also do slice 9 grids in Flash Pro too. package com.renaun.qnx { import flash.display.Sprite; import qnx.ui.skins.SkinStates; import qnx.ui.skins.text.TextInputSkin; public class SimpleCustomTextInputSkin extends TextInputSkin { [Embed(source="/assets/OddShapeSkin.png", scaleGridTop="14", scaleGridBottom="15", scaleGridLeft="18", scaleGridRight="22")] private var OddShapeSkin:Class; [Embed(source="/assets/OddShapeSkinFocus.png", scaleGridTop="14", scaleGridBottom="15", scaleGridLeft="18", scaleGridRight="22")] private var OddShapeSkinFocus:Class; protected var skin1 prite; protected var skin2 prite; override protected function initializeStates():void { super.initializeStates(); skin1 = new OddShapeSkin(); skin2 = new OddShapeSkinFocus(); setSkinState(SkinStates.UP, skin1); setSkinState(SkinStates.DOWN, skin1); setSkinState(SkinStates.FOCUS, skin2); showSkin(skin1); } } } 12-02-2010 02:33 PM 12-20-2010 11:55 AM There are two ways to share data between a Flex 4 Spark component and its skin: you can either pull the data from the component into the skin or you can push the data to the skin from the component. It’s a subtle difference, but the latter approach is recommended because it does not rely on data binding, and it promotes encapsulation.
https://supportforums.blackberry.com/t5/Adobe-AIR-Development/How-do-I-skin-a-TextInput-component/m-p/697915
CC-MAIN-2016-30
refinedweb
1,056
58.08
This add-on is operated by Alpine Shark, LLC Proxy Your API Calls to Stop Sharing IP Quotas QuotaGuard Last updated 12 December 2015 Table of Contents QuotaGuard is an add-on for proxying API requests so they don’t originate from Heroku IP addresses. Services like Google Maps Geocoding will now work as if you had your own dedicated server with dedicated IP address. QuotaGuard is accessible as an HTTP Proxy so is language and platform agnostic. There is native support across Ruby, Python, Node.js, Scala, Java and every other mainstream language. Provisioning the add-on QuotaGuard can be attached to a Heroku application via the CLI: $ heroku addons:create quotaguard:starter -----> Adding quotaguard:starter to sharp-mountain-4005... done, v18 (free) Once QuotaGuard has been added a QUOTAGUARD_URL setting will be available in the app configuration and will contain the full URL you should use to proxy your API requests. This can be confirmed using the heroku config:get command. $ heroku config:get QUOTAGUARD_URL After installing QuotaGuard the application should be configured to fully integrate with the add-on.ARD QUOTAGUARD_URL value retrieved from heroku config to your .env file. $ heroku config -s | grep QUOTAGUARD_URL >> .env $ more .env Credentials and other sensitive configuration values should not be committed to source-control. In Git exclude the .env file with: echo .env >> .gitignore. For more information, see the Heroku Local article. Using with Rails Geocoding is the most common usage for QuotaGuard so this tutorial will focus on that use case. To add geocoding to your Rails project we recommend the Geocoder gem. Once you have completed the standard setup of Ruby Geocoder you can use QuotaGuard by adding the following to your geocoder initializer: # config/initializers/geocoder.rb Geocoder.configure( ... :http_proxy => ENV['QUOTAGUARD_URL'], :timeout => 5 ) All geocoding requests will now go via QuotaGuard automatically. Using with Python/Django There are many geocoding libraries available for Python but the most used is geopy which uses urllib2 environment variables to set a proxy service. In your application initialization you should set the http_proxy variable to match the QUOTAGUARD_URL. If using Geopy you also need to force it to use the http version of Google’s API, not https by passing in scheme="http" to the Geocoder constructor. # Assign QuotaGuard to your environment's http_proxy variable import os from geopy import geocoders os.environ['http_proxy'] = os.environ['QUOTAGUARD_URL'] g = geocoders.GoogleV3(scheme="http") place, (lat, lng) = g.geocode("10900 Euclid Ave in Cleveland") print "%s: %.5f, %.5f" % (place, lat, lng) Testing in the Python interpreter This code will check the IP your requests originate from with and without using the QuotaGuard proxy. If the IP addresses are different then you are successfully routing requests through QuotaGuard. import urllib2 import os url = '' heroku_ip_request = urllib2.urlopen(url) print "Heroku IP:" heroku_ip_response = heroku_ip_request.read() print heroku_ip_response os.environ['http_proxy'] = os.environ['QUOTAGUARD_URL'] proxy = urllib2.ProxyHandler() opener = urllib2.build_opener(proxy) in_ = opener.open(url) qg_response = in_.read() print "QuotaGuard IP:" print qg_response if heroku_ip_response != qg_response: print "SUCCESS! The IP addresses are different so everything is working!" else: print "SOMETHING WENT WRONG. The IP addresses are the same. Are you sure you have a QUOTAGUARD_URL environment variable set?" Using with Node.js Accessing an HTTP API with Node.js To access an HTTP API you can use the standard HTTP library in Node.js); }); Accessing an HTTPS API with Node.js The standard Node.js HTTPS module does not handle making requests through a proxy very well. If you need to access an HTTPS API we recommend using the Request module (npm install request). Please note accessing an HTTPS endpoint requires our Enterprise plan. var request = require('request'); var options = { proxy: process.env.QUOTAGUARD_URL, url: '', headers: { 'User-Agent': 'node.js' } }; function callback(error, response, body) { if (!error && response.statusCode == 200) { console.log(body); } } request(options, callback); Using with PHP PHP cURL is the easiest way to make HTTP requests via a proxy. This Geocoding example assumes that you have set the QUOTAGUARD_URL environment variable. <?php function lookup($string){ $quotaguard_env = getenv("QUOTAGUARD_URL"); $quotaguard = parse_url($quotaguard_env); $proxyUrl = $quotaguard['host'].":".$quotaguard['port']; $proxyAuth = $quotaguard['user'].":".$quotaguard['pass']; $string = str_replace (" ", "+", urlencode($string)); $details_url = "".$string."&sensor=false"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $details_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_PROXY, $proxyUrl); curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyAuth); $response = json_decode(curl_exec($ch), true); // If Status Code is ZERO_RESULTS, OVER_QUERY_LIMIT, REQUEST_DENIED or INVALID_REQUEST if ($response['status'] != 'OK') { return null; } print_r($response); $geometry = $response['results'][0]['geometry']; $longitude = $geometry['location']['lng']; $latitude = $geometry['location']['lat']; $array = array( 'latitude' => $latitude, 'longitude' => $longitude, 'location_type' => $geometry['location_type'], ); return $array; } $city = 'San Francisco, USA'; $array = lookup($city); print_r($array); ?> Monitoring & logging Real-time and historical usage stats can be displayed on the QuotaGuard Dashboard accessible from your Heroku Dashboard. Dashboard The QuotaGuard dashboard allows you to view your real-time and historical usage of every API. The dashboard can be accessed via the CLI: $ heroku addons:open quotaguard Opening quotaguard for sharp-mountain-4005... or by visiting the Heroku apps web interface and selecting the application in question. Select QuotaGuard from the Add-ons menu. Troubleshooting Once you pass your plan limit you will receive a response including the message status: "PROXY_OVER_QUERY_LIMIT" This will resolve itself at the end of the 24 hour period. You may also receive this message if you send excessive requests to rate-throttled services like Google Maps in a short period of time. If you see this message and believe you have not reached your limit raise a support ticket. HTTP vs HTTPS HTTPS access is limited to our Enterprise plan. If you are accessing Google Maps you have the choice to use the HTTP or HTTPS endpoint so upgrading is not necessary unless you want to secure all requests between your app and the Google API. Static IP Address If you require a static IP address we have an alternative service called QuotaGuard Static available from (QuotaGuard Static Add-ons page)[]. Migrating between plans Application owners can migrate at any time with no interruption to your service. Your new limits/features will take effect immediately. Use the heroku addons:upgrade command to migrate to a new plan. $ heroku addons:upgrade quotaguard:enterprise -----> Upgrading quotaguard:enterprise to sharp-mountain-4005... done, v18 ($20/mo) Your plan has been updated to: quotaguard:enterprise Removing the add-on QuotaGuard can be removed via the CLI. This will destroy all associated data and cannot be undone! $ heroku addons:destroy quotaguard -----> Removing quotaguard from sharp-mountain-4005... done, v20 (free) Support All QuotaGuard support and runtime issues should be submitted via the Heroku Support channels. Any non-support related issues or product feedback is welcome at support@quotaguard.com or by visiting QuotaGuard.com.
https://devcenter.heroku.com/articles/quotaguard
CC-MAIN-2016-18
refinedweb
1,119
50.43
Want to see the full-length video right now for free? You can download a cheat sheet and install instructions for all of the tools shown in this video. In the first half of this tutorial, we'll learn about a couple of commands that let us quickly jump to files by name. In the second half, I'll demonstrate how to set up your environment to get the most out of these two commands. gfcan do Here I've got the source code for appraisal, which is an open source project from thoughtbot. tree lib Appraisal follows the standard conventions for laying out a rubygem: the lib directory contains contains both a file and a folder named after the project. Let's crack open the lib/appraisal.rb file. This is our entry point to the library, and we can read it like a table of contents. Watch this: if I place Vim's cursor on a reference to another file, I can jump to the filename under the cursor using the gf mapping. It's almost like clicking a hyperlink on a web page! Each time I use the gf command, Vim records my location in the jumplist. I can go back to where I came from with the ctrl-o mapping. To extend the web browser analogy: gf is like clicking a link, and <C-o> is like pressing the back button. Each of the files that are prefixed in the appraisal namespace belong to the current project. But here you see that this project is requiring a module from a 3rd party library: The gf mapping works here too: it opens the specified file from the rake library. [FIXME: actually, gf opens rake from standard library, 2gf opens bundled rake.] Let's back up with ctrl-o, then dive a little deeper into the appraisal project using gf each time. This file requires the fileutils module, which is part of the ruby standard library. Once again, if I use the gf command it goes straight to the specified file. The gf mapping is complemented by the :find Ex command. For example, if I run: :find fileutils Vim jumps to the specified module, just the same as if I had placed my cursor on the word fileutils and used the gf mapping. One nice feature of the :find command is that it hooks in to Vim's tab-completion behaviour. For example, if I type "find appraisal-slash" then press control-dee: :find appraisal/<C-d> the <C-d> mapping reveals a list of all the ways this command-line could be completed. Pressing the <Tab> key cycles through the list of suggestions. If you are familiar with rails.vim, you may already be accustomed to using commands such as :Econtroller, :Emodel, :Eview, and so on. Under the hood, these commands invoke Vim's built-in :find command, but they focus their search on a subdirectory of your rails app. I LOVE those commands, and prefer using them to using fuzzy-file plugins when possible. For more details, look up :h rails-type-navigation Let's strip everything down to the basics, by launching Vim with a minimal vimrc: vim -u minimal-vimrc -o lib/appraisal.rb minimal-vimrc -utells vim to use the specified file as a vimrc -ocauses the other specified files to be open in split windows The top split contains the ruby source code, and the bottom split contains the minimal vimrc file: As well as disabling Vi compatibility mode, I've disabled plugins so as to turn off some functionality that comes built-in. This is just for demonstration purposes. We'll add that functionality again later. Now watch what happens if I try and use the gf command. We get an error message: Can't find file "..." in path That seems to offer a hint: maybe if we configure the path option, then Vim will be able to find the specified file. But actually, that won't help in this case. The problem is that Vim is looking for a file called appraisal/version - that is, a file with no extension. Here's a quick-and-dirty fix: we can change the require statement to include the .rb suffix. Save the change, and now the gf command works just fine. That's valid ruby, but it's not idiomatic. If we were to submit this as a patch to an open-source project, it would likely get rejected. As a general rule: your source code should leave no clues as to which text editor was used to author it. We can do better than this. Let's revert those changes. Instead, we'll configure the suffixesadd setting: :h suffixesadd This instructs Vim to try appending a file extension to the text under the cursor when the gf mapping is invoked. Adding .rb to the list of suffixes should do the trick: :set suffixesadd+=.rb Now we can use the gf command. That's a much neater solution than changing the source code. Configuring the suffixesadd option by hand in this manner has a side-effect. Watch this: if we create a new file with a different filetype, (JavaScript in this case): :new example.js It uses the same value for suffixesadd as we set for the ruby files. :set suffixesadd? suffixesadd=.rb That's not going to be very helpful when working with javascript. Instead of setting the option globally by hand, we'll use an autocommand to set the suffixesadd option locally for each buffer containing ruby code. In this snippet of Vimscript: augroup rubypath autocmd! autocmd FileType ruby setlocal suffixesadd+=.rb augroup END The setlocal command scopes the command to the current buffer. The autocommand triggers this setting each time we open (or create) a ruby file. But if we create a JavaScript file the autocommand will not apply. Of course, we could use a similar technique to configure Vim in a way that would be useful for JavaScript files, as well as other filetypes too. Having saved those changes to our minimal-vimrc, let's quit and restart Vim. The gf command works in our ruby file, because the suffixesadd option includes the .rb extension, but if I create a JavaScript file, the suffixesadd setting is unaffected. Nice one! We'll use this pattern again to apply local settings to ruby files. Configuring the suffixesadd option makes the gf mapping work for the require statements in the lib/appraisal.rb file, but it turns out that's a bit of a fluke. The gf command still doesn't work for the require statements in other files. Once again, we're getting the error message: Can't find file "..." in path Now let's dig in to that path setting and see what's going on. We can inspect it by running: :set path? path=.,/usr/include,, That reveals a comma separated list containing three items. I've created a custom command :Path (with a big P): :Path that lists the paths one per line, which is a little easier to read. /usr/includedirectory, and When we invoke the gf command, Vim searches each of these locations for a file who's path matches the text under the cursor. If successful, Vim opens the file at that path. Otherwise it displays an error message. Let's walk through the hit and miss scenarios we've just witnessed. First, we opened the file lib/appraisal.rb and invoked the gf mapping on the appraisal/task string. Current file: lib/appraisal.rb <cWORD>: appraisal/task Vim searches for the filepath appraisal/task.rb in each of the locations specified in the path option. It starts by looking relative to the directory of the current file (CFD - current file directory): '.' - CFD ./lib/ appraisal/task.rb First time lucky! Vim opens the matching file at lib/appraisal/task.rb. Now we're in a different context: the path of the current file becomes: lib/appraisal. Here's what happens when we invoke gf on the appraisal/file string: Current file: lib/appraisal/task.rb <cWORD>: appraisal/file First, Vim searches relative to the directory of the current file (CFD): '.' - CFD ./lib/appraisal/ appraisal/task.rb Finding no match, Vim then looks in the /usr/include directory: 'usr/include' /usr/include/ appraisal/task.rb Finally, Vim looks relative to the current working directory: '' - cwd ./ appraisal/task.rb Having run out of paths to search, Vim shows an error message. We could fix this by adding the lib directory to Vim's path. That should match any of the files in the appraisal project, regardless of what the current file directory is. [pause] Let's do it! We'll use an autocommand to add the lib directory to Vim's path when working on ruby files: autocmd FileType ruby setlocal path+=lib We'll save those changes to our minimal-vimrc and relaunch Vim. We can now use the gf command on any require statements that reference local files. Pretty neat! But the gf command still doesn't work on require statements that reference third party code, such as the rake gem, or modules from the standard library, such as fileutils. Let's look at how to fix those, one by one. At present, the gf command fails when invoked on the string rake/tasklib. We should be able to fix that by updating our path to reference the lib directory of the bundled rake gem. [suspend Vim: ctrl-z] The bundle show command can reveal the path where a gem has been installed: bundle show rake /Users/drew/.rvm/gems/ruby-1.9.3-p374/gems/rake-10.1.0 If we inspect the lib directory within, we should find the tasklib file that was referenced in our code: tree /Users/drew/.rvm/gems/ruby-1.9.3-p374/gems/rake-10.1.0/lib ├── rake │ ... │ ├── tasklib.rb │ ├── testtask.rb │ ... └── rake.rb [foreground Vim: fg] Once again, we'll use an autocommand to add this directory to Vim's path setting: autocmd FileType ruby setlocal path+=/Users/drew/.rvm/gems/ruby-1.9.3-p374/gems/rake-10.1.0/lib We'll save those changes to our minimal-vimrc and relaunch Vim. This time, when we run gf on the string rake/tasklib it takes us straight to the file in the bundled gem. [suspend Vim: ctrl-z] Now we can use Vim's gf mapping on any statement that requires a module from the rake library. But this project bundles over a dozen other rubygems: bundle show --paths If we added to Vim's path the lib directory for each of these, then we could dive into the code of all bundled gems using the gf and :find commands. The gf command still doesn't work on modules from the standard library. Let's fix that! [suspend Vim: ctrl-z] We can inspect Ruby's loadpath by running this one-liner: ruby -e 'puts $LOAD_PATH' /Users/drew/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1 /Users/drew/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/x86_64-darwin12.2.1 /Users/drew/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby /Users/drew/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/vendor_ruby/1.9.1 /Users/drew/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/vendor_ruby/1.9.1/x86_64-darwin12.2.1 /Users/drew/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/vendor_ruby /Users/drew/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1 /Users/drew/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/x86_64-darwin12.2.1 [Note: $: is a shorthand for $LOAD_PATH] If we were to add each of these directories to Vim's path, then the gf command should be able to dive into all modules in the standard library. I happen to know that the file we're looking for is in the ruby/1.9.1 directory. [foreground Vim: fg] So let's add that directory to our path: autocmd FileType ruby setlocal path+=/Users/drew/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1 Save our minimal-vimrc and restart Vim... Now the gf command can successfully locate the fileutils module. Hurray! gftarget to include require Watch this: if I use the gf command on the word require, Vim attempts to locate a file called require.rb. To open the file that's actually being required, we have to position the cursor on top of the filepath. It's not a big deal, but it would be handy if the gf command went to the referenced file when invoked from the start of the line. pathautomatically Our autocommands configure Vim's path option for ruby files in this project, but we'll need a more flexible approach to manage Vim's path for multiple projects. Let's fire up Vim again, without using the minimal-vimrc: vim -o lib/appraisal.rb minimal-vimrc Now we're using my personal Vim configuration, which includes a few plugins that I'd recommend to all rubyists: The vim-ruby plugin automatically configures the path setting to include each of the directories listed in ruby's $LOAD_PATH. :Path Even if you haven't installed any plugins, you probably already have vim-ruby, because it's included in the standard Vim distribution. Even so, I'd recommend installing it by hand to ensure you get the most up to date version. The vim-ruby plugin includes an enhancement for the gf command. I can now position the cursor on the require keyword, and gf behaves as though the cursor were positioned on the required filepath. That's a bit more useful than the default behavior, which was to attempt to locate a file called require.rb. The vim-bundler plugin automatically configures the path setting to include the lib directory for each gem referenced in your Gemfile. :Path The vim-rake plugin automatically configures the path setting to include the lib directory for libraries that follow the conventional layout of a rubygem. It's smart about configuring each buffer's path relative to its own codebase, so you can interact with more than one library at once: appraisal/task.rband rake/tasklib.rb(use bundled gem, not stdlib rake) These 3 plugins work together to ensure that Vim's path includes all of the directories that your ruby project knows about. If you work with rails, then Tim Pope's rails.vim should be high on your list of essential plugins. This plugin automatically configures your path to include the directories that make up a conventional rails app. (I encourage you to explore it for yourself!) For more details, check out thoughtbot's Vim for Rails Developers screencast. A handful of popular ruby libraries, such as minitest and rake, may be included in your ruby distribution. If you prefer to bundle these gems, so as to get a more up to date version of them, then you may have to take extra care when using the gf and :find commands, because both versions of the library will appear in your path. [open lib/appraisal/task.rb in two split windows] Watch this: in this first split, I'll use gf. Now I'm going to switch to the other split and use the mapping 2gf. That tells Vim to skip the first match and jump to the second one instead. At a glance, these two buffers look identical, but each one has a different filepath. The first is from the ruby distribution, and the second is from the bundled gem. In each window, if we look up the version: :windo find rake/version We'll see that the bundled gem is more recent. Let's back up through the jumplist until we get back to where we started. Inspecting the path, you'll see that the core libraries appear earlier in the list than the bundled gems. That's why plain gf (without the count) goes to the older version of rake. In this context, we need to use 2gf to jump to the bundled version of rake. That's worth watching out for, as it could lead to confusion! Compared with rails.vim, the feature list for bundler.vim is quite brief. Blink, and you could miss the bullet point saying that: 'path' and 'tags' are automatically altered to include all gems from your bundle We'll learn more about the tags option in the final part of this series. But I hope that this video has convinced you that having your path properly configured makes a big difference, and this actually a killer-feature of bundler.vim!
https://thoughtbot.com/upcase/videos/navigation-between-ruby-files
CC-MAIN-2019-13
refinedweb
2,802
71.95
Hey everyone. As always I'm sorry for my noobness when it comes to java, but I got a question I can't seem to find answered anywhere else on the web. I'm trying to make a simple program that takes whatever number the user types in, and makes a linked linked with the # of random numbers that the user typed. So if the user types 5: you could get 100 26 89 23 54 import java.util.*; import java.io.IOException; import java.util.Scanner; public class LinkedListProgram { public static void main(String[] args) throws IOException { int i,number; Scanner sc = new Scanner(System.in); LinkedList<String> list = new LinkedList<String>(); ListIterator li; String line; System.out.println("Enter # of nodes"); number = sc.nextInt(); if (number > 0) { while (i = 0; i <= number; i++) } else { System.out.println("\nnumber is less than 0\n"); } } } I'm not sure how you place numbers into a linkedlist though. I got the while statement down, but idk what to put in it that will make the linked list work as I specified. Any help or tips are greatly appreciated.
https://www.daniweb.com/programming/software-development/threads/421787/inserting-numbers-into-a-linkedlist
CC-MAIN-2018-13
refinedweb
187
73.27
This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project. Daniel Berlin wrote: > Subject: > > Re: C++ debugging progress > From: > > Daniel Berlin <dan@cgsoftware.com> > Date: > > Wed, 28 Nov 2001 02:43:43 -0500 (EST) > > To: > > Daniel Jacobowitz <drow@mvista.com> > CC: > > <libstdc++@gcc.gnu.org>, <gdb@sources.redhat.com> > > > >On Wed, 28 Nov 2001, Daniel Jacobowitz wrote: > >>> For the curious, I've gotten all but two of the virtual function tests to >>> pass in virtfuncs.exp. I'm not entirely sure what's wrong with one of the >>> others, and the other goes up as far as the parser (pEe->D::fd() yields >>> "attempt to take address of value not in memory"). There's also a bunch of >>> namespace problems, of course. >>> >>>. > This would also be unfortunate for Mozilla, which compiles -fno-rtti. Debugging Mozilla using gdb is already extremely memory intensive, and being required to use RTTI would make it even worse. :-/ Dan
https://www.sourceware.org/ml/gdb/2001-11/msg00321.html
CC-MAIN-2019-39
refinedweb
161
65.93
OCJP Practice Papers - Java Basics OCJP Practice Papers - Java Basics : Covers all the basic questions Which of the following method signatures is a valid declaration of an entry point in aJava application? A. public void main(String[] args) B. public static void main() C. private static void start(String[] mydata) D. public static final void main(String[] mydata) The following class diagram demonstrates the relationship between Gold and Silver,which extend the Metal class. Assume the attributes are all declared public. Whichstatement about the diagram is not true? A.The diagram demonstrates platform independence in Java. B. The diagram demonstrates object-oriented design in Java. C. The Gold and Silver classes inherit weight and color attributes from the Metalclass. D. Gold does not inherit the luster attribute. What is the proper filename extension for a Java bytecode compiled file? A. .java B. .bytecode C. .class D. .dll Given that a Date class exists in both the java.util and java.sql packages, what is theresult of compiling the following class? import java.util.*; import java.sql.*; public class BirthdayManager { private Date rob = new Date(); private java.util.Date sharon = new java.util.Date(); } A. The code does not compile because of lines 1 and 2. B. The code does not compile because of line 4. C. The code does not compile because of line 5. D. The code compiles without issue. Which of the following is not a facet of traditional object-oriented programminglanguages? A. Objects are grouped as procedures, separate from the data they act on. B. An object can take many forms via casting. C. An object can hold data, referred to as attributes. D. An object can perform actions, via methods. Which variables have a scope limited to a method? A. Interface variables B. Class variables C. Instance variables D. Local variables Which package is imported into every Java class by default? A. java.util B. java.lang C. system.lang D. java.system Which of the following is not a valid code comment in Java? A. // Add 5 to the result B. /*** TODO: Fix bug 12312 ***/ C. # Add configuration value D. /* Read file from system ****/ Which statement about a valid .java file is true? A. It can only contain one class declaration. B. It can contain one public class declaration and one public interface definition. C. It must define at least one public class. D. It may define at most one public class. Given the following application, fill in the missing values in the table starting from thetop and going downward. A. 2, 0, 1 B. 2, 2, 1 C. 1, 0, 1 D. 0, 2, 1 Which statement about import statements is true? A. The class will not compile if it contains unused import statements. B. Unused import statements can be removed from the class without causing a classto become unable to be compiled. C. The class will not compile if a duplicate import statement is present. D. If a class contains an import statement for a class used in the program that cannotbe found, it can still compile. What is the result of compiling and executing the following class? 1: public class ParkRanger { 2: int birds = 10; 3: public static void main(String[] data) { 4: int trees = 5; 5: System.out.print(trees+birds); 6: } 7: } A. It does not compile. B. It compiles but throws an exception at runtime. C. It compiles and outputs 5. D. It compiles and outputs 15. Which statements about Java are true? I. The java command can execute .java and .class files. II. Java is not object oriented. III. The javac command compiles directly into native machine code. A. I only B. III only C. II and III D. None are true. Which of the following lines of code is not allowed as the first line of a Java class file? A. import widget.*; B. // Widget Manager C. package sprockets; D. int facilityNumber; Which one of the following statements is true about using packages to organize yourcode in Java? A. Every class is required to include a package declaration. B. To create a new package, you need to add a package.init file to the directory. C. Packages allow you to limit access to classes, methods, or data from classes outsidethe package. D. It is not possible to restrict access to objects and methods within a package. Given that the current directory is /user/home, with an application Java file in/user/home/Manager.java that uses the default package, which are the correctcommands to compile and run the application in Java? A. javac Manager java Manager B. javac Manager.java java Manager C. javac Manager java Manager.class D. javac Manager.java java Manager.class Structuring a Java class such that only methods within the class can access itsinstance variables is referred to as _______. A. platform independence B. object orientation C. inheritance D. encapsulation What is the output of the following code snippet? String tree = "pine"; int count = 0; if (tree.equals("pine")) { int height = 55; count = count + 1; }System.out.print(height + count); A. 1 B. 55 C. 56 D. It does not compile. Which of the following is true of a Java bytecode file? A. It can be run on any computer with a compatible JVM. B. It can only be executed on the same type of computer that it was created on. C. It can be easily read and modified in a standard text editor. D. It requires the corresponding .java that created it to execute. What is the correct character for terminating a statement in Java? A. A colon (:) B. An end-of-line character C. A tab character D. A semicolon (;): } A. The code does not compile due to line 6. B. The code does not compile due to line 7. C. 31 D. 61 Given the following class definition, which is the only line that does not contain acompilation error? 1: public ThisClassDoesNotCompile { 2: double int count; 3: void errors() {} 4: static void private limit; } A. Line 1 B. Line 2 C. Line 3 D. Line 4 Which of the following features allows a Java class to be run on a wide variety ofcomputers and devices? A. Encapsulation B. Object oriented C. Inheritance D. Platform independence Which of the following is not a property of a JVM? A. It prevents Java bytecode from being easily decoded/decompiled. B. It supports platform independence. C. It manages memory for the application. D. It translates Java instructions to machine instructions. Which of the following variables are always in scope for the entire program? A. Package variables B. Class variables C. Instance variables D. Local variables Given the following wildcard import statements, which class would be included in theimport? import television.actor.*; import movie.director.*; A. television.actor.recurring.Marie B. movie.directors.John C. television.actor.Package D. movie.NewRelease Which is the correct order of statements for a Java class file? A. import statements, package statement, class declaration B. package statement, class declaration, import statement C. class declaration, import statements, package declaration D. package statement, import statements, class declaration Given the following class definition, what is the maximum number of importstatements) {} } A. Zero B. One C. Two D. Three Given the following class definition, which command will cause the application tooutput the message White-tailed? package forest; public class Deer { public static void main(String... deerParams) { System.out.print(theInput[2]); } } A. java forest.Deer deer 5 "White-tailed deer" B. java forest.Deer "White-tailed deer" deer 3 C. java forest.Deer Red deer White-tailed deer D. java forest.Deer My "deer White-tailed" Which of the following is a true statement? A. The java command compiles a .java file into a .class file. B. The javac command compiles a .java file into a .class file. C. The java command compiles a .class file into a .java file. D. The javac command compiles a .class file into a .java file. Which of the following statements about Java is true? A. Java is a procedural programming language. B. Java allows method overloading. C. Java allows operator overloading. D. Java allows direct access to objects in memory. Given the following code, what values inserted in order into the blank lines, allow thecode to compile? _______agent; public _______Banker { private static _______getMaxWithdrawal() { return 10; } } A. import, class, null B. import, interface, void C. package, int, int D. package, class,); } } A. 2 5 B. 8 5 C. 6 5 D. The code does not compile. What is one of the most important reasons that Java supports extending classes viainheritance? A. Inheritance requires that a class that extends another class be in the same package. B. The program must spend extra time/resources at runtime jumping through multiple layers of inheritance to determine precise methods and variables. C. Method signature changes in parent classes may break subclasses that use overloaded methods. D. Developers minimize duplicate code in new classes by sharing code in a common parent class. Which of the following is a valid code comment in Java? A. //////// Walk my dog B. #! Go team! C. / Process fails at runtime / D. None of the above Which of the following method signatures is not a valid declaration of an entry pointin a Java application? A. public static void main(String... arguments) B. public static void main(String arguments) C. public static final void main(String[] arguments) D. public static void main(String[] arguments) Given the file Magnet.java below, which of the marked lines can you independently insert the line public String color; into and still have the code compile? // line a1 public class Magnet { // line a2 public void attach() { // line a3 } // line a4 } A. a1 and a3 B. a2 and a4 C. a2, a3, and a4 D. a1, a2, a3, and a4 What is required to define a valid Java class file? A. A class declaration B. A package statement C. At least one import statement D. The public modifier What is the proper filename extension for a Java source file? A. .jav B. .class C. .source D. .java: } A. The code does not compile because of line 2. B. The code does not compile because of line 3. C. The code does not compile because of line 6. D. The code compiles without issue. Given a class that uses the following import statements, which class would not beautomatically accessible within the class without using its full package name? import dog.*; import dog.puppy.*; A. dog.puppy.female.KC B. dog.puppy.Georgette C. dog.Webby D. java.lang.Object ._______is the technique of structuring programming data as a unit consisting ofattributes, with actions defined on the unit. A. Encapsulation B. Object orientation C. Platform independence D. Polymorphism Given the following class definition, what is the maximum number of importstatements that can be discarded and still have the code compile? For this question, assume that the Broccoli class is in the food.vegetables package, and the Apple classis the food.fruit package. package food; import food.vegetables.*; import food.fruit.*; import java.util.Date; public class Grocery { Apple a; Broccoli b; Date c; } A. 0 B. 1 C. 2 D. 3 Given the following application, what is the expected output? public class Keyboard { private boolean numLock = true; static boolean capLock = false; public static void main(String... shortcuts) { System.out.print(numLock+" "+capLock); } } A. true false B. false false C. It does not compile. D. It compiles but throws an exception at runtime.); } } A. The code does not compile. B. 5 C. 10 D. 20 What is the result of compiling and executing the following class? package sports; public class Bicycle { String color = "red"; private void printColor(String color) { color = "purple"; System.out.print(color); } public static void main(String[] rider) { new Bicycle().printColor("blue"); } } A. red B. purple C. blue D. It does not compile. Which statements about calling the compilation command javac and the execution command java are true? I. java may use a period . to separate packages. II. javac takes a .java file and returns a .class file. III. java may use a slash (/) to separate packages. A. I only B. II only C. I and II D. I, II, and III What is the result of compiling and executing the following application? package forecast; public class Weather { private static boolean heatWave = true; public static void main() { boolean heatWave = false; System.out.print(heatWave); } } A. true B. false C. It does not compile. D. It compiles but throws an error at runtime. Given the following class diagram, which Java implementation most closely matchesthis structure? A. public class Book { public int numOfPages; B. public class Book { public String getRating() {return null;} } C. public class Book { public int numberOfPages; public String getRating() {return null;} } D. public class Book { void numberOfPages; } A. The JVM schedules garbage collection on a predictable schedule. B. The JVM ensures that the application will always terminate. C. The JVM requires a properly defined entry point method to execute theapplication. D. A Java compiled code can be run on any computer. All OCJP Java Certification Tutorials - Oracle (OCJP) Java Certification Exam - Java Building Blocks Java 8 Certification - Operators And Statements - Java Core API - Java Class Design - Java Exception - Java Try-Catch Block - Exceptional Handling in Java - Common Exception in Java OCJP Practice Test, Certification Path, Tips/Tricks - Oracle (OCJP) Java Certification Exam - Java Certification Tips And Tricks - OCJP Practice Papers - Java Basics - OCJP Practice Papers - Operators And Decision Constructs - OCJP Practice Papers-A Advanced Java Class Design - OCJP Practice Papers Creating And Using Arrays - OCJP Practice Papers Using Loop Constructs - OCJP Practice Papers - Generics And Collections - OCJP Practice Papers - Lambda Built-In Functional Interfaces - OCJP Practice Papers Java Class Design - OCJP Practice Papers - Java Stream API - OCJP Practice Papers - Exceptions And Assertions - OCJP Practice Papers - Date/Time API - OCJP Practice Papers - Java I/O Fundamentals - OCJP Practice Papers - Working With Methods And Encapsulation - OCJP Practice Papers - Working With Inheritance - OCJP Practice Papers - Handling Exceptions - OCJP Practice Papers - Selected Classes From Java API - OCJP Practice Papers - Java File I/O Nio.2 - OCJP Practice Papers - Java Concurrency
http://toppertips.com/ocjp-practice-papers-java-basics
CC-MAIN-2020-40
refinedweb
2,353
61.33
BBC micro:bit Reed Switch Introduction A reed switch is a switch that is actuated by the presence of a magnetic field. When you bring a magnet close to the switch, you do the equivalent of pressing a button. Depending on the exact reed switch you are using, the switch is either opened or closed when the magnet is introduced. A reed switch can be used just like you would a button, making it quite a simple component to work with. Circuit Here are the basic connections you need to use the reed switch, The resistor in the image is a 10KOhm pulldown resistor. This was my test version, without and then with the magnet near to the reed switch. Programming Your basic button code is going to work nicely here, from microbit import * while True: buttonState = pin0.read_digital() if buttonState==1: display.show(Image.YES) else: display.clear() sleep(20) Challenges - The reed switch is quite easy to use. Its main selling point is that it is contactless. You don't need to be touching the parts of the circuit to activate the switch. This means that you can place the swtich behind plastic, cardboard or glass and still make the switch work. This provides the basic for some magic-like behaviours. You could make a die that always comes out six if the magnet is there and random if not. - Place two reed switches in a line. Work out the exact positioning to make sure that your magnet activates them separately. You can now write a program to detect whether the switches both activated within a given time frame and if so, in what order. This allows you to detect whether a magnetic source is being swiped across the area that activates the switch and determine the direction. Set this up well and your two switches can record 5 different actions (left, right, swipe left, swipe right, both) if you have a magnet in each hand.
http://www.multiwingspan.co.uk/micro.php?page=reed
CC-MAIN-2019-09
refinedweb
328
72.26
tag:blogger.com,1999:blog-232339592014-10-02T00:53:14.884-04:00Medicated MoneyAfter being diagnosis with ‘Docitis,’ the medical condition of ‘one’s acquiring more and more debt!,’ my wife (28) and I (27) decided to begin a serious overhaul of our finances. This is our prescription to medicating our money, and curing our disease!Medicated Money MoneyThanks for stopping by Medicated Money! Unfortunately, if you are reading this here, then you may not know that we have moved! Come check us out at our brand, new site:<br /><br /><a href=""><span style="font-family:lucida grande;font-size:180%;">Medicated Money</span></a><span style="font-family:lucida grande;font-size:180%;"> </span><br /><p><span style="font-size:130%;"><span style="font-size:100%;"></span></span> </p>Medicated Money Damn Good Question<p>JLP over at <a href="" target="_blank" mce_href="">All Financial Matters</a> posted another great question of the day.<br />Should home equity be included in figuring net worth?</p><p>As some of you know, <a href="" target="_blank" mce_href="">I recently had a post</a>? </p><p><strong>This is posted on our old site! To read more, please come visit us at our new site: </strong><a href=""><strong></strong></a><strong>!</strong></p>Medicated Money's To You, Mr. EBay Buyer!Being in the medical field, Mrs. Medicated and I have spent a few Ben Franklins on books that we needed to study with while in school. While in school, we were just dating, not very financial savvy, and poor students living off student loans! We didn't spend much money, but we did spend a lot on different medical textbooks. We both needed to purchased the same books for the same classes to learn the same material. Why do I bring this up? Well, fast forward now years later and our bookshelf in the office is filled with medical book after medical book from top to bottom. <br /><br /><strong><em>This is posted on our old site! To read more, please come visit us at our new site: </em></strong><a href=""><strong><em></em></strong></a><strong><em>!</em></strong>Medicated Money Back To Work!We are happy to announce that Mrs. Medicated has found a job and is planning on starting this Monday. As you may remember, we moved from Texas to the Northeast so Mr. Medicated could take a new job. This job has been going extremely well. <br /><br /><strong><em>This is posted on our old site! To read more, please come visit us at our new site: </em></strong><a href=""><strong><em></em></strong></a><strong><em>!</em></strong>Medicated Money One’s Net Worth: Honey, What’s The Dog Worth?So, honestly, what should be included in one's net worth? Just the basics? How about everything and the kitchen sink? The reason I bring this up is that I love reading the net worth postings (like <a href="" target="_blank" mce_href="">here</a>, <a href="" target="_blank" mce_href="">here</a>, and <a href="" target="_blank" mce_href="">here</a>) that always come in at the beginning of the month. When we decided to start posting our net worth, we wanted it to represent not only our financial status, but a monthly reminder to get our ass in gear and clean up our financial mess. At least this is what I would tell <a href="" target="_blank" mce_href="">Scott if I was asked "why do you post your net worth?"</a> The thing is, the more and more I read, it seems like many people count everything when they calculate their net worth! However, Mrs. Medicated and I are a little different. We do not tally everything when it comes to our net worth. Why would we do that? Well, there are a couple of reasons, but let's first talk about what we do and don't count.<br /><br /><strong>This is posted on our old site! To read more, please come visit us at our new site: </strong><a href=""><strong></strong></a><strong>!</strong>Medicated Money Worth - September 2006After a rough hit to our Net Worth in the month of August, we were determined to make up the ground lost and then some. Our net worth this past month did extremely well due to 2 main factors.<br /><br />Instead of paying for unexpected expenses (not completely unexpected in knowing that we were going to move, but still cost more than expected), we were able to get back to paying down our debt and saving money.<br /><br />Even though I am the only one working (Mrs. Medicated starts her new job in 1 week, but more on that in a different post), we did receive extra pay from our old employee based on our PTO (paid time off) which off-set the fact that we received just one new check in the month of Sept.<br /><br />With that stated, let’s take a look at the numbers:<br /><br /><strong><em>This is posted on our old site! To read more, please come visit us at our new site: </em></strong><a href=""><strong><em></em></strong></a><strong><em>!</em></strong>Medicated Money Insurance: Unfortuanely Revisted<p><em>“You know, somebody actually complimented me on my driving today. They left a little note on the windshield that said ‘Parking Fine!’</em> -Tommy Cooper </p><p>With the move from Texas to Pennsylvania, we knew that we were heading into a increase in cost of living from one to the other, and we would need to adjust our monthly budget due to this. With that being said, we needed to switch our <a href="" target="_blank" mce_href="">Texas auto insurance</a> to a Pennsylvania policy to complete the registration of our cars. Needless to say, many people warned me to be ready when I saw the rates jump considerably between states.</p><p><strong><em>This is posted on our old site! To read more, please come visit us at our new site: </em></strong><a href=""><strong><em></em></strong></a><strong><em>!</em></strong></p>Medicated Money Price Of Higher EducationIn the latest version of CNN Money's <a href="" target="_blank" mce_href="">'Millionaires In The Making: The Marchbanks</a>,' a young couple very similar to Mrs. Medicated and I in age and salary are featured. To be honest, I love reading these articles as do many other pf bloggers. The Marchbanks are kicking ass and taking names with their financial status, and worth this, they should be commended for this (hence the article).<br /><br />If you are unfamiliar with this series, these articles are a nice little recap of people doing it right and how they do it. For the most part, it is the same basic pf advice stated by all. Yes, you know that one should save as much money as possible. Yes, you know on should max out retirement savings. And yes, you know I should own a home to get the equity created from home ownership. Very basic advice plus very basic financial commitment equals millionaire status, right? Wrong and here's why!<br /><br /><strong><em>This is posted on our old site! To read more, please come visit us at our new site: </em></strong><a href=""><strong><em></em></strong></a><strong><em>!</em></strong>Medicated Money La Vista, Car Loan #2This past week was another crazy week at work, and with that, we did not have the chance to get around to posting. Yet, riding on the <a href="" target="_blank" mce_href="">coattails of lamoneyguy</a>, we also have great news. We have finally finished paying off Car Loan #2. This car is Mrs. Medicated's car, and she swears that it has been driving different since we paid off the car. A little more smoother and comfortable!<br /><br /><strong>This is posted on our old site! To read more, please come visit us at our new site: </strong><a href=""><strong></strong></a><strong>!</strong>Medicated Money You Missing Something?After 3 weeks of working at my new job, I forgot about something very important. You see, at my last position, I was paid twice/month and only on certain days of the month. To be honest, it was definitely annoying at first, but after almost 4 years of it, it became so normal that I barely thought about it. I would know that money would be deposited in the account on these 2 days, and I knew to always check our accounts a few days before and then a day or two after. Well, one of these days came and went this week and with my mind still processing the normal routine, I did what I normally do on this particular day.<br /><br /><em><strong>This is posted on our old site! To read more, please come visit us at our new site: </strong></em><a href=""><em><strong></strong></em></a><em><strong>!</strong></em>Medicated Money Think I Just Heard Our Budget ScreamDo you ever have your budget set with everything in place and are doing so well by the middle of the month, and the next thing you know, the budget is blown to pieces from an unplanned event? Well, this weekend, we had one of those experiences!<br /><br /><em>This is posted on our old site! To read more, please come visit us at our new site: </em><a href=""><em></em></a><em>!</em>Medicated Money Over Our Retirement AccountsToday I completed the paperwork needed to complete our rollover to a IRA. We both our rolling over our 403(b) accounts as well as our Work-Retirement accounts into a IRA account.<br /><br /><em>This is posted on our old site! To read more, please come visit us at our new site: </em><a href=""><em></em></a><em>!</em>Medicated Money Are Moving!Well, after 6 months of blogging on Blogger.com, we have decided to make a change! We have enjoyed blogging so much; we decided to take it a step further! Unfortunately, here at Blogger.com, we felt that we were limited in everything that we wanted Medicated Money to be. Because of this, we are proud to announce that we have moved!<br /><br />Our new website is: <a href=""></a><br /><br />We are extremely excited about this new change and would love if you stop by and pay us a visit. After much hard work, we are finally up and running!<br /><br />So, with that, we would like to thank Blogger for hosting us, and look forward to continuing on at our new site, <a href=""></a>Medicated Money Retirement Plan<span style="font-size:85%;">With the start of my new job this week, I needed to attend 2 days of orientation. For the most part, it was your standard ‘this is how we do this’ orientation. I did my best to pay attention to all of the speakers, but to be honest, after a couple of hours of hearing about hospital protocols and procedures, I was lucky I didn’t fall asleep. I did perk up though when retirements and benefits were discussed.<br /><br />Overall, I am both happy and disappointed with my new company’s plan. They offer a 4% base plan and a 50% matching plan on employee money contributed up to 5% of your salary. On the whole, one can receive up to 6.5% of their salary from the institution. The bad news is that you become eligible for these plans after one year.<br /><br />Due to the one year waiting period for enrollment, we have decided to not make any retirement contributions in the 1st year of employment. We plan on completing our debt repayment plan, and then banking enough money for a down payment on a house. As for the wife, she is currently still looking for a position. We hope that after a very good interview this week, she will have a job offer early next week. If that stands true, her position does offer a 3% matching rate on contributions to a 401(k) that starts immediately. We definitely would take advantage of this offer and contribute just 3% and put the rest of her salary to the plans already mentioned.</span>Medicated Money For August 2006<span style="font-size:85%;">I think for the record I am going to just erase the month of August 2006 from my memory. Not only did we get killed from the expense of the move, but our general expenses were out of control. But you have that monthly budget, right? Well, the monthly budget was put through the ringer because we didn’t even come close to staying on budget. Here are the numbers:</span> <p><span style="font-size:85%;"></span></p><p><span style="font-size:85%;"><a href=""><img style="CURSOR: hand" alt="" src="" border="0" /></a></span></p><p><span style="font-size:85%;">As you can see, our spending was out of control. Hard to believe this statement is coming from this couple that was making so much progress the last couple of months. We are planning on creating a new budget for our new home, hopefully something around the $3k mark. We should be able to do that once the dust from everything settles. As for explaining this month, let’s just forgot that we even brought it up and move on!</span></p>Medicated Money Worth - August 2006<span style="font-size:85%;">We knew that this month we were going to take a serious hit in our Net Worth. With our move across the country, we decided to stop our debt repayment schedule and just pay minimal amounts. We also decided to tap into our emergency fund to help pay for the move. Even with these financial moves, we still took a serious beating to our net worth. We were hoping to not lose too much ground; hoping to maybe stay where we were at. After completing the calculations this afternoon, it looks like we lost roughly about 1 good month’s progress. Here are the numbers:</span> <p><span style="font-size:85%;"></span></p><p><span style="font-size:85%;"><a href=""><img style="" alt="" src="" border="0" /></a><br /></span></p><p><span style="font-size:85%;">As you can see, we had a nearly 9% negative loss in the month of August. Granted, if you remove the moving expenses that are a one and done expense, we actually had a positive net worth of 2%. Unfortunately, we have to be fair to ourselves, and we wanted to include this to get the whole picture, even if it meant, taking a negative hit!<br /><br />We only paid $1,000.69 towards our debt repayment plan. We have been averaging closer to $4,000/month. We hope we can get back on track in the month of September with vengeance.<br /><br />As occurred in the month of July, negative change in the Work Retirement– Wife account is due to a recent inquiry which resulted in a wrong amount being calculated. The value now is the correct amount.<br /><br />The negative change in the Student Loan #1 as well as 0% credit card are due to up-to-date statements instead of just using Quicken software. The 0% credit card also was affected thanks to <a href="">Bank of America</a>.</span></p>Medicated Money Debt Repayment – August 2006<a href=""><img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="" border="0" /></a><span style="font-size:85%;">We knew coming into the month of August that we were going to suspend our repayment plan and just pay the minimal amounts on each bill. It still was disappointing to see that we only paid $1,000.96 to our bills. I was getting use to seeing the total debt get smaller and smaller each month. As for our goal of paying off $36,500 by the end of the year, this will definitely make it even more difficult.<br /><br />In the month of August, we paid $1,000.96 to our repayment plan lowering our total goal to $17,547 left to pay off. This means we need to average $4,390/month to reach our goal! My guess is that we will not be able to reach this goal due to the expense of our move and we are running out of time. However, I am optimistic that we may be able to complete this goal. We'll just have to wait and see!</span>Medicated Money Little Vacation!<a href=""><img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="" border="0" /></a><span style="font-size:85%;">After driving 1,500 miles, the last thought on my mind would be drive another few hundred miles. However, like always, Mrs. Medicated was right in saying that I would definitely look forward to it after the move. Why would she say this? Well, we are planning on driving to the beach for a 3 day mini-vacation. After the stress of our move, the Drive, and the unpacking of the past 3 days, we are ready to just sit back and relax. So thinking ahead, Mrs. Medicated planned this small vacation before the stress of the move really kicked in 3 weeks ago.<br /><br />Yes, financially speaking, it may not be the smartest decision to go and spend money on a vacation after spending close to 5k to move across the country, but you know what, we need it! After doing this blog since March, I have realized that you can only worry about money so much, after that, it is time wasted. Sometimes you just have to live a little, and if that means spending some money on yourself instead of waiting for a rainy day, so be it! So, I apologize if this goes against the grain on the personal finance advice, but we need some time to just unwind and get ready to start a new job! I promise we’ll kick it into financial ass-kicking gear starting next week!</span>Medicated Money Expense Of Moving Cross-Country & Getting Back On Track<span style="font-size:85%;">I estimated that our move would cost us around $2,500. Boy was I wrong! All in all, by changing jobs and moving 1,500 across the country, our bill was around $4,000. Add in the fact that in this month we ended up paying 2 different rents for the majority of the month, we are looking at roughly a $5k bill. For the majority of this bill, we put most of it on credit cards to be able to buy some time in paying for everything; however, we need to pay it this CC bill to avoid interest. We are going to take a serious hit in our net worth and debt repayment due to this move.<br /><br />As of right now, I am planning on starting my new job September 5th. Mrs. Medicated is still currently looking for a position after having a couple of leads fall through. We are not worry about her situation, though we would like her to find something sooner than later. We still have 2 paychecks each coming from our old employer that we will help for the month of September, as well as receiving our security deposit back from our old rental house. All in all, we are planning to pay off the credit card as soon as possible, place the remaining money from these checks in our debt repayment, and hopefully be back on a dual income by October. From there, it is our goal to try to finish paying off our remaining balance on our debt repayment plan, and then beginning saving for our house down payment.<br /><br />Our goal is buy a house in the next 12 to 18 months depending on the location, price, and amount saved for the down payment. We are extremely happy with the decision that we have made to move, but as you can see, it has changed our financial progress. We need to just get settled into our new house, new job(s), and then determine how fast we can get the train back on track! Thanks to all of the well-wishers especially D over at <a href="">Divorce To Financial Freedom </a>for the encouraging words and support!</span>Medicated Money Sweet 'New' Home<span style="font-size:85%;"><em>“What is more agreeable than one's home?”</em> -Marcus Tullius Cicero<br /><br />We made it to our new home yesterday and are happy to announce that everything went safe and sound. We have spent the last 2 days unpacking, unpacking, and some more unpacking! I did take a time-out today to get the computer set-up and get back to being online. Definitely need our internet access!<br /><br />So the big question of the day for us is: How did this move affect us financially? Well, to be honest, the hour is late and the day is almost done, but we will answer this question over the next couple of days as well as get our ‘financial house’ in order as well.</span>Medicated Money Day!<a href=""><img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="" border="0" /></a><br /><span style="font-size:85%;">We finished packing up our stuff and crammed everything in the truck to head out across the county. Hard to believe that moving day is here! We probably will be out of commission for the next week with the move and everything, but we hope to have the blog up and running shortly after we move into our new home. Until then, thanks for reading.<br /><br />-The Medicated’s</span>Medicated Money Got To Roll With It!<a href=""><img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="" border="0" /></a><br /><span style="font-size:85%;">With this past Friday being our last day of work, we spent today finalizing everything with our now previous employment. We had meetings with HR, Payroll, Benefits, and underwent exit interviews. We are planning on signing up for COBRA, but this will not occur until September 1st due to our health insurance continues for the rest of the month. We plan to discuss this in another post!<br /><br />One important item from today’s meeting was to decide what to do with the money we have invested into our pension fund. With our employer, one becomes vested at 5 years of service. Unfortunately, we did not reach the five years; therefore, we have decided to roll the money into an IRA. I contacted our financial institution that we invest our 403(b) into, and because we like their services, we have determined to stay with them. We plan to roll our pension money into an IRA as well as take the money from our 403(b) and roll that in as well.<br /><br />I must say that I was very impressed with the service our financial institution provided. They spent the better part of an hour going through the online application and answered every question that I had. I am unsure what financial institution options we will have with our new company; however, we are hoping that our current group will be an option.<br /><br />As of right now, because my new company does not match any contributions for the 1st year, we are currently of thinking of not investing any money in order to fund our housing account that we plan to start after we complete our debt repayment plan. Yet, that topic is for another post!</span>Medicated Money, Pack, Pack<a href=""><img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="" border="0" /></a><br /><span style="font-size:85%;">After a long 2 days of packing, we are about 75% finished with our preparation for the move. Our to-do list was filled with tasks and things that we need to complete before we move, and unfortunately, we were unable to make a dent in it due to the never ending packing of boxes and bins! It truly is amazing how much stuff you have when you start going through it!</span><?xml:namespace prefix = o /><o:p><span style="font-size:85%;"><br /></span></o:p><p class="MsoNormal"><o:p></o:p><span style="font-size:85%;">However, I just wanted to say thanks to the members over at the </span><a href=""><span style="font-size:85%;">Money Blog Network Forums</span></a><span style="font-size:85%;">. I thought I would be able to do a little Medicated Money site updating this week after a discussion with members on the Network, but alas, it was not to be.<br /></span></p><p class="MsoNormal"><span style="font-size:85%;">I really appreciate the advice given and plan to implement it when I have the time! Thanks again to </span><a href=""><span style="font-size:85%;">Flexo</span></a><span style="font-size:85%;">, </span><a href=""><span style="font-size:85%;">Kewee</span></a><span style="font-size:85%;">, </span><a href="ttp://"><span style="font-size:85%;">My Money Forest</span></a><span style="font-size:85%;">, </span><a href=""><span style="font-size:85%;">Tricia</span></a><span style="font-size:85%;">, </span><a href=""><span style="font-size:85%;">Pfblueprint</span></a><span style="font-size:85%;">, and </span><a href=""><span style="font-size:85%;">Financial Reflections</span></a><span style="font-size:85%;">!<o:p></o:p></span></p>Medicated Money Preparation Before The Move!<span style="font-size:85%;">In preparation for the big move, I decided to take our car into the shop for its 30k tune-up. We are planning on renting a 24ft truck, towing one car with the rental truck, and driving our second car. All in all, 1,500 miles of open road lay between us and our new home. </span><br /><span style="font-size:85%;"></span><br /><span style="font-size:85%;">It definitely will be an exciting trip, but definitely a long one. We are figuring that we will be able to manage around 50mph with the truck, and our goal is drive 500 miles/day. This means we are looking at most likely 3 days of driving. The car checked out fine, but more outflow of our money to pay for this. $600 all said and done! I keep telling myself that it is better to have the car checked out and ready to go then hit a problem on the road that could possible cost us not only much more money but more importantly, time! </span><br /><span style="font-size:85%;"></span><br /><span style="font-size:85%;">Thanks again to D over at <a href="">Divorce To Financial Freedom</a> for <a href="">reminding us to not get too stressed out </a>from this entire ‘move’ thing!</span>Medicated Money Money Is Hemorrhaging Money!<span style="font-size:85%;"><em>"Finance is the art of passing money from hand to hand until it finally disappears."</em> <em>-</em>Robert W. Sarnoff</span><br /><span style="font-size:85%;"></span><br /><span style="font-size:85%;">With our upcoming new employment and move across the country, we are currently hemorrhaging money from all possible gaps. We knew going into the month of August that things were going to get a little tight, but this is ridiculous. I am constantly online checking accounts, sliding money from here to there to still try to maximize interest rates (why try!?!) As of right now, the blood loss is somewhere around $5k with everything. Include our normal monthly expenses; it seems that everyone has their fingers in an almost empty cookie jar. </span><br /><span style="font-size:85%;"></span><br /><span style="font-size:85%;">From paying 2 rents plus security deposits to buying supplies to move, the damage is mounting! The good news is that we are still afloat, but we are taking on water fast! Hopefully, we can dig ourselves out before we completely sink!</span>Medicated Money
http://feeds.feedburner.com/MedicatedMoney
CC-MAIN-2018-13
refinedweb
4,777
70.94
Hi Guys, I try to get familiar with my i.MX RT1050 EVK Board (what a beast...). For that i would like to toggle a pin (GPIO_AD_B1_08) as fast as possible. With the following code i get to ~4.4Mhz. What can i expect ? Is my configuration ok, or did i miss something ? And maybe i already didn't understand bit manipulation or why does bit toggling with "GPIO1->DR ^= (24U)" not working ? #include "board.h" #include "fsl_gpio.h" #include "pin_mux.h" #include "clock_config.h" #include "fsl_common.h" #include "fsl_iomuxc.h" int main(void) { gpio_pin_config_t tst_config = {kGPIO_DigitalOutput, 0, kGPIO_NoIntmode}; BOARD_ConfigMPU(); BOARD_BootClockRUN(); /* Init Test-Port GPIO1 Pin 24 (GPIO_AD_B1_08) */ GPIO_PinInit(GPIO1, (24U), &tst_config); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B1_08_GPIO1_IO24, 0xB0E9u); /* 0xB0E9u: Slew Rate Field: Fast Slew Rate Drive Strength Field: R0/5 Speed Field: max(200MHz) Open Drain Enable Field: Open Drain Disabled Pull / Keep Enable Field: Pull/Keeper Enabled Pull / Keep Select Field: Pull Pull Up / Down Config. Field: 100K Ohm Pull Up Hyst. Enable Field: Hysteresis Disabled */ while (1) { // GPIO1->DR ^= (24U); // Does not work ?? GPIO1->DR |= (1U << (24U)); // Low GPIO1->DR &= ~(1U << (24U)); // High } } Any hint would be great. Regards, Daniel Your configuration seems to be OK. The measured toggle speed is also something like expected, since it is limited by some internal bus arbitration delays to access GPIO register etc. Have a great day, Artur
https://community.nxp.com/thread/469064
CC-MAIN-2019-35
refinedweb
224
60.61
Writing your first Django app, part 3 This document is for Django's SVN release, which can be significantly different from previous releases. Get old docs here: 0.96, 0.95. This tutorial begins where Tutorial 2 left off. We’re continuing the Web-poll application and will focus on creating the public interface — “views.” Philosophy A view is a “type” of Web page in your Django application that generally serves a specific function and has a specific template. For example, in a weblog: - Poll “archive” simple Python function. Design your URLs. Django loads that module and looks for a module-level variable called urlpatterns, which is a sequence of tuples in the following format: (regular expression, Python callback function [, optional dictionary]) Django starts at the first regular expression and makes its way down the list, comparing the requested URL against each regular expression until it finds one that matches. When it finds a match, Django calls the Python callback function, with an HTTPRequest object as the first argument, any “captured” values from the regular expression as keyword arguments, and, optionally, arbitrary keyword arguments from the dictionary (an optional third item in the tuple). For more on HTTPRequest objects, see the request and response documentation. For more details on URLconfs, see the URLconf documentation. When you ran python django-admin.py startproject mysite at the beginning of Tutorial 1, it created a default URLconf in mysite/urls.py. It also automatically set your ROOT_URLCONF setting (in settings.py) to point at that file: ROOT_URLCONF = 'mysite.urls' Time for an example. Edit mysite/urls.py so it looks like this: from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^polls/$', 'mysite.polls.views.index'), (r'^polls/(?P<poll_id>\d+)/$', 'mysite.polls.views.detail'), (r'^polls/(?P<poll_id>\d+)/results/$', 'mysite.polls.views.results'), (r'^polls/(?P<poll_id>\d+)/vote/$', 'mysite.polls.views.vote'), ) associated Python package/module: mysite.polls.views.detail. That corresponds to the function detail() in mysite/polls/views.py. Finally, it calls that detail() function like so: detail(request=<HttpRequest object>, poll_id='23') The poll_id='23' part comes from (?P<poll_id>\d+). Using parenthesis$', . Write your first view Well, we haven’t created any views yet — we just have the URLconf. But let’s make sure Django is following the URLconf properly. Fire up the Django development Web server: add the following view. It’s slightly different, because it takes an argument (which, remember, is passed in from whatever was captured by the regular expression in the URLconf): def detail(request, poll_id): return HttpResponse("You're looking at poll %s." % poll_id) Take a look in your browser, at “/polls/34/”. It’ll display whatever ID you provide in the URL. Write views that actually do something mysite.polls.models import Poll from django.http import HttpResponse def index(request): latest_poll_list = Poll.objects.all(): Ah. There’s no template yet. First, create a directory, somewhere on your filesystem, whose contents Django can access. (Django runs as whatever user your server runs.) Don’t put them under your document root, though. You probably shouldn’t make them public, just for security’s sake. Then edit TEMPLATE_DIRS in your settings.py to tell Django where it can find templates — just as you did in the “Customize the admin look and feel” section of Tutorial 2. When you’ve done that, create a directory polls in your template directory. Within that, create a file called index.html. Note that our loader.get_template('polls/index.html') code from above maps to “[template_directory]/polls/index.html” on the filesystem. Put the following code in that template: {% loader, Context and HttpResponse. The render_to_response() function takes a template name as its first argument and a dictionary as its optional second argument. It returns an django.http.Http404 exception if a poll with the requested ID doesn’t exist. A shortcut: get_object_or_404() It’s a very common idiom to use get() and raise get_object_or_404() function takes a Django model module as its first argument and an arbitrary number of keyword arguments, which it passes to the module’s get() function. It raises Http404 if the object doesn’t exist. Philosophy Why do we use a helper function get_object_or_404() instead of automatically catching the DoesNotExist exceptions at a higher level, or having the model API raise Http404 instead of DoesNotExist? Because that would couple the model layer to the view layer. One of the foremost design goals of Django is to maintain loose coupling. There’s also a get_list_or_404() function, which works just as get_object_or_404() — except using filter() instead of get(). It raises Http404 if the list is empty. Write a 404 (page not found) view When you raise 'django.views.defaults.page_not_found' by default. Three more DEBUG is set to True (in your settings module) then your 404 view will never be used, and the traceback will be displayed instead. template guide for full details on how templates work.r include(): (r'^polls/', include('mysite.polls.urls')), include(), simply, references another URLconf. Note that the regular expression doesn’t have a $ (end-of-string match character) but has the trailing slash. Whenever Django encounters include(), it chops off whatever part of the URL matched up to that point and sends the remaining string to the included URLconf for further processing. Here’s what happens if a user goes to “/polls/34/” in this system: - Django will find the match at '^polls/' - It will strip off the matching text ("polls/") and send the remaining text — "34/" — to the ‘mysite.polls.urls’ urlconf for further processing. Now that we’ve decoupled that, we need to decouple the ‘mysite.polls.urls’ urlconf by removing the leading “polls/” from each line: urlpatterns = patterns('mysite.polls.views', (r'^$', 'index'), (r'^(?P<poll_id>\d+)/$', 'detail'), (r'^(?P<poll_id>\d+)/results/$', 'results'), (r'^(?P<poll_id>\d+)/vote/$', 'vote'), ) The idea behind part 4 of this tutorial to learn about simple form processing and generic views. Questions/Feedback If you notice errors with this documentation, please open a ticket and let us know! Please only use the ticket tracker for criticisms and improvements on the docs. For tech support, ask in the IRC channel or post to the django-users list.
http://www.djangoproject.com/documentation/tutorial03/
crawl-001
refinedweb
1,036
58.69
The Java Tutorials have been written for JDK 8. Examples and practices described in this page don't take advantage of improvements introduced in later releases.. Another implication of the fact that a generic class is shared among all its instances, is that it usually makes no sense to ask an instance if it is an instance of a particular invocation of a generic type: Collection cs = new ArrayList<String>(); // Illegal. if (cs instanceof Collection<String>) { ... } similarly, a cast such as // Unchecked warning, Collection<String> cstr = (Collection<String>) cs; gives an unchecked warning, since this isn't something the runtime system is going to check for you. The same is true of type variables // Unchecked warning. <T> T badCast(T t, Object o) { return (T) o; } Type variables don't exist at run time. This means that they entail no performance overhead in either time nor space, which is nice. Unfortunately, it also means that you can't reliably use them in casts.: // Not really allowed. List<String>[] lsa = new List<String>[10]; Object o = lsa; Object[] oa = (Object[]) o; List<Integer> li = new ArrayList<Integer>(); li.add(new Integer(3)); // Unsound, but passes run time store check oa[1] = li; // Run-time error: ClassCastException. String s = lsa[1].get(0); If arrays of parameterized type were allowed, the previous example would compile without any unchecked warnings, and yet fail at run-time. We've had type-safety as a primary design goal of generics. In particular, the language is designed to guarantee that if your entire application has been compiled without unchecked warnings using javac -source 1.5, it is type safe. However, you can still use wildcard arrays. The following variation on the previous code forgoes the use of both array objects and array types whose element type is parameterized. As a result, we have to cast explicitly to get a String out of the array. // OK, array of unbounded wildcard type. List<?>[] lsa = new List<?>[10]; Object o = lsa; Object[] oa = (Object[]) o; List<Integer> li = new ArrayList<Integer>(); li.add(new Integer(3)); // Correct. oa[1] = li; // Run time error, but cast is explicit. String s = (String) lsa[1].get(0); In the next variation, which causes a compile-time error, we refrain from creating an array object whose element type is parameterized, but still use an array type with a parameterized element type. // Error. List<String>[] lsa = new List<?>[10]; the next section, Class Literals as Runtime-Type Tokens.
https://docs.oracle.com/javase/tutorial/extra/generics/fineprint.html
CC-MAIN-2019-09
refinedweb
414
58.38
In my previous post I focused on InterBase 2020 and outlined five good reasons why InterBase should be your next database engine. In this post I want to look at five awesome additions to Delphi that help you write lean, modern and fully compliant Windows 10 applications. To the average non-technical computer user, Windows 10 might seem as just another Windows version. I still hear both non-technical users and developers ask why they should leave Windows 7 behind. What exactly is so unique about Windows 10? In order to understand why Windows 10 is awesome, we first have to take a step back to the previous edition of Windows, namely Windows 8. A bit of context At the time when Windows 8 was the latest thing, Microsoft was still active in the mobile market, and Windows 8 represented a substantial refactoring of the Windows family. Microsoft made no secret of their plans to eventually retire x86 in favour of ARM (which is still a goal for both Microsoft and Apple), and in order to deliver said platform transparently, the OS was to be engineered from the ground up. Above: QualComm produces some of the most powerful ARM SoC (system on a chip) available. The SnapDragon 800 series delivers performance close to Intel i5, yet cost a fraction of the price. The SnapDragon SoC is used in Microsoft Surface tabs, and also powers the latest Samsung Galaxy Note 10. The result of this effort was WinRT (Windows Runtime), a chipset agnostic architecture that, once adopted, enabled developers to write applications that could be compiled for any CPU, providing the code was source-compatible (not unlike FireMonkey and its abstraction layer over desktop, mobile and embedded). The idea was initially to retire the aging WinAPI and thus make the entire Windows eco-system portable. But WinRT has not replaced WinAPI, instead it co-exists and compliments the system. Universal Windows Platform (UWP) Needless to say the Windows 8 journey did not go as Microsoft had planned. They took Windows Mobile off the market (which is a great shame, Windows Mobile was wonderful to use) and decided to focus on what they do best; namely the Windows desktop. UWP (universal windows platform) can be seen as a kind of successor to WinRT. It incorporates the same technology (so WinRT is still there) except it has broader implications and embrace more diverse technologies. The most important being that it allows other languages, and developers that don’t use Visual Studio to co-exist without the restrictions of Windows 8 (WinRT was C++ only). Microsoft also added an emulation layer to UWP, to make sure applications written for x86 and WinAPI can seamlessly run on ARM. I should underline that Delphi has support for the WinRT APIs that are now an intrinsic part of Windows 10. There are some 40 units in the VCL (under the WinAPI.* namespace) that let you work directly with that aspect of Windows. As well as components written especially for Windows 10, that we will cover briefly in this post. Right then. Lets jump into my top five features and have a closer look! 1: Scaling and DPI awareness If you have updated to Windows 10 you have undoubtedly noticed that graphics are smoother than under Windows 8 (and especially Windows 7), and that Windows will scale form content if you are using a monitor that supports high DPI. This feature goes deeper than you might expect, because users can have both HD and SD capable monitors connected to the same machine – and Windows 10 will ensure that applications look their best regardless of DPI count. Support for DPI awareness for monitors, has to be defined in the application manifest, but this is now a part of your project options inside the Rad Studio IDE. So making your desktop application DPI aware is nothing more than a 2-click operation. On the component side (or form decoration if you will) you can add support for HD graphics through the latest TImageCollection and TVirtualImageList. These components simplify support for HD displays when available – and fall back to older SD (low-res) glyphs when not available. You can read more about DPI awareness and the parts of the VCL that this affects here: An in-depth look at TImageCollection and TVirtualImageList can be found here: 2: UWP contracts Feature detection used to be a difficult, low-level task. And since Windows 10 supports several CPU architectures (e.g x86 and ARM), detecting specific hardware features for multiple device families adds considerable headache to an already complicated task. This is one of the aspects that WinRT / UWP has greatly alleviated, through the notion of contracts. The concept of “contracts” under UWP is that applications should better adapt to their surroundings by investigating its features. For example, a graphics program can expose a camera function if the device has a camera attached – and omit that button or option if no camera is there (adaptive UI). The contract part is a way of telling Windows “let me know when this condition becomes true”. This technology might not seem that important at first glance, but when you factor in that UWP covers devices like Xbox, Hololens, and Surface (Tablet PC), being able to detect and respond to the available features is quite important. The fundamental idea behind adaptive applications is that your app checks for the functionality (or feature) it needs, and only uses it when available. The traditional way of doing this is by checking the OS version and then use those APIs. With Windows 10, your app can check at runtime, whether a class, method, property, event, or API contract is supported by the current operating system. If so, the app can then call the appropriate API RAD Studio provides WinRT API mappings and Object Pascal interfaces, and this delivers support for various Windows 10 services, contracts included. So through Delphi you can access this feature directly via the exact same methods other languages use. You can read more about some of the additions for Windows 10 that Rad Studio provides here: There is a good overview of contracts you can use on MSDN: And a very nice article on how to use the API at Microsoft’s website here: 3: Deploy to Microsoft Store An integrated appstore (or package manager) was first made popular by Linux, and later commercialized by Apple. A good software store where applications can immediately be purchased and installed, that then takes care of updates automatically is a wonderful thing. Today, all major operating systems have a built-in app store, Windows 10 included. When you write applications that should be sold or distributed through the Microsoft Store, the app must be packaged in a particular way (*.appx package files). Just like apps for macOS, iOS, and Android must be provisioned and signed, so must applications for the Windows 10 store. And RAD Studio makes this very easy. In fact, the process is more or less identical for the 3 stores in question (Google Play, Appstore, Microsoft Store). Microsoft Store support has been a part of Rad Studio since version 10.1 (currently at 10.3), so getting your products quickly to market has never been easier. Click here for a more in-depth look at how to package your app for Windows 10 store: Or check out this short video presentation 4: Windows 10 Notifications I mentioned briefly that WinRT did not replace WinAPI, and that it instead was amalgamated into what we today know as UWP (Universal Windows Platform). Another facet of what Microsoft did was to greatly simplify tasks that were previously low-level and time consuming, making them easier to use and broadening their functionality. Being notified about changes in the hardware, like someone ejecting a CD-ROM or plugging in a USB stick, is nothing new. But the notification layer in Windows 10 unifies a number of notification channels (not just visible notifications for the user) – including cloud services. From a programming point of view, this makes life considerably easier. For example, let us say your application can store data through multiple services, both local and remote. Instead of you having to write separate signal handling for cloud and local, you can now unify much of this into a single, coherent strategy. Note: This aspect of UWP is still under development by Microsoft, so there is still functionality that is due in the future, such as push notifications through BaaS (back-end as a service). Toast notifications Toast notifications allows your app to inform the users about relevant information and timely events that they. One of the new components in RAD Studio, is a component called TNotificationCenter. This simplifies how your application deals with local, multi-device notifications, including Windows 10 Toast notifications. This component merges notification functionality of all platforms, covering iOS, Android, OS X/macOS, and Windows 10 under one roof. You can read more about how you can leverage notifications for all platforms here: And there is a good introduction to the general principles of Toast Messages on MSDN: 5: Windows 10 VCL components I mentioned that Delphi contains roughly 40 units that import and otherwise makes WinRT (UWP) functionality available to Delphi and C++Builder developers. There is a wealth of topics that are uniquely bound to Windows 10 (or that were introduced with Windows 8). We are sure to see plenty of additions to the component palette in the Delphi and C++Builder versions to come. Out of the box you get some very nice components that are simply not present on older Windows versions like Windows 7. I know that there are still people using Windows 7 as their primary OS, and that some are reluctant to upgrade. But Microsoft officially shut down all update services last week – and Windows 7 is now officially retired/EOL. So if you have been waiting for a nudge to upgrade, then now is the time to do so. I updated when Windows 10 revision 2 came out. It really is a completely different experience in every regard, and it is faster than Windows 7 (I know this because I updated directly without any changes to the hardware), so you will no doubt get a year or two extra out of your PC. As for components you can drag & drop on a form, they are: I also mentioned the new components for dealing with HD and SD graphics for decorating your applications (buttons, toolbars, imagelists, treeview et-al): It’s also worth mentioning that Windows 10 has the BlueTooth API. This has been encapsulated in Delphi as a standard TBlueTooth component. Things like BlueTooth used to involve a lot of low-level operations, enumerating USB devices, locating BT adapter objects etc. But Delphi and C++Builder now offer a clean, user-friendly approach to working with BlueTooth directly. If you are unfamiliar with the Bluetooth support, you can read up here: If you think the list of new components is underwhelming, please keep in mind that Windows 10 is still young. The VCL has been tried and tested by time and represents the fastest and most efficient way of building native Windows applications without equal. All those existing VCL controls also work great on Windows 10. And the key behind the VCL frameworks efficiency in this matter, has to do with its adaptable architecture. In other words, encapsulating the unique features of Windows 10 is a piece of cake for the VCL. You can have a look at the documentation for Windows 10 components in RAD Studio Rio here: Reflections In this overview of how Delphi and C++Builder tap directly into Windows 10 and provide you with a clear-cut path to use those features in your applications — we have barely scratched the surface. When I was preparing for this article and going over the WinAPI namespace, it didn’t require much imagination to see how the wealth of available features exposed through UWP, will result in some amazing components and RTL add-ons in the near future. But there is a balance in this material that we developers often forget, namely that Embarcadero has a responsibility to its technology partners. There must be room for third party developers to write components and contribute to the community. This is something that I feel Embarcadero has always handled right. They make sure that you as a customer get access to the latest features; they incorporate changes in the underlying sub-strata whenever its needed; and they avoid competing with themselves by allowing their technology partners to build component packages and solutions. Delphi and C++Builder has always enjoyed a rich ecosystem of components and technologies. No matter what you might need, from kernel level drivers all the way up to cloud service integration, there is always a solution to be found. Sometimes as a commercial component set, but more often than not as a free solution by the community itself. Access to insight is one of the reasons why Delphi remains so popular. Another factor that I love about Delphi 10.x (covering the past 3 major versions) is that there have been radical optimization done on the run-time library. Affecting the performance of the VCL and FMX frameworks independently. In some cases we are talking about a speed boost of 100%. So the final chapter on Delphi performance has not been written. Delphi is going from strength to strength, and I feel the community is going through a form of revival. We are seeing a steady influx of new developers, as well as developers returning to Delphi and C++Builder for various reasons — but the most common reason I hear is that there simply is no equal when it comes to Windows software development. Delphi is a unique formula, perfected over decades. There simply is no other language nor product that offers the same delicate balance between speed, productivity and quality. For Windows 10 development, Delphi is the best software authoring system the platform has ever, end of story. And there has never been a better time to be a Delphi developer! Design. Code. Compile. Deploy. Start Free Trial Upgrade Today Free Delphi Community Edition Free C++Builder Community Edition
https://blogs.embarcadero.com/5-unique-delphi-features-for-windows-10/
CC-MAIN-2021-43
refinedweb
2,382
57.71
I'm a complete Linux beginner. Thank you. We are making a system using Laravel. Install Laravel5.5 on Linux and execute php artisan command The following error will occur: [Addition] I checked the following errors and found that Laravel 5.6 is required, but I cannot install Laravel 5.6 for the rental server. In the local environment, it runs on Laravel 5.5. I would be happy if you couldn't understand why the Laravel 5.6 is required. Thank you in advance.Error message Applicable source codeApplicable source code PHP Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting identifier (T_STRING) or \\ (T_NS_SEPARATOR) in /home/users/0/mond.jp-funfun/fun-corp/ vendor/myclabs/deep-copy/src/DeepCopy/deep_copy.php on line 5 Supplemental information (FW/tool version etc.)Supplemental information (FW/tool version etc.) <? php namespace DeepCopy; use function function_exists; if (false === function_exists ('DeepCopy \ deep_copy')) { / ** * Deep copies the given value. * * @param mixed $value * @param bool $useCloneMethod * * @return mixed * / function deep_copy ($value, $useCloneMethod = false) { return (new DeepCopy ($useCloneMethod))->copy ($value); } } Laravel 5.5 is installed on Lollipop PHP7.1 server. Thank you in advance. - Answer # 1 Related articles - linux - i want to use ldd on macos (not otool) - i want to be able to use laravel with sakura vps - linux - how to use the find command - ajax - laravel js want to use - linux - even if i try to install laravel using the environment of docker, the following error appears and the capacity is insuff - how to use bootstrap4 with laravel - php - i want to use constants in my laravel env file - linux - i want to use the scp command with cygwin - php - i want to use a laravel 6x session - linux - cannot use yum command - How to use the Linux tr command - Use of LVM for Linux Disk Management - How to use awk in Linux error you are experiencing is likely to occur when running under PHP 5.6. (Function import with useis from PHP 5.6). Check that you are running the expected version of PHP.
https://www.tutorialfor.com/questions-101162.htm
CC-MAIN-2020-40
refinedweb
339
54.93
Exception: java.lang.IllegalAccessException: Class sun.applet.AppletPanel can not access a member of class Hello with modifiers "" First off: Welcome to the Java Ranch, we hope you’ll enjoy visiting as a regular however, your name is not in keeping with our naming policy here at the ranch. Please change your display name to an appropriate name as shown in the policy. It looks like you've defined your Hello class without any access specification so it'll get the default access level, which us package. Meaning that only classes in the same package can access it. Change the class declaration to 'public class Hello' and you should be in business. Originally posted by Marilyn deQueiroz: I have loaded my class in a web browser Why are you trying to run an application in a web browser rather than from the command line? An Applet is a different animal than an Application. An applet extends java.applet.Applet. Your application does not. An applet doesn't need a main() method like your application has. Try opening a "dos window" and type "java Hello" for a better chance to see results. Regarding "the default access level, which us package", he meant "the default access level, which is package access." (I don't think that will help you, but changing it to public won't hurt anything either.) Regarding your name, "RH" is an acceptable first name. Pick a different last name, or use your real last name. Also, I think you should be able to register with and use "Robert H" as your first name if you wish. I login with "Marilyn deQueiroz" and my display name is "Marilyn de Queiroz".
http://www.coderanch.com/t/391983/java/java/access-member-class-modifiers
CC-MAIN-2013-20
refinedweb
281
64.81
We’ve looked at dictionaries as able to represent what something is. For example, this dictionary represents a student: my_student = { 'name': 'Rolf Smith', 'grades': [70, 88, 90, 99] } If we want to calculate the average grade of the student, we could create a function to do so: def average_grade(student): return sum(student['grades']) / len(student['grades']) However, there is a flaw with this. This function is separate and unrelated from the student (e.g. in a large program, they could even be in different files), but it depends on the student variable having a particular structure: - The studentmust be a dictionary; and - There must be a gradeskey that must be a list or tuple, so that we can use sum()and len()on them. It would be great if we could have something inside our dictionary that would return the average grade. That means the function would live in the same place as the data, and then it’s easier to see whether the data we require has changed or not. Something like this: my_student = { 'name': 'Rolf Smith', 'grades': [70, 88, 90, 99], 'average': # something here } It would be fantastic if we could do this, and naturally the 'average' would have to change when then 'grades changes. It must be a function. There’s no way to do this in a dictionary. Sorry! We must use objects for this. We can begin by thinking of objects as things that can store both data and functions that relate to that data. Here’s that dictionary in object format: class Student: def __init__(self, new_name, new_grades): self.name = new_name self.grades = new_grades def average(self): return sum(self.grades) / len(self.grades) Scary syntax! Don’t worry—what it does is close to the same. When you have that class, you can create objects using it. Let’s do that first and then explain exactly what is happening: student_one = Student('Rolf Smith', [70, 88, 90, 99]) student_two = Student('Jose', [50, 60, 99, 100]) To create a new object, we use the class name as if it were a function call: Student(). Inside the brackets, we put arguments that will map to the __init__ method in the Student class. Student('Rolf Smith', [70, 88, 90, 99]) maps to __init__(new_name, new_grades). What you end up with is a thing that has two properties, name and grades. print(student_one.name) print(student_two.name) Inside the __init__ method, we use self.name and self.grades. self is the current object, so when we assign values we modify only the “current object”. Notice how we don't pass anything that maps to the self parameter, because Python will do that for us. In all these function calls, Python will treat self as the object that you are referring to (more about this in just a moment!). Student('Rolf Smith', [70, 88, 90, 99]) def __init__(self, new_name, grades): self.name = new_name self.grades = new_grades When you do this, self is the new object you are creating. You can assign it to a variable: student_one = Student('Rolf Smith', [70, 88, 90, 99]) As you do that more, every object is a different self, with differently assigned properties depending on what you passed to the Student() constructor call. Properties Cool, so now we have the objects, both of which have different properties: student_one = Student('Rolf Smith', [70, 88, 90, 99]) student_two = Student('Jose', [50, 60, 99, 100]) These are similar to our dictionaries, in that the dictionaries also store values: d_student_one = { 'name': 'Rolf Smith', 'grades': [70, 88, 90, 99] } d_student_two = { 'name': 'Jose', 'grades': [50, 60, 99, 100] } To access them: student_one.name student_one.grades student_two.name student_two.grades d_student_one['name'] d_student_one['grades'] d_student_two['name'] d_student_two['grades'] Methods A method is a function which lives in a class. The average() method in the Student class also has access to self, the current object. When we call the method: student_one.average() What is really happening in the background is: Student.average(student_one) As you can see, student_one is passed as the first argument (and that is what self is in the method definition): def average(self): return sum(self.grades) / len(self.grades) So again, because self is student_one, self.grades is student_one.grades. Thus: - The sum of self.gradesis the sum of [70, 88, 90, 99]: 347. - The length of self.gradesis 4. The result will be 86.75. Recap Just to recap, the class is very similar to the dictionary but it allows us to include methods as well that have access to the properties of the object we created. Classes also gives us a bunch more functionality, we’ll look at that in the coming posts!
https://blog.tecladocode.com/learn-python-day-13-objects-in-python/
CC-MAIN-2019-26
refinedweb
780
63.39
SharePoint Web Services provides us a good feature that allows us to access or change the SharePoint items remotely. We can use the Web Services to add more power to our application.The following are the core features of SharePoint Web Services: The following table contains some of the web services inside SharePoint 2010: Service Description ASMX WebSvcAdmin Creation and Deletion of sites Admin.asmx WebSvcLists List Management service Lists.asmx WebSvcAlerts List Item Events service Alerts.asmx WebSvcAuthentication Authentication based service Authentication.asmx WebSvcsites Web sites management service Sites.asmx WebSvcspsearch Searching service Search.asmx A more detailed list can be found here: How to find the URL of a Service?The URL of a service can be located in the _vti_bin folder of the site or site collection. Each site or site collection will have this folder with all the web services inside it with a .asmx extension.Example: To use the search service use the following URL: Using Adding Reference to ProjectNow we can try adding a reference to the service inside the Visual Studio application. Create a new Ordinary Console Application (please note that we are not using a SharePoint Console Application): Now we need to Add a Web Reference. In Visual Studio 2010 this option is available under the Add Service Reference option as shown below:In the dialog that appears click the Advanced button.In the next dialog, choose the Add Web Reference option.You will get the following dialog. This dialog is suitable for adding web service references.Enter the URL of the Lists.asmx as shown above. You need to replace the PC name with yours.Set a Web reference name in the second highlighted box. This serves as the namespace.Click the Add Reference button and your proxy class and related classes will be ready within a while. Inside the Program.cs, enter the namespace and you can see the classes inside it as shown below:Invoking the Proxy ClassOur class of interest is the Lists proxy. You can create an instance of it using the following code:SPReference.Lists client = new SPReference.Lists();Setting CredentialsWhenever we open a SharePoint site (without anonymous login enabled) the site will prompt with user credentials. As we are invoking through a web service the prompt dialog won't work. We need to pass the credentials using the property named Credentials.client.Credentials = new NetworkCredential("appes", "password"); / // using System.Net;Getting a Reference to a ListWe can try getting a reference to the Manager List inside our site. The Managers list contains items with columns: Use the following code to fetch the data and display it to the console:SPReference.Lists client = new SPReference.Lists();client.Credentials = new NetworkCredential("appes", "PWD");System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();System.Xml.XmlElement viewFields = xmlDoc.CreateElement("ViewFields");viewFields." + "<FieldRef Name=\"Name\" />" + "<FieldRef Name=\"Address\" />"; XmlNode listItems = client.GetListItems("Manager", null, null, viewFields, null, null, null);foreach (XmlNode node in listItems) if (node.Name == "rs:data") for (int f = 0; f < node.ChildNodes.Count; f++) { if (node.ChildNodes[f].Name == "z:row") { string title = node.ChildNodes[f].Attributes["ows_Title"].Value; string name = node.ChildNodes[f].Attributes["ows_Name"].Value; string address = node.ChildNodes[f].Attributes["ows_Address"].Value; Console.WriteLine(title + " " + name + " " + address); } } Console.ReadKey(false);On executing the application we can see the following result:The following are the steps involved in getting list item data: Create List Proxy client Set Credentials Set the View Columns Invoke GetListItems() method Iterate through the nodes Get value of node having name z:row NoteUsing web services, XML is used to represent the data. For advanced programming using properties, please refer to the Server Object Model and SharePoint LINQ articles.References SummaryIn this article we have seen the Web Services feature of SharePoint 2010. It provides the flexibility of interoperability compared with the Server Object Model. Developers can access and manage a SharePoint site from non .Net platforms like Java. The attached source code contains the example we discussed..
http://www.c-sharpcorner.com/UploadFile/40e97e/sharepoint-2010-web-services/
CC-MAIN-2015-48
refinedweb
668
51.55
tyler bucasas2,453 Points exit challenge my code keeps receiving a "Exception: EOF when reading a line" someone please let me know if I'm on the right track, thank you! import sys while True: start = input("press 'n' or 'N' to quit") if start.lower != 'n' or 'N': print("Enjoy the show!") else: sys.exit() 2 Answers Oszkár FehérTreehouse Project Reviewer Hi Tyler. Actually you have the code what it passes the quiz. So after the import , the while loop it's not needed. The if statement it's almost ready If you call the lower() function, than you need to call the function with () ,and no need to pass in the 'N' to, if start.lower() != 'n': The lower() function makes the character small. What you wanted to write it would look like this if start != 'n' or start != 'N': But this is more writing it can be done in a different way if start not in ['n', 'N']: This line does what the previous line does. The rest of the code it's okey. So overall it should look something like this: import sys start = input("press 'n' or 'N' to quit") if start.lower() != 'n': print("Enjoy the show!") else: sys.exit() You did well, the necessary code you made it. Keep up the good work and happy coding. I hope this will help you. behar10,781 Points Hey tyler! You have a couple of issues in your code. First is that your missing parenthesis after you use the lower method. Secondly is with the way your using the or operator. With these kinds of operators, you need to be more specfic. You currently doing something like this: test = 5 if test == 5 or 6: # Do something But you should be doing it like this: if test == 5 or test == 6: # Do something But seeing as your already using the .lower() method, you dont need to check if start == "N". It could never be that because your converting it to lowercase. Finally the challenge never asks you to make a while loop for this, so just delete that. In the end your code should look something like this: import sys start = input("press 'n' or 'N' to quit") if start.lower() != "n": print("Enjoy the show!") else: sys.exit() Hope this helps! behar10,781 Points behar10,781 Points Too slow..
https://teamtreehouse.com/community/exit-challenge
CC-MAIN-2019-30
refinedweb
394
84.27
Advanced: Making Dynamic Decisions and the Bi-LSTM CRF¶ Dynamic versus Static Deep Learning Toolkits¶ Pytorch is a dynamic neural network kit. Another example of a dynamic kit is Dynet (I mention this because working with Pytorch and Dynet is similar. If you see an example in Dynet, it will probably help you implement it in Pytorch). The opposite is the static tool kit, which includes Theano, Keras, TensorFlow, etc. The core difference is the following: - In a static toolkit, you define a computation graph once, compile it, and then stream instances to it. - In a dynamic toolkit, you define a computation graph for each instance. It is never compiled and is executed on-the-fly Without a lot of experience, it is difficult to appreciate the difference. One example is to suppose we want to build a deep constituent parser. Suppose our model involves roughly the following steps: - We build the tree bottom up - Tag the root nodes (the words of the sentence) - From there, use a neural network and the embeddings of the words to find combinations that form constituents. Whenever you form a new constituent, use some sort of technique to get an embedding of the constituent. In this case, our network architecture will depend completely on the input sentence. In the sentence “The green cat scratched the wall”, at some point in the model, we will want to combine the span \((i,j,r) = (1, 3, \text{NP})\) (that is, an NP constituent spans word 1 to word 3, in this case “The green cat”). However, another sentence might be “Somewhere, the big fat cat scratched the wall”. In this sentence, we will want to form the constituent \((2, 4, NP)\) at some point. The constituents we will want to form will depend on the instance. If we just compile the computation graph once, as in a static toolkit, it will be exceptionally difficult or impossible to program this logic. In a dynamic toolkit though, there isn’t just 1 pre-defined computation graph. There can be a new computation graph for each instance, so this problem goes away. Dynamic toolkits also have the advantage of being easier to debug and the code more closely resembling the host language (by that I mean that Pytorch and Dynet look more like actual Python code than Keras or Theano). Bi-LSTM Conditional Random Field Discussion¶ For this section, we will see a full, complicated example of a Bi-LSTM Conditional Random Field for named-entity recognition. The LSTM tagger above is typically sufficient for part-of-speech tagging, but a sequence model like the CRF is really essential for strong performance on NER. Familiarity with CRF’s is assumed. Although this name sounds scary, all the model is is a CRF but where an LSTM provides the features. This is an advanced model though, far more complicated than any earlier model in this tutorial. If you want to skip it, that is fine. To see if you’re ready, see if you can: - Write the recurrence for the viterbi variable at step i for tag k. - Modify the above recurrence to compute the forward variables instead. - Modify again the above recurrence to compute the forward variables in log-space (hint: log-sum-exp) If you can do those three things, you should be able to understand the code below. Recall that the CRF computes a conditional probability. Let \(y\) be a tag sequence and \(x\) an input sequence of words. Then we compute Where the score is determined by defining some log potentials \(\log \psi_i(x,y)\) such that To make the partition function tractable, the potentials must look only at local features. In the Bi-LSTM CRF, we define two kinds of potentials: emission and transition. The emission potential for the word at index \(i\) comes from the hidden state of the Bi-LSTM at timestep \(i\). The transition scores are stored in a \(|T|x|T|\) matrix \(\textbf{P}\), where \(T\) is the tag set. In my implementation, \(\textbf{P}_{j,k}\) is the score of transitioning to tag \(j\) from tag \(k\). So: where in this second expression, we think of the tags as being assigned unique non-negative indices. If the above discussion was too brief, you can check out this write up from Michael Collins on CRFs. Implementation Notes¶ The example below implements the forward algorithm in log space to compute the partition function, and the viterbi algorithm to decode. Backpropagation will compute the gradients automatically for us. We don’t have to do anything by hand. The implementation is not optimized. If you understand what is going on, you’ll probably quickly see that iterating over the next tag in the forward algorithm could probably be done in one big operation. I wanted to code to be more readable. If you want to make the relevant change, you could probably use this tagger for real tasks. # Author: Robert Guthrie import torch import torch.autograd as autograd import torch.nn as nn import torch.optim as optim torch.manual_seed(1) Helper functions to make the code more readable. def argmax(vec): # return the argmax as a python int _, idx = torch.max(vec, 1) return idx.item() def prepare_sequence(seq, to_ix): idxs = [to_ix[w] for w in seq] return torch.tensor(idxs, dtype=torch.long) # Compute log sum exp in a numerically stable way for the forward algorithm def log_sum_exp(vec): max_score = vec[0, argmax(vec)] max_score_broadcast = max_score.view(1, -1).expand(1, vec.size()[1]) return max_score + \ torch.log(torch.sum(torch.exp(vec - max_score_broadcast))) Create model class BiLSTM_CRF(nn.Module): def __init__(self, vocab_size, tag_to_ix, embedding_dim, hidden_dim): super(BiLSTM_CRF, self).__init__() self.embedding_dim = embedding_dim self.hidden_dim = hidden_dim self.vocab_size = vocab_size self.tag_to_ix = tag_to_ix self.tagset_size = len(tag_to_ix) self.word_embeds = nn.Embedding(vocab_size, embedding_dim) self.lstm = nn.LSTM(embedding_dim, hidden_dim // 2, num_layers=1, bidirectional=True) # Maps the output of the LSTM into tag space. self.hidden2tag = nn.Linear(hidden_dim, self.tagset_size) # Matrix of transition parameters. Entry i,j is the score of # transitioning *to* i *from* j. self.transitions = nn.Parameter( torch.randn(self.tagset_size, self.tagset_size)) # These two statements enforce the constraint that we never transfer # to the start tag and we never transfer from the stop tag self.transitions.data[tag_to_ix[START_TAG], :] = -10000 self.transitions.data[:, tag_to_ix[STOP_TAG]] = -10000 self.hidden = self.init_hidden() def init_hidden(self): return (torch.randn(2, 1, self.hidden_dim // 2), torch.randn(2, 1, self.hidden_dim // 2)) def _forward_alg(self, feats): # Do the forward algorithm to compute the partition function init_alphas = torch.full((1, self.tagset_size), -10000.) # START_TAG has all of the score. init_alphas[0][self.tag_to_ix[START_TAG]] = 0. # Wrap in a variable so that we will get automatic backprop forward_var = init_alphas # Iterate through the sentence for feat in feats: alphas_t = [] # The forward tensors at this timestep for next_tag in range(self.tagset_size): # broadcast the emission score: it is the same regardless of # the previous tag emit_score = feat[next_tag].view( 1, -1).expand(1, self.tagset_size) # the ith entry of trans_score is the score of transitioning to # next_tag from i trans_score = self.transitions[next_tag].view(1, -1) # The ith entry of next_tag_var is the value for the # edge (i -> next_tag) before we do log-sum-exp next_tag_var = forward_var + trans_score + emit_score # The forward variable for this tag is log-sum-exp of all the # scores. alphas_t.append(log_sum_exp(next_tag_var).view(1)) forward_var = torch.cat(alphas_t).view(1, -1) terminal_var = forward_var + self.transitions[self.tag_to_ix[STOP_TAG]] alpha = log_sum_exp(terminal_var) return alpha def _get_lstm_features(self, sentence): self.hidden = self.init_hidden() embeds = self.word_embeds(sentence).view(len(sentence), 1, -1) lstm_out, self.hidden = self.lstm(embeds, self.hidden) lstm_out = lstm_out.view(len(sentence), self.hidden_dim) lstm_feats = self.hidden2tag(lstm_out) return lstm_feats def _score_sentence(self, feats, tags): # Gives the score of a provided tag sequence score = torch.zeros(1) tags = torch.cat([torch.tensor([self.tag_to_ix[START_TAG]], dtype=torch.long), tags]) for i, feat in enumerate(feats): score = score + \ self.transitions[tags[i + 1], tags[i]] + feat[tags[i + 1]] score = score + self.transitions[self.tag_to_ix[STOP_TAG], tags[-1]] return score def _viterbi_decode(self, feats): backpointers = [] # Initialize the viterbi variables in log space init_vvars = torch.full((1, self.tagset_size), -10000.) init_vvars[0][self.tag_to_ix[START_TAG]] = 0 # forward_var at step i holds the viterbi variables for step i-1 forward_var = init_vvars for feat in feats: bptrs_t = [] # holds the backpointers for this step viterbivars_t = [] # holds the viterbi variables for this step for next_tag in range(self.tagset_size): # next_tag_var[i] holds the viterbi variable for tag i at the # previous step, plus the score of transitioning # from tag i to next_tag. # We don't include the emission scores here because the max # does not depend on them (we add them in below) next_tag_var = forward_var + self.transitions[next_tag] best_tag_id = argmax(next_tag_var) bptrs_t.append(best_tag_id) viterbivars_t.append(next_tag_var[0][best_tag_id].view(1)) # Now add in the emission scores, and assign forward_var to the set # of viterbi variables we just computed forward_var = (torch.cat(viterbivars_t) + feat).view(1, -1) backpointers.append(bptrs_t) # Transition to STOP_TAG terminal_var = forward_var + self.transitions[self.tag_to_ix[STOP_TAG]] best_tag_id = argmax(terminal_var) path_score = terminal_var[0][best_tag_id] # Follow the back pointers to decode the best path. best_path = [best_tag_id] for bptrs_t in reversed(backpointers): best_tag_id = bptrs_t[best_tag_id] best_path.append(best_tag_id) # Pop off the start tag (we dont want to return that to the caller) start = best_path.pop() assert start == self.tag_to_ix[START_TAG] # Sanity check best_path.reverse() return path_score, best_path def neg_log_likelihood(self, sentence, tags): feats = self._get_lstm_features(sentence) forward_score = self._forward_alg(feats) gold_score = self._score_sentence(feats, tags) return forward_score - gold_score def forward(self, sentence): # dont confuse this with _forward_alg above. # Get the emission scores from the BiLSTM lstm_feats = self._get_lstm_features(sentence) # Find the best path, given the features. score, tag_seq = self._viterbi_decode(lstm_feats) return score, tag_seq Run training START_TAG = "<START>" STOP_TAG = "<STOP>" EMBEDDING_DIM = 5 HIDDEN_DIM = 4 # Make up some training data training_data = [( "the wall street journal reported today that apple corporation made money".split(), "B I I I O O O B I O O".split() ), ( "georgia tech is a university in georgia".split(), "B I O O O O B".split() )] word_to_ix = {} for sentence, tags in training_data: for word in sentence: if word not in word_to_ix: word_to_ix[word] = len(word_to_ix) tag_to_ix = {"B": 0, "I": 1, "O": 2, START_TAG: 3, STOP_TAG: 4} model = BiLSTM_CRF(len(word_to_ix), tag_to_ix, EMBEDDING_DIM, HIDDEN_DIM) optimizer = optim.SGD(model.parameters(), lr=0.01, weight_decay=1e-4) # Check predictions before training with torch.no_grad(): precheck_sent = prepare_sequence(training_data[0][0], word_to_ix) precheck_tags = torch.tensor([tag_to_ix[t] for t in training_data[0][1]], dtype=torch.long) print(model(precheck_sent)) # Make sure prepare_sequence from earlier in the LSTM section is loaded = torch.tensor([tag_to_ix[t] for t in tags], dtype=torch.long) # Step 3. Run our forward pass. loss = model.neg_log_likelihood(sentence_in, targets) # Step 4. Compute the loss, gradients, and update the parameters by # calling optimizer.step() loss.backward() optimizer.step() # Check predictions after training with torch.no_grad(): precheck_sent = prepare_sequence(training_data[0][0], word_to_ix) print(model(precheck_sent)) # We got it! Out: (tensor(2.6907), [1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1]) (tensor(20.4906), [0, 1, 1, 1, 2, 2, 2, 0, 1, 2, 2]) Exercise: A new loss function for discriminative tagging¶ It wasn’t really necessary for us to create a computation graph when doing decoding, since we do not backpropagate from the viterbi path score. Since we have it anyway, try training the tagger where the loss function is the difference between the Viterbi path score and the score of the gold-standard path. It should be clear that this function is non-negative and 0 when the predicted tag sequence is the correct tag sequence. This is essentially structured perceptron. This modification should be short, since Viterbi and score_sentence are already implemented. This is an example of the shape of the computation graph depending on the training instance. Although I haven’t tried implementing this in a static toolkit, I imagine that it is possible but much less straightforward. Pick up some real data and do a comparison! Total running time of the script: ( 0 minutes 18.899 seconds) Gallery generated by Sphinx-Gallery
https://pytorch.org/tutorials/beginner/nlp/advanced_tutorial.html
CC-MAIN-2019-43
refinedweb
2,027
50.23
Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode. Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript). Language Bindings Then why not put the active part inside that widget ? What kind of graphics cards do you have on your system ? Hi, QSignalMapper might be what you are looking for. Hello, It was an other problem that causes this problem. So, I solved and now it works. Thanks . Final solution, it works very well. Thanks to @SGaist and @VRonin : No one has replied For more information, here is the error that I get : Couldn't load plugin OptionsTRANUS due to an error when calling its classFactory() method ImportError: cannot import name OptionsTRANUSDialog Traceback (most recent call last): File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 333, in startPlugin plugins[packageName] = package.classFactory(iface) File "C:/Users/emna/.qgis2/python/plugins\OptionsTRANUS__init__.py", line 34, in classFactory from .Options_TRANUS import OptionsTRANUS.py", line 30, in from .OptionsTRANUS_project import OptionsTRANUSProject File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 607, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:/Users/emna/.qgis2/python/plugins\OptionsTRANUS\OptionsTRANUS_project.py", line 24, in from .Options_TRANUS_dialog import OptionsTR_dialog.py", line 29, in from .launch_tranus_dialog import LaunchTR\launch_tranus_dialog.py", line 7, in from .Options_TRANUS_dialog import OptionsTRANUSDialog ImportError: cannot import name OptionsTRANUSDialog Python version: 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] QGIS version: 2.18.3 Las Palmas, 77b8c3d Python Path: C:/OSGEO4~1/apps/qgis/./python C:/Users/emna/.qgis2/python C:/Users/emna/.qgis2/python/plugins C:/OSGEO4~1/apps/qgis/./python/plugins C:\OSGEO4~1\apps\Python27\lib\site-packages\setuptools-0.9.8-py2.7.egg C:\OSGEO4~1\bin\python27.zip C:\OSGEO4~1\apps\Python27\DLLs C:\OSGEO4~1\apps\Python27\lib C:\OSGEO4~1\apps\Python27\lib\plat-win C:\OSGEO4~1\apps\Python27\lib\lib-tk C:\OSGEO4~1\bin C:\OSGEO4~1\apps\Python27 C:\OSGEO4~1\apps\Python27\lib\site-packages C:\OSGEO4~1\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg C:\OSGEO4~1\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win-amd64.egg C:\OSGEO4~1\apps\Python27\lib\site-packages\pytz-2012j-py2.7.egg C:/Users/emna/.qgis2//python I've took a look at the official project on SourceForge so we may have something different currently. For the record, the bug is in PySide. I moved to PyQt and except a few differences, the code is the same. No crash at all. Sad. First version, you don't want to call find each and every time you want to do something with an internal object. By the way, why not use super rather than call the base class __init__ ? Thank you! I didnt noticed that. I did correct this mistakes, but still getting the same error:( and empty window :/ Thanks for this useffull link. No special suggestions, the goal of both is to provide a complete set of bindings for the Qt modules. PySide2 information can be found here. If you need to start right now with Qt 5 and python, PyQt might be the current best option. I haven't tested Python for mobile application so I can't comment on that however there might be catches with the mobile platform development rules about using an interpreter that you should check. Hi and welcome to devnet, Yes, do_work will be called in your thread. For such a use case, it's a bit overkill, QtConcurrent::run would likely be simpler and cleaner. Putting your stylesheet at the application level (especially if the one your wrote) means that each and every widget might be customised which requires changing the style used to draw the widget. So you should be careful with what you put in your stylesheet. @SGaist DATE_RECEIVED = self.date_received.text() i stop passing self.date_received.text() to DATE_RECEIVED and i do it in all of my variable What does " i have problem with touch events" mean in your case? ps: And please use code tags when posting code is much easier to read than import foo from bar def foobar(): print("this is not readable") ;) I'd recommend brining this to the PyQt forum. They'll be best to answer packaging related questions. Just in case, I saw the pyqt5-tools package that might be interest. Hope it helps Disabled Categories are greyed out
https://forum.qt.io/category/15/language-bindings
CC-MAIN-2017-13
refinedweb
771
59.6
Created on 2019-12-17 17:51 by RunOrVeith, last changed 2021-06-22 14:45 by eric.smith. This issue is now closed. When creating a dataclass with a default that is a field with a default factory, the factory is not correctly resolved in cls.__init__.__defaults__. It evaluates to the __repr__ of dataclasses._HAS_DEFAULT_FACTORY_CLASS, which is "<factory>". The expected behavior would be to have a value of whatever the default factory produces as a default. This causes issues for example when using inspect.BoundParameters.apply_defaults() on the __init__ of such a dataclass. Code to reproduce: ``` from dataclasses import dataclass, field from typing import Any, Dict @dataclass() class Test: a: int b: Dict[Any, Any] = field(default_factory=dict) print(Test.__init__.__defaults__) # <factory> ``` The affected packages are on a high-level dataclasses, on a lower level the issue is in the builtin __function.__defaults__. The problem is that __init__ has to have a sentinel to know whether or not to call the default value. If the default were just "dict", should it call it, or is the passed in value really dict, in which case it doesn't get called? dataclass() class Test: a: int b: Dict[Any, Any] = field(default_factory=dict) The generated __init__ looks like: def __init__(self, a, b=_HAS_DEFAULT_FACTORY): self.a = a self.b = dict() if b is _HAS_DEFAULT_FACTORY else b If it were: def __init__(self, a, b=dict): self.a = a Then what would the assignment to self.b look like? What if you instantiated an object as Test(0, dict)? You wouldn't want dict to get called. You need to differentiate between Test(0, dict) and Test(0). The former does not call b, but the latter does call b. I guess I could make the default value something like _CALLABLE(dict), but I'm not sure that would do you any good. But at least you could tell from the repr what it is. I don't think there's any action to be done here, so I'm going to close this.
https://bugs.python.org/issue39078
CC-MAIN-2021-49
refinedweb
344
67.15
Odoo Help Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps: CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc. Create a dynamic list of checkboxes in a view [Closed] The Question has been closedby Hello, I am learning how to develop custom modules so excuse me if this sounds basic. For a new module I need to be able to create a view which will have N number of checkboxes. That N number will come from the inputs of another view, lets call it Categories So in the view User I want the view to show a checkbox for each category in the Categories table. Is this possible? If anyone can point me out on a module with similar functionalities or tip me on the basics on how this can be achieved I will be very thankful. Thanks in advance First you have to dynamically create N number of fields for check boxes. Now second thing about how to display N number of fields? You can dynamically create fields & view by overriding def view_init & def fields_view_get methods. You can find similar code in POS Return. Hope it will solve your problem. Thanks Sudhir! Let me make sure I understand. I create both functions inside of my class "Users" lets say which will read the fields form my other table to create the N fields, but when are those functions called? Or those are functions which always get called by OpenERP? I will start testing Hi Yakito...looking for similar solution. Can you please post some dummy code for these functions to understand proper. It will be a great help. Thanks. About This Community Odoo Training Center Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
https://www.odoo.com/forum/help-1/question/create-a-dynamic-list-of-checkboxes-in-a-view-1965
CC-MAIN-2017-09
refinedweb
306
73.98
CodePlexProject Hosting for Open Source Software I don't know that Why RouteCollection Class in System.Web namespace don't contain MapServiceRoute method. (I am using VS2010 Ultimate, .Net framework 4). MapServiceRoute is in namespace Microsoft.ApplicationServer.Http.Activation in the following assembly Microsoft.ApplicationServer.HttpEnhancements. You have to make a reference to that assembly to make the following call RouteTable.Routes.MapServiceRoute<ContactResource>("Contact", config); Ok! Thanks! Are you sure you want to delete this post? You will not be able to recover it later. Are you sure you want to delete this thread? You will not be able to recover it later.
https://wcf.codeplex.com/discussions/256919
CC-MAIN-2017-13
refinedweb
104
55.2
Author Note: The original article was written in Feb 2002. Here I am after 9 years later. Fixed some grammar and code bugs and updated it to .NET 4.0. BTW, this article is almost reaching 2 million views.Programming Arrays in C# Programming C# is a new self-taught series of articles, in which I demonstrate various topics of C# language in a simple step by step tutorial format. Arrays are probably one of the most wanted topics in C#. The focus of this article is arrays in C#. The article starts with basic definitions of different array types and how to use them in our application. Later, the article covers the Arrays class and its methods, which can be used to sort, search, get, and set an array's items. Introduction In C#, an array index starts at zero. That means the first item of an array starts at the 0th position. The position of the last item on an array will total number of items - 1. So if an array has 10 items, the last 10th item is at 9th position.. intArray = new int[5]; The following code snippet declares an array that can store 100 items starting from index 0 to 99. intArray = new int[100]; Defining arrays of different types In the previous code snippet, we saw how to define a simple array of integer type. Similarly, we can define arrays of any type such as double, character, and string. In C#, arrays are objects. That means that declaring an array doesn't create an array. After declaring an array, you need to instantiate an array by using the "new" operator. The following code snippet defines arrays of double, char, bool, and string data types. double[] doubleArray = new double[5]; char[] charArray = new char[5]; bool[] boolArray = new bool[2]; string[] stringArray = new string[10]; Initializing Arrays Once an array is declared, the next step is to initialize an array. The initialization process of an array includes adding actual data to the array. The following code snippet creates an array of 3 items and values of these items are added when the array is initialized. // Initialize a fixed array int[] staticIntArray = new int[3] {1, 3, 5}; Alternative, we can also add array items one at a time as listed in the following code snippet. // Initialize a fixed array one item at a time int[] staticIntArray = new int[3]; staticIntArray[0] = 1; staticIntArray[1] = 3; staticIntArray[2] = 5; The following code snippet declares a dynamic array with string values. // Initialize a dynamic array items during declaration string[] strArray = new string[] { "Mahesh Chand", "Mike Gold", "Raj Beniwal", "Praveen Kumar", "Dinesh Beniwal" }; Accessing Arrays We can access an array item by passing the item index in the array. The following code snippet creates an array of three items and displays those items on the console. // Read array items one by one Console.WriteLine(staticIntArray[0]); Console.WriteLine(staticIntArray[1]); Console.WriteLine(staticIntArray[2]); This method is useful when you know what item you want to access from an array. If you try to pass an item index greater than the items in array, you will get an error. Accessing an array using a foreach Loop The foreach control statement (loop) is used to iterate through the items of an array. For example, the following code uses foreach loop to read all items of an array of strings. string[] strArray = new string[] { "Mahesh Chand", "Mike Gold", "Raj Beniwal", "Praveen Kumar", "Dinesh Beniwal" }; // Read array items using foreach loop foreach (string str in strArray) { Console.WriteLine(str); } This approach is used when you do not know the exact index of an item in an array and needs to loop through all the items. Array Types Arrays can be divided into the following four categories. · Single-dimensional arrays · Multidimensional arrays or rectangular arrays · Jagged arrays · Mixed arrays. Single Dimension ArraysSingle-dimensional arrays are the simplest form of arrays. These types of arrays are used to store number of items of a predefined type. All items in a single dimension array are stored contiguously starting from 0 to the size of the array -1. The following code declares an integer array that can store 3 items. As you can see from the code, first I declare the array using [] bracket and after that I instantiate the array by calling the new operator. intArray = new int[3]; Array declarations in C# are pretty simple. You put array items in curly braces ({}). If an array is not initialized, its items are automatically initialized to the default initial value for the array type if the array is not initialized at the time it is declared. The following code declares and initializes an array of three items of integer type. The following code declares and initializes an array of 5 string items. string[] strArray = new string[5] { "Mahesh", "Mike", "Raj", "Praveen", "Dinesh" }; You can even directly assign these values without using the new operator. string[] strArray = { "Mahesh", "Mike", "Raj", "Praveen", "Dinesh" }; You can initialize a dynamic length array as follows: string[] strArray = new string[] { "Mahesh", "Mike", "Raj", "Praveen", "Dinesh" }; Multi-Dimensional Arrays A multi-dimensional array, also known as a rectangular array is an array with more than one dimension. The form of a multi-dimensional array is a matrix. Declaring a multi-dimensional array A multi dimension array is declared as following: string[,] mutliDimStringArray; A multi-dimensional array can be fixed-sized or dynamic sized. Initializing multi-dimensional arrays The following code snippet is an example of fixed-sized multi-dimensional arrays that defines two multi dimension arrays with a matrix of 3x2 and 2x2. The first array can store 6 items and second array can store 4 items. Both of these arrays are initialized during the declaration. int[,] numbers = new int[3, 2] { { 1, 2 }, { 3, 4 }, { 5, 6 } }; string[,] names = new string[2, 2] { { "Rosy", "Amy" }, { "Peter", "Albert" } }; Now let's see examples of multi-dimensional dynamic arrays where you are not sure of the number of items of the array. The following code snippet creates two multi-dimensional arrays with no limit. int[,] numbers = new int[,] { { 1, 2 }, { 3, 4 }, { 5, 6 } }; string[,] names = new string[,] { { "Rosy", "Amy" }, { "Peter", "Albert" } }; You can also omit the new operator as we did in single dimension arrays. You can assign these values directly without using the new operator. For example:int[,] numbers = { { 1, 2 }, { 3, 4 }, { 5, 6 } }; string[,] names = { { "Rosy", "Amy" }, { "Peter", "Albert" } }; We can also initialize the array items one item at a time. The following code snippet is an example of initializing array items one at a time. int[,] numbers = new int[3, 2]; numbers[0, 0] = 1; numbers[1, 0] = 2; numbers[2, 0] = 3; numbers[0, 1] = 4; numbers[1, 1] = 5; numbers[2, 1] = 6; Accessing multi-dimensional arrays A multi-dimensional array items are represented in a matrix format and to access it's items, we need to specify the matrix dimension. For example, item(1,2) represents an array item in the matrix at second row and third column. The following code snippet shows how to access numbers array defined in the above code. Console.WriteLine(numbers[0,0]); Console.WriteLine(numbers[0, 1]); Console.WriteLine(numbers[1, 0]); Console.WriteLine(numbers[1, 1]); Console.WriteLine(numbers[2, 0]); Console.WriteLine(numbers[2, 2]); Jagged Arrays Jagged arrays are arrays of arrays. The elements of a jagged array are other arrays. Declaring Jagged Arrays Declaration of a jagged array involves two brackets. For example, the following code snippet declares a jagged array that has three items of an array. int[][] intJaggedArray = new int[3][]; The following code snippet declares a jagged array that has two items of an array. string[][] stringJaggedArray = new string[2][]; Initializing Jagged Arrays Before a jagged array can be used, its items must be initialized. The following code snippet initializes a jagged array; the first item with an array of integers that has two integers, second item with an array of integers that has 4 integers, and a third item with an array of integers that has 6 integers. // Initializing jagged arrays intJaggedArray[0] = new int[2]; intJaggedArray[1] = new int[4]; intJaggedArray[2] = new int[6]; We can also initialize a jagged array's items by providing the values of the array's items. The following code snippet initializes item an array's items directly during the declaration. intJaggedArray[0] = new int[2]{2, 12}; intJaggedArray[1] = new int[4]{4, 14, 24, 34}; intJaggedArray[2] = new int[6] {6, 16, 26, 36, 46, 56 }; Accessing Jagged Arrays We can access a jagged array's items individually in the following way: Console.Write(intJaggedArray3[0][0]); Console.WriteLine(intJaggedArray3[2][5]); We can also loop through all of the items of a jagged array. The Length property of an array helps a lot; it gives us the number of items in an array. The following code snippet loops through all of the items of a jagged array and displays them on the screen. // Loop through all itesm of a jagged array for (int i = 0; i < intJaggedArray3.Length; i++) System.Console.Write("Element({0}): ", i); for (int j = 0; j < intJaggedArray3[i].Length; j++) { System.Console.Write("{0}{1}", intJaggedArray3[i][j], j == (intJaggedArray3[i].Length - 1) ? "" : " "); } System.Console.WriteLine(); Mixed Arrays Mixed arrays are a combination of multi-dimension arrays and jagged arrays. The mixed arrays type is removed from .NET 4.0. I have not really seen any use of mixed arrays. You can do anything you want with the help of multi-dimensional and jagged arrays. A Simple Example Here is a complete example listed in Listing 1 that demonstrates how to declare all kinds of arrays then initialize them and access them. To test this code, create a console application using Visual Studio 2010 or Visual C# Express and copy and paste this code. Console.WriteLine("Single Dimension Array Sample"); // Single dim array Console.WriteLine("-----------------------------"); Console.WriteLine("Multi-Dimension Array Sample"); string[,] string2DArray = new string[2, 2] { { "Rosy", "Amy" }, { "Peter", "Albert" } }; foreach (string str in string2DArray) Console.WriteLine("Jagged Array Sample"); int[][] intJaggedArray3 = new int[] {2,12}, new int[] {14, 14, 24, 34}, new int[] {6, 16, 26, 36, 46, 56} }; Console.Write("Element({0}): ", i); Console.Write("{0}{1}", intJaggedArray3[i][j], j == (intJaggedArray3[i].Length - 1) ? "" : " "); Console.WriteLine(); Listing 1 The output of Listing 1 looks like Figure 1. Figure 1 Array Class Array class is the mother of all arrays and provides functionality for creating, manipulating, searching, and sorting arrays in .NET Framework. Array class, defined in the System namespace, is the base class for arrays in C#. Array class is an abstract base class that means we cannot create an instance of the Array class. Creating an Array Array class provides the CreateInstance method to construct an array. The CreateInstance method takes first parameter as the type of items and second and third parameters are the dimension and their range. Once an array is created, we use SetValue method to add items to an array. The following code snippet creates an array and adds three items to the array. As you can see the type of the array items is string and range is 3. You will get an error message if you try to add 4th item to the array. Array stringArray = Array.CreateInstance(typeof(String), 3); stringArray.SetValue("Mahesh Chand", 0); stringArray.SetValue("Raj Kumar", 1); stringArray.SetValue("Neel Beniwal", 2); Note: Calling SetValue on an existing item of an array overrides the previous item value with the new value. The code snippet in Listing 2 creates a multi-dimensional array. Array intArray3D = Array.CreateInstance(typeof(Int32), 2, 3, 4); for (int i = intArray3D.GetLowerBound(0); i <= intArray3D.GetUpperBound(0); i++) for (int j = intArray3D.GetLowerBound(1); j <= intArray3D.GetUpperBound(1); j++) for (int k = intArray3D.GetLowerBound(2); k <= intArray3D.GetUpperBound(2); k++) { intArray3D.SetValue((i * 100) + (j * 10) + k, i, j, k); } foreach (int ival in intArray3D) Console.WriteLine(ival); Listing 2 Array Properties Table 1 describes Array class properties. IsFixedSize Return a value indicating if an array has a fixed size or not. IsReadOnly Returns a value indicating if an array is read-only or not. LongLength Returns a 64-bit integer that represents total number of items in all the dimensions of an array. Length Returns a 32-bit integer that represents the total number of items in all the dimensions of an array. Rank Returns the number of dimensions of an array. Table 1 The code snippet in Listing 3 creates an array and uses Array properties to display property values. int[] intArray = new int[3] {0, 1, 2}; if(intArray.IsFixedSize) Console.WriteLine("Array is fixed size"); Console.WriteLine("Size :" + intArray.Length.ToString()); Console.WriteLine("Rank :" + intArray.Rank.ToString()); Listing 3 The output of Listing looks like Figure 2. Figure 2 Searching for an Item in an Array The BinarySearch static method of Array class can be used to search for an item in an array. This method uses the binary search algorithm to search for an item. The method takes at least two parameters. First parameter is the array in which you would like to search and the second parameter is an object that is the item you are looking for. If an item is found in the array, the method returns the index of that item (based on first item as 0th item). Otherwise method returns a negative value. Note: You must sort an array before searching. See comments in this article.Listing 4 uses BinarySearch method to search an array for a string. // Create an array and add 5 items to it Array stringArray = Array.CreateInstance(typeof(String), 5); stringArray.SetValue("Mahesh", 0); stringArray.SetValue("Raj", 1); stringArray.SetValue("Neel", 2); stringArray.SetValue("Beniwal", 3); stringArray.SetValue("Chand", 4); // Find an item object name = "Neel"; int nameIndex = Array.BinarySearch(stringArray, name); if (nameIndex >= 0) Console.WriteLine("Item was at " + nameIndex.ToString() + "th position"); else Console.WriteLine("Item not found"); Listing 4 Sorting Items in an Array The Sort static method of the Array class can be used to sort array items. This method has many overloaded forms. The simplest form takes as a parameter the array you want to sort. Listing 5 uses the Sort method to sort array items. Using the Sort method, you can also sort a partial list of items. Console.WriteLine(); Console.WriteLine("Original Array"); Console.WriteLine("---------------------"); foreach (string str in stringArray) Console.WriteLine("Sorted Array"); Console.WriteLine("---------------------"); Array.Sort(stringArray); } Listing 5 The output of Listing 5 looks like Figure 3. Figure 3 Alternatively the Sort method takes starting index and number of items after that index. The following code snippet sorts 3 items starting at 2nd position. Array.Sort(stringArray, 2, 3); The new output looks like Figure 4. Figure 4 Getting and Setting Values The GetValue and SetValue methods of the Array class can be used to get and set values of an array's items. The code listed in Listing 4 creates a 2-dimensional array instance using the CreateInstance method. After that I use the SetValue method to add values to the array. In the end, I find number of items in both dimensions and use GetValue method to read values and display on the console. Array names = Array.CreateInstance(typeof(String), 2, 4); names.SetValue("Rosy", 0, 0); names.SetValue("Amy", 0, 1); names.SetValue("Peter", 0, 2); names.SetValue("Albert", 0, 3); names.SetValue("Mel", 1, 0); names.SetValue("Mongee", 1, 1); names.SetValue("Luma", 1, 2); names.SetValue("Lara", 1, 3); int items1 = names.GetLength(0); int items2 = names.GetLength(1); for (int i = 0; i < items1; i++) for (int j = 0; j < items2; j++) Console.WriteLine(i.ToString() + "," + j.ToString() + ": " + names.GetValue(i, j)); Listing 6 The output of Listing 6 generates Figure 5. Figure 5 Reverse an array items The Reverse static method of the Array class reverses the order of items in an array. Similar to the Sort method, you can just pass an array as a parameter of the Reverse method. Console.WriteLine("Reversed Array"); Array.Reverse(stringArray); // Array.Sort(stringArray, 2, 3); Console.WriteLine("Double Reversed Array"); Listing 7 The output of Listing 7 generates Figure 6. Figure 6 Clear an array items The Clear static method of the Array class removes all items of an array and sets its length to zero. This method takes three parameters - first an array object, second starting index of the array and third is number of elements. The following code clears two elements from the array starting at index 1 (means second element of the array). Array.Clear(stringArray, 1, 2); Note: Keep in mind, the Clear method does not delete items. Just clear the values of the items. The code listed in Listing 8 clears two items from the index 1. Console.WriteLine("Clear Items"); Listing 8 The output of Listing 8 generates Figure 7. As you can see from Figure 7, the values of two items from the output are missing but actual items are there. Figure 7 Get the size of an array The GetLength method returns the number of items in an array. The GetLowerBound and GetUppperBound methods return the lower and upper bounds of an array respectively. All these three methods take at least a parameter, which is the index of the dimension of an array. The following code snippet uses all three methods. Console.WriteLine(stringArray.GetLength(0).ToString()); Console.WriteLine(stringArray.GetLowerBound(0).ToString()); Console.WriteLine(stringArray.GetUpperBound(0).ToString()); Copy an array The Copy static method of the Array class copies a section of an array to another array. The CopyTo method copies all the elements of an array to another one-dimension array. The code listed in Listing 9 copies contents of an integer array to an array of object types. // Creates and initializes a new Array of type Int32. Array oddArray = Array.CreateInstance(Type.GetType("System.Int32"), 5); oddArray.SetValue(1, 0); oddArray.SetValue(3, 1); oddArray.SetValue(5, 2); oddArray.SetValue(7, 3); oddArray.SetValue(9, 4); // Creates and initializes a new Array of type Object. Array objArray = Array.CreateInstance(Type.GetType("System.Object"), 5); Array.Copy(oddArray, oddArray.GetLowerBound(0), objArray, objArray.GetLowerBound(0), 4); int items1 = objArray.GetUpperBound(0); Console.WriteLine(objArray.GetValue(i).ToString()); Listing 9 You can even copy a part of an array to another array by passing the number of items and starting item in the Copy method. The following format copies a range of items from an Array starting at the specified source index and pastes them to another Array starting at the specified destination index. public static void Copy(Array, int, Array, int, int); Clone an Array Clone method creates a shallow copy of an array.. The following code snippet creates a cloned copy of an array of strings. string[] clonedArray = (string[])stringArray.Clone(); Summary In this article, you learned basics of arrays and how arrays are handled and used in C#. In the beginning of this article, we discussed different types of arrays such as single dimension, multi dimension, and jagged arrays. After that we discussed the Array class. In the end of this article, we saw how to work with arrays using different methods and properties of the Array class. ©2016 C# Corner. All contents are copyright of their authors.
http://www.c-sharpcorner.com/UploadFile/mahesh/WorkingWithArrays11232005064036AM/WorkingWithArrays.aspx
CC-MAIN-2016-18
refinedweb
3,246
58.08
Objectives - Demystify infrared light. - Introduce infrared sensors (IR). - Learn how to use a IR remote control with your Arduino . - Example sketchs. - The switch-case statement. Bill of materials INFRARED REMOTE CONTROLS We are so used to infrared remote controls that we don’t give time over to think about them. They are nowadays familiar to us, although they would have seemed magic to our grandparents. Today it seems normal that electronic equipment, televisions, stereos, air conditioners, respond to our instructions without having to get up from the sofa, but this has not always been the case, moreover, these kind of controls have become popular not so long ago. We have heard that they operate by using infrared rays and not much more. I wonder how many people would answer correctly to what infrared rays are and which principle of operation is behind a remote control. To focus some ideas, let’s start by saying that the electromagnetic waves are characterized mainly by their frequency or what is the same, the inverse of this, that is, the wavelength. They are similar to sound waves. Those that have a lower frequency are called infrasounds, and after them come the sound waves, of course. A little above we find the ultrasounds (surprising names, which basically means below and above what you hear). In the electromagnetic spectrum, we find first radio waves and microwaves. Then as you see in this image, we can see the infrared zone (below red), the spectrum of visible light with the familiar colours (which are just one way our brain perceives the light frequencies) and then the ultraviolet (above violet). Further up the scale we find the X-ray (when the German scientist Roentgen discovered this kind of radiation in the late nineteenth, he had no idea of what it was, so it seemed a good idea to call them X-rays, or unknown, and we still continue with this joke) and finally the gamma or cosmic rays. The amount of radiation energy increases rapidly with frequency, that is why X-rays and gamma rays are very harmful to living beings. One way to describe the infrared rays would be a light with a different wavelength, that we are not able not see, but nevertheless light. A little-known curiosity is that the camera of your mobile phone or tablet is able to see and show the IR radiation of your remote controls. Infrared light is suitable for remote controls because: - Uses a light frequency that makes no harm in living tissues. It has less impact than visible light. - As we often watch TV in the dark, we do not see it when using the remote control. - Its range is relatively short, but we do not usually watch TV or have the stereo beyond 2 or 3 meters away. So it is practical, simple and cheap (what the manufacturers like), but it also has drawbacks. The main drawback is that anything with a certain temperature, including us, emits infrared radiation. That is why IR cameras can show people or animals clearly in the dark (as you can see in action or war movies). And this could interfere with the IR remote control, as well as things like heating, sun and other hot items. So the solution to avoid this is to modulate the signal with a carrier. The basic idea is to send a train of stable waves (the carrier) and mix it with the information you want to send (the signal). This same principle is used with radio and almost any radio signal that is sent through the air. We have found this gif image in the subprojects site and I think it is ideal to show the process of modulation and transmission. The emitter is a simple transistor that controls an infrared LED diode, very similar to the normal LEDs diodes we have used so far, but this time designed to emit light in a colour that we are not able to see. A simple processor in the remote control takes care of the signal generation and mixing with the carrier to ensure that our TV does not receive spurious commands. - The process of mixing a signal with a carrier is called modulation. - The reverse process, that is, to extract the signal from an RF wave and obtain a clean signal is called demodulation. The receiver is a little more complex because the IR emission standards for remote controls, appeared like mushrooms after a storm and each manufacturer presented its own standard. At the end the industry ended up designing receivers capable of receiving and demodulating almost anything, and as they are sold like cupcakes (because we love to keep our ass glued to the sofa) they are so cheap, besides a technological marvel. A current typical IR receiver includes the receiver, amplifier-demodulator and ready for use. You can not imagine the amount of electronics that is included in this innocent looking little piece. IR SENSORS The wiring diagram is again trivial, as the AX-1838HS only has 3 pins: Vcc, GND and signal. As we will use an interrupt to read the signal is essential to connect the signal pin to the Arduino pin 2 (Interruption 0) or pin 3 (Interruption 1). We are going to connect it to pin 2, as can be seen in the code and examples. THE CONTROL PROGRAM So that they can be used in a comfortable way, we will download a library that will make our life easier. Of the several available we liked the one from Hood Nico, for several reasons. - It is light and very fast to decode IR signals and besides uses very little memory. - Although it does not decode everything, it accepts NEC and Panasonic standards and compatibles. It also has a “do your best” mode that seems to work pretty well, what gives us a 85% chance to recognize your remote control. - It uses interruptions, which makes it very light and fast . This way we can see a good example of using them. - It is of the few able to decode simultaneous signals of several different remote controls, each using a different protocol. First we have to download the IRLremote.zip library, and then install it following the usual procedure we saw in previous chapters.IRLremote.zip Once done, we must import the library: #include "IRLremote.h" And then we initialize it: IRLbegin<IR_ALL>(interruptIR); Let’s start with an example that the author recommends in order to recognize the remote control we use. You can load the following example IRLremote \ ReceiveInterrupt: #include "IRLremote.h" const int interruptIR = 0; // Arduino interruption 0: Pin 2 uint8_t IRProtocol = 0; // Variables to receive data uint16_t IRAddress = 0; uint32_t IRCommand = 0; void setup() { Serial.begin(115200); // Pay attention to baud rate Serial.println("Startup"); IRLbegin<IR_ALL>(interruptIR); } void loop() { uint8_t oldSREG = SREG; // Stop interruptions cli(); if (IRProtocol) // If it recognizes the protocol { Serial.print("Protocol:"); Serial.println(IRProtocol); Serial.print("Address:"); Serial.println(IRAddress, HEX); Serial.print("Command:"); Serial.println(IRCommand, HEX); IRProtocol = 0; } SREG = oldSREG; } void IREvent(uint8_t protocol, uint16_t address, uint32_t command) { IRProtocol = protocol; // We store the values and come back IRAddress = address; IRCommand = command; } This program simply tries to read your remote control and send that information to the console. Make sure you set the baud rate at 115200: As you see the interruption service routine simply shows the values of the protocol that the library kindly he acknowledges on the fly. These values are: - It informs about the signal model that our remote control uses. Right now it recognizes four protocols and the author seeks the cooperation of users, to increase the number of available protocols within the library. Currently they are: - IR_NO_PROTOCOL , 0 - IR_USER, 1 - IR_ALL, 2 - IR_NEC, 3. - IR_PANASONIC, 4 - Address of your remote control. Each remote control has a address that identifies it. You could use more than one remote control and they will be recognized separately. - The command or which button is pressed on the remote control. Each button has a different code and these codes will be used in your programs to launch different actions, depending on the pressed button. We have tried 5 different IR remote controls (we have many junk) and 4 were recognized correctly at first: Panasonic, Sony, LG and Keyes. The one that was not recognized was an old remote control from a Schneider TV that we didn’t know where it came from. - We should mention that if you have an old CRT TV, a video recorder or something like this that you no longer use, throw the appliance if you want but keep the remote control because chances are that it can be recognized by your Arduino. - In addition your old junk, having remote control, include this IR receivers, so they can be disassembled and reused for your stuff. (I recommend disassembling only the old and useless gadgets, not those who are working…). And in this sketch is already implicit everything you need to use an IR remote control in your projects. The rest of the chapter is simply an example of how to manage these keystrokes with a switch statement, that is a C++ statement that we had not ever used. We will assemble a prototype with Arduino and 4 coloured LED diodes to turn them one at a time or all at once, using the IR remote control. SCHEMATIC AND WIRING DIAGRAMS The schematic is quite simple: And the wiring diagram is harder to draw than to assemble: THE CONTROL PROGRAM At the beginning of this chapter we saw that we received instructions from the remote control (I hope so) and on the console was shown the value of the protocol, its address and which command corresponded to the button pressed. These commands are what you need for your sketch to start working. - If you have more than one remote control and want to use them, you’ll have to also control the address of each remote control. First you have to run the previous sketch to record the codes that correspond to each key of your remote control, and write a table. You don’t have to write all keys for now, but at least those that we are going to use. The results from the LG remote control were the following: And using these values we can write the control program. We will use the switch-case statement, which is very comfortable when you have to check many values and take some action in response to a variable. The basic idea is like this: switch (IRCommand) {; } The switch statement analyzes the variable whose value determines what action to take, in this case which button was pressed. And then a case clause is set for each possible value. Note that all case clauses end with a colon. Then come the statements to be executed and the cause clause ends with a break statement. The break statement ends the switch-case statement and prevents the execution of other case clauses. We have written on purpose a Serial.println() so you can see that you can write several statements without using a block of code, because it is already implicit in the case. You can include a default clause at the end, just in case you want an action to be executed if the value of the variable does not match any other case specified above. Here you have a example sketch:Sketch 58.1 #include "IRLremote.h" const int interruptIR = 0; uint8_t IRProtocol = 0; // Variables to receive the data uint16_t IRAddress = 0; uint32_t IRCommand = 0; void setup() { Serial.begin(115200); // Pay attention to baud rate for (int i = 8 ; i<12 ; i++) pinMode(i, OUTPUT); IRLbegin<IR_ALL>(interruptIR); } The only new thing up here, has been to define as output the pins from 8 to 11: void loop() { uint8_t oldSREG = SREG; // Stop the interruptions cli(); if (IRProtocol) { switch (IRCommand) // Here we have the switch-case statement {; } IRProtocol = 0; } SREG = oldSREG; } void IREvent(uint8_t protocol, uint16_t address, uint32_t command) { IRProtocol = protocol; // Recogemos los valores IRAddress = address; IRCommand = command; } The switch clause is very useful to avoid nested if-else statements that make you lose the thread. Imagine that you have to check all the possible keys of a remote control. Finally and before finishing, we should comment that the author of the library recommended that if we are to use a single command, we must replace the following line: IRLbegin<IR_ALL>(interruptIR); by one that matches our model because this way we will save memory and speed in decoding the signals. In our case, as the protocol is 3, IR_NEC, we would use: IRLbegin<IR_NEC >(interruptIR); Summary - We have a clearer picture of what infrared light is. - We have introduced the AX-1838HS, IR remote control’s sensor. - We have seen we can use the remote controls we have at hand and that our Arduino is able to read most of them. - We have seen the switch-case statement. Give a Reply
http://prometec.org/58-infrared-sensors/
CC-MAIN-2019-13
refinedweb
2,170
59.13
[ ] Konstantin Shvachko commented on HADOOP-227: -------------------------------------------- Merging of fsimage with the edits can be done using O(sqrt( number of files )) memory. Suppose the number of files in fsimage (sorted by path name) is N. I divide fsimage into blocks so that each block has B=sqrt(N) namespace entries. The number of such blocks will be also M=sqrt(N). For each block we store in memory the path name of the first entry of the block, and the block offset. I then start reading the edits file. For every operation in edits I read an appropriate block from fsimage using the table in-memory, look for the appropriate entry, and perform operation on the corresponding file. Update operations are performed in place, remove just leaves the free space in the block. When a new entry needs to be added current block is split into two new blocks each containing half of the records of the original block, and is stored in the end of the fsimage file. The in-memory table is also updated to reflect new keys and new block offsets. This algorithm needs to keep in memory the table of size M and one block of size B. The total size of memory used is M + B = O(sqrt(N)). If we need to tighten the memory requirement then we can divide N into smaller number of blocks (reduce M) and read a part of the block each time (reduce B). The price is more disk IOs, which seems acceptable, for the name-node disk usage is not critical. >:
http://mail-archives.apache.org/mod_mbox/hadoop-common-dev/200612.mbox/%3C33063628.1165285404390.JavaMail.jira@brutus%3E
CC-MAIN-2016-50
refinedweb
263
70.13
Few weeks ago, I noticed while browsing Twitter that Ryan Cavanaugh had some issues with his microwave : Ryan Cavanaugh@searyanc My microwave has multiple software bugs, seemingly caused by race conditions. Sometimes cooking ends with the clock not at 00:00. Sometimes the cooling fan doesn't turn on (!). Sometimes a button registers a beep but doesn't do its assigned function. Disturbing.18:36 PM - 31 Mar 2020 Let's try to fix it for him, shall we? 😁 Requirements First, let's define the scope and requirements of our microwave. As a user, I want my microwave to: - Have 5 buttons so I can interact with it: - +10s: No matter what the current state is, add 10s to the remaining time - +60s: No matter what the current state is, add 60s to the remaining time - Start: - If the current state is "reset", simply start the microwave - If the current state is "stopped", resume the microwave - Stop: If the current state is "started", pause the microwave - Reset: If the current state is "started" or "stopped", stop the microwave and reset the remaining time to 0 - See the remaining time displayed at all time - See the remaining time going down every second when the microwave is started - Automatically stop when it's started and reaches 0s remaining Pick your weapons Language The idea for this app and blog post came from Ryan Cavanaugh's tweet. Typescript has to be our default 🙏. Libs We'll use only 1 library: RxJs. As you've noticed in the requirements, a microwave is time based and also look like a state machine. RxJs will come really handy to handle such a case 🚀. State VS streams? Before we start sketching out our main data flow, I'd like to clarify the difference between the state of our app VS the streams we can use. A common pitfall I see quite often with RxJs is when someone creates a lot of Subjects or BehaviorSubjects to hold some state. It's making things quite hard to follow and then we have to combine multiple streams to build our main state using for example combineLatest. While this could work nicely for a few streams, the more streams you add, the hardest it'll be to maintain. A pattern like Redux can instead be used and makes things much simpler to reason about. We'll discover a diagram in the next part to visualize this. Implementing the main data flow Before implementing all the "details", we'll think and sketch our main stream. Based on the requirements explained earlier, we know that the state of the microwave will change based on 4 different actions: - Add some time (in our case either +10s or +60s) - Start the microwave - Stop the microwave - Reset the microwave Let's now transform the above diagram into some code. Defining the actions We are now aware that we need to create 4 actions. Actions are simple objects with: - A type (unique string per action) - A payload (optional and can be anything) In a very simplified way, we could write them as such: export interface StartAction { type: 'Start'; } export interface StopAction { type: 'Stop'; } export interface ResetAction { type: 'Reset'; } export interface AddTimeAction { type: 'AddTimeMs'; payload: { timeMs: number }; } But thanks to Typescript, we can improve that code by building on top of it to make it type safe to: - Create an action before dispatching it - Make sure that in our "reducer" function we do not forget to deal with all of them - Avoid to deal with strings and rather use enums // as the number of actions has a known length // I prefer to use an enum to define all of them // rather than just writing the type of an action // as a string export enum EMicrowaveAction { START = 'Start', STOP = 'Stop', RESET = 'Reset', ADD_TIME_MS = 'AddTimeMs', } export interface StartAction { type: EMicrowaveAction.START; } export interface StopAction { type: EMicrowaveAction.STOP; } export interface ResetAction { type: EMicrowaveAction.RESET; } export interface AddTimeAction { type: EMicrowaveAction.ADD_TIME_MS; payload: { timeMs: number }; } // we can also create a union type // (or a "one of" type) of all our actions // this will be useful in our reducer later on export type MicrowaveAction = StartAction | StopAction | ResetAction | AddTimeAction; // we don't **have to** use the namespace here // but I personally like this approach as when // you start having different parts in your // store, you can use the namespace to clearly // indicate which one is which, example from // the previous schema: // `UserActions`, `MessagesActions`, `DocumentsActions`, etc export namespace Actions { // we then create a function for each action type // this allows us to simply call a well named function // instead of dispatching an object several times in our app export const start = (): StartAction => ({ type: EMicrowaveAction.START, }); export const stop = (): StopAction => ({ type: EMicrowaveAction.STOP, }); export const reset = (): ResetAction => ({ type: EMicrowaveAction.RESET, }); export const addTime = (timeMs: number): AddTimeAction => ({ type: EMicrowaveAction.ADD_TIME_MS, payload: { timeMs }, }); } Good! We're now able to send actions 👏. Let's move on to the part where we need to handle them. Defining our reducer Before we define our reducer... What the fork is a reducer?! Let's take a quick look to our previous diagram: In the picture above, the reducer is the black square holding the microwave state. As you can notice, every time an action is being dispatched, the reducer will be called. It is a simple function which: - Takes 2 parameters - The current state - The action which just got dispatched - Returns a new state Important note: A reducer must be pure: - Data must be immutable Never mutate data from the current state or the action - It must not have any side effect You can't for example make HTTP calls within a reducer. Make them before dispatching an action, and once you've got the result pass it in the payload of the action - For any input passed to the function we must be able to guess the output You can't for example get the current timestamp in a reducer. Instead, if you need the current timestamp get it before dispatching the action and pass it in the payload of the action The microwave state We said previously that our microwave will have 4 actions available to change its current state (add time/start/stop/reset). But can the microwave status be the same as all these actions? Is it a 1-1 relationship? No, it isn't. The add time action shouldn't change the current status of the microwave. Lets define the MicrowaveStatus for that purpose then: export enum MicrowaveStatus { STARTED = 'Started', STOPPED = 'Stopped', RESET = 'Reset', } Now, we need to think about how to hold the internal state of the microwave. What data does our microwave need to work internally? Of course, it'll need the status we just created so we can start with: // internal state to the reducer interface MicrowaveInternalState { status: MicrowaveStatus; // ... todo } It'll also need to keep track of how much time the user plans to use it (when adding time through the add time action): interface MicrowaveInternalState { status: MicrowaveStatus; timePlannedMs: number; // ... todo } And finally, we need to keep track of how much time has been spent already with the microwave in the STARTED status. interface MicrowaveInternalState { status: MicrowaveStatus; timePlannedMs: number; onAndOffTimes: number[]; } You may now think: Why is onAndOffTimesan array of numbers instead of just the time elapsed in the STARTEDstatus? Lets think a bit about how a microwave works: - You enter some time using the buttons - You press start - The microwave is running - You can pause/restart the program until you reach 0s left (or stop it before) At no point in that workflow you press a button to keep the microwave running every second. Well, this is exactly the same for our actions. Actions represent how we want to interact with the state and every computation should be driven from the state downstream. In this case, we keep a record of the timestamps when the user toggle the microwave on and off. Later on, we'll see how to compute the elapsed time. In the meantime, we can still prepare the interface that will be consumed publicly when we subscribe to the microwave stream. It is pretty much the same except that instead of onAndOffTimes: number[] we'll have timeDoneMs: number. // exposed/computed state export interface MicrowaveState { status: MicrowaveStatus; timePlannedMs: number; timeDoneMs: number; } Here's another diagram to visually represent what we're building: Implementing the reducer function Now that we've understood the architecture we're trying to build and especially the role of the reducer function, we can start implementing it. If you refer to the previous diagram, the reducer is a (pure) function which takes 2 parameters: The MicrowaveInternalState and an action. We'll see later on how to attach the current timestamp to each action (without having to pass it manually all the time). For now, we'll assume the current timestamp is passed within an object, next to the current action. const microwaveReducer = (microwave: MicrowaveInternalState, { value: action, timestamp }): MicrowaveInternalState => { switch (action.type) { case EMicrowaveAction.START: return { // todo: return the new `MicrowaveInternalState` }; case EMicrowaveAction.STOP: return { // todo: return the new `MicrowaveInternalState` }; case EMicrowaveAction.RESET: return { // todo: return the new `MicrowaveInternalState` }; case EMicrowaveAction.ADD_TIME_MS: { return { // todo: return the new `MicrowaveInternalState` }; } default: unreachableCaseWrap(action); } return microwave; }; Before we start implementing each case, note the use of a switch statement and the call in the default of unreachableCaseWrap. As the action.type is a union type, every time we handle one case and return a result (hence stopping the switch), Typescript is smart enough to narrow down the next possible type. By having an unreachableCaseWrap function to which we pass the action.type, we can ensure that we don't forget to implement any type in our switch 🔥! Otherwise Typescript would throw an error at compile time. export const unreachableCaseWrap = (value: never) => {}; By saying that unreachableCaseWrap takes as an input a value of type never, if within our switch statement we're not handling all the different possible types, Typescript will notice that we're trying to pass a value which is not of type never. Cool! Now let's move on to implementing our reducer. Remember, we have to return a new state, without mutating the previous one. We want this function to remain pure. Does this mean we've got to deep copy the whole state? Isn't that going to be really expensive? Nop 😁! And thanks to ES6 we can easily do this using the spread operator. Here's a tiny example: const obj1 = { propA: { propA1: 'Value A 1', propA2: 'Value A 2', }, propB: { propB1: 'Value B 1', propB2: 'Value B 2', }, }; console.log(obj1); // displays: // --------- // { // propA: { // propA1: 'Value A 1', // propA2: 'Value A 2', // }, // propB: { // propB1: 'Value B 1', // propB2: 'Value B 2', // } // } const obj1Updated = { ...obj1, propB: { ...obj1.propB, propB2: 'NEW VALUE', }, }; // `obj1` has **not** been modified console.log(obj1); // displays: // --------- // { // propA: { // propA1: 'Value A 1', // propA2: 'Value A 2', // }, // propB: { // propB1: 'Value B 1', // propB2: 'Value B 2', // } // } console.log(obj1Updated); // displays: // --------- // { // propA: { // propA1: 'Value A 1', // propA2: 'Value A 2', // }, // propB: { // propB1: 'Value B 1', // propB2: 'NEW VALUE', // } // } And we can use the same syntax for arrays. Instead of using methods which mutates the array, like push for example, we can do the following: const arr = [1, 2, 3]; console.log(arr); // [1, 2, 3] const arrUpdated = [...arr, 4]; // `arr` has **not** been modified console.log(arr); // [1, 2, 3] console.log(arrUpdated); // [1, 2, 3, 4] As we're not deeply copying our entire state, this kind of copy is as efficient as possible. We reuse all the objects that we're not modifying and instead of making a deep copy, we just pass their reference. Now that we know how to create an updated version of an object without mutating it, lets take a look to the full reducer: const microwaveReducer = (microwave: MicrowaveInternalState, { value: action, timestamp }): MicrowaveInternalState => { switch (action.type) { case EMicrowaveAction.START: return { ...microwave, status: MicrowaveStatus.STARTED, onAndOffTimes: [...microwave.onAndOffTimes, timestamp], }; case EMicrowaveAction.STOP: return { ...microwave, status: MicrowaveStatus.STOPPED, onAndOffTimes: microwave.status !== MicrowaveStatus.STARTED ? microwave.onAndOffTimes : [...microwave.onAndOffTimes, timestamp], }; case EMicrowaveAction.RESET: return INITIAL_MICROWAVE_STATE; case EMicrowaveAction.ADD_TIME_MS: { return { ...microwave, timePlannedMs: microwave.timePlannedMs + action.payload.timeMs, }; } default: unreachableCaseWrap(action); } return microwave; }; Once again, our function is pure 🙌. Easy to understand, not a single side effect, for any input we're able to expect a given output and easily testable. Fantastic! Implementing the selector function As a reminder, here's how the selector should look like: Just like a reducer, a selector must be a pure function. const microwaveSelector = (microwave: MicrowaveInternalState): MicrowaveState => { switch (microwave.status) { case MicrowaveStatus.RESET: return { timePlannedMs: microwave.timePlannedMs, status: MicrowaveStatus.RESET, timeDoneMs: 0, }; case MicrowaveStatus.STOPPED: { const timeDoneMs = computeTimeDoneMs(microwave.onAndOffTimes); if (microwave.timePlannedMs === 0 || microwave.timePlannedMs - timeDoneMs <= 0) { return { timePlannedMs: 0, status: MicrowaveStatus.RESET, timeDoneMs: 0, }; } return { timePlannedMs: microwave.timePlannedMs, status: MicrowaveStatus.STOPPED, timeDoneMs: timeDoneMs, }; } case MicrowaveStatus.STARTED: return { timePlannedMs: microwave.timePlannedMs, status: MicrowaveStatus.STARTED, timeDoneMs: computeTimeDoneMs(microwave.onAndOffTimes), }; default: throw new UnreachableCase(microwave.status); } }; We don't really care about the computeTimeDoneMs. It gives us how much time did the microwave spent running from the onAndOffTimes array. As it's not what we want to focus on today, here's the code without further explanations: export const chunk = <T>(arr: T[]): T[][] => arr.reduce<T[][]>((result, _, index, array) => { if (index % 2 === 0) { result.push(array.slice(index, index + 2)); } return result; }, []); const computeTimeDoneMs = (onAndOffTimes: number[]) => chunk(onAndOffTimes).reduce((timeElapsed, [on, off]) => timeElapsed + off - on, 0); Create the microwave state stream Build the MicrowaveInternalState stream We now have all the logic for our state and our selector. We can start working on our data flow using RxJs streams. For that, we'll start by creating a factory function which for a given action$ observable, will return a MicrowaveState observable. As a first step, we'll create the function and manage the MicrowaveInternalState using our reducer: const INITIAL_MICROWAVE_STATE: MicrowaveInternalState = { timePlannedMs: 0, onAndOffTimes: [], status: MicrowaveStatus.RESET, }; export const createMicrowave = (action$: Observable<MicrowaveAction>): MicrowaveState => { const microwaveState$: Observable<MicrowaveInternalState> = action$.pipe( timestamp(), scan(microwaveReducer, INITIAL_MICROWAVE_STATE), startWith(INITIAL_MICROWAVE_STATE), ); // todo: use our selector to transform the `MicrowaveInternalState` into a `MicrowaveState` // ... }; In less than 5 lines, we've got a fully reactive approach to manage our internal state so far 🤯. This is one of the reasons why RxJs is powerful and worth learning. But as nice as this is, it's probably a lot to process already! Lets go through it together: - We get an action$stream. Any time a new action is dispatched, we'll receive it here - The timestampoperator wraps a value into an object containing the value + the current timestamp - The scanoperator is similar to the reducefunction available on iterable objects in Javascript. You provide a function (our microwaveReducerin this case), which will get an accumulator (our MicrowaveInternalState) and a value (our action). From this, it should return a value which will be emitted downstream and which will also become the new value passed as the accumulator the next time the scanruns. Finally, as the 2nd argument of the scanoperator, we provide an initial state (in our case, the INITIAL_MICROWAVE_STATE). The scanoperator is really powerful and let us have the state scoped to that function. It's not created before and it is only possible to update it by sending a new value to the scan. No one has access to a variable holding our state and likely to be mutated - Last but not least, when we subscribe to the microwave we expect to receive an initial state. Before you start your microwave, it still exists, doesn't it? So right after the scan, we emit the initial state of the microwave. Another possible way to achieve this would be to startWith(Actions.reset())before the scanand then the scanwould be started with the RESETaction. But why run the whole reducer function when we know the initial value it's about to return? Build the public MicrowaveState stream using our selector So far we know the current state of the microwave, how much time is left, and we've got an array with the timestamps of when it was toggled STARTED/STOPPED. How can we get an update every second to represent the state of the microwave while it's running (started)?); } }), ); For MicrowaveStatus.RESET and MicrowaveStatus.STOPPED, we just pass the MicrowaveInternalState to our selector which will transform it to a MicrowaveState. For the MicrowaveStatus.STARTED, it's slightly different as we need to update the stream every second (for the countdown): timer(0, 1000): Start the stream immediately and emit every seconds timestamp: Get the current timestamp (which will be updated every second thanks to timer) map: Use the microwaveSelector(just like MicrowaveStatus.RESETand MicrowaveStatus.STOPPED) but instead of passing the internal state directly, we create a new object (immutability for the win!). Within that new object, we add the current timestamp into the onAndOffTimes(which therefore will update the timeDoneMsin the output) 🙌. The important thing to understand here is that thanks to immutability we never modify the original onAndOffTimesso by adding the new timestamp in the array we don't accumulate them in the array. We take the initial one and add one. We take the initial one and add one. We take the initial one and add one. Etc... takeWhile(x => x.timeDoneMs < x.timePlannedMs): As soon as the time done is equal or greater than the time planned, we stop that inner stream (no more update needed every second) endWith(MICROWAVE_RESET_STATE): When the stream ends, we emit the reset state Note that before that inner stream, we've got: microwaveState$.pipe( switchMap(microwave => { // ... }), ); So when microwaveState$ emits new value, we'll kill all that inner stream and start a new one, which is exactly what we want. Final version of the microwave factory function export const createMicrowave = (action$: Observable<MicrowaveAction>): Microwave => { const microwaveState$: ConnectableObservable<MicrowaveInternalState> = action$.pipe( timestamp(), scan(microwaveReducer, INITIAL_MICROWAVE_STATE), startWith(INITIAL_MICROWAVE_STATE), publishReplay(1), ) as ConnectableObservable<MicrowaveInternalState>;); } }), shareReplay({ bufferSize: 1, refCount: true }), ); // we need to keep the state subscribed as if no one is listening // to it we should still be able to take actions into account // note: we don't unnecessarily subscribe to `microwave$` as this // does some computation derived from the state so if someone subscribes // later on, that stream would still be up to date! const microwaveStateSubscription = microwaveState$.connect(); return { microwave$, cleanUp: () => { microwaveStateSubscription.unsubscribe(); }, }; }; Notice the subtle changes above? publishReplay(1)? shareReplay({ bufferSize: 1, refCount: true })? microwaveState$.connect()? cleanUp? This is the last part 🥵. Hang tight! We have 2 stream to represent: - The internal state: microwaveState$ - The public state: microwave$ When someone calls the createMicrowave factory function, they'll get a stream representing the microwave. But what if they start dispatching actions without listening to the microwave first? Nothing would be taken into account which is unfortunate. To fix this, we put publishReplay(1) at the end of microwaveState$. This operator is quite powerful and brings the following features: - The "publish" side transforms the Observableinto a ConnectableObservable. It means that we will have to connect manually to the observable. The connect method will basically subscribe to it. This is why we need to return an object containing a cleanUpwhich will unsubscribeto it when needed - The "replay" side (which needs an argument, here 1) means that if a value is emitted by that stream before someone subscribe to it downstream, it'll keep the value and send it straight away to a late subscriber The last one to understand is shareReplay({ bufferSize: 1, refCount: true }). It's applied as the last operator of the microwave$ stream. When someone calls the createMicrowave factory function and subscribe multiple times to the microwave$ stream, the microwaveState$ won't be re-triggered (as explained previously it's been shared), but for microwave$ we'd have the whole selector and observable chain for the started state running 1 time per subscriber. When we create an instance of a microwave using the createMicrowave, we should be able to subscribe multiple times to it without triggering that logic multiple times. Therefore, we use shareReplay. We set the bufferSize property to 1 so that if someone subscribes later on, he'll get the last value straight away. We set the refCount property to true (which is very important), so that if the microwave is started but no one listen, the whole observable chain with timer, timestamp, microwaveSelector, takeWhile, endWith will NOT run. Only if there's at least one subscriber. And if more than one, they share the results 🔥. Conclusion On one hand, working with observables and thinking reactively can be very challenging. There's a steep learning curve and the concept is very different from imperative programming. On the other hand, RxJs is very powerful and once we get used to it, it becomes easier to write complicated workflows. If you decide to use reactive programming, remember that using subscribe is where the reactive programming ends. Michael Rx Hladky 02:58 AM - 05 Oct 2019. Posted on by: Maxime Software engineer. Trying to share more on dev.to about my discoveries and side projects. Favourite stack: Typescript, Angular, NestJs. Discussion nice. now to build it...
https://dev.to/maxime1992/building-a-reactive-microwave-for-ryan-cavanaugh-with-rxjs-3b1a
CC-MAIN-2020-40
refinedweb
3,513
53.81
Porting Graphical Apps to Windows CE, Part 1 Finding Unsupported Graphics APIs Up to this point, we've been working with porting user interface elements to Windows CE. We started there because we have a big advantage in that arena: Most user interface elements are defined in the application's resource file, which provides a very handy tool for quickly locating unportable features. As we approach less superficial aspects of an application, the challenges of porting begin to emerge a bit more aggressively. In the user interface, for the most part, either something is portable or its not. We'll be examining some APIs from here on out that may raise portable issues that are subtler. You have two key jobs. First, you have to find unsupported APIs, and either trim the features they represent, or create a workaround. Next, you'll have to find and modify APIs that support only subsets of the flags and parameters that are defined under Win32. In this installment, we're going to learn a technique for handling the first problem. We'll use the linker to find unsupported APIs embedded in the implementation of your application's behaviors. The Linker, Your New Best Friend - Choose the subset of graphics behaviors that are essential to the Win CE version of your application. - Copy the code for the behaviors into a new Win CE project. - Run a build to identify unsupported APIs It's possible that the steps above will yield fully functional Windows CE graphics code. If you get a clean compile and link, try running your code on a CE device to test it. Don't be too disappointed if this "clean build" doesn't work properly. Some of the graphics APIs behave differently under CE and many support only subsets of the Win 32 flags used as function parameters. The more likely result of the steps above is that the linker will report some unresolved externals. Below is fragment of code from a project called Unresolved. This application is an automatically generated "Hello World " program, with the sole addition of the two lines shown in bold and their associated parameter. Listing 1 - Adding Two Unsupported Graphics APIs to "Hello World" case WM_PAINT: RECT rt; static POINT ptCurrent; hdc = BeginPaint(hWnd, &ps); GetClientRect(hWnd, &rt); LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING); MoveToEx( hdc, 0, 0, &ptCurrent ); LineTo( hdc, rt.right. rt.bottom ); DrawText(hdc, szHello, _tcslen(szHello), &rt, DT_SINGLELINE | DT_VCENTER | DT_CENTER); EndPaint(hWnd, &ps); break; When the project is built, this is the text shown in the output window: Figure 1 - Linker Reporting Unresolved External References This is incredibly helpful information to the porting process, but there are a couple of caveats to observe in putting the linker in the harness as your porting workhorse. First, to get started, generate a Windows CE project and carefully add your own code to it. In particular, you have to pay attention to the system settings for the path to header files. If you use a generated "Hello World" application targeting all of the Windows CE platforms, this is automatic. If you create an empty project and add your files, then getting the proper header and library paths set is much more time consuming and difficult. Remember, all of the different CE targets have processor specific libraries and linkage. Porting Tip: When porting graphics and other behaviors, start with an automatically generated "Hello World" project and copy your code into the appropriate places in the generated files. The second thing to be careful of is copying code files from your own projects that include hard coded paths to Win 32 header files. Here is how a hard coded include path looks: #include "c:\ Unresolved\Unresolved.h" The quotes around the file name tell the compiler to look in very specific places for the header file Unresolved.h. In this case, the search begins in the "current directory" ( the one where the project workspace lives ) and then proceeds through the directories specified in the INCLUDE environment variable. The compiler will use the first occurrence of Unresolved.h it comes upon in its search. While it is not likely that a file named Unresolved.h will turn up unexpectedly, the header file names for various Windows programming components are exactly the same and occur in a variety of directories. Hard coded Windows API header file names which resolve incorrectly will send the build process wildly awry. Porting Tip: Search for the string #include in your own code and double check hard coded include file paths. Change or eliminate any that point to Win32 header files. Remember that header files often contain #include statements. Most all your Windows include files will be specified in statements like the one shown below: #include <commctrl.h> The angle brackets around the include file name mean "look in standard places". The standard places for your Windows CE project are always generated correctly if you start with a "Hello World" application. Third, the linker report may include unresolved externals that don't actually occur in the source code you wrote. Here's what to do if you get an unresolved external that looks some thing like this: C:\Unresolved\Unresolved.cpp(165) : error C2065: '_gcvt' : undeclared identifier I've seen linker errors like this one in areas of my code that had to do with pointer arithmetic. Before you do anything, search your code files and make sure the reference is not just a typo. If the string isn't found in your code files, choose the Project.Settings menu item, and go to the C++ tab. Select the category Listing Files, and under Listing File Type, choose Assembly with Source. Figure 2 - Getting a Source and Assembly Listing Press Ok, which will dismiss the dialog, and then rebuild. This build generates the file you need to examine in order to find the unresolved external "_gcvt". The file will have the suffix ".asm". For example, if we did this for the Unresolved project, we'd want to check the file Unresolved.asm. When you search this file for the unresolved external "_gcvt" you'll find it somewhere in between two lines of your own source code. The one that precedes it is the source line that generated the unresolved external. Experiment with rearranging code or eliminating the statement. I've never had any really extreme difficulty getting past these, but I have found that sometimes it helps not to do too many operations in one statement. For example, if you de-reference a pointer and increment it in one statement, you are doing multiple operations, and the success may depend on rules of precedence. It might be a better approach to break the operations up and have more explicit control of the order in which they happen. The fourth and final caveat about letting the linker help you with the "rough cut" is that many of the Windows API functions implemented on CE are limited in the parameters and flag values they support. For example, the CE API CreateDIBSection() requires that the last two of its six parameters be set to 0. These parameters have legitimate uses under Win 32, and ported code may well include non-zero values for them. A clean build tells you that no unsupported functions remain in your code, but it doesn't assure proper content in the function parameter lists. Looking Ahead Next time we'll begin a hands-on exploration of graphic functionality on Windows CE, starting with line drawing primitives. We'll learn more about finding APIs that have limited parameter and flags support, and see how to create basic graphical output on CE devices.<<
http://www.developer.com/ws/pc/article.php/1573381
CC-MAIN-2017-04
refinedweb
1,278
60.65
Adding Intelligence with Cognitive Services - PDF for offline use - - Sample Code: - - Related Articles: - Let us know how you feel about this 0/250 last updated: 2017-02 Microsoft Cognitive Services are a set of APIs, SDKs, and services available to developers to make their applications more intelligent by adding features such as facial recognition, speech recognition, and language understanding. This article provides an introduction to the sample application that demonstrates how to invoke some of the Microsoft Cognitive Service APIs. Overview The accompanying sample is a todo list application that provides functionality to: - View a list of tasks. - Add and edit tasks through the soft keyboard, or by performing speech recognition with the Bing Speech API. For more information about performing speech recognition, see Speech Recognition using the Bing Speech API. - Spell check tasks using the Bing Spell Check API. For more information, see Spell Checking using the Bing Spell Check API. - Translate tasks from English to German using the Translator API. For more information, see Text Translation using the Translator API. - Delete tasks. - Set a task's status to 'done'. - Rate the application with emotion recognition, using the Emotion API. For more information, see Emotion Recognition using the Emotion API. Tasks are stored in a local SQLite database. For more information about using a local SQLite database, see Working with a Local Database. The TodoListPage is displayed when the application is launched. This page displays a list of any tasks stored in the local database, and allows the user to create a new task or to rate the application: New items can be created by clicking on the + button, which navigates to the TodoItemPage. This page can also be navigated to by selecting a task: The TodoItemPage allows tasks to be created, edited, spell-checked, translated, saved, and deleted. Speech recognition can be used to create or edit a task. This is achieved by pressing the microphone button to start recording, and by pressing the same button a second time to stop recording, which sends the recording to the Bing Speech Recognition API. Clicking the smilies button on the TodoListPage navigates to the RateAppPage, which is used to perform emotion recognition on an image of a facial expression: The RateAppPage allows the user to take a photo of their face, which is submitted to the Emotion API with the returned emotion being displayed. Understanding the Application Anatomy The Portable Class Library (PCL) project for the sample application consists of five main folders: The PCL project also contains some important files: NuGet Packages The sample application uses the following NuGet packages: Microsoft.Net.Http– provides the HttpClientclass for making requests over HTTP. Newtonsoft.Json– provides a JSON framework for .NET. Microsoft.ProjectOxford.Emotion– a client library for accessing the Emotion API. PCLStorage– provides a set of cross-platform local file IO APIs. sqlite-net-pcl– provides SQLite database storage. Xam.Plugin.Media– provides cross-platform photo taking and picking APIs. In addition, these NuGet packages also install their own dependencies. Modeling the Data The sample application uses the TodoItem class to model the data that is displayed and stored in the local SQLite database. The following code example shows the TodoItem class: public class TodoItem { [PrimaryKey, AutoIncrement] public int ID { get; set; } public string Name { get; set; } public bool Done { get; set; } } The ID property is used to uniquely identify each TodoItem instance, and is decorated with SQLite attributes that make the property an auto-incrementing primary key in the database. Invoking Database Operations The TodoItemRepository class implements database operations, and an instance of the class can be accessed through the App.TodoManager property. The TodoItemRepository class provides the following methods to invoke database operations: - GetAllItemsAsync – retrieves all of the items from the local SQLite database. - GetItemAsync – retrieves a specified item from the local SQLite database. - SaveItemAsync – creates or updates an item in the local SQLite database. - DeleteItemAsync – deletes the specified item from the local SQLite database. Platform Project Implementations The Services folder in the PCL project contains the IFileHelper and IAudioRecorderService interfaces that are used by the DependencyService class to locate the classes that implement the interfaces in platform projects. The IFileHelper interface is implemented by the FileHelper class in each platform project. This class consists of a single method, GetLocalFilePath, which returns a local file path for storing the SQLite database. The IAudioRecorderService interface is implemented by the AudioRecorderService class in each platform project. This class consists of StartRecording, StopRecording, and supporting methods, which use platform APIs to record audio from the device's microphone and store it as a wav file. On iOS, the AudioRecorderService uses the AVFoundation API to record audio. On Android, the AudioRecordService uses the AudioRecord API to record audio. On the Universal Windows Platform (UWP), the AudioRecorderService uses the AudioGraph API to record audio. Invoking Cognitive Services The sample application invokes the following Microsoft Cognitive Services: - Bing Speech API. For more information, see Speech Recognition using the Bing Speech API. - Bing Spell Check API. For more information, see Spell Checking using the Bing Spell Check API. - Translate API. For more information, see Text Translation using the Translator API. - Emotion API. For more information, see Emotion Recognition using the Emotion API..
https://docs.mono-android.net/guides/xamarin-forms/cloud-services/cognitive-services/
CC-MAIN-2017-13
refinedweb
867
53.92
Preventing spamming So I'm making a backend for a project, which manages the signing up and stuff. I spammed a few requests as a test: import threading,requests def spam_req(): while True: r=requests.post(' while True: threading.Thread(target=spam_req).start() And this lagged down the backend a lot, I couldn't even get into the homepage. So I tried to ban IPs that spam more than 100 requests an hour, but found out that replit doesn't allow you to see users' IPs. Do any of you have any idea how to prevent spamming then? If your database involves writing to a file, it won't work. Use ReplDB @MrVoo i'm using repldb, im asking how to prevent request spam
https://replit.com/talk/ask/Preventing-spamming/146002
CC-MAIN-2022-21
refinedweb
124
82.65
In this tutorial, you will learn how to read a text file and display non-duplicate words in ascending order. The given code reads the file and stored the file text into StringBuffer. The buffer object is then passed to StringTokenizer which broke the text of file into words. We have stored these words into ArrayList. ArrayList allows duplicate values therefore in order to get the non-duplicate words, we have converted ArrayList to HashSet as HashSet doest not allow duplicates. Then, again we have converted HashSet to ArrayList and using the Collection class, we have sorted the list elements which are actually the non-duplicate words. data.txt: Where there is a will there is a way. Example: import java.io.*; import java.util.*; class FileWords { public static void main(String[] args) throws Exception { File f=new File("c:/data.txt"); BufferedReader br=new BufferedReader(new FileReader(f)); StringBuffer buffer=new StringBuffer(); String str; while((str=br.readLine())!=null){ buffer.append(str); buffer.append(" "); } ArrayList list=new ArrayList (); StringTokenizer st = new StringTokenizer(buffer.toString().toLowerCase()); while(st.hasMoreTokens()) { String s = st.nextToken(); list.add(s); } HashSet set = new HashSet (list); List arrayList = new ArrayList (set); Collections.sort(arrayList); for (Object ob : arrayList) System.out.println(ob.toString()); } } Output: a is there way. where will
http://www.roseindia.net/tutorial/java/io/displayNonDuplicateWords.html
CC-MAIN-2015-06
refinedweb
215
50.94
Thanks for the report. I'll look into it! When the following program is run through valgrind, it states an error: #include <stdlib.h> #include <string.h> #include <curl/curl.h> int main() { struct curl_httppost * post = NULL; struct curl_httppost * last = NULL; char * request = malloc( 4096 ); memset( request, 1, 4096 ); #ifdef HIDE_BUG /* This would make the error go away - apparently strlen() is used on buffer */ request[ 4095 ] = 0; #endif curl_formadd( &post, &last, CURLFORM_COPYNAME, "a", CURLFORM_BUFFER, "b", CURLFORM_BUFFERPTR, request, CURLFORM_BUFFERLENGTH, ( long ) 4096, CURLFORM_END ); return 0; } $ gcc test.c -lcurl; valgrind ./a.out ==18321== Invalid read of size 1 ==18321== at 0x4C2B4F4: strlen (mc_replace_strmem.c:390) ==18321== by 0x4E3FF07: curl_formadd (in /usr/lib/x86_64-linux-gnu/libcurl.so.4.3.0) ==18321== by 0x400789: main (in /tmp/a.out) ==18321== Address 0x887c0b0 is 0 bytes after a block of size 4,096 alloc'd ==18321== at 0x4C2ABED: malloc (vg_replace_malloc.c:263) ==18321== by 0x40071B: main (in /tmp/a.out) $ curl -V curl 7.31.0 (x86_64-pc-linux-gnu) libcurl/7.31.0 OpenSSL/1.0.1c zlib/1.2.7 libidn/1.25 libssh2/1.4.3 librtmp/2.3 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp Features: GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP Thanks for the report. I'll look into it! Thanks a lot for your excellent report and guidance on how to repeat the problem. This bug is now fixed in commit 0ddc678927eaa: I'm closing this report now! You're welcome! I was wondering though what a proper workaround for the existing versions of libcurl would be? I think zero terminating the data pointed to so that libcurl won't read outside the allocated boundary. Setting a content-type could also work. As can be seen in the patch, the problem is/was that the buffer pointer was wrongly passed in to the function that checks the file name for a known extension to get a default content-type (if no custom such has been set). That function uses strlen() on the pointer.
https://sourceforge.net/p/curl/bugs/1262/
CC-MAIN-2017-13
refinedweb
355
75.2
Dear All, I am new to PyRosetta and I am trying to calculate the ddG after point-mutation. The calculation logic is like the following: 1) clean the pdb file and use cartesian relax to minimize its energy 2) perform the point mutation with mutate_residue() function 3) calculate the score before and after the mutation to gain the ddG However, the ddG data I got was always positive values and have large differences from the benchmark. Can someone give me some help? Which part of my code is wrong? Thank you guys so much for your input and suggestions!! from pyrosetta import * from pyrosetta.rosetta import * from pyrosetta.toolbox import * init("-ignore_unrecognized_res 1 -ex1 -ex2 -flip_HNQ -relax:cartesian -nstruct 200 -crystal_refine -optimization:default_max_cycles 200") testPose= Pose() testPose = pose_from_pdb("1BNI.clean.pdb") from pyrosetta.rosetta.protocols.relax import FastRelax scorefxn = pyrosetta.create_score_function("ref2015_cart") relax = pyrosetta.rosetta.protocols.relax.FastRelax() relax.constrain_relax_to_start_coords(True) relax.coord_constrain_sidechains(True) relax.ramp_down_constraints(False) relax.cartesian(True) #relax.min_type("dfpmin_armijo_nonmonotone") relax.min_type("lbfgs_armijo_nonmonotone")#for non-Cartesian scorefunctions use'dfpmin_armijo_nonmonotone' relax.set_scorefxn(scorefxn) s0=scorefxn(testPose) relax.apply(testPose) s1=scorefxn(testPose) testPose.dump_pdb('1BNI.relax.pdb') AA=['G','A','L','M','F','W','K','Q','E','S','P','V','I','C','Y','H','R','N','D','T'] ddG=[] mp=Pose() for i in AA: mp.assign(testPose) mutate_residue(mp,52,i) s2=scorefxn(mp) dg=s2-s1 ddG.append(dg) print(ddG) Best regards Hi, I would relax or minimise after the mutation. Not sure `mutate_residue` does this allready. I would have a flexible backbone around the mutation (i.e. 8 Angs), but keep everything else fixed. Here is one implementation of ddg And another: And the newest one in the rosetta_scripts directory (not sure it's been released yet): rosetta_scripts_scripts/scripts/public/stabilize_proteins_pm_mc/ Best, Ajasja PS: also what's the diffrence between s0 and s1? Does relax take into account the coord constraints? I would use two diffrent scoring functions one for relax and one for scoring, so there would be no doubt if constraints are on. Hi Ajasja, Thank you so so much for your kindly reply. First of all, I would like to say sorry that I am new to both Rosetta and PyRosetta so you may find my questions are a bit silly. I checked the reference you sent to me but seems that both of them are only suitable for Rosetta, while I want to do the job in PyRosetta. Regarding the questions in your PS section. I found that the energy before and after the relax was different. s0 is a positive number while s1 is a negative number. I don't know whether in my python code the relax takes into account the coord constraints, but according to the official tutorial the command "relax.constrain_relax_to_start_coords(True)" helps me do it? Also, may I ask you what do you mean by "using two different scoring functions?", do you mean that I can set up a scorefxn1="ref2015_cart" for cartesian_relax, while setting up another scorefxn2='ref2015' for the scoring calculation? For your suggestion, May I ask how you keep everything else fixed while having a flexible backbone around the mutation? Do I have to do the minimization for the mutated pose? The "mutate_residue()" function is attached below, does the "Packer" help me do the job already? Really sorry to bother you again and again, looking forward to hearing from you! Best, Kai San
https://rosettacommons.org/comment/12580
CC-MAIN-2022-27
refinedweb
571
50.12
It's not too hard to do this since Java 1.5, which added the Process and ProcessBuilder classes. Here's an example program that starts up Firefox at a particular website: public class OpenSite{ public static void main(String arg[]){ try { Process p = new ProcessBuilder("firefox", "").start(); } catch(java.io.IOException io){ } } } I've compressed the various parts of the action down to one line here: Process p = new ProcessBuilder("firefox", "").start(); I'm creating an "anonymous" ProcessBuilder object, calling its start() method, which returns a Process, which I name simply "p". The whole thing is wrapped up in a try...catch structure because javac wants to see us deal with any I/O errors that result. In this program, I just ignore them. So you'll want to make sure that you either catch those errors and deal with them, or that they will be unimportant enough that they don't matter. Also note that the Java program's process will last as long as the external program you call. So if you don't shut down this instance of the firefox process, you'll have Java still running. If you want to see something fun you can do with this on Mac, check out my article on my other blog about adding speech to the Simple Video Game Kernel.
https://beginwithjava.blogspot.com/2010/08/
CC-MAIN-2022-40
refinedweb
222
79.6
How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?HaTr_4568521 May 2, 2020 1:06 AM I'm having a pair of CYW954907EVAL-1F boards and need to program them so that files stored on the SD card of one such module can be transferred to another such module using 802.11 protocol (802.11ac to be more specific). In WICED Studio 6.4, I could find the sd_filesystems program that can be used for routing data to and from the SD card. What I'm looking for is how do I program CYW954907EVAL-1F for various 802.11 PHY and MAC so that I can establish a connection between both the modules and transfer the data. Attached are some of the contents I've already referred to but couldn't make out much as in from where to start. Also, the other controllers that I've used have a set of instructions and programming well defined which helps the beginner to start with the development. For CYW954907EVAL-1F also, if any such literature is available which best fits the marked application, please suggest that as well. P.S. I've already gone through the video tutorials available from Cypress which gives a good start for sure, however, the same is not having the details I'm looking for and hence the question. 1. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?RaktimR_11 May 2, 2020 9:23 AM (in response to HaTr_4568521) What are the 11ac specific features you are trying to enable? The idea is to use the sd_filesystem application and use tcp/udp to transmit data b/w two CYW54907. 2. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?HaTr_4568521 May 3, 2020 5:04 AM (in response to RaktimR_11) Dear RaktimR_11 Following features of 802.11ac I want to implement: - use of 5 GHz frequency band for communication - bandwidth of communicaion = 40 MHz - modulation scheme: QPSK - channel coding rate: 1/2 or 3/4 - Guard interval: 400 nsec - Spatial stream: 1 (however, I'd also like to program for more number of spatial streams) - transmit power: 15 dBm or more another query: how would I pair / connect two devices? Also, is there any literature available for programming the CYW954907 using WICED studio, cause referring to the code directly doesn't help much to me. Thanks. 3. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?RaktimR_11 May 4, 2020 12:12 AM (in response to HaTr_4568521) use of 5 GHz frequency band for communication - wwd_wifi_set_preferred_association_band( WLC_BAND_5G ); bandwidth of communicaion = 40 MHz - wwd_wifi_set_bandwidth(40) modulation scheme: QPSK channel coding rate: 1/2 or 3/4 I am guessing that you mean to use MCS 0-7 - wwd_wifi_set_mcs_rate( wwd_interface_t interface, int32_t mcs, wiced_bool_t mcsonly); Guard interval: 400 nsec Re: (CYW43907) How to set GI(guard interval) for 802.11n If you need APIs find the ioctls and use them accordingly. More help on ioctls: How to use IOCTL commands in CYW43907 Spatial stream: 1 (however, I'd also like to program for more number of spatial streams) Since this is a SISO chip, only NSS 1 is supported which is the default configuration. transmit power: 15 dBm or more Country specific. Usually fixed by regulatory authorities of each country. Determined by clm_blob in Cypress WLAN solutions. More on clm_blob: If it's within per-defined limit set according to the ccode, wl txpwr1 or wwd_wifi_set_tx_power() can be used. another query: how would I pair / connect two devices? pairing/connect usually exists for BT/BLE devices. For WLAN it is more like ap-sta connection which goes through the auth-assoc process. You can setup a CYW54907 as a softAP and host a udp_server on the same interface; simultaneously, you can configure the other CYW54907 as a STA, connect to the softAP and use it as a udp_client to connect to the udp_server. For getting started with WICED, we do provide a quick-start-guide, which can be found in 43xxx_Wi-Fi/doc/WICED-QSG.pdf You can also refer to the product guide: CYW43907/CYW54907 Product Guide WICED can be a little tricky to get started with. But once you are comfortable after going through the above mentioned literature and the WICED-WiFi videos, it will warm up to you. 4. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?HaTr_4568521 May 4, 2020 2:20 AM (in response to RaktimR_11) Dear RaktimR_11, Thanks for the prompt response. wwd_wifi_set_preferred_association_band( WLC_BAND_5G ); wwd_wifi_set_bandwidth(40); wwd_wifi_set_mcs_rate( wwd_interface_t interface, int32_t mcs, wiced_bool_t mcsonly); This seems to be helpful. Another thing is, I could find the code snippet for TCP Server and TCP client. What modifications shall I do to implement a UDP server and a UDP client? Quick start guide and product guide are definitely good to start with, however, doesn't help much for a specific application development. 5. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?RaktimR_11 May 4, 2020 2:25 AM (in response to HaTr_4568521) 6. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?HaTr_4568521 May 4, 2020 2:54 AM (in response to RaktimR_11) In the same folder, you can find udp_receive and transmit operation (i.e, server and client). Those documents can only help you to get started with but for each user-specific application, you need to refer to the numerous applications spread across snip, demo, waf, wwd folder etc. Ohh!! Sounds good. I'll refer to it and get back in case of queries. One more thing, what determines the parameter value? for example, while referring to the TCP Server code, I could find the TCP_PACKET_MAX_DATA_LENGTH value as 30 and the same thing I also observed for UDP_MAX_DATA_LENGTH as well. So how would I be able to determine what is the appropriate value of such parameters? Thanks again for the help. 7. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?HaTr_4568521 May 4, 2020 7:24 AM (in response to HaTr_4568521) some queries I had RaktimR_11 - could not understand the difference between the soft AP used for device configuration and soft AP used for normal operation - while working on the code, I commented the line UDP_TARGET_IS_BROADCAST and assigned the IP address to the receiver as The code snap is also attached below: SSID: WICED UDP Transmit App Protocol: Wi-Fi 4 (802.11n) Security type: WPA2-Personal Network band: 2.4 GHz Network channel: 1 Link-local IPv6 address: fe80::55a:5607:c3b8:b260%21 IPv4 address: 192.168.0.2 IPv4 DNS servers: 192.168.0.1 //commented out #define UDP_TARGET_IS_BROADCAST //commented out #define GET_UDP_RESPONSE #ifdef UDP_TARGET_IS_BROADCAST #define UDP_TARGET_IP MAKE_IPV4_ADDRESS(192,168,0,255) #else #define UDP_TARGET_IP MAKE_IPV4_ADDRESS(192,168,0,25) #endif - What determines whether the device will work as a UDP server or as a UDP client? Cause I checked for the code of wifi_config_dct.h and they both looked similar to me. - Where shall I be mentioning this? cause while editing wifi_config_dct.h, I found "WICED_802_11_BAND_2_4GHZ" as a CLIENT_AP_BAND and "1" as CLIENT_AP_CHANNEL. Shall we not set all such things for the server as well? wwd_wifi_set_preferred_association_band( WLC_BAND_5G ); wwd_wifi_set_bandwidth(40); wwd_wifi_set_mcs_rate( wwd_interface_t interface, int32_t mcs, wiced_bool_t mcsonly); Thanks! 8. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?RaktimR_11 May 6, 2020 2:10 AM (in response to HaTr_4568521) If you have multiple questions pertaining to different topics relevant to same project, its always recommended to create separate threads and increase the outreach; so that others can also help. Trying to list down the answers - config_interface softap is mainly to configure the device during startup; say you want the device to connect to an AP after starting up. You can enter the credentials hosted on a webserver running on the config interface - softap: it is more generic functionality allowing clients(STAs) to join and communicate with each other in server-client model. Typically, transmit operation is attributed to client and the receive operation is attributed to server with some exceptions as always. So, when you use wiced_udp_receive, it means the socket is waiting on data to be sent by some clients on that particular IP addr; if not broadcast (If you don't want broadcast, you just need to comment out the UDP_TARGET_IS_BROADCAST as you have rightly done). wifi_config_dct.h is provided so that you can modify the basic wlan related parameters like ssid, passphrase, band, channel which is stored in DCT ( a dedicated section of ext flash). What you had asked primarily, is more to leverage the 11ac specific features which is why I recommended wwd apis. All of these APIs need to be incorporated in both client, server application(specifically .c file) by following the guidelines mentioned in 43xxx_Wi-Fi/WICED/WWD/include/wwd_wifi.h. Essentially, you can create a single application with two threads, one for tx, one for rx and control the thread spawning from command line along with the 11ac specific common settings that has been mentioned earlier. 9. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?HaTr_4568521 May 11, 2020 5:55 AM (in response to RaktimR_11) Hello RaktimR_11, I've now gone through wwd_wifi.h and could find that many functions that I'd been looking for are defined in this header file. As a solution to my problem statement, I further broke down the code and now trying to create an access point with some of the PHY parameters of 802.11ac. Code for the same is as follows: #include "wiced.h" #include "wiced_wifi.h" #include "wwd_wifi.h" #define SOFT_AP_SSID "Try1_802.11ac" #define SOFT_AP_PASSPHRASE "80211AC" #define SOFT_AP_SECURITY WICED_SECURITY_WPA2_AES_PSK #define SOFT_AP_CHANNEL 1 static const wiced_ip_setting_t device) ), }; void application_start(void) { wiced_init( ); wiced_ssid_t* ssid; wiced_security_t auth_type; const uint8_t* security_key; uint8_t key_length; uint8_t channel; uint8_t tx_power = 15; wiced_antenna_t antenna_type = 3; uint8_t bandwidth_value = 40; int32_t mcs_value = 7; wiced_interface_t interface; wwd_result_t result; wiced_bool_t mcsonly; &ssid = SOFT_AP_SSID; auth_type = WICED_SECURITY_WPA2_AES_PSK; &security_key = SOFT_AP_PASSPHRASE; key_length = 8; channel = SOFT_AP_CHANNEL; result = wiced_network_up_default( &interface, &device_init_ip_settings ); if( result != WICED_SUCCESS ) { printf("Bringing up network interface failed !\r\n"); } result = wwd_wifi_start_ap(&ssid, auth_type, &security_key, key_length, channel); if( result != WWD_SUCCESS ) { printf("Bringing up AP failed !\r\n"); } result = wwd_wifi_set_tx_power( tx_power ); if( result != WWD_SUCCESS ) { printf("Tx power set to 15 dBm failed !\r\n"); } result = wwd_wifi_select_antenna( antenna_type ); if( result != WWD_SUCCESS ) { printf("Antena Selection for diversity receiver failed !\r\n"); } wwd_wifi_set_preferred_association_band( WLC_BAND_5G ); wwd_result_t wwd_wifi_set_bandwidth( bandwidth_value ); result = wwd_wifi_set_mcs_rate( interface, mcs_value, mcsonly); } In the project folder, .c, .mk and wifi_config_dct.h are there. .mk file is as follows: NAME := apps_802.11ac_configuration $(NAME)_SOURCES := 802.11ac_configuration.c WIFI_CONFIG_DCT_H := wifi_config_dct.h However, upon making the target, I'm getting the following error. tools/makefiles/wiced_config.mk:267: *** Unknown component: Harsh_May.802.11ac_configuration. Stop. make: *** No rule to make target 'build/Harsh_May.802.11ac_configuration-CYW954907AEVAL1F/config.mk', needed by 'main_app'. Stop. I'm really not sure what error(s) are there in the code. I'd appreciate it if you could please through some light on the same? 10. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?HaTr_4568521 May 19, 2020 1:55 AM (in response to HaTr_4568521) Hello RaktimR_11, could you please look into this? 11. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?RaktimR_11 May 19, 2020 7:52 AM (in response to HaTr_4568521)1 of 1 people found this helpful I don't see the makefile error in my case. Probably, this is occurring because of some extra space issue in some line in the .mk. But I am not clear on the application side what you are trying to do; since most of the commands are supposed to be executed when the driver down. But I see that you are trying to do wiced_network_up with the dct settings and then again trying to initialize the softap with wwd_wifi_* commands. You should do either or and use the wwd specific apis while the driver is down.. Then do the driver up and host the ap. Alternatively, you can use the wl commands and explore the versatile nature of test.console example to test all 11ac specific features. The application can be located at 43xxx_Wi-Fi/apps/test/console. To use this example application, you would need to set CONSOLE_ENABLE_WL ?= 1 in line #380 of console.mk file. For ap specific case, you can use the start_ap command. I used something like this start_ap softap wpa2 12345678 38 40 no_wps 192.168.2.1 255.255.255.0 What this command essentially did is setup a softap, named "softap" ironically with wpa2 security and can be found in a 40 MHz channel in 5GHz (in this case channel 38). Look at the chart below to understand the channel in UNII bands. Additionally for guard interval, mcs rates etc, you can refer to the wl documentation as found in WL Tool for Embedded 802.11 Systems: CYW43xx Technical Information. Now you should be able to implement your ap with the desired settings. Additionally, if you want to convert this to an api based application you can just check the wl tool and command console implementation and try referring to the wwd_wifi_* apis to perform your application.
https://community.cypress.com/thread/54374
CC-MAIN-2020-50
refinedweb
2,239
54.83
C language metaprogramming and code generation from Python Project description calligra is a pure Python package that tries to modelize a subset of the C langage syntax in order to reason about C types, from Python scripts. Its main goals are to do metaprogrammation and code generation. It does not parse C code itself at all. calligra was first designed to (un)serialize complex (but not too complex …) C structures from JSON. Contents 1 Installation 1.1 Requirements calligra requires Python 3. It has been tested on Python 3.6 on Linux but it should work on 3.4 and 3.6 and on Windows also. At the moment, it does not require any external Python modules/packages, but this might change in the future. As calligra is intended to generate code, some external dependencies might be needed to compile the generated code. 1.2 From github You can clone this repository and install it with setuptools directly: $ python3 setup.py install --user 1.3 From pip As every pip available package, you can install it easily with the pip package: $ python3 -m pip install --user calligra 2 Howto 2.1 Introduction As specified before, calligra is intended to reason about C types at a Python level. Currently, you can modelize the following types: - primary types like char, int, float, double etc. - C strings (char*) - enum - struct, named and anonymous - union, named and anonymous and the following declaration modifiers: - pointers - array Nested array of pointers or pointers to array are not supported. At the moment, you have two choices: - define everything from Python - parse C code with the cparser importer module In the future, you will be able to import definitions from: - JSON Schema 2.2 Examples Lets start with a basic example. In the following code snippets we will be defining a C structure called person with 2 members: - a string name - an unsigned integer age And then we will generate the associated C code. First import the main modules: import calligra import calligra.stdlib calligra module is where the C type/declaration syntax is modelized. calligra.stdlib is where standard C types are defined. Then define the structure: namespace = calligra.stdlib.namespace person = calligra.struct(namespace, 'person') person.add( calligra.declaration( namespace, namespace.get('char'), 'name', pointer = True ) ) person.add( calligra.declaration( namespace, namespace.get('uint8_t'), 'age' ) ) Finally, generate the C code: print(person.define()) This should generate something similar to: struct person { char *name; uint8_t age; }; More advanced examples are located in the examples/ directory. 3 Modules 3.1 Conversion Conversion modules are located in the calligra/convert/ directory and are meant to (un)serialize C types to and from another format (like JSON). Currently available conversion modules are: 3.1.1 Jansson In order to use the jansson conversion module, just import the calligra.convert.jansson module: import calligra.convert.jansson After that, every type should now have a to_json and a from_json method. Those are actually calligra.functions object which you can define to generate the corresponding C code: print(person.to_json.define()) Which should generate something similar to: json_t *person_to_json(struct person const *person); And for the function body: print(person.to_json.code(body = True)) Which should generate something similar to (non-contractual code): json_t *person_to_json(struct person const *person) { json_t *json = json_object(), *child; if(!json) { return NULL; } /*name*/ if((person != NULL) && ((*person).name != NULL) && (*(*person).name != 0)) { child = json_string((*person).name); if(!child || json_object_set_new_nocheck(json, "name", child) != 0) { if(child) { json_decref(child); } json_decref(json); return NULL; } } /*age*/ if(person != NULL) { child = json_integer((*person).age); if(!child || json_object_set_new_nocheck(json, "age", child) != 0) { if(child) { json_decref(child); } json_decref(json); return NULL; } } return json; } 3.2 Importer Importer modules are located in the calligra/importer/ directory and are meant to import C types from another format (like C). Currently available importer modules are: 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/calligra/
CC-MAIN-2021-25
refinedweb
666
51.34
12 February 2010 14:59 [Source: ICIS news] By Nel Weddle LONDON (ICIS news)--The European ethylene market may have passed its 2010 peak as tight supply eased amid improved cracker operations and derivative prices softened in Asia, market sources said on Friday. Ethylene had been viewed as balanced to short, and from December to January demand had been better than expected, primarily driven by unexpected outages at three crackers over the Christmas and New Year break. Higher prices in ?xml:namespace> By the end of January, however, unplanned cracker outages at BASF's facilities in INEOS lifted its ethylene and propylene (C3) forces majeures, which had been in place since 15 December, on 12 February. “Crackers in “February is the month where the situation changes,” it added. “We can still pay €820-830/tonne ($1,123-1,137/tonne) on the pipe today, but by early March this will be lower”. Sources said that with ethylene spot levels around €820/tonne, cracker operators could still make a good margin so they were incentivised to run as hard as was technically possible. Additionally, cracker by-products propylene and butadiene (BD) were in short supply and attracting strong demand from Asia and the One source said: “There is plenty of opportunity to buy [spot ethylene volumes] in the European system, so why bother with deep-sea volumes? [There is] no need to compete with Asian prices.” Sources pointed out ongoing uncertainties regarding demand levels, particularly for export, after the Lunar New Year holidays. Asian spot ethylene levels were already moving off a 17-month peak of $1,400/tonne because of weak derivative demand. High prices in the region had resulted in production cuts at downstream plants. Some sources said Asian buyers had retreated to the sidelines because they had covered for the holidays and for the start of the heavy turnaround schedule. Additionally crude had shown some downturn. Current Asian spot prices around $1,320/tonne CFR (cost and freight) southeast Asia would equate to around $1,200/tonne CIF (cost insurance freight) NWE (northwest Europe), or in the mid-to-high €800s/tonne in euro terms – too high for a potential March delivery, some players said. Sources on the buying side said they had been offered volumes from Libya, Mexico, Saudi Arabia and “We have had loose discussions with potential buyers for March,” said a trader. “Their views on pricing are substantially below contract value, but they are not really in any rush to lock in any deal, there are no concerns regarding availability from European suppliers.” Not all sources were of the view that ethylene would lengthen enough – at least in the short to medium term – to suggest weaker spot pricing. “Demand is excellent for both ethylene and propylene,” said one large producer. Another said: “Demand is good for us, not really strong. But we have no volume available for any additional demand.” Another source said it viewed the market as well balanced and it would continue to tailor its operating rates to suit demand levels. Much would depend on the export opportunities afforded to European derivatives following the Lunar New Year holidays. Looking ahead to the second half of the year, there were the usual concerns about the impact of new capacities in the Middle East and in “ ($1 = €0.73) For more on eth.
http://www.icis.com/Articles/2010/02/12/9334477/europe-ethylene-may-have-peaked-as-tight-supply-eases.html
CC-MAIN-2013-20
refinedweb
558
58.21
Here are some questions about C programming which I come across and answer very frequently on programming newsgroups. All of them can be used in C++ programs as well. You might find them helpful. I need help with my homework!If you want to use any of the functions on this page in a C++ program, see C++ Notes. Please don't void my main()! What should my "int main()" return? What should I use instead of gets()? How do I input numbers as binary strings? How do I output numbers as binary strings? If I posted a link to this page in reply to a message you posted on a programming newsgroup, it seemed to me that you were asking for someone to do your programming homework for you. Your post probably looked like one of the following: You typed in your assignment word-for-word.First let me say that I apologize if I have misjudged you and you really aren't trying to get someone to do your homework for you. You complained that your instructor is stupid, but your instructor is smarter than you are, he or she already knows how to write this program! You said you have tried and tried, but get nothing but errors, but you didn't include any of your code. You said you do not have any idea where to start, and you didn't include any of your code. Your post looked like a thinly disguised attempt into fooling somebody into thinking that it is not your homework. You specifically asked for help, and not for someone to write the code, but you still didn't post any of the code you had written on your own. In this case, you still want to look at the suggestions below for the best way to get help. But if you are... The purpose of actually writing programs in a programming class is to learn how to write them. If you don't do the work, you will be cheating yourself out of the knowledge you are going to school for. Most regular contributors to the programming newsgroups will not just write your program for you. Some of them will write a program with deliberate and subtle errors, in the hopes that you will turn it in as your own work and get caught for cheating. Here are some of the replies I have posted in newsgroups to messages like yours. They are sarcastic, but don't worry, I will follow them with some suggestions on how to successfully get help with your homework..OK, I promised to give you advice on how to get useful help with your assignment in a programming newsgroup. The best results will come from following the steps below. Please post your instructor's email address in case I have any questions about your assignment. In fact, I have a great idea. I could just email your assignment directly to your instructor and then you wouldn't even have to go to class either! If you can't even figure out how to start, sit down with a pencil and paper and go work on the problem as a problem, not as a program. Take it one step at a time until you figure out how the actual operation needs to be done. Try to write the program yourself. Give it your best effort, using everything you have learned so far. If there is one particular part of the program which you just can't get to work right, perform the following steps. - Cut your program down to the smallest possible code sample which compiles and displays your problem. In the process of doing this many people find and fix the problem on their own! - If your program uses non-standard functions from non-standard headers with names like conio.h, dos.h, or bios.h, remove them from the program. - Do not attach your executable or source code to your message. Just copy the source code in your text editor and paste in into the body of your message as plain text. - Be sure to include the exact text of important error or warning messages which you get when trying to build your program. - Include the brand and version number of the compiler you are using and the operating system on your computer. If your compiler can make more than one type of program (many PC compilers can make programs for MS-DOS or Windows) then specify exactly what type you are trying to make. - Do not ask for an email reply. In the first place, it tends to annoy the people who can help you the most. In the second place, programming newsgroups are read by thousands of people worldwide. If your question is not important enough for you to take the time and effort to come back to the group in a few hours or a day to look for answers, it is certainly not important enough for you to waste the time and bandwidth of all those readers by posting it. Finally if someone posts an incorrect answer to your problem on the group, others will point out the error and correct it. If you get an answer by email, how will you know if it is right or not? - Do not post your question again if you do not see any replies in 15 minutes or an hour. Usenet groups do not work that fast. It could take up to a day (or more) before you get a reply. - It could be that you will not get a reply at all. It is possible that your question is outside the range of topics normally discussed on the group, and none of the people who see it are interested enough, or familiar enough with the subject, to post a reply. - This last one seems too obvious to mention, but the fact that I am mentioning it indicates that some people can't figure it out for themselves. Be polite in your post, and use proper spelling and grammar. You are asking for help from people who know more than you, at least about the problem you are having. If they don't know more than you, you are wasting your time asking them for help! Remember that nobody is paying these people to help you, they do it because they want to. Politeness and respect will make the most knowledgeable contributors more likely to help you. If you follow the advice above, and if your question is really on topic in the group you posted it too, there is a good chance that you will receive several excellent replies to help you solve your problem. [ Top ] A commonly asked question: Why do people say that main() has to return an int and void main(void) is wrong? I think it is all right because: First let's talk about the items above. Some computer languages are proprietary, that is they belong to a particular company, and that company has final authority to determine what the language is and isn't. One example is Java. This language is a product of Sun Microsystems, and it defined by them. Any other company which uses the Java language signs a contract with Sun and agrees that their version will be 100% compatible with Sun's standard. Another language is Microsoft's Visual Basic. This is a programming package that only they sell, and only for their Windows operating systems. Since this language is completely theirs, the definition of what the language is is completely theirs. This is not the case with most general purpose programming languages, and this includes C and C++. Nobody owns these languages or their definitions. Instead the languages are defined by International Standards, which are generated and maintained by ISO, the International Standards Organization. ANSI, which is the American National Standards Institute, is the American national standards body and is one of the member bodies of ISO. You may have heard the term ANSI C or ANSI C++. These terms are in common use because it was ANSI that issued the first standard for C. When the ISO International Standard was adopted, ANSI adopted the ISO version and it became the ANSI version as well. The current ANSI standards for C and C++ are the ISO International standards. The ANSI/ISO standards for C and C++ define the languages, not Microsoft or Borland or any other compiler vendor. Here is what the standards have to say: The function called at program startup is named main. The implementation declares no prototype for this function. It can be defined with no parameters:The newly ratified update to the C standard in 1999 will make this even clearer, perhaps because of all the clueless who could not understand that only the two formats above, both of which define main to return an int, are valid.int main(void) { /* ... */ } or with two parameters (referred to here as argc and argv, though any names may be used, as they are local to the function in which they are declared): int main(int argc, char *argv[ ]) { /* ... */ } The draft of the new standard expands on the two definitions above by modifying the wording "It can be defined" to "It shall be defined with a return type of int". An implementation shall not predefine the main function. This function shall not be overloaded. It shall have a return type of type int but otherwise its type is implementation defined. All implementations shall allow both of the following definitions of main:The two definitions which follow are identical to those in the C standard. On many operating systems, the value returned by main() is used to return an exit status to the environment. On Unix, MS-DOS, and Windows systems, the low eight bits of the value returned by main() is passed to the command shell or calling program. This is often used to change the course of a program, batch file, or shell script. Many compilers will refuse to compile a source code file containing a definition of main() which does not return an int. On some platforms a program starting with void main() may crash on startup, or when it ends. A program which contains a main() function that is not defined to return an int is just plain not real C or C++. [ Top ] There are three and only three completely standard and portable values to return from main() or pass to exit(): The plain old ordinary integer value 0.If you use 0 or EXIT_SUCCESS your compiler's run time library is guaranteed to translate this into a result code which your operating system considers as successful. The constant EXIT_SUCCESS defined in <stdlib.h> or <cstdlib> The constant EXIT_FAILURE defined in <stdlib.h> or <cstdlib> If you use EXIT_FAILURE your compiler's run time library is guaranteed to translate this into a result code which your operating system considers as unsuccessful. Note: Some operating systems, such as Unix, MS-DOS, and Windows, truncate the integer passed to exit() or returned from main() to an unsigned char and make this available to the shell script, batch file, or parent process which invoked the program. On these systems programmers sometimes use different positive numbers to indicate different reasons for the failure of the program to execute successfully. Such usage is not portable and may not work correctly on all implementations and operating systems. Only the values 0 and the constants EXIT_SUCCESS and EXIT_FAILURE are portable and guaranteed to work correctly on all hosted implementations. Warnings It is not good programming practice to take advantage of this C++ feature. Programs should always specifically indicate a return status. C++ does not provide this automatic return for any function except int main(). C does not provide an automatic return value for main() or any other function. It is up to the program to specify a return value or the status returned to the operating system is undefined. [ Top ] You might have been told this in a C programming newsgroup already, but it is important enough that I will repeat it here: Never, never, NEVER use the function gets(). It is the most dangerous function in the entire C standard library because there is there is no way to use it safely! Consider this example: #include <stdio.h> int main(void) { char name [25]; printf("Enter your name: "); fflush(stdout); if (gets(name) != NULL) printf("Hello and Goodbye %s\n", name); return 0; }What do you think will happen if the user types fifty characters into your twenty-five character array? What if the user types one hundred characters? Two hundred?? The answer is that gets() will fill up your array and then keep on going, trying to write to memory past the end of the array which your program does not have the right to access. A program crash is likely. Some notorious computer viruses have based their attack on deliberately overflowing buffers used by calling gets(). You might also have heard that you should use the fgets() function, with stdin as the FILE * parameter, instead of gets(). Most people stop after saying that, but that doesn't actually give you the same result. gets() removes the '\n' character from the input but fgets() does not. That means you must manually remove the '\n' before passing the string to fopen(), or for many other uses. Here is my getsafe() function. Like gets() and fgets() both, it returns a pointer to char. This is either the pointer which was passed to it, or NULL if end of file or an error occurred. Like gets(), it removes the '\n' at the end of the string, if there is one. The prototype is: char *getsafe(char *buffer, int count);Here is the function: #include <stdio.h> #include <string.h> char *getsafe(char *buffer, int count) { char *result = buffer, *np; if ((buffer == NULL) || (count < 1)) result = NULL; else if (count == 1) *result = '\0'; else if ((result = fgets(buffer, count, stdin)) != NULL) if (np = strchr(buffer, '\n')) *np = '\0'; return result; }That's all it takes to safely get input strings from the standard input with the '\n' removed. Notes for using this function in C++. [ Top ] The next step is to use the standard C library function strtoul() prototyped in <stdlib.h>. This function looks confusing to many newcomers to C, because it has so many parameters. Its prototype is: unsigned long int strtoul(const char *nptr, char **endptr, int base);Here is what the parameters are: nptr is a pointer to the array of characters containing the string you want parsed. It has the const type qualifier to indicate that the function will not modify the string.This code has a few other interesting features. It includes the standard header <limits.h> which defines some very important constants. In this case two of the constants it defines are used trim the unsigned long value returned by strtoul() to fit in an unsigned int and an unsigned char. endptr is a pointer to a pointer to char. If this parameter is not NULL, a pointer to the remainder of the string is stored in the object endptr points to. This can be useful in parsing complex input lines from a file, but for the purpose of processing one line at a time we will use NULL for this parameter. base the final parameter is the number base to be used. If we use 10 for base, the string would be parsed as a decimal number. If we use 16, the string will be taken to represent a hexadecimal number even if it doesn't start with 0x or 0X. If we use 2, strtoul() will accept only the characters '0' and '1' and assume they represent a number in binary. #include <stdio.h> #include <stdlib.h> #include <limits.h> int main(void) { char buffer [50]; unsigned char uc; unsigned int ui; unsigned long ul; if (fgets(buffer, sizeof buffer, stdin) != NULL) { ul = strtoul(buffer, NULL, 2); ui = (unsigned int)(ul & UINT_MAX); uc = (unsigned char)(ul & UCHAR_MAX); printf("You entered %lu decimal, %lX hex\n", ul, ul); printf("This is %X as an unsigned int\n", ui); printf("This is %X as an unsigned char\n", uc); } return 0; } The function strtoul() has another very useful feature. If you pass 0 as the base parameter, the function uses the same rules for converting the numeric string to a value that the C compiler uses on source code. If the first non whitespace characters of the string are "0x" or "0X",strtoul() parses the string as hex, accepting the letters 'a' through 'f' and'A' through 'F' as well as the digits '0' through '9'. If the first non whitespace character of the string is '0' and it is not followed by 'x' or 'X', strtoul parses the string as octal, and only acceptsthe digits '0' through '7'. Finally if the first non whitespace character of the string is any digit except'0', that is '1' through '9', strtoul parses the number as decimal. Notes for using this function in C++. [ Top ] When it comes to outputting a numeric value of one of the integer types as a string of just 0's and 1's, however, we are strictly on our own. The code to do this is not very hard. Here is the code for displaying an unsigned char: #include <string.h> #include <limits.h> char *unsigned_char_to_text(char val) { unsigned char usc = (unsigned char)val; unsigned char mask = UCHAR_MAX - (UCHAR_MAX >> 1); static char result [CHAR_BIT + 1]; char *store = result; while (mask) { *store++ = (char)('0' + ((usc & mask) != 0)); mask >>= 1; } *store = '\0'; return result; } To generate a function to output an unsigned int as a binary string, just make the following changes to this function: Change val to int and usc and mask to unsigned int.To make a function to do the same for unsigned long, change val to long and usc and mask to unsigned long, change UCHAR_MAX to ULONG_MAX, and use "sizeof(long) * UCHAR_BIT + 1". Change the two references to UCHAR_MAX to UINT_MAX. Change the expression "UCHAR_BIT + 1" for the array size to "sizeof(int) *UCHAR_BIT + 1". Warning about the returned string. The string used to store the characters in the unsigned_char_to_text is defined as a static array of characters inside the function. It must be static because local variables defined inside a function go out of scope and cease to exist once the function returns, so it is illegal and a bug to return a pointer to a local non static variable. The fact that the string is static means that each call to the function uses the same string space and overwrites the string produced by a previous call. So if you use this function more than once in a program you should be careful to do the following: Use the string immediately to display or write to a file, before calling the function again. If you do need to keep the generated string for some time, and the function might be called again, copy the string. Notes for using this function in C++. [ Top ] All of these functions are written in standard C. They can also be used and work correctly in a C++ program. In some of the cases, the features of C which I use in these functions could be replaced with C++ specific features. This is usually the preferred method in C++ if it provides a newer way of doing something than C does. Even so, the C code here is perfectly legal in C++. If your have a newer C++ compiler that supports namespaces, you can modify the programs to use the C++ feature namespace feature to place the C library function names in the std namespace. In place of traditional C header names like <string.h>, you can use the new C++ replacements like <cstring>. If you do so, preface the name of the C library functions with std::, such as std::strchr(buffer, '\n');
http://home.att.net/%7Ejackklein/ctips01.html
crawl-002
refinedweb
3,350
70.23
22 May 2012 12:10 [Source: ICIS news] SINGAPORE (ICIS)--?xml:namespace> Many local distributors tested the market with higher price offers amid the more positive market sentiment, the industry sources added. The retail prices of locally produced and imported PE grades were at yuan (CNY) 9,600-11,000/tonne ($1,517-1,738/tonne) ex-warehouse on Tuesday, up by CNY50-150/tonne from last Friday, according to Chemease, an ICIS service in The retail prices of locally and imported PE and PP grades had been falling over the past four weeks because of weak domestic demand and concerns over the ongoing eurozone sovereign debt crisis, the sources said. ($1 = CNY6.33) Additional reporting by Rain Dong, Lizzie Yu,
http://www.icis.com/Articles/2012/05/22/9562453/china-pe-pp-retail-prices-rebound-on-stronger-crude-lldpe-futures.html
CC-MAIN-2014-35
refinedweb
121
53.04
I need to write a function in C that reads a small text file , stores every character in a variable, and then stops reading when it reaches EOF. I assume I need to use fread(); I need precise info on my problem, I have been searching around only finding which parameters go into fread(); but no luck on how to loop until end of file. Any help will be greatly appreciated. I'm not much on programming, but here is a starter. do { what ever crap you need in here } while !EOF that should help a little until someone else can reply sorry its not more The only limit a person has, is the limit they give themselves. Cogito ergo sum. - Descartes I find it easier to use the fscanf function, which is similar to the scanf function used to read from standard in. First you need to open a file stream (this opens test.txt for read-only) FILE * pFIn = fopen("test.txt", "r"); This move the file pointer to the start of the file. fseek(pFIn, 0L, SEEK_SET); This scans a character from the file and stores it in the myChar variable of type char. iVal = fscanf(pFIn, "%c", &myChar); You would then loop while iVal does not equal EOF. iVal normally contains the number of bytes read or EOF on end of file FILE * pFIn = fopen("test.txt", "r"); fseek(pFIn, 0L, SEEK_SET); iVal = fscanf(pFIn, "%c", &myChar); while(iVal != EOF){ //Do stuff iVal = fscanf(pFIn, "%c", &myChar); } Hope this helps! \"When you say best friends, it means friends forever\" Brand New \"Best friends means I pulled the trigger Best friends means you get what you deserve\" Taking Back Sunday Visit alastairgrant.ca Maybe something like this would work.. I cant remember my c all that well but something like this would work in c++ and c. Use an array of n size. i=0 while scanf array[i] i++ Ben Franklin said it best. \"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.\" sry i didn't go in detail, it's 1:00 am, and i really should get some sleep #define MAX 200 \\ put whatever here... char text[MAX]; (open file) for ( t = 0; t < MAX ; t ++) { fscanf( FILE, TYPE, &text[t] ) } <--- 10 min later -----> (edited) here's a simple program that should do what you ask #include <fstream.h> main() { ifstream fin("Msdos.sys"); // ignore msdos.sys and replace it with the text file cout<< "thingy's\n\n\n"; char ch; int t = 0; char text[]; while(fin.get(ch)) text[t] = ch; cout << ch; t++; fin.close(); } Tha all mity Rodent! using fgetc() function is also an option. and not to make your programme more dynamic use linked list to store the inputs of the file stuct some_name{ char file_data; struct some_name *next; }; fgetc may be a little tricky for him to use.. fgetc just calls a character, but he wants to change all the characters into a variable.. You also can try by using struct of array and combine it with linked list ,use some pointer I hope you understand what i mean ok Struct bla_bla_bla{ Char data; int x; struct data *next; }*head,*curr,*tail; Forum Rules
http://www.antionline.com/showthread.php?239870-help-with-fread-in-C
CC-MAIN-2017-51
refinedweb
547
81.12
Operator, oh could you help me place this call? See, the number on the matchbook is old and faded… - Jim Croce, “Operator (That’s Not the Way it Feels)” When was the last time you called the telephone operator? Do operators even exist anymore? With your lists of contacts in your cell phone, Outlook, and Lync, how could you ever be without the number you need? And with everything all nicely synched up, you have all the numbers you need regardless of the device or the application you’re using. Right? Okay, maybe not. It’s possible that maybe things aren’t always synched. Because of that you might want to export your contacts from an application so you can either import them somewhere else, save them as a backup, or just have them available in another format. However, you’ll soon discover that Microsoft Lync 2010 doesn’t actually have an Export feature. But that’s okay, we’ve come up with a script to remedy that situation. This script will export your Lync 2010 contacts to a Microsoft Excel spreadsheet. Requirements. Before you get too excited about this, there are a few things you need to know about. First of all, this script runs only on the client machine and applies to the currently logged-in Lync user. Lync must be running and you must be logged in to it for this script to work. Second, you must have the Microsoft Lync 2010 SDK installed on the client machine. Download the Lync 2010 SDK. And, of course, third, you need Windows PowerShell 2.0. You don’t need the Lync Server Management Shell; this script runs against Lync, not Lync Server. Oh yeah, you also need Microsoft Excel. I’ve overcome the blow, I’ve learned to take it well I only wish my words could just convince myself… Hey, come on, the requirements aren’t that bad! We’re going to start by showing you a stripped-down version of the script. In this version we retrieve all the contact information and display it to the screen. After walking you through how to retrieve all the information we’ll show you the full script that exports everything to Excel. Ready? Okay, here we go: $assemblyPath = “C:\Program Files (x86)\Microsoft Lync\SDK\Assemblies\Desktop\Microsoft.Lync.Model.DLL” Import-Module $assemblyPath $DisplayName = 10 $PrimaryEmailAddress = 12 $Title = 14 $Company = 15 $Phones = 27 $FirstName = 37 $LastName = 38 $cl = [Microsoft.Lync.Model.LyncClient]::GetClient() $gs = $cl.ContactManager.Groups foreach ($g in $gs) { Write-Host $g.Name foreach ($contact in $g) { $contact.GetContactInformation($LastName) $contact.GetContactInformation($FirstName) $contact.GetContactInformation($Title) $contact.GetContactInformation($Company) $contact.GetContactInformation($PrimaryEmailAddress) $eps = $contact.GetContactInformation($Phones) foreach ($ep in $eps) { switch ($ep.Type) { "WorkPhone" {"work: " + $ep.DisplayName} "MobilePhone" {"mobile: " + $ep.DisplayName} "HomePhone" {"$home: " + $ep.DisplayName} } } } } Yes, we did say this is the simplified version. But don’t worry, we’ll walk through it and you’ll see it’s not nearly as complicated as it might seem at first. The first two lines are required anytime you’re going to be working with the Lync SDK: $assemblyPath = “C:\Program Files (x86)\Microsoft Lync\SDK\Assemblies\Desktop\Microsoft.Lync.Model.DLL” Import-module $assemblyPath The first line sets a variable ($assemblyPath) to the full path of the DLL that contains the objects for the Microsoft.Lync.Model namespace. A namespace is simply a container for a bunch of objects, methods, and properties. (Stay with us here just a minute longer, it gets easier.) When we create objects (such as Lync Contacts) that are part of an SDK, Windows PowerShell doesn’t know where to get those objects from until you tell it which SDK, and which namespace, the object is in. The path we’ve provided here is the default installation path of the Lync SDK, and the Microsoft.Lync.Model.DLL file contains all the objects for the Microsoft.Lync.Model namespace. If you didn’t install the SDK to the default path you’ll need to modify this line. That was probably more explanation than you needed, but it’s there in case you wanted to know. All you really need to know is that you have to include the full path to the DLL for this script to work, and you need to pass that DLL path to the Import-Module cmdlet: Import-Module $assemblyPath Import-Module is a Windows PowerShell cmdlet that reads the DLL and enables you to use all the objects, methods, and so on that are in that DLL. Okay, we now have everything from the Lync SDK that we need to actually get started. The next thing we do is define some variables: $DisplayName = 10 $PrimaryEmailAddress = 12 $Title = 14 $Company = 15 $Phones = 27 $FirstName = 37 $LastName = 38 We’ll get back to these in a bit. For now we’re going to move on: $cl = [Microsoft.Lync.Model.LyncClient]::GetClient() This line grabs the instance of Lync 2010 currently running on your machine and puts it in the variable $cl. It does this by calling the GetClient method of the Microsoft.Lync.Model.LyncClient class. (This class is part of the Lync SDK, so the script would crash at this line if we hadn’t imported the DLL with the Import-Module cmdlet.) Now that we have a reference to your Lync client stored in $cl, we need to access all the contact groups (such as Frequent Contacts and Current Contacts). We do that with this line: $gs = $cl.ContactManager.Groups In this line we retrieve the Groups collection, which is available through the client’s ContactManager object. The Groups collection contains just what it sounds like: all the group you have in your instance of Lync. We store the collection of groups in the variable $gs. Now all we need to do is go through all the groups and pull out the information for each contact. To do that we set up a foreach loop to loop through the groups collection and look at one group at a time: foreach ($g in $gs) { Write-Host $g.Name We start the loop by saying that for every group ($g) in the groups collection ($gs) we’re going to display a blank line, then the name of the group ($g.Name). (The Write-Host cmdlet, with no parameters or values, will write a blank line.) We don’t really need to do this to display contact information, but we thought it would be helpful to know which group each contact is in. For each group, we want to get information for every contact within that group. What do you think we need to do next? That’s right, we need another foreach loop. (The For each at the beginning of the sentence gave it away, didn’t it?) foreach ($contact in $g) Each group is really a collection of contacts. So for each group ($g) we go through and retrieve information about one contact ($contact) at a time. In order to retrieve information about a contact, you call the GetContactInformation method: $contact.GetContactInformation($LastName) $contact.GetContactInformation($FirstName) $contact.GetContactInformation($Title) $contact.GetContactInformation($Company) $contact.GetContactInformation($PrimaryEmailAddress) Remember all those variables we defined at the beginning of the script? Well, here they are. The GetContactInformation method takes a number as a parameter. The number you pass to GetContactInformation determines the information the method will return. For example, if you pass GetContactInformation the value 38, it will return the last name of the contact. We could have written the preceding lines like this: $contact.GetContactInformation(38) $contact.GetContactInformation(37) $contact.GetContactInformation(14) $contact.GetContactInformation(15) $contact.GetContactInformation(12) This works just fine, but it’s not really considered good scripting. We put the numbers into variables with names that describe what they’re for, which makes the script much easier to read (and debug). This line doesn’t tell you what data to expect in return: $contact.GetContactInformation(38) Whereas this line makes it clear you’re expecting a last name: $contact.GetContactInformation($LastName) Note. Yes, you could just add comments to the script. (We haven’t done that here simply to keep things cleaner as we walk you through.) But it’s still best to use descriptive variables, too. Trust us. Oh, and if you’re wondering where all these numbers are coming from, take a look at the Lync SDK documentation. It tells you which numbers will retrieve which piece of contact information. Operator, oh could you help me place this call? ‘Cause I can’t read the number that you just gave me… So as you can see, we’ve displayed the last name, first name, title, company, and primary email address of the contact. But what about this next line? $eps = $contact.GetContactInformation($Phones) Notice here that we put the output from the phone information into a variable. Why didn’t we simply display the phone numbers like we did everything else? Because it’s possible for a contact to have more than one phone number. You know what that means: that’s right, another foreach loop: foreach ($ep in $eps) One thing to note here: The variable $eps doesn’t actually contain a collection of phone numbers. What it contains is a collection of contact endpoints. An endpoint can be one of several things, including a telephone number or a SIP address. You determine what type of endpoint you’re working with by checking the Type property of the endpoint. Since we’re interested only in phone numbers, we put in a switch statement to take an action based on the endpoint type: switch ($ep.Type) { "WorkPhone" {"work: " + $ep.DisplayName} "MobilePhone" {"mobile: " + $ep.DisplayName} "HomePhone" {"$home: " + $ep.DisplayName} } If you haven’t seen a switch statement before, don’t worry, it’s actually pretty simple. For this statement, we’re looking at the Type property of the endpoint, $ep.Type. Within the curly braces ({}) we include each of the values we’re interested in. We want to retrieve the contact’s work phone number, mobile phone number, and home phone number (assuming you have the level of access required to see those values, and that the contact has provided them). Take a look at the first line in the switch statement: "WorkPhone" {"work: " + $ep.DisplayName} All we’re doing here is checking to see if the value of $ep.Type is the string WorkPhone. If it is, we perform the actions inside the {}, which is to display the string work: followed by the DisplayName property of the endpoint ($ep.DisplayName). The DisplayName for an endpoint of type WorkPhone is the work phone number. If the type matches WorkPhone, we display the work phone number, exit the switch statement, then move on to the next endpoint for the current contact. If the type isn’t WorkPhone, we check to see if the type is MobilePhone, and so on. Note. For a list of all the endpoint types you can check for, take a look at the ContactEndpointType enumeration in the Lync SDK. After we loop through all the endpoints, we go back and do this all over again with the next contact in the group. When we’re done with the current group, we go back to the first foreach loop we started with and move on to the next group, and once again do this all over again with all the contacts in that group. This continues until we run out of groups and contacts, at which point the script ends. That’s all well and good that we can display this information to the Windows PowerShell window, but that really isn’t much more useful than simply looking at the information in Lync. Isn’t that the way they say it goes? Well let’s forget all that. No, no, don’t forget all that; we still need everything we just did. But now we’re going to add to it. This script collects all the information from your Lync contacts, and it exports that information to an Excel spreadsheet. (You’ll probably need to do a little formatting of the spreadsheet to make it look nice.) $assemblyPath = “C:\Program Files (x86)\Microsoft Lync\SDK\Assemblies\Desktop\Microsoft.Lync.Model.DLL” Import-module $assemblyPath $DisplayName = 10 $PrimaryEmailAddress = 12 $Title = 14 $Company = 15 $Phones = 27 $FirstName = 37 $LastName = 38 $objExcel = New-Object -ComObject Excel.Application $wb = $objExcel.Workbooks.Add() $item = $wb.Worksheets.Item(1) $item.Cells.Item(1,1) = "Contact Group" $item.Cells.Item(1,2) = "Last Name" $item.Cells.Item(1,3) = "First Name" $item.Cells.Item(1,4) = "Title" $item.Cells.Item(1,5) = "Company" $item.Cells.Item(1,6) = "Primary Email Address" $item.Cells.Item(1,7) = "Work Phone" $item.Cells.Item(1,8) = "Mobile Phone" $item.Cells.Item(1,9) = "Home Phone" $cl = [Microsoft.Lync.Model.LyncClient]::GetClient() $gs = $cl.ContactManager.Groups $i = 2 foreach ($g in $gs) { $gn = $g.Name foreach ($contact in $g) { $ln = $contact.GetContactInformation($LastName) $fn = $contact.GetContactInformation($FirstName) $t = $contact.GetContactInformation($Title) $c = $contact.GetContactInformation($Company) $eps = $contact.GetContactInformation($Phones) foreach ($ep in $eps) { switch ($ep.type) { "WorkPhone" {$work = $ep.DisplayName} "MobilePhone" {$mobile = $ep.DisplayName} "HomePhone" {$homep = $ep.DisplayName} } } $item.Cells.Item($i,1) = $gn $item.Cells.Item($i,2) = $ln $item.Cells.Item($i,3) = $fn $item.Cells.Item($i,4) = $t $item.Cells.Item($i,5) = $c $item.Cells.Item($i,6) = $email $item.Cells.Item($i,7) = $work $item.Cells.Item($i,8) = $mobile $item.Cells.Item($i,9) = $homep $ln = "" $fn = "" $t = "" $c = "" $work = "" $mobile = "" $homep = "" $i++ } } $objExcel.Visible = $True # Remove the comment marks from the following lines to save # the worksheet, close Excel, and clean up. # $wb.SaveAs("C:\Scripts\LyncContacts.xlsx") # $objExcel.Quit() # [System.Runtime.Interopservices.Marshal]::ReleaseComObject($wb) | Out-Null # [System.Runtime.Interopservices.Marshal]::ReleaseComObject($item) | Out-Null # [System.Runtime.Interopservices.Marshal]::ReleaseComObject($objExcel) | Out-Null # [System.GC]::Collect() # [System.GC]::WaitForPendingFinalizers() Remove-Variable objExcel Remove-Variable wb Remove-Variable item We’re not going to explain how this all works, that’s a bit too much for this article. To learn about using Windows PowerShell to export data to Excel, take a look at this article. And if you’d like to see a version of this script fully commented, look here. Thank you for your time Oh you’ve been so much more than kind You can keep the dime. Hey Ucguy, Thanks for the feedback. We weren't sure there would be a huge audience for this type of thing, but for anyone interested in using PowerShell to script against their Lync client we thought this would be helpful. If you or anyone else out there can come up with what you'd consider a more practical use of scripting againt the client, we'd definitely like to hear it. We can publish your examples, or we can see about creating examples based on whatever it is you need to do. Just let us know! cspshell@microsoft.com. Ineresting info but not very useful or practical What are our options for backing up contact data from the entire Lync back-end database? In OCS 2007 R2, we used DBImpExp.exe as part of our DR plan. This doesn't seem to be an option in Lync 2010. I would like to import my contacts into the client via a csv file. Hi, is there a way to import Contacts to Lync? Especially including the Name of the person? I need this to import many YahooIDs to a Lync Client for some hounded users
https://blogs.technet.microsoft.com/csps/2011/04/07/how-to-export-lync-contacts-to-excel/
CC-MAIN-2019-22
refinedweb
2,594
58.18
Torsten Knodt wrote: > Hello, > I've used LinkSerializer with the command line environment. > In cocoon-users I had a talk with Vadimir (LinkSerializer not seeing > links (href, src)) and he explained me how LinkSerializer works. > Now I'm thinking about documenting this, but I think the following > change would be the better solution. > I think it should work out of the box with xhtml conforming to a valid > DTD. > Now this is failing, because the tags are in the xhtml namespace, but > not the attributes, they are non-namespaced. > My idea is to match also on the tag namespace with non-namespaced > attributes. Done. You can check out CVS now and see how it works for you. Vadim > I would make a patch, when it would go into the cvs. > As this doesn't make any incompatibilities, it could also go into the > next 2.0 revision. > > With kind regards > Torsten Knodt --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org
http://mail-archives.apache.org/mod_mbox/cocoon-dev/200208.mbox/%3C3D5B1CFC.9090205@verizon.net%3E
CC-MAIN-2017-17
refinedweb
172
65.73
String interpolation / format inspired by Python's f-strings. fmt vs. & You can use either fmt or the unary & operator for formatting. The difference between them is subtle but important. The fmt"{expr}" syntax is more aesthetically pleasing, but it hides a small gotcha. The string is a generalized raw string literal. This has some surprising effects: Example: import std/strformat let msg = "hello" assert fmt"{msg}\n" == "hello\\n" Because the literal is a raw string literal, the \n is not interpreted as an escape sequence. There are multiple ways to get around this, including the use of the & operator: Example: import std/strformat let msg = "hello" assert &"{msg}\n" == "hello\n" assert fmt"{msg}{'\n'}" == "hello\n" assert fmt("{msg}\n") == "hello\n" assert "{msg}\n".fmt == "hello\n"The choice of style is up to you. Formatting strings Example: import std/strformat assert &"""{"abc":>4}""" == " abc" assert &"""{"abc":<4}""" == "abc " Formatting floats Example: import std/strformat assert fmt"{-12345:08}" == "-0012345" assert fmt"{-1:3}" == " -1" assert fmt"{-1:03}" == "-01" assert fmt"{16:#X}" == "0x10" assert fmt"{123.456}" == "123.456" assert fmt"{123.456:>9.3f}" == " 123.456" assert fmt"{123.456:9.3f}" == " 123.456" assert fmt"{123.456:9.4f}" == " 123.4560" assert fmt"{123.456:>9.0f}" == " 123." assert fmt"{123.456:<9.4f}" == "123.4560 " assert fmt"{123.456:e}" == "1.234560e+02" assert fmt"{123.456:>13e}" == " 1.234560e+02" assert fmt"{123.456:13e}" == " 1.234560e+02" Expressions Example: import std/strformat let x = 3.14 assert fmt"{(if x!=0: 1.0/x else: 0):.5}" == "0.31847" assert fmt"""{(block: var res: string for i in 1..15: res.add (if i mod 15 == 0: "FizzBuzz" elif i mod 5 == 0: "Buzz" elif i mod 3 == 0: "Fizz" else: $i) & " " res)}""" == "1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz " Debugging strings fmt"{expr=}" expands to fmt"expr={expr}" namely the text of the expression, an equal sign and the results of evaluated expression. Example: import std/strformat assert fmt"{123.456=}" == "123.456=123.456" assert fmt"{123.456=:>9.3f}" == "123.456= 123.456" let x = "hello" assert fmt"{x=}" == "x=hello" assert fmt"{x =}" == "x =hello" let y = 3.1415926 assert fmt"{y=:.2f}" == fmt"y={y:.2f}" assert fmt"{y=}" == fmt"y={y}" assert fmt"{y = : <8}" == fmt"y = 3.14159 " proc hello(a: string, b: float): int = 12 assert fmt"{hello(x, y) = }" == "hello(x, y) = 12" assert fmt"{x.hello(y) = }" == "x.hello(y) = 12" assert fmt"{hello x, y = }" == "hello x, y = 12"Note that it is space sensitive: Example: import std/strformat let x = "12" assert fmt"{x=}" == "x=12" assert fmt"{x =:}" == "x =12" assert fmt"{x =}" == "x =12" assert fmt"{x= :}" == "x= 12" assert fmt"{x= }" == "x= 12" assert fmt"{x = :}" == "x = 12" assert fmt"{x = }" == "x = 12" assert fmt"{x = :}" == "x = 12" assert fmt"{x = }" == "x = 12" Implementation details An expression like &"{key} is {value:arg} {{z}}" is transformed into: var temp = newStringOfCap(educatedCapGuess) temp.formatValue(key, "") temp.add(" is ") temp.formatValue(value, arg) temp.add(" {z}") temp Parts of the string that are enclosed in the curly braces are interpreted as Nim code. To escape a { or }, double it. Within a curly expression, however, {, }, must be escaped with a backslash. To enable evaluating Nim expressions within curlies, colons inside parentheses do not need to be escaped. Example: import std/strformat let x = "hello" assert fmt"""{ "\{(" & x & ")\}" }""" == "{(hello)}" assert fmt"""{{({ x })}}""" == "{(hello)}" assert fmt"""{ $(\{x:1,"world":2\}) }""" == """[("hello", 1), ("world", 2)]""" & delegates most of the work to an open overloaded set of formatValue procs. The required signature for a type T that supports formatting is usually proc formatValue(result: var string; x: T; specifier: string). The subexpression after the colon (arg in &"{key} is {value:arg} {{z}}") is optional. It will be passed as the last argument to formatValue. When the colon with the subexpression it is left out, an empty string will be taken instead. For strings and numeric types the optional argument is a so-called "standard format specifier". Standard format specifiers for strings, integers and floats The general form of a standard format specifier is: [[fill]align][sign][#][0][minimumwidth][.precision][type] The square brackets [] indicate an optional element. The optional align flag can be one of the following: - < - Forces the field to be left-aligned within the available space. (This is the default for strings.) - > - Forces the field to be right-aligned within the available space. (This is the default for numbers.) - ^ -: The available floating point presentation types are: Limitations Because of the well defined order how templates and macros are expanded, strformat cannot expand template arguments: template myTemplate(arg: untyped): untyped = echo "arg is: ", arg echo &"--- {arg} ---" let x = "abc" myTemplate(x) First the template myTemplate is expanded, where every identifier arg is substituted with its argument. The arg inside the format string is not seen by this process, because it is part of a quoted string literal. It is not an identifier yet. Then the strformat macro creates the arg identifier from the string literal, an identifier that cannot be resolved anymore. The workaround for this is to bind the template argument to a new local variable. template myTemplate(arg: untyped): untyped = block: let arg1 {.inject.} = arg echo "arg is: ", arg1 echo &"--- {arg1} ---" The use of {.inject.} here is necessary again because of template expansion order and hygienic templates. But since we generally want to keep the hygiene of myTemplate, and we do not want arg1 to be injected into the context where myTemplate is expanded, everything is wrapped in a block. Future directions A curly expression with commas in it like {x, argA, argB} could be transformed to formatValue(result, x, argA, argB) in order to support formatters that do not need to parse a custom language within a custom language but instead prefer to use Nim's existing syntax. This would also help with readability, since there is only so much you can cram into single letter DSLs. Types StandardFormatSpecifier = object fill*, align*: char ## Desired fill and alignment. sign*: char ## Desired sign. alternateForm*: bool ## Whether to prefix binary, octal and hex numbers ## with `0b`, `0o`, `0x`. padWithZero*: bool ## Whether to pad with zeros rather than spaces. minimumWidth*, precision*: int ## Desired minimum width and precision. typ*: char ## Type like 'f', 'g' or 'd'. endPosition*: int ## End position in the format specifier after ## `parseStandardFormatSpecifier` returned. - Type that describes "standard format specifiers". Source Edit Procs proc alignString(s: string; minimumWidth: int; align = '\x00'; fill = ' '): string {. ...raises: [], tags: [].} - Aligns s using the fill char. This is only of interest if you want to write a custom format proc that should support the standard format specifiers. Source Edit proc formatValue(result: var string; value: SomeFloat; specifier: string) - Standard format implementation for SomeFloat. It makes little sense to call this directly, but it is required to exist by the & macro. Source Edit proc formatValue(result: var string; value: string; specifier: string) {. ...raises: [ValueError], tags: [].} - Standard format implementation for string. It makes little sense to call this directly, but it is required to exist by the & macro. Source Edit proc formatValue[T: SomeInteger](result: var string; value: T; specifier: string) - Standard format implementation for SomeInteger. It makes little sense to call this directly, but it is required to exist by the & macro. Source Edit proc parseStandardFormatSpecifier(s: string; start = 0; ignoreUnknownSuffix = false): StandardFormatSpecifier {. ...raises: [ValueError], tags: [].} An exported helper proc that parses the "standard format specifiers", as specified by the grammar: [[fill]align][sign][#][0][minimumwidth][.precision][type] This is only of interest if you want to write a custom format proc that should support the standard format specifiers. If ignoreUnknownSuffix is true, an unknown suffix after the type field is not an error.Source Edit Macros macro `&`(pattern: string{lit}): string - &pattern is the same as pattern.fmt. For a specification of the & macro, see the module level documentation. Example: let x = 7 assert &"{x}\n" == "7\n" # regular string literal assert &"{x}\n" == "7\n".fmt # `fmt` can be used instead assert &"{x}\n" != fmt"7\n" # see `fmt` docs, this would use a raw string literalSource Edit macro fmt(pattern: static string; openChar: static char; closeChar: static char): string - Interpolates pattern using symbols in scope. Example: let x = 7 assert "var is {x * 2}".fmt == "var is 14" assert "var is {{x}}".fmt == "var is {x}" # escape via doubling const s = "foo: {x}" assert s.fmt == "foo: 7" # also works with const strings assert fmt"\n" == r"\n" # raw string literal assert "\n".fmt == "\n" # regular literal (likewise with `fmt("\n")` or `fmt "\n"`) Example: # custom `openChar`, `closeChar` let x = 7 assert "<x>".fmt('<', '>') == "7" assert "<<<x>>>".fmt('<', '>') == "<7>" assert "`x`".fmt('`', '`') == "7"Source Edit
https://nim-lang.github.io/Nim/strformat.html
CC-MAIN-2021-39
refinedweb
1,470
57.77
ServletContextListener example ServletContextListener example Before going into the details of ServletContextListener we should understand what is ServletContext... servlet in the web application. ServletContextListener is a interface which ServletContextListener example ServletContextListener example  ...; ServletContextListener we should understand what is ServletContext. ServletContext... application. ServletContextListener is a interface which contains two methods ServletContextListener ServletContextListener ServletContextListener is a interface which contains two methods... to start and shutdown the events. How the ServletContextListener servlets servlets why we require wrappers in servlets? what are its uses.../response. For e.g. compression, encryption, XSLT etc. Here is an servlets documentation for the support. SSI is useful when you want a small part of the page servlets ; Please visit the following links: Logging Filter Servlet Example Response Filter Servlet Example Servlets i want to write a simple program on servlet context listener. Hi Friend, Please visit the following link: Hope error servlets which is given at your link getting an error given below SQLException caught: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error please suggest Error on example Error on example When I execute this program,it is throwing ArrayIndexOutOfBound exception. How can I solve this. Post your code ServletContextListener with Timer In this section, you will learn how to use timer with ServletContextListener to run code snippet after every 1 minute immediate after the application run Send Cookies in Servlets in servlets. Cookies are small bits of information that a Web server sends... Send Cookies in Servlets  ...; } Now in the above example which shows the process of adding error "+it); } } this is my program i am getting an error saying cannot find symbol class string... line s of "string ad" is small. make it capital as String ad Hi Friend, You have done a small mistake. You have defined a String in lower case error error When I deploye the example I have this message cannot Deploy HelloWorld Deployment Error for module: HelloWorld: Error occurred during deployment: Exception while deploying the app [HelloWorld Servlets Books Platform, by Dustin R. Callaway Java Servlets by Example, by Alan R... this is it. The book starts with a introduction to servlets and a small history... Servlets Books   Servlets Programming Servlets Programming Hi this is tanu, This is a code for knowing...; import javax.servlet.http.HttpServletResponse; //In this example we are going... visit the following links: Error - Struts Error Hi, I downloaded the roseindia first struts example and configured in eclips. It is working fine. But when I add the new action and I.... If you can please send me a small Struts application developed using eclips. My Servlets Program Servlets Program Hi, I have written the following servlet: [code... error saying that cannot find symbol:SerialBlob(); , while I have set... executed the program, it gave me error as follows A small programming task, plz respond at the ealiest.. A small programming task, plz respond at the ealiest.. Hi Guys ,small task to you all... at this example: 7 2 3 4 5 36 37 38 34 6 33 44 46 40 7 24 43 42 41 8 35 32 47 30 Java Servlets Java Servlets If the binary data is posted by both doGet and doPost then which one is efficient?Please give me some example by using both doGet and doPost. Thanks in Advance The doPost method is more efficient Html+jsp+database is enough to do the small operation Html+jsp+database is enough to do the small operation Hai , If u want to do simple insetion and data retrival operation throw jsp ?.you need... (SQLException e) { System.out.println("Error occurred " + e); } %> error in sample example error in sample example hi can u please help me XmlBeanFactory class is deprecation in java 6.0 so, pls send advance version class Use XmlBeanFactory(Resource) with an InputStreamResource parameter how to execute jsp and servlets with eclipse how to execute jsp and servlets with eclipse hi kindly tell me how to execute jsp or servlets with the help of eclipse with some small program servlets - Java Beginners servlets I am doing small project in java on servlets. I want to generate reports on webpage ,how is it possible and what is the difference between dynamic pages & reports ? tell me very urgent pls,pls servlets How would you set an error message in the servlet,and send...; // Retrieve the three possible error attributes, some may be null codeObj... = typeObj.toString(); // The error reason is either the status code or exception Servlets - JSP-Servlet Servlets Hello Sir, can you give me an example of a serve let program which connects to Microsoft sql server and retrieves data from it and display... visit the following link: Servlets - Java Beginners Servlets Hi, How can i run the servlet programon my system? I wrote the code in java.(I've taken the Helloworld program as example program... for more information, Thanks Amardeep Servlets Servlets How to edit and delete a row from the existing table in servlets servlets servlets How do you communicate between the servlets? We can communicate between servlets by using RequestDespatcher interface and servlet chaining I have a small problem in my datagridview - Design concepts & design patterns I have a small problem in my datagridview i have datagridviewer in c... be for example 5(integer!) if in my datagridwiewer Will be 5(whatwhich should be take in my base_database_) its back color will be for example blue.. -------change... the Name, Address, tel no fields are common. For example, If I Servlets Servlets How to check,whether the user is logged in or not in servlets to disply the home page servlets - Servlet Interview Questions servlets How would you set an error message in the servlet,and send the user back to the JSPpage? Please give java or pseudocode examples. servlets servlets Hi what is pre initialized servlets, how can we achives? When servlet container is loaded, all the servlets defined in the web.xml file does not initialized by default. But the container receives...: error in web application error in web application In your application when i am trying...]); System.out.println("MySQL Connect Example."); Connection conn = null... to apply to apply in servlets only for extraction of database fields and in jsp just...:// Small clarification Small clarification This function is used to search and select particular word. In this function document.getElementById('d')); getElementById is used to get the element by using id,but here there is no id with 'd', what - JSP-Servlet Servlets Hello ! I have the following error when i try to run Java file which has connections for MYSQL. java.lang.ClassNotFoundException: com.mysql.jdbc.Driver My program coding how to execute jsp and servlets with eclipse how to execute jsp and servlets with eclipse hi kindly tell me how to execute jsp or servlets with the help of eclipse with some small program hi friend, You may go through the following links, may servlets - Servlet Interview Questions Accessing Database from servlets through JDBC! ; This article shows you how to access database from servlets... servlets directory and register the servlet. Now open your browser... trapped error. } out.println
http://www.roseindia.net/tutorialhelp/comment/81125
CC-MAIN-2014-42
refinedweb
1,185
63.39
React Native - View View is the most common element in React Native. You can consider it as an equivalent of the div element used in web development. Use Cases Let us now see a few common use cases. When you need to wrap your elements inside the container, you can use View as a container element. When you want to nest more elements inside the parent element, both parent and child can be View. It can have as many children as you want. When you want to style different elements, you can place them inside View since it supports style property, flexbox etc. View also supports synthetic touch events, which can be useful for different purposes. We already used View in our previous chapters and we will use it in almost all subsequent chapters as well. The View can be assumed as a default element in React Native. In example given below, we will nest two Views and a text. src/components/home/Home.js import React, { Component } from 'react' import { View, Text } from 'react-native' const Home = () ⇒ { return ( <View> <View> <Text>This is my text</Text> </View> </View> ) } export default Home
https://www.tutorialspoint.com/react_native/react_native_view.htm
CC-MAIN-2018-39
refinedweb
192
64.3
. As usual, this article is written using literate programming. The article source is a literate Curry file, which you can load into KiCS2 to play with the code. I want to thank all the people from the Curry mailing list who have helped me improving the code in this article. Preliminaries We import the module SearchTree: import SearchTree Basic things We define the type Sym of symbols and the type Str of symbol strings: data Sym = M | I | U showSym :: Sym -> String showSym M = "M" showSym I = "I" showSym U = "U" type Str = [Sym] showStr :: Str -> String showStr str = concatMap showSym str Next, we define the type Rule of rules: data Rule = R1 | R2 | R3 | R4 showRule :: Rule -> String showRule R1 = "R1" showRule R2 = "R2" showRule R3 = "R3" showRule R4 = "R4" So far, the Curry code is basically the same as the Haskell code. However, this is going to change below. Rule application Rule application becomes a lot simpler in Curry. In fact, we can code the rewriting rules almost directly to get a rule application function: applyRule :: Rule -> Str -> Str applyRule R1 (init ++ [I]) = init ++ [I, U] applyRule R2 ([M] ++ tail) = [M] ++ tail ++ tail applyRule R3 (pre ++ [I, I, I] ++ post) = pre ++ [U] ++ post applyRule R4 (pre ++ [U, U] ++ post) = pre ++ post Note that we do not return a list of derivable strings, as we did in the Haskell solution. Instead, we use the fact that functions in Curry are nondeterministic. Furthermore, we do not need the helper functions splits and replace that we used in the Haskell implementation. Instead, we use the ++-operator in conjunction with functional patterns to achieve the same functionality. Now we implement a utility function applyRules for repeated rule application. Our implementation uses a similar trick as the famous Haskell implementation of the Fibonacci sequence: applyRules :: [Rule] -> Str -> [Str] applyRules rules str = tail strs where strs = str : zipWith applyRule rules strs The Haskell implementation does not need the applyRules function, but it needs a lot of code about derivation trees instead. In the Curry solution, derivation trees are implicit, thanks to nondeterminism. Derivations A derivation is a sequence of strings with rules between them such that each rule takes the string before it to the string after it. We define types for representing derivations: data Deriv = Deriv [DStep] Str data DStep = DStep Str Rule showDeriv :: Deriv -> String showDeriv (Deriv steps goal) = " " ++ concatMap showDStep steps ++ showStr goal ++ "\n" showDerivs :: [Deriv] -> String showDerivs derivs = concatMap ((++ "\n") . showDeriv) derivs showDStep :: DStep -> String showDStep (DStep origin rule) = showStr origin ++ "\n-> (" ++ showRule rule ++ ") " Now we implement a function derivation that takes two strings and returns the derivations that turn the first string into the second: derivation :: Str -> Str -> Deriv derivation start end | start : applyRules rules start =:= init ++ [end] = Deriv (zipWith DStep init rules) end where rules :: [Rule] rules free init :: [Str] init free Finally, we define a function printDerivations that explicitly invokes a breadth-first search to compute and ultimately print derivations: printDerivations :: Str -> Str -> IO () printDerivations start end = do searchTree <- getSearchTree (derivation start end) putStr $ showDerivs (allValuesBFS searchTree) You may want to enter printDerivations [M, I] [M, I, U] at the KiCS2 prompt to see the derivations function in action.
https://jeltsch.wordpress.com/2015/08/30/miu-in-curry/
CC-MAIN-2017-09
refinedweb
532
54.7
Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (ie, “ACE” is a subsequence of “ABCDE” while “AEC” is not). Here is an example: S = “rabbbit”, T = “rabbit” Solution: The problem itself is very difficult to understand. It can be stated like this: Give a sequence S and T, how many distinct sub sequences from S equals to T? When you see string problem that is about subsequence or matching, dynamic programming method should come to mind naturally. The key is to find the initial and changing condition. public class Solution { public int numDistinct(String S, String T) { int m = S.length(); int n = T.length(); int dp[][] = new int[m+1][n+1]; for(int i=0; i<=m;i++){ dp[i][0] = 1; } for(int i=1; i<=m; i++){ for(int j=1; j<=n; j++){ if(S.charAt(i-1) == T.charAt(j-1)){ dp[i][j] += dp[i-1][j]+dp[i-1][j-1]; }else{ dp[i][j] +=dp[i-1][j]; } } } return dp[m][n]; } } public class StringSubsequence { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String S = br.readLine(); String T = br.readLine(); distinctSeubsequence(S,T); } private static void distinctSeubsequence(String s, String t) { // TODO Auto-generated method stub char[] first = s.toCharArray(); char[] second = t.toCharArray(); int flag = 0; int count =0; for(int i = 0 ; i < s.length() ; i++) { if(first[i] == second[flag]) { flag++; } if(flag == t.length()) { count++; flag=0; System.out.println(t + " is a subsequence String of " + s); } } System.out.println("Number of subsequences are : " + count); } } Perfect yet simple solution.
http://www.crazyforcode.com/distinct-subsequences/
CC-MAIN-2016-50
refinedweb
315
67.45
On Mon, Sep 23, 2013 at 6:45 AM, Chris Lambacher <chris at kateandchris.net>wrote: > > On Sun, Sep 22, 2013 at 10:41 PM, Zero Piraeus <z at etiol.net> wrote: > >> I may be misunderstanding the use case given in the issue, >> > > To clarify the use case, since it is my bug, this is so that the enum > values are always available for comparison. The exact use case is in Django > templates where a value comes from the database. If you want to compare you > either have to use __class__ which I would say is a code smell, or you have > to provide the Enum class. The code we are using for this is open source >. An example of how this will be > used in practice is: > > {% if object.state == object.state.completed %} > some html > {% endif %} > Now I see your use case. But I disagree that the best solution is to allow accessing the enum values as attributes on object.state -- I would recommend using __class__ to make it clear to the reader what's going on, or to add the right Enum subclass to your template parameters. Tbe expression you show in your example here will just baffle most readers who haven't thought deeply about the issue. (How would you compare a value that is a timedelta with a known timedelta? You'd have to import the datetime module or use __class__, right?) > but it seems >> to me that having to use >> >> Color.red.__class__.blue >> >> (what is being complained about in the issue), while not exactly pretty, >> makes a lot more semantic sense than >> >> Color.red.blue >> >> ... which is just bizarre. >> > > Any more bizarre than any other class that has properties of it's own type? > Yes, because you rarely if ever see them accessed that way. > a = 0 > a.real.numerator.real.numerator > But that's different! Each of the attributes here (.real, .numerator) is defined as an instance attribute. > > It is only weird because we are not used to seeing classes where the > properties are instances of the class. I am not a core developer, but I > have been programming in Python for more than 10 years, and I (and the > other similarly experienced developers I work with) found that not having > access to the class level properties was weird (yes I am aware that they > are not actually class level properties but everywhere else Enum works hard > to make it look like they are. See for instance the __dir__ method: >). > Sorry to burst your bubble, but there is no rule that because you can access something on the class you should be able to access it on the instance. Try asking an instance for its class's __mro__ or __bases__. -- --Guido van Rossum (python.org/~guido) -------------- next part -------------- An HTML attachment was scrubbed... URL: <>
https://mail.python.org/pipermail/python-dev/2013-September/128901.html
CC-MAIN-2021-04
refinedweb
471
72.87
Console The Particle Console is your centralized IoT command center. It provides interfaces to make interacting with and managing Particle devices easy. This guide is divided into two main sections, tools for developers and tools to manage product fleets. Note: The Console does not yet work in Microsoft Internet Explorer including Edge. Please use another browser, such as Chrome or Firefox, to access the Console. If you're experiencing rendering issues, turn off any ad blocking extensions you may be using. Developer Tools While actively developing an IoT project or product, the Console offers many helpful features to make prototyping a breeze. See the last time a device connected, debug a firmware issue by observing event logs, set up a webhook to send data to an external service, and more. Devices The Devices page allows you to see a list of the devices associated with your account. Here, you can see specific information about each device, including it's unique Device ID, it's name, the type of device, the last time it connected to the Particle cloud, and whether or not the device is currently online. When Sandbox (1) is selected, you will see the devices in your personal sandbox, vs. your growth or enterprise organization. Clicking the Devices icon (2) shows the Device List. If the Show sandbox devices only checkbox (3) is not checked, then the list will be like the old, pre-checkbox, behavior and will show devices that are claimed to your account, both in your free developer sandbox as well as product devices in free, growth, and enterprise organization products. When checked, the list will only include non-product devices claimed to your account in the free developer sandbox. - Total personal devices is the number of non-product devices in your free developer sandbox. - Total claimed product devices is the total number of devices claimed to your account that are in a product. The 100-device limit in the free tier is the total of the devices claimed to your account in the developer sandbox, plus all devices in any free tier products that you are the owner of. You can also take certain actions on devices from this view, such as renaming the device and unclaiming it from your account. Unclaiming a cellular device removes it from your account, but does not stop billing. As the claiming status and SIM are separate, you must also pause or release ownership of your SIM to stop billing. Event Logs The Logs feature provides a clean interface to view event information in real-time, just from your devices. We're hoping that this is handy both while debugging code during development, and checking out recent activity on your device once you power-on your finished project. Tailored around improving the experience of browsing logs, the page provides a handful of tools, like filtering, modifiers which enable you to narrow down your search for events, making it easier to view only the data that is relevant to you. In this view, you'll only see events that come in while the browser window is open. To visit the page go to Logs The left side of the page contains a real-time log of events passing through the cloud. You'll get the name, data, timestamp and the device name associated with each event as it comes in. Oh Yeah! And, if you click on the event, you can see the event data. How to publish events Publishing events can be achieved in multiple ways: - Using particle.publishin firmware (docs) - Using Particle API JS's publishEvent(docs) - Using the Publish event button in the Event Logs page: Filtering the events Filters let you narrow down your search and only see events that are relevant. You can filter the events by writing anything in the input. Your query will be compared with the event name, data, publisher, and date. Modifiers Besides writing in the input, you can use modifiers to narrow down your search even further. You can see the list of modifiers by pressing the Advanced button. deviceFilter by device ID (example: device:34003d001647353236343012). The devicemodifier is not usable when viewing a device's individual page, as the stream is already listening only for events coming from that device. eventFilter by event name (example: event:status) rangeOnly show events that have a number value between min and max ( range:min-max, example: range:20-100) dataFilter by data (example: data:device-is-ok) Modifiers can be grouped: device:34003d001647353236343012 event:temperature range:30-50 Note: Having multiple modifiers of the same type is not yet supported (you can not filter by 2 device IDs) You can combine modifiers with a query. In this example, we combine the query '35' with the modifier 'event:temperature'. The page will only show events named temperature that have 35 as their data. Viewing event data To view more details about an event, click on it. If the event data is a valid JSON string, it will be displayed in a way that makes it easier to read and understand. To view the raw version of the JSON, click on the RAW button. You can copy the data to the clipboard if you click on the copy button. Note: You can also navigate through the event list by using the up and down arrow keys Clearing the event logs You can empty the list of received events by pressing on the Clear button. Pausing the event stream If lots of events are coming through, you can put events in a queue by clicking on the Pause button. This should help you navigate through the list of events that you have already received. To make the events from the queue visible click on the Play button. Integrations Integrations allow you to send data from your Particle devices to external tools and services. The Console provides an interface to create, view, edit, and delete Particle integrations. For more information on how to start using integrations, you should check out: Billing & Usage The Billing & Usage page shows billing information and data usage (data operations and cellular). All accounts have a personal sandbox on the free plan. The sandbox can include up to 100 cellular and Wi-Fi devices (in any combination, not to exceed 100 total), free of charge. For the growth tier, this is in addition to devices included in your growth tier blocks. From this page you can view the total number of devices and data operations consumed by your free sandbox devices. For users who are Administrators of an organization, selecting the organization then Billing & Usage icon shows the usage for all products within the organization. In the Growth and Enterprise tiers, usage is divided by the class of devices. For example: Wi-Fi and Cellular: Also Tracker devices, which have higher data allocations than other cellular devices: These panels turn yellow at 70% of your plan limits, and red when the limits have been reached. You can also quickly view your usage from the popup under your email address in the upper-right corner of the console window. The numbers of devices and data operations will be updated within a half hour. Cellular data usage may be delayed for up to a week. Historical data At the bottom of the Billing & Usage panel you can request a data usage report: - Time Range: Past week, Past month, Past 3 months, Past year - Data Requested: Data usage by device, Data usage by product It will take several minutes to generate the data, and you will be emailed a csv file when done. This option is also available for organization administrators in the organization Billing & Usage panel. Billing limits You will receive warnings by email, and as a pop-up, and in the Billing & Usage tab in the console at 70%, 90%, and 100% of the allowable data operations. In the free plan,. In the growth plan,. Upgrading to the growth tier Following the link from the emails or Billing & Usage page leads to a contact form to initiate the upgrade process. A representative will contact you by telephone to complete the upgrade process to growth tier. When you upgrade to the growth tier, you will get an organization, which is the collection of products and accounts in your plan. The usage limits in the growth tier apply monthly across all products of the same type in your organization. Some limits vary between cellular, Wi-Fi, and tracker products. Additionally, all organization members still have a private sandbox in their account and can still have their own 100 free devices that do not count against your growth plan limits. If you already have your devices in a product, the entire product can be moved into your growth organization without affecting the customers, access tokens, or cloud API endpoints, so this should be a relatively easy transition. Product Tools For many using Particle, the end-goal is to move from a single prototype to a professional deployment of thousands or millions of units in the field. When you begin making this transition to managing a larger fleet of devices, you'll find yourself asking questions like: - How many of my devices are online right now? - Which firmware version is running on each device? - Who of my customers are using their devices, and who isn't? - Who in my company has access to this fleet, and what information can they access? This is where creating a Particle product is vital to ensure scaling can happen seamlessly and successfully. Luckily, the Particle Console is designed to give you full visibility into the state of your product fleet, and provide a centralized control panel to change how devices are functioning. It allows you and a team to manage firmware running on your devices, collect and analyze product data, and manage team permissions from a single administrative interface. The first step to get started is understanding the differences between your personal devices and those added to a Product. Devices vs Product Devices Up until now, you've been an individual user of Particle. Your devices belong to you, and you can only act upon one device at a time. When you create a Product, you'll have a few additional important concepts available to you: devices, team members and customers. First, you'll set up a Product, the overarching group responsible for the development of your Internet of Things products. Defining a Product is what unifies a group of homogeneous devices together, and your Product can be configured to function exactly how you envision. Each Product has its own fleet of associated devices. Any hardware on the Particle Device Cloud including the PØ, P1, Photon, and Electron, could be used inside a Product, but it's important to note that only one type of device will be in each Product Customers own a device, and have permissions to control their device. You will define the extent of their access to the device when you configure your Product. For cellular devices, it is also common to have all devices claimed to a single account, rather than using individual customer accounts. It is also possible to use unclaimed product devices. Your Product also has team members with access to the Console. It is important to note that team members and customers have different levels of access. For instance, only team members will typically be able to send an over-the-air firmware update, while customers may have the ability to control their own product. These access levels will be controlled through the Console. Defining a product Our cloud platform thinks that all devices are Photons, Electrons, or Cores — unless it's told otherwise. Now's the time to define your own product within the platform and tell us a bit about how that product should behave. Photons are development kits. They're designed to be easy to reprogram and run a variety of software applications that you, our users, develop. Your product is (probably) not a development kit. While some of the characteristics of the development kits will carry over, you're going to want to make a bunch of changes to how your product works. These include: - Limiting access (e.g. only certain people can reprogram them) - Collecting bulk data, events, errors, and logs from all of your devices - Distributing firmware updates in a controlled fashion To create a product, return to your personal console page and click on the New Product button. This will open up a modal where you can add basic details about your product: You now have your very first Particle product! Woot! Adding team members Now that you have created a Product successfully, it's time to add your coworkers and friends that are collaborating with you on your IoT product. Adding a team member will give them full access to your Product's Console. To do this, click on the team icon () on the sidebar of your Product Console. This will direct you to the team page, where you can view and manage team members. Right now, your username should be the only one listed as a member of the Product. To add a new team member, just click the Invite team member button pictured below: Clicking this button will open up a modal where you can invite a team member by email address. Before inviting a new team member, make sure that they already have a Particle account with the email address you will be using to invite them to the Product. The invite team member modal Once your team member is successfully invited, they will receive an email notifying them of their invitation. The next time they log into their Console, they will have the option of accepting or declining the invitation. Remember that you can have up to 5 team members in the free Prototype tier, so go send some invites! API Users are also displayed in the team members tab. Nice! Now you have a Product with a team. Your Product ID When you created your product, a unique numeric ID was assigned to it. This small piece of information is very, very important to you as a product creator, and it will be used countless times during the development and manufacturing process for your product. You will be able to find your product's ID at any time in the navigation bar when viewing information about your product: Your product ID is marked with a key icon This ID will be used by the Particle Device Cloud to identify which devices belong to your Product, and subsequently it is part of what empowers you to manage firmware running on those devices en masse. When working with devices that belong to your Product, it is important to note that this product ID must be compiled into the firmware that is running on each device. The product ID that the device reports to the cloud from its firmware will determine which Product it requests to become a part of. This will be covered more in-depth in the rollout firmware section below. Adding Devices Now that you have your Product, it's time to import devices. Importing devices will assign them to your Product and allow you to start viewing and managing these devices within your Product Console. For any product you may be developing, you likely have one or more Particle development kits (i.e. a Photon) that you have been using internally for prototyping purposes. We strongly recommend importing these devices into your Product, and using them as your development group. In addition, you'll want to have a test group of devices to serve as the guinea pigs for new versions of product firmware. You should get into the habit of uploading a new version of firmware to your product, and flashing it to your test group to ensure your code is working as expected. This too will be covered more in-depth in the rollout firmware section below. To import devices, click on the Devices icon in your product sidebar, then click on the "Import" button. To allow you to import devices in bulk, we allow you to upload a file containing multiple device IDs. Create a .txt file that contains all of the IDs of devices that you would like to import into your product, one on each line. Not sure what your device ID is? You cannot register devices that have already been 'claimed' by someone outside of your team; all of these devices must either belong to a team member or belong to no one. The file should look something like this: 55ff6d04498b49XXXXXXXXXX 45f96d06492949XXXXXXXXXX 35ee6d064989a9XXXXXXXXXX Where each line is one Device ID. Once you have your file ready, drop it onto the file selector in the import devices dialog box. As noted at the bottom of the dialog box, if you previously rolled out firmware, those newly imported devices will be updated over the air to that firmware next time they connect to the Particle Device Cloud. Rollout Firmware One of the most valuable features of a Particle product is being able to seamlessly manage firmware on a fleet of IoT devices. You now have the ability to continuously improve how a device functions after deployment. In addition, product firmware management allows you to quickly and remotely fix bugs identified in the field, fleet-wide. This happens through firmware releases, which targets some or all of a device fleet to automatically download and run a firmware binary. Recommended development flow When releasing firmware your fleet, it's helpful to first understand Particle's recommended release flow. This flow has been designed to minimize risk when deploying new firmware to devices: The recommended flow for releasing firmware The first step of the release flow is using development devices to rapidly develop and iterate on product firmware. These are special product devices marked specifically for internal testing. This gives you the flexibility to experiment with new firmwares while still simulating behaviors of deployed devices in the production fleet. For information on marking a device as a development devices, check out the guide. When you have finalized a firmware that you feel confident in releasing to your fleet, prepare the binary and upload it to your product. Before releasing, you will need to ensure that the uploaded product firmware is running on at least one device in your product fleet. Your development device(s) may already be running the firmware, but we also recommend locking one or more devices to the newly updated firmware and ensure that it re-connects successfully to the cloud. This is because locking more closely represents a release action, with the specific firmware being delivered to a product device. Mark the firmware as released. This will target product devices to automatically download and run the firmware. The Particle Device Cloud will respect the precedence rules to determine which firmware is delivered to a given device. You can also use device groups, to more safely roll out the firmware by targeting a subset of the fleet for release. The rest of this section contains details around how to go through this process. Development devices Please visit the guide on development devices for information on this feature. Preparing a binary Click the Firmware icon in the left sidebar to get started. This will direct you to your product's firmware page, your centralized hub for viewing and managing firmware for your product's devices. If you haven't yet uploaded any firmware for this Product, your page will look like this: If you have been using the Web IDE to develop firmware, you are used to the process of writing, compiling, and then flashing firmware. You will follow the same high-level process here, but altered slightly to work with a fleet of devices. The first thing you'll need to do is compile a firmware binary that you will upload to your Console. Preparing firmware (4.x and later) Unlike compiling a binary for a single device, it is critical that the firmware version is included in the compiled binary when targeting Device OS 4.0 or later. Add the PRODUCT_VERSION macro to your main application .ino file, below #include "Particle.h" if it includes that line. For more information, see PRODUCT_VERSION. The firmware version must be an integer that increments each time a new binary is uploaded to the Console. This allows the Particle Device Cloud to determine which devices should be running which firmware versions. Here is an example of Blinky with the correct product version details: #include "Particle.h" } Preparing firmware (3.x and earlier) Unlike compiling a binary for a single device, it is critical that the product ID and a firmware version are included in the compiled binary. Specifically, you must add PRODUCT_ID([your product ID]) and PRODUCT_VERSION([version]) into the application code of your firmware. For more information, see PRODUCT_VERSION. Add these two macros near the top of your main application .ino file, below #include "Particle.h" if it includes that line. Remember that your product ID can be found in the navigation of your Console. The firmware version must be an integer that increments each time a new binary is uploaded to the Console. This allows the Particle Device Cloud to determine which devices should be running which firmwares. Here is an example of Blinky with the correct product and version details: PRODUCT_ID(94); } Compiling Binaries If you are using Particle Workbench, follow the instructions to use the Particle: Cloud Compile or Particle: Compile Application (local) to create a firmware binary. If you are in the Web IDE, you can easily download a compiled binary by clicking the code icon () in your sidebar. You will see the name of your app in the pane, along with a download icon (shown below). Click the download icon to compile and download your current binary. Compile and download a product binary from the web IDE Once you have a binary ready to go, it's time to upload it to the Console! Uploading firmware Back on the firmware page, click on the Upload button in the top-right corner of the page. This will launch the upload firmware modal: A few things to keep in mind here: - The firmware version that you enter into this screen must match what you just compiled into your binary. Madness will ensue otherwise! - You should give your firmware a distinct title that concisely describes how it differs from other versions of firmware. This name will be important in how firmware is rolled out to devices - Attach your newly compiled .binfile in the gray box Click upload. Congrats! You've uploaded your first version of product firmware! You should now see it appear in your list of firmware versions. Your firmware version now appears in your list of available binaries You can update the details of your product firmware version by clicking Edit when hovering over that firmware version. If you find a problem with your firmware version during testing, you can delete the firmware version, recompile it and reupload it. It is only possible to delete a firmware version before marking it as released. Edit the details of your firmware version or delete an unreleased version Releasing firmware Time to flash that shiny new binary to some devices! Notice that when you hover over a version of firmware, you have the ability to release firmware. Releasing firmware is the mechanism by which any number of devices can receive a single version of firmware without being individually targeted. Imagine identifying a bug in your firmware and pushing out a fix to thousands of devices that are out in the field. Or, consider the possibility of continuing to add new capabilities to your fleet connected devices, even after being deployed. It is all possible via releasing firmware. As a product creator, you can choose to release firmware to some or all of your product fleet. Releasing a firmware as the product default sets the firmware as the default version available to all devices in the fleet to download and run. To start the release process, place your cursor over the firmware you want to release and click Release firmware: A modal will appear, asking you to confirm the action you are about to take: Always confirm the version, targeted group(s) and impacted devices before releasing firmware to your device fleet to ensure you are taking the desired action. Impacted devices refers specifically to the number of devices that will receive an OTA firmware update as a direct result of this action. Keep in mind that releasing firmware always presents risk. Anytime the code on a device is changed, there is a chance of introducing bugs or regressions. As a safeguard, a firmware version must be successfully running on at least one device before it can be released. When you have confirmed the release is what you have intended, click the Release this firmware button. Note that the devices will not receive the firmware immediately; instead, they will be targeted for an over-the-air update the next time they start a new secure session with the cloud (this is called a handshake). It is also possible to release firmware to a subset of your product fleet, using device groups. For more information on fine-grained firmware management, please check out the guide on device groups. Locking firmware In many cases, you may want to force a device to download and run a specific version of product firmware. This is referred to as locking the device. You can lock a device to a new version of product firmware to test it before releasing the firmware to the fleet. To lock a device to a firmware, find the device on your product's devices view . Click on the device, which will take you to the device details view. Click on the Edit button: This will allow you to edit many aspects of the device's state, including the firmware it is targeted to run. Find the Firmware section, select a version of firmware you want to lock the device to, and click the Lock button as sown below: If the device is currently online, you can optionally immediately trigger an OTA update to the device by checking Flash now next to the lock button. Otherwise, the device will download and run the locked firmware the next time it handshakes with the cloud (starts a new secure session, most often on reset). Once the device downloads and runs the locked firmware, it will no longer be targeted by the Particle cloud for automatic firmware updates, until it is unlocked. For more details, please read the firmware precedence rules. Unlocking firmware Unlocking a product device breaks its association with the locked firmware version and makes the device eligible to receive released product firmwares once again. To unlock a device, visit the device's details view by clicking on it from your product's device list. Click the Edit button (shown above), and then click the Unlock button: The device above is now unlocked from version 3 of product firmware, and may be targeted to receive a released firmware next time it handshakes with the cloud. Firmware Precedence Rules Devices in your fleet will be targeted to receive a version of product firmware according to these precedence rules: Managing Customers Now that you have set up a Product, your customers will be able to create accounts on the Particle platform that are registered to your Product. When properly implemented, your customers will have no idea that Particle is behind the scenes; they will feel like they are creating an account with ACME, Inc.. There are three ways you can authenticate your customers: - Simple authentication. Your customers will create an account with Particle that is registered to your product. You do not need to set up your own authentication system, and will hit the Particle API directly. - Two-legged authentication. Your customers will create an account on your servers using your own authentication system, and your web servers will create an account with Particle for each customer that is paired to that customer. Your servers will request a scoped access token for each customer to interact with their device. This is a completely white-labeled solution. - Login with Particle. Your customers will create a Particle account and a separate account on your website, and link the two together using OAuth 2.0. Unlike the other authentication options, this option will showcase Particle branding. This is most useful when the customer is aware of Particle and may be using Particle's development tools with the product. As customers are created for your product, they will begin to appear on your Customers () page. For each customer, you will be able to see their username and associated device ID. Note that the device ID column will not be populated until the customer goes through the claiming process with their device. Customers are commonly used for Wi-Fi products because you will often need a mobile app to configure Wi-Fi network credentials. Creating a customer associates a user with their device or devices, and allows a mobile app to communicate directly with the Particle cloud API on behalf of only that user. For cellular devices, you can use customer accounts as well. However, it is common to use two other methods: Single account claiming claims all devices to a single account owned by the product creator. Cellular apps often use a web app, which does not need to have Particle API access per-user. Instead, they can handle this in the back-end. Even cellular products that have a mobile app may prefer to implement them using a mobile framework and communicate from the app to their own back-end using standard web technologies instead of the Particle API. This makes it easier to find app developers, since they don't need to know about the Particle platform. Unclaimed product devices eliminate the claiming step entirely. This simplifies device setup. However, there is an important limitation: unclaimed product devices cannot subscribe to events. They can, however, receive OTA updates, and handle Particle functions and variables. The Asset Tracker Tracker Edge firmware typically operates using unclaimed product devices. Monitoring Event Logs The Logs page () is also available to product creators! Featuring the same interface as what you are used to with the developer version of the Console, the logs will now include events from any device identifying as your product. Use this page to get a real-time look into what is happening with your devices. In order to take full advantage of the Logs page, be sure to use Particle.publish() in your firmware. Managing your billing To see all billing related information, you can click on the billing icon in the sidebar (). This is the hub for all billing-related information and actions. For more specifics about the pricing tiers and frequently asked questions, go check out the Pricing page. How billing works - Device communication is paused1 when the monthly limit is reached For more information see Device Cloud - Introduction - Pricing.. Free tier products Products can be prototyped in the Free tier at no charge. However, there is a limit of 100 devices for Free tier products. In the Growth tier, usage is measured by blocks. You can choose how many blocks you initially want to purchase in advance. It is also possible to add blocks if you run out of Data Operations, available devices, or cellular data. You will receive warnings by email, and as a pop-up and in the Billing & Usage tab in the console at 70%, 90%, and 100% of the allowable data operations for your current number of blocks.. In the Growth and Enterprise tiers, you will also have access to an Organization, which allows finer access control to multiple products. The number of devices is limited by the number of blocks you have purchased, 100 devices per block. You can purchase as many blocks as necessary to support number of devices you need. Status It’s easy to find out the status of your Product’s metrics. Visit console.particle.io/billing and you’ll see an up-to-date list of each Product you own, how many outbound events they’ve used that billing cycle, number of devices in each, and how many team members they have. The renewal date for each Product plan is also shown, so you know when the next bill is coming up. Updating your credit card You can update your credit card from the billing page by clicking on the "UPDATE" button next to the credit card on file. Whenever your credit card on file expires or no longer is valid, be sure to update your credit card info here to avoid any disruptions in your service. Failed Payments If we attempt to charge your credit card and it fails, we do not immediately prevent you or your team from accessing your Device Management Console. We will continue to retry charging your card once every few days for a maximum of 3 retries. You will receive an email notification each time an attempt is made and fails. When you receive this notification, the best thing to avoid any interruption in service is to update your credit card. Organizations An organization makes it easy to manage multiple products with shared team members and billing. Organizations are available in the Growth and Enterprise tiers. If your account is a member of an organization, the Sandbox popup in the upper left corner of the Particle console lists the organizations you can select: Selecting an organization brings up the organization view, which typically has: - Products - the products in this organization. - Team - the users in this organization and their roles (administrators, developers, etc.). - Billing & Usage - only for users who have an Administrator role. You still have granular access control at the product level when using an organization. For example, if you have a contractor who is working on a single product you can grant developer access to that product only instead of all products in your organization. Asset Tracker Features All Asset Tracker devices are intended to be used in a product, not as developer devices. This makes it easy to manage a fleet of asset trackers, allowing per-fleet and per-device configuration settings, and features like fleet mapping. The Product Features in the previous section also apply to Tracker devices. Create Product When you create a product with Asset Tracker (Cellular as the type, the Asset Tracker features are enabled for the product. Even if you have an existing product, you'll need to create a new Asset Tracker product as products can only have a single type of device. For example, a product cannot have both an Asset Tracker and a Boron in it. This is done automatically for you if you use setup.particle.io. It's OK if you're starting out with a single Tracker; you can create a free prototyping level product that only has one device in it. Map The map view shows your fleet of devices or selected devices on a map. The Map view is available for Asset Tracker products in the Maps icon. You can show a subset of your devices on the map by searching: - By Device ID - By Device Name - By Device Groups You can also search by the last known location, or within a certain time range. And view details about a specific device: On the Tracker One the temperature ("temp") is shown in degrees Celsius. This is the temperature on the board, within the enclosure, and will typically be several degrees warmer than the ambient temperature. Device Fleet Settings Your Tracker devices are intended to, in general, be configured with fleet-wide settings that are used for all devices in your fleet. The fleet-wide settings are in the Map View. Click Gear icon in the upper-left corner of the map to update Tracker Settings. Note that the settings are automatically synchronized with the device, even if the device is asleep or disconnected at the time the change is made. When the device connects to the cloud again, the checksum of the current device and cloud settings are compared, and if they are different, an updated configuration is sent to the device. Additionally, the Geofence settings are always per-device, with no fleet-wide default. It's also possible to have per-device configuration for your own custom settings. The per-device settings are within the device configuration, and do not appear in the fleet settings. Finally, when a device is marked as a Development Device, all configuration fields can be configured per-device, and these can override the fleet settings. Development devices also do not get automatic fleet firmware updates. Location Settings report. Publish on GPS lock. If checked, publish location when GNSS lock is obtained, even if the device has not reached the radius trigger or maximum location update frequency yet. The minimum location update frequency is still obeyed. Acknowledge location publishes. If checked, the device will expect cloud acknowledgement of location publishes and retry failed transmissions. If unchecked, one attempt will be made to send, which may or may not succeed. If you are publishing frequently, it may be preferable to lose some points, rather than record delayed information. Enhanced location. If checked, the Particle cloud will process location fusion, enhanced geolocation using Wi-Fi access points and cellular tower information. Publish cellular tower data. If checked, the Tracker will include information about nearby cellular towers with location events. Publish GNSS data. If checked, the Tracker will use the GNSS (GPS) module for geolocation. Publish Wi-Fi access point data. If checked, the Tracker will include nearby Wi-Fi access points in location publishes. The Wi-Fi access points are not connected to; most Wi-Fi access points periodically broadcast their presence to allow Wi-Fi devices to find them. This public information is used by the Wi-Fi geolocation service. Callback to device with enhanced location data. If checked, the Particle cloud will send back enhanced geolocation data obtained from Wi-Fi or cellular tower information back to the device. This is useful if your device firmware wants to process this information on device. If you're only tracking location from the cloud, it's not necessary to enable this option. Motion Settings The motion settings determine how the IMU (inertial measurement unit, the accelerometer) is used to determine whether to publish a location. The Interval minimum also applies to motion events. Movement events can occur while the device is awake, also also wake. RGB LED Settings The Tracker Firmware configures the RGB status LED. The Type popup menu has the following options: - off: The RGB LED is turned off (dark). - tracker: Color indicates signal strength (yellow = lower signal strength, green = higher signal strength). Fast breathing red while connecting to cellular. - particle: Use standard Particle colors like breathing cyan instead of tracker-style colors. Default for Tracker SoM Evaluation Board. Sleep Settings Sleep mode allows the device to enter a low-power state when idle, conserving battery power. Sleep requires Tracker Edge v10 and Device OS 2.0.0-rc.3 or later. There are additional details in the Tracker Sleep page.. Maximum Connecting Time is the maximum duration, in seconds, to wait for being cellular-connected and to obtain a GNSS lock before publishing. If connecting takes too long, then the device will go back to sleep instead of continuously attempting to connect. The default is 90 seconds. You can find out more in the Tracker Sleep Tutorial. Device Settings Geofence settings are only configurable per-device, not in the fleet settings. Normally, for other settings, you will use the product settings across your fleet of Tracker devices. If you mark a device as a Development Device, you can change settings on a per-device basis within the Device Configuration. Geofence settings Wake interval configures how often to wake to check whether the device is inside or outside of the geofence. If no notification is required, and the Minimum location update frequency has not been met yet, then the device may go back to sleep quickly without having to connect to cellular. If zero, the geofence will only be checked when otherwise waking from sleep. If you are not using sleep modes, the wake interval is ignored. There are up to four notification zones, each of which can have their own settings. Enable turns on or off a zone, allowing it to be easily disabled. Shape sets the shape. Only one shape, Circular, is supported at this time. Latitude (Degrees) is the latitude of the center of the circle. This must be a decimal number (not hours, minutes, seconds), -90.0 to 90.0. Longitude (Degrees) is the latitude of the center of the circle. This must be a decimal number (not hours, minutes, seconds), -180.0 to 180.0. Radius (Meters) is the radius of the circle in meters (decimal). Publish inside zone publishes when inside the circle, limited by the Maximum location update frequency. Publish outside zone publishes when outside the circle, limited by the Maximum location update frequency. Publish on enter zone publishes when the device moves into the circle. Publish on exit zone publishes when the device moves out of the circle. Time Before Trigger requires that the device be inside or outside of the zone for this many seconds before notification. This can help reduce false alarms when the device may be near the edge of the zone. 0 means notify immediately without waiting. This is an integer. The publish on inside, outside, enter, and exit affect the trig array in the location event. The following values may be present in the trig array for geofence events. Multiple items may be present: Typical Settings Typical settings in common scenarios: Vehicle (detailed information) - Radius Trigger: 151 meters (500 feet) - Maximum location update frequency: 30 seconds - Minimum location update frequency: 900 seconds (15 minutes) Sleep: disabled This will get detailed location information, but limits the data to at most once every 30 seconds. If the vehicle is moving 24 hours a day you will exceed your 25 MB data quota, but as long as it's in movement less than half of the time you'll be within the limit. The minimum location update frequency assures that events will be published periodically when stationary, so the cellular signal and battery strength will be known. Vehicle (less detail) - Radius Trigger: 1600 meters (1 mile) - Maximum location update frequency: 300 seconds (5 minutes) - Minimum location update frequency: 900 seconds (15 minutes) Sleep: disabled This will provide an approximate location while using less data, for example if you are looking for the general area of the vehicle. The minimum location update frequency assures that events will be published periodically when stationary, so the cellular signal and battery strength will be known. Tracking an item for location and theft prevention with external power - Movement: Medium - Maximum location update frequency: 30 seconds - Minimum location update frequency: 3600 seconds (1 hour) Sleep: disabled If the item is moving, the location will be published every 30 seconds. This should not be used if the item will be in movement 24 hours a day, as you will exceed the 25 MB data limit. However, if it's typically not moving this will be fine. It also updates the location information every hour even when not moving. Tracking an item - battery only - Movement: Medium - Maximum location update frequency: 900 seconds (15 minutes) - Minimum location update frequency: 28800 seconds (8 hours) Sleep: enabled If the item is moving, the location will be published every 15 minutes, otherwise the device will be in sleep mode to conserve battery power. It will also update location every 8 hours even when not moving. More sleep-related examples can be found in the Tracker Sleep Tutorial. Periodically sending information - Maximum location update frequency: 120 seconds (2 minutes) - Minimum location update frequency: 120 seconds (2 minutes) Sleep: disabled If you have additional sensors that you are monitoring, and you want to continuously send samples at set time intervals, just set the maximum. Data Usage A location publish uses one data operation to send the location data to the Particle cloud. If you subscribe to enhanced location events on the device, an additional data operation will be used. You can estimate the number of data operations you will consume using this calculator. For more information on the free tier, growth tier, blocks, and data operations, see Pricing Tiers. More information View Device Using the cmd box When viewing a device in the console, in the functions and variables area on the right, is the cmd box. . Using off-the-shelf releases To use off-the-shelf Tracker Edge firmware releases, click on the Firmware icon in your product in the console. automatically. Devices and SIM cards There are multiple lists of devices and SIM card lists, and this section describes which one is which. Devices - sandbox The devices list includes devices that are claimed to your account, that you are the owner of, in your free developer sandbox. These devices count against your free tier limit of 100 devices. It also includes devices that are claimed to your account, that are part of a product (free, growth, or enterprise). Devices that are claimed to your account but are part of product do not count toward your free device limit. The exception is free tier products owned by you, in which case all devices, whether claimed by you or not, count toward the 100 device limit. Only devices claimed by you show up in this list; the others are only in the product device list but still count toward the limit. In the developer sandbox, non-product, there is no add devices button. The intended paths to add a device are: - Using the Particle mobile apps for iOS and Android - Using the Particle CLI - Using setup.particle.io - Sandbox is selected in the upper left (1). - The Devices icon is selected in the left navigation bar (2). SIM cards - sandbox Cellular devices with Particle SIM cards, either built-in (MFF2) or plastic nano SIM cards (4FF) show up in this list. In the developer sandbox, non-product, there is no import button. The intended paths to activate a SIM card are: - From setup.particle.io where you can set up a cellular device with a SIM card, or activate just the SIM card - From the Particle mobile apps for iOS and Android - Sandbox is selected in the upper left (1). - The SIM cards icon is selected in the left navigation bar (2). Products - sandbox The products list in the sandbox shows: - Free tier products that you are the owner of - Free tier products that you are a team member of You can tell by the email address under the product description as this is the owner of the product (3). If you are the owner, all devices in that product count toward your 100 device limit. - Sandbox is selected in the upper left (1). - The Products icon is selected in the left navigation bar (2). Products Devices - sandbox This list shows all devices that are included in a product, regardless of claiming. - Sandbox! If you click the ... button on the right side of the product device list, there are three options: - Mark as development device - Unclaim device - Remove device Add Devices allows a single device ID, or a file of device IDs, to be added to a product. Within the free sandbox, there is a limit of 100 devices. This is across all device types, and is further reduced by the non-product devices claimed by the product owner. Products SIM cards - sandbox Cellular devices with Particle SIM cards, either built-in (MFF2) or plastic nano SIM cards (4FF), show up in this list. The cellular usage by these SIM cards count against the cellular data limit for the user account that owns the product. If the 45 MB per month limit is exceeded for the free sandbox account, the account is paused until the next billing cycle. - Sandbox! Import SIM cards adds a SIM to the product. This is normally only necessary if you have an Electron 2G/3G with a 4FF plastic nano SIM card. For all devices with a built-in MFF2 SMD SIM card, if you add the device to the product, its matching SIM card is automatically added as well. Products - organization The products list in the organization shows all products in the organization you have selected. The Organization Team configuration determines what access you have (Administrator, Developer, View-Only, etc.) for all products in the organization. It is also possible to invite team members to the product who are not part of the organization. For example, if you hire a outside contractor to work on a specific project you could grant developer access to only that product, not the whole organization. Organizations are used for both growth and enterprise tiers. An organization is a collection of products, shared team access controls, and shared billing that span across all products. This makes it much easier to manage multiple products. Every member of an organization also has a free sandbox associated with their account. Products Devices - organization This list shows all devices that are included in a product, regardless of claiming. - An organization! Add Devices allows a single device ID, or a file of device IDs, to be added to a product. Products SIM cards - organization Cellular devices with Particle SIM cards, either built-in (MFF2) or plastic nano SIM cards (4FF), show up in this list. The cellular usage by these SIM cards count against the cellular data limit for the organization that owns the product. In the growth plan, for each class of class device (cellular or tracker), there is a pool of data based on the number of blocks. If you exceed this pool of cellular data, a new block is added to the organization. - An organization!
https://docs.particle.io/getting-started/console/console/
CC-MAIN-2022-27
refinedweb
8,366
61.16
In this tutorial we will learn about Process Whitelisting, which is part of Alcide Runtime Security (ART). We will see how DevOps and/or SecOps teams can enable the detection of unauthorized or compromised processes running on pods in their kubernetes clusters. For this tutorial, we will leverage GitHub Actions to do our build actions generating the process whitelist checksum. Since GitHub Actions run automatically when you push to a repository, you'll have to create a new repository to add the action to. Please refer to the instructions here. Of course, if you prefer to use an existing repository that is possible as well. Create the following file named app.py in the myapp folder: from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello, World!' if __name__ == '__main__': app.run(debug=True, host='0.0.0.0') This is a simple Python web server that returns Hello World when opened. Create the following file named Dockerfile in the root of the new repository: FROM ubuntu:xenial LABEL maintainer="yourname@organization.net" RUN apt-get update -y && \ apt-get install -y python-pip python-dev WORKDIR / COPY my-app/app.py / RUN pip install Flask ### This is the Alcide whitelist generator integration ### ARG ALCIDE_PROCESS_WHITELIST_HASH_KEY ENV ALCIDE_PROCESS_WHITELIST_HASH_KEY ALCIDE_PROCESS_WHITELIST_HASH_KEY ADD /generator RUN chmod +x /generator &&\ /generator -k ${ALCIDE_PROCESS_WHITELIST_HASH_KEY} -i /usr/bin/python &&\ rm -f generator ### End of integration section ### ENTRYPOINT [ "python" ] CMD [ "/app.py" ] This Dockerfile sets up the image for running the Python Flask application and generates a white list entry for the process we want to allow this container to run. In this case, we create a hash for /usr/bin/python because this image will run a python web server. Create the following file named main.yml file in the .github/workflows directory in your repository: # Runs a set of commands using the runners shell - name: Run a multi-line script run: | docker login --username ${GITHUB_ACTOR} --password ${{ secrets.DOCKER_PASSWORD }} docker build -t ${GITHUB_ACTOR}/my-app:latest . docker push ${GITHUB_ACTOR}/my-app:latest env: ALCIDE_PROCESS_WHITELIST_HASH_KEY: ${{ secrets.ALCIDE_PROCESS_WHITELIST_HASH_KEY }} Add two secrets DOCKER_PASSWORD and ALCIDE_PROCESS_WHITELIST_HASH_KEY to the GitHub secrets. DOCKER_PASSWORDis the password of to your docker account (we recommend you use an access token instead of your main password) so the image can be uploaded to the public Docker hub. ALCIDE_PROCESS_WHITELIST_HASH_KEYwe will start with an invalid key so the workload will get flagged as unauthorized - enter 123abc. By saving the workflow yaml, GitHub will automatically start running your workflow. Navigate to the output by clicking on the > Actions header item on your main repository page. Now that we have a Docker image built and uploaded to DockerHub, we can run a kubernetes workload on the cluster you have connected to your Alcide Cloud environment. # create an environment variable with your username so you can copy and paste the kubectl commands export USERNAME=<yourusername> # spin up our unauthorized workload kubectl run --generator=run-pod/v1 process-whitelist-workload --image=${USERNAME}/my-app:latest When we go to the Infrastructure overview in Alcide Cloud, we will see the following alert (may take 5 to 10 minutes). Let's delete the workload and re-build the Docker image with the correct key. kubectl delete process-whitelist-workload The correct key for your organization can be found within the Alcide Cloud platform at Settings/Keys/Process whitelist under hash key → Show key (direct url:). We will use this key to generate the whitelist and later validate its authenticity in runtime. Update the existing GitHub secret named ALCIDE_PROCESS_WHITELIST_HASH_KEY with the new value. To kick off the build process, make an arbitrary change (like creating a README.md) and push it to the repository. Under > Actions we will see a new build job starting. Execute the following command again: kubectl run --generator=run-pod/v1 --image=${USERNAME}/my-app:latest We will see the pod workload reappearing in Alcide Cloud without any alert, like so: Let's wreak some havoc and simulate an attack on the running pod and a hacker getting shell access to the pod. We won't actually trigger a Flask vulnerability - although you could - but rather use kubectl exec to spawn a bash terminal in the container. kubectl exec -ti process-whitelist-workload bash Since we didn't generate a whitelist entry for bash, once we do this, the workload should get flagged in Alcide Cloud. Again, this may take several moments to show up. You see that Process Whitelisting is useful both for detecting both unauthorized/compromised Docker container images as well as hackers compromising the running pod. That's all folks! Get rid of the pod by running the following command: kubectl delete process-whitelist-workload In this codelab we covered:
https://codelab.alcide.io/codelabs/runtime-codelab-05/
CC-MAIN-2020-24
refinedweb
783
54.32
OK, so you want to create a windows service and you’re not a .NET guru? This is exactly what got me in trouble with my wife. It started off easy enough, but before the weekend was through, my wife was getting on to me for spending so much time at the computer. She thought that I should be spending quality time with our family, imagine that. I told her that I was doing some ‘personal’ research, that, “no, it’s not work honey” and “I’m trying to learn some new technology”, “think of it as reading a book, only on the computer…” Inanities like that, she wasn’t having any of it, of course. Regardless, I am glad to report, I figured it out and just in the nick of time, too. This The Command Prompt is found in the folder: Microsoft Visual Studio .NET 2003\Visual Studio .NET Tools You will need the command prompt for installing and uninstalling the service later in this guide. 12 Steps to Service Bliss Overview 1.. Details 1. Create a Project a. Click the IDE menu item: File-New-Project or just click the New Project button from the Start Page the New Project dialog will pop up. b. Select Visual C# Projects. c. Select Windows Service from the Templates window. d. Type a descriptive name into the Name field, something like timedService. e. Change the location if you don’t like it (optional). f. Click OK. 2. Browse the Autogenerated Code The IDE will autogenerate some code and drop you into Service1.cs [Design] view. To look at the generated code, right click the window and select – View Code. I highly recommend you at least skim the autogenerated code. When you think you’ve seen enough, Click back to Service1.cs [Design] view. 3. Rename the .cs File First, let’s change the name of the .cs file to something more applicable. To do this, find the Solution Explorer – usually the top right window. If you cannot see the window anywhere, click the IDE menu item: View-Solution Explorer. a. Expand the timedService Project(or whatever you named your project) b. Right Click on Service1.cs c. Click Rename d. Name it something like timedService.cs You will notice that the design view tab now shows timedService.cs [Design] and, if you look at the source code again, that the namespace is timedService. 4. Rename the main Class While the namespace has been changed to timedService, the name of the class is a generic – Service1, not descriptive and not helpful, we will change it. To do so, find the Class View window. It is usually in the top right window as a tab behind the Solution Explorer. If you cannot see the window anywhere, click the IDE menu item: View – Class View. a. Expand the timedService Project by clicking the + sign to the left of the name. b. Expand the timedService Code Namespace. c. Right Click on the Service1 Code Class. d. Click Properties. Find the Properties window, usually the bottom right window. If you cannot see the window anywhere, click the IDE menu item: View-Properties Window. Make sure that Service1 CodeClass is showing in the dropdown at the top of the properties window. Below that you will see a Misc property, expand it if it is not already. e. Click the text field to the right of (Name) f. Type in something like C_TimedService or whatever you like that helps you to remember that this is the Class that contains our service logic. You will see the changes once the focus changes from the text field, ie. Press enter, tab, click on another window, whatever. It is sad, but the change of name is not complete until we replace the name Service1 in the Main and Initialize Component methods. g. Click back to timedService.cs code view. h. Type Ctrl-H to bring up the Replace dialog or from the IDE main menu – select Edit – Find and Replace – Replace. i. Type Service1 into the ‘Find what’ edit box j. Type C_TimedService into the ‘Replace with’ edit box k. Click the Replace All button – should result in 3 occurrence(s) replaced. Now, let’s flesh out the service by adding the ability to actually install and uninstall the service. 5. Add the Service Installer/Uninstaller In order to actually be able to install our program as a service requires hooks into the Windows Service API and can be rather involved from a programmatic standpoint. You should be glad that the IDE abstracts the details away from the programmer so gracefully. This abstraction makes adding an installer, a piece of cake. a. Click back to the timedService.cs [Design] window. b. Right Click in the window. c. Select Add Installer. The view will change to ProjectInstall.cs [Design] and there will be two icons added to the view, serviceProcessInstaller1 and serviceInstaller1. d. Switch to the Properties Window – serviceInstaller1 System.ServiceProcess.ServiceInstaller should be selected. e. Change the (Name) property to something like timedServiceInstaller f. Change the ServiceName property to something like timedService – this is the display name that will show up in Administrative Tools – Services. g. Select serviceProcessInstaller1 System.ServiceProcess.ServiceProcessInstaller from the Properties Window dropdown. h. Change the (Name) property to something like timedServiceProcessInstaller. i. Change the Account to LocalSystem by selecting it from the dropdown that will appear when you click to the right of Account. The program is now installable and uninstallable as a service, however, the program does not really do anything, yet. We will fix that. 6. Create a Timer In this step we will create a 30 second timer with the idea that our service will do something every 30 seconds. a. Click back to the timedService.cs [Design] window. b. Click the Toolbox, if you cannot see the Toolbox anywhere, click the menu item: View – Toolbox and you may as well click the Push Pin icon in the top right of the window, so it will stay in the foreground. c. Click the Components* button d. Double Click the Timer* button (icon that looks like a clock). A timer icon will now appear in the design window. e. Click the Toolbox’s push pin so it will keep itself out of the way. f. Click the timer1 icon in the design window and switch to the Properties Window and timer1 System.Timers.Timer should be selected. g. Verify that the Enabled property is True or change it to True h. Change the Interval property to 30000 (30 seconds times 1000 milliseconds) i. Change the (Name) property to something like timer. We are set to make the service do something useful. *If either the Components or Timer buttons are not present, right click in the grey area and select Add/Remove Items… a dialog will pop up and you can select Timer – System.Timers from the .NET Framework Components tab. 7. Do Something Useful This is the sticky wicket, or is it thicket? What is useful? In our case, we will have our application log a message to a text file, saying that the program is alive and well. This will provide us with a simple, yet effective demonstration the efficacy of our service. a. Click back to the timedService.cs [Design] window. b. Double Click the timer icon. This will drop you into the timedService.cs code window and create a method called timer_Elapsed. This is where we will add our logging code. c. Type (or copy and paste) the code below into the method, between the start and end curly braces: System.IO.StreamWriter logfile = System.IO.File.AppendText("c:\\log.txt"); logfile.WriteLine("[" + System.DateTime.Now + "]: I am ALIVE!"); logfile.Close(); This is the only coding that we will do, period. The timer_Elapsed method is where you will want to call your class methods for doing the work. Obviously, you can elaborate on this section to your hearts content. 8. Build the Service Building the service is a breeze. From the IDE’s main menu, select Build – Build Solution. If the build succeeded, you will see the line below in the Output window: Build: 1 succeeded, 0 failed, 0 skipped If it fails to build it’s probably a typing error or a missed step. Retrace your steps and verify that you haven’t missed anything. If all else fails, email me and I might be able to help. That’s it, now let’s install the service. 9. Install the Service This is one of the steps that requires the Visual Studio .NET 2003 Command Prompt. If you have not already started it, start it now and change to the project directory (directory where the exe file was written). You can determine this in the IDE by selecting from the main menu – Project – Properties (timedService must be selected in the Solution Explorer) and looking at the Project – Project Folder field (hover over it for a tooltip or click it to select for pasting into a cd command). If you copy it from there you will need to cd into bin\debug to get to the actual exe. a. Verify that you are in the correct directory by typing dir, you should see the file timedService.exe in the directory. b. Type installutil.exe timedService.exe to install the service. If the install is successful, you will see these two lines: The Commit phase completed successfully. The transacted install has completed. Otherwise look at the output, and the files – timedservice.InstallLog and timedservice.InstallState that will have been created, to determine the cause, and retry after correcting the problem. 10. Run the Service Running the service is what it’s all about. a. In windows Click Start-Settings-Control Panel. b. Double click on the Administrative Tools icon. c. Double click on the Services icon. d. Click on the timedService entry e. Click on the Play button (right triangle) at the top of the Services window. The service should now be running and the Status field should say Started. To verify that the service is doing what it should, browse to the log.txt file and open it in your favorite text editor. Scroll to the bottom of the file and you will see an entry like this: [1/2/2004 10:02:00 AM]: I am ALIVE! Wait a while (more than 30 seconds) and you will see more entries with timestamps 30 seconds apart – you may need to refresh your editor to see the changes. 11. Stop the Service What goes up, must come down. a. In windows Click Start-Settings-Control Panel. b. Double click on the Administrative Tools icon. c. Double click on the Services icon. d. Click on the timedService entry e. Click on the Stop button (square) at the top of the Services window. The service should now be stopped and the Status field should be empty. 12. Uninstall the Service While I would like to think that you have found this Service to be the Killer App of all time, I will go ahead and tell you how to uninstall the service. You will need this knowledge in order to be able to develop .NET Services. This step requires the Visual Studio .NET 2003 Command Prompt. Start it now and change to the project directory (directory where the exe file was written). You will need to cd into bin\debug to get to the actual exe. a. Close the Services application if it is running. b. Verify that you are in the correct directory by typing dir, you should see the file timedService.exe in the directory. c. Type installutil.exe /u timedService.exe to uninstall the service. If the uninstall is successful, you will see this line: The uninstall has completed. Otherwise look at the output to determine the cause and retry after correcting the problem. Conclusion The usual development cycle of edit, compile, debug, edit and recompile is applicable with service as well, with two additions: edit, compile, install, debug, uninstall, edit, recompile, reinstall. The uninstall and reinstall steps are really only necessary when you make changes that impact either of the Service Installer Objects – timedServiceProcessInstaller or timedServiceInstaller. I hope that you have found this guide instructive and helpful. I sure could have used it the other day. My wife would have appreciated it. Let me know if there are errors or omissions and I will try to update the guide. Resources Here are some good places to look for more information a. F1 and Shift-F1 – no, really! It’s not the best, but it should be your first line of defense. b. Google is where you will have the most luck. c. Got Dot Net is a pretty decent place to visit. d. Code Project has a lot of source code for .NET. e. Code Guru has a lot of .NET related material. f. Microsoft MSDN .NET Framework Home Page – If all else fails, use the source… g. Download the source h. Email the author Will Senn. I have VS.NET 2003 but I don’t seem to find the motivation to install it as it takes a long time (I need to install 2002 first and then upgrade it). I know that MS is offering a .NET SDK and C# compiler and tools free of charge, but I am not sure if it includes a debugger and if I can use these with SharpDevelop free IDE. I know how much resource it can take to figure out a (what seems as) simple task when it’s not documented too well. Thank you for your hardwork, I know i will find it useful ! (Sorry Eugenia for earlier) No, the SDK does not include a free debugger as far as I know. Yes, there is a free debugger in the SDK.… This is a good guide to help folks get off the ground when developing win32 .NET console-based services. I find it frightening how heavily dependent this process is on the visual studio .NET GUI – all just to make a console service? For Windows users curious how the same could be accomplished on Linux or BSD, one can use the ‘cron’ daemon to run a command every minute, hour, day, month, or day-of-the-week. For example, the following command will achieve the same result: echo “[`date ‘+%D %r’`]: I am ALIVE!” >> ~/time_service.log It appends this line: [01/05/04 12:10:11 PM]: I am ALIVE! to the ‘time_service.log’ file in your home directory. To make the ‘cron’ daemon run this command every minute, type ‘crontab -e’ and add the following: * * * * * echo “[`date ‘+%D %r’`]: I am ALIVE!” >> ~/time_service.log The 5 stars represent minute, hour, day, month, and day of the week. In this case, we want to run our command every minute, all the time.. Does this service you made run in kernel space? There are a number of other sample on creating .Net based services on. To Anonymous, the service runs with the permissions level of the user under whose account the service is running (set during the install, or later via the component manager). Think of it running as a background user. To the author of the article, can you explain why the timer1 is being contained by the installer design, rather than the service class? If you have both 2002 and 2003 why deal with SharpDevelop?? I mean its a very nice FREE IDE but doesn’t compare to vs.net. I know it doesn’t compare. But I don’t want to spend 2 hours installing VS.NET and spend 6 GB of space. In the meantime since my last message I have already installed the 1.1 SDK and #develop. It took about 500 MB and 20 minutes overall and it will be good enough for a beginning. You should be able to install the VS.net 2003 upgrade first and feed it the 2002 disk to prove you have the previous version when the install routine asks for it. Took me a while to find when I was developing my first Windows Service… When you are ready to start debugging the .NET Windows Service it’s nice to override the OnStart() method and add a sleep (10-15 seconds) there to give you time to attach the debugger before the service executes your code. Also, when you start the service go back into Visual Studio (I use 2002) and select Debug->Processes. In the window find your service (by executable name) and click the Attach button. Click Close and you will be debugging your service. You can set breakpoints now that will be hit etc. When you are done debugging go back into the Processes window detach from the process. Hope that helps someone… 🙂 Does this service you made run in kernel space? No, a cron job does not run in kernel space. In fact, almost nothing runs in kernel space on a typical unix machine. While there can be some (minor) performance gain from running code in kernel space, it is considered bad to put code into the kernel if it doesn’t have to be there. Why? Because any bug in kernel code can easily lead to a crashed system or a security vulnerability. User space is good because it lets the OS do its job–protecting processes from one another. Just a few comments on the cron ideas (I’ll just comment on them inline): I find it frightening how heavily dependent this process is on the visual studio .NET GUI – all just to make a console service? Well, you can write a .NET service as easy as writing the code in a .cs file and compiling it using csc.exe with the correct command-line parameters. No GUI needed. For Windows users curious how the same could be accomplished on Linux or BSD, one can use the ‘cron’ daemon to run a command every minute, hour, day, month, or day-of-the-week.[i] Windows provides a command ‘at’ which is similar to cron (granted not as powerful) which you <u>can</u> use to schedule tasks to run at various times using it. Just run ‘at /?’ to see. [i. If you run a command using ‘> command &’ does it continue to run if you log out? A Windows Service can be set to run as soon as Windows boots even before any users logs in. Also, with a Windows Service you can configure it to run as any user you’d like. I think you could loosely compare a Windows Service to a daemon in Unix. Hi, The reason that it is so GUI oriented is because, I wanted to show how ‘easily’ it could be done using the GUI – there are a lot of code based tutorials around. Believe it or not, you would think that this type of information would be easily found, but it really isn’t – least not that I could find. The do something part is simple on purpose, as well – rocket science is left to the user – I provided a shell not the meat. Your example using echo could be similarly managed in windows with the AT command and a batch file. Again, it’s just a tutorial – it is educational not robust or useful. Thanks for the comments. Will Worked as advertised, cept my executable ended up in <pathname>inDebug …. is that normal? Good tutorial, BTW I meant … my executable ended up in <pathname>inDebug (after I clicked on Build Solution, there is no executable in the root directory of my project directory). WorknMan: It should have been <ProjectDir>/bin/Debug if you built it in debug mode – the default and didn’t specify a different directory. To specify the directory simply select Project-Properties from the main menu and select Configuration Properties in the dialog that pops up. Under Outputs you can change the Output Path (bin/Debug) to whatever you like – under the project directory. In order to actually install it in production (or just to test from another location) simply copy it where you want it to reside and run installutil nameofexe from that location. installutil comes with the .NET framework. Thanks, Will Jeremy, Stellar hint! I didn’t think of doing it that way, I just attached and then stopped the process – I know, pretty random, yours is a much better way and allows debugging of the startup code. Thanks, Will This was a GREAT article and can only wish more were documentated and easy to read as this (the screen shots were excellent)!!! It was not only useful but informative. Thanks much 🙂 This article assumes you are installing this on a the local machine – how do I deploy the created service on a third-party computer that does not have VS.NET on it??? Thanks This article assumes you are installing this on a the local machine – how do I deploy the created service on a third-party computer that does not have VS.NET on it??? Thanks SharpDevelop has a good debugger that comes from the .Net SDK. SharpDevelop can be used on the .Net SDK because that is what it was designed for. SharpDevelop didn’t create their own compiler just an IDE. This article assumes you are installing this on a the local machine – how do I deploy the created service on a third-party computer that does not have VS.NET on it??? At the least you’ll need the .NET Framework installed on any computer that you plan to run .NET applications on. InstallUtil.exe comes with all versions of the .NET Framework, AFAIK, so you can always install a .NET Windows Service. >@Jeremy – At the least you’ll need the .NET Framework installed on any computer that you plan to run .NET applications on. InstallUtil.exe comes with all versions of the .NET Framework, AFAIK, so you can always install a .NET Windows Service. But how do you se InstallUtil.exe ??? Anon: type pathtoinstallutilinstallutil nameofexe from the directory with nameofexe in it, where pathtoinstallutil is something like: D:WINNTMicrosoft.NETFrameworkv1.1.4322 and nameofexe is something like: timedservice.exe as Jeremy pointed out, you get installutil with the framework. If you are looking for how to create a professional installer – I hate to be coy, but – that’s beyond the scope of my little 15 page tutorial. Will Yeah…..2 hours of doing something else…..once you start the install…..lwhy don’t you go and do something else…..like see the outdoors or something for a few hours……once the install starts its not like you have to sit there…..also the 6GB….most of that is the MSDN and disk space is so cheap…..get over it.
https://www.osnews.com/story/5568/a-visual-quickstart-guide-to-windows-net-services/
CC-MAIN-2021-31
refinedweb
3,803
75.61
Yes, there will be internet access on the evaluation machine. Yes, there will be internet access on the evaluation machine. Can you provide more information? Also, the Known Issues doc says: - When running the solution within the VS .NET IDE please confirm that the port number assigned to the ASP .NET Development Server matches the settings in the Client project settings designer. For example, in the port number is 34052. This URL is visible by clicking on the ASP .NET Development Server tray icon once the Web Project is started. For the Client web services to contact the server web services, the client must contact the services on the correct port. You may check the Client port settings by selecting properties for the SskWebService reference and viewing the URL. Could that be your problem? Are you sure you're config which defaults to port 1956 is the same as the actual port the web service is running on? Hi, Yesterday I wanted to implement the SSK into the app I plan to enter, but couldn't even get the sample to work. I always receive the following error message: "An unknown error occurred while contacting the server.There was an error during asynchronous processing. Unique state object is required for multiple asynchronous simultaneous operations to be outstanding." Any ideas what might be causing this?? Exception using Shareware Starter Kit with Click-Once deployment.Version..ctor(String version) at System.Configuration.LocalFileSettingsProvider.CreateVersion(String name) at System.Configuration.LocalFileSettingsProvider.GetPreviousConfigFileName(Boolean isRoaming) at System.Configuration.LocalFileSettingsProvider.Upgrade(SettingsContext context, SettingsPropertyCollection properties, Boolean isRoaming) at System.Configuration.LocalFileSettingsProvider.Upgrade(SettingsContext context, SettingsPropertyCollection properties) at System.Configuration.ApplicationSettingsBase.Upgrade() at System.Configuration.ApplicationSettingsBase.GetPropertyValue(String propertyName) at System.Configuration.ApplicationSettingsBase.get_Item(String propertyName) at Client.Properties.Settings.get_LoggingEnabled() at SSK.SSKClient.UIHelper.Logger.Log(String s) at SSK.SSKClient.ClientStorage.DataStore..ctor(Form form) at MyApp.Program.Main() I keep getting this error message the first time my application is ran using Click-Once deployment. Subsequent launches of the same application does not fail: Hope I can fix this before the submission deadline or else the application will always fail the first run just to be clear, when is the actual cutoff date and time (PST) for entries? Please could someone explain how the ASP .NET development server gets started. I can run the SSK Sample successfully and this starts the ASP .NET Development Server and puts its icon in the tray. I've integrated the client modules into my own program. However, my program fails if the Development Server icon is not in the tray to start with. How come it starts when the Sample runs but not when my program runs? Should my program be starting the development server or is this just something the Sample does to make things easy? Thanks, Julian SSK Source Update Use of deprecated classes in SSK.Server.SendMail class. It's using System.Web.Mailnamespace classes for sending e-mail, while .NET Framework 2.0 has a new namespace for sending e-mails, namely System.Net.Mail. Below is an updated version of the "sendmail.cs" file inside the App_Code folder of the sharewareservice part of SSK. This update makes it possible to send e-mail from your localhost without IIS SMTP Service installed. using System; using System.Net.Mail; using System.Configuration; using System.Data.SqlClient; using Microsoft.ApplicationBlocks.Data; namespace SSK.Server { /// <summary> /// Summary description for SendMail. /// </summary> public class SendMail { private MailMessage _message; //constructor public SendMail() { } /// <summary> /// Send an email to the user with their license information /// </summary> /// <param name="invoice">The invoice for the transaction</param> /// <param name="authLicense">The product key generated by the system.</param> public void SendMailApprovedLicense(string invoice, string authLicense) { SqlDataReader reader = SqlHelper.ExecuteReader(ConfigurationSettings.AppSettings["SQLConnectionString"], "SendMailApprovedLicense", invoice); if (reader.HasRows) { reader.Read(); string body; string to = (string)reader["Email"]; string subject = "Your product has been activated.";<tr><td>"; body += "Dear " + (string)reader["Firstname"] + ",<br><br><br>"; body += "Thank you for activating your product. Please make a note of the following information "; body += "for future reference:<br><br>"; body += "</td></tr>"; body += "<tr><td width=\"500\">"; body += "Product Key: " + invoice + " "; body += "<br><br>"; body += "</td></tr>"; body += "<tr><td>"; body += "Thank you,<Br>"; body += ConfigurationSettings.AppSettings["FromName"] + "<br><br>"; body += ConfigurationSettings.AppSettings["FromEmail"]; body += "</td></tr>"; body += "</table>"; try { Send(subject, body, to); } catch { //fail gracefully if the mail doesn't send } } } public void Send(string subject, string body, string to) { _message = new MailMessage(); _message.IsBodyHtml = true; _message.From = new MailAddress(ConfigurationSettings.AppSettings["FromEmail"]); _message.Subject = subject; _message.Body = body; _message.To.Add(to); SmtpClient smtp = new SmtpClient(ConfigurationSettings.AppSettings["SMTP"]); smtp.Send(_message); } } } August 12th, 23:59PM Pacific Daylight Time Will there be Office 2003 and/or Outlook 2003 installed on evaluation machine? Hello, my name is Joe and i am 10 years old, why can't i enter. I could make an realy good program and i would love absaloutly love to go to the PDC 05. - PJausovec wrote:Will there be Office 2003 and/or Outlook 2003 installed on evaluation machine? I'm sure we can accomodate that. - joeisadotnet wrote:Hello, my name is Joe and i am 10 years old, why can't i enter. I could make an realy good program and i would love absaloutly love to go to the PDC 05. Joe, Sorry, there is alcohol served at PDC events and everyone must be at least 21 years old to attend. Before I put the finishing touches on my entry (and a night of testing), I need to confirm a couple of things... The judges will be running the Shareware Starter Kit service on the local machine, will it be the same service and DB that is available to us all and has been since the start of this contest? If the above is true, given that it is the same DB, are our apps are to use the same information as the sample client when it comes to those values used to distinguish one app from another in the eyes of the service/DB (ie ProductName, DevID, etc)? I just want to make sure that I am accounting for any meaningful differences between the machine(s) that my app will be run on compared to those I have already have and continue to test with. Yes, we will be using a VPC that will be re-initialized to judge each application. The VPC will have VS2005 B2 and the SSK installed. This means that it will have the same DB, product name, etc. that you have been testing with. Can I just watch over the net and get the things their using. - dbates wrote: Can the application be packaged in a MSI, rather than a collection of binaries and assemblies. The MSI could be zipped up with a screen shot? Yes, that is the required packaging. - danv303 wrote:How complete are you expecting the entries to be? I think I can get my project into a polished beta state - mostly usable but some rough edges. I expect to be starting the beta testing phase when around the due date - would it reflect badly on my submission? We do expect everything to be "beta" at some level. Of course, if it crashes all the time, that would not be so good... <smile> - joeisadotnet wrote:Can I just watch over the net and get the things their using. You are certainly welcome to download the tools and submitted applications. We just can't award you the prize. Thread Closed This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.
http://channel9.msdn.com/Forums/Coffeehouse/73109-How-to-enter-the-Coden-my-way-to-PDC-Contest?page=3
CC-MAIN-2014-41
refinedweb
1,292
59.3
Amazing Link in Japanese G-DEP Associate Research Engineer 東京大学大学院工学系研究科 岡安優 Motivation DLに夢を抱きつつ、よくわからないでいきなりTensorflow!! GPU!! CUDA!!!!! and cuDNN!! COME ON! -> Install Error Parade..... ということで、この記事ではこれからGPUでの高速計算を本格的に行っていきたい上記のような自分への戒めを込めた勉強用の記事となります。 Content - GPU computing and CUDA - Basic Hardware - Get CUDA! - Play with CUDA - Architecture of GPU - CUDA Programming (1) - CUDA Programming (2) - Elementary Programming Practice (1) - Elementary Programming Practice (2) - OpenACC and PGI compiler (1) - OpenACC and PGI compiler (2) - OpenACC and PGI compiler (3) - Library from NVIDIA 1. GPU computing and CUDA 1.1 Introduction So, let us start with the definition of GPU, which is short for Graphic Processing Unit. As it named, mainly it is aimed at coping with the image processing. And this unit is connected to VRAM(Video Random Access Memory) to efficiently process the images. The compositions are as simple as those of CPU, but what GPU makes so popular is that parallel computing power. If you don't have any idea what i am talking about, then please check this blog and video first!!. As you can see, it is excel in a parallel processing of huge data. With these quality features, now we are wondering who can provide such a great product?? The answer is on this website. By now, we have grasped a bit of GPU, right? Then let's move on to the purpose why we are interested in this cutting-edge-technology! 1.2 What is GPU computing? You may have already covered this fancy video, but let me put up here again! And as you can see it is magically fast! isn't it? In fact, it is said that originally scientists were wondering how to utilise the parallelised computing unit of GPU, and they have found the different colours on each unit of GPU. Since then they leveraged that uniqueness for parallel computing. Later on NVIDIA has developed the chip for this computation method leading the world to GPU! So what they created was CUDA which is IDE for general-purpose computing on GPU(GPGPU so called). 1.3 What is the difference between CPU and GPU? You know? With the birth of CPU, we were sticking to the clock speed though, what GPU showed us was totally a new world. GPU is put more than hundreds of computing unit on it. Hence, as the video have shown, GPU own such a massive computational resource. 1.4 What is CUDA? So hereby, we are kind of understanding about GPU, but in this section, I would like to focus on CUDA. It stands for Computational Unified Device Architecture. Quoted from Official Blog of Nvidia. 2. Basic Hardware Needless to say, we are not pursuing a static academic knowledge. We need a practical knowledge. So in this section, let us move on to the hardware of GPU. At first, the appearance. Then the inside of this black rocky face. 2.1 Motherboard Yes, this sticking out one is GPU! 2.3 CPU Hello our (old) friend! Still love you! 2.4 RAM 2.5 Power Suply Note: GPU needs relatively large electricity compared to CPU. And it depends on what type of GPU do you have, so please check the required buttery beforehand! 2.6 GPU This is absolute beauty!! 3. Get CUDA! Please finish installation before jumping into this section. Useful Link for Ubuntu users: 3.1 Hello World of CUDA We have been talking enough already, so let's get our hands dirty! Please compile this file(hello.cu) using "nvcc". #include <stdio.h> int main( void ) { printf("Hello, World!\n"); return 0; } $ nvcc hello.cu # compiling the file $ ./a.out # you can run the file Congratulation!! You just finished making your first cuda programme. So what the compiler nvcc so called did was a bit complicated. It have classified the code into CPU and GPU part. And then for cpu part of code, it applies C compiler, while it compiles GPU part by itself(nvcc). Link of this PPT: Now let's try genuine cuda programming! Save below code as hello_gpu.cu and compile it! #include <stdio.h> __global__ void kernel( void ) { } int main( void ) { kernel<<<1,1>>>(); printf( "Hello, GPU World!\n" ); return 0; } $ nvcc hello_gpu.cu $ ./a.out # output Hello World! Since we have finished with simple helloworld programme, I believe that warm-up has finished! And let's dive into official tutorial provided by NVIDIA. Link: I would like to skip deeper insight, because there are many good articles over the world already. And for this tutorial from NVIDIA, they have explained how we can optimise the code. Starting off with the simple C++ code, and they let us optimise more modify a bit of it. sample1.cpp #include <iostream> #include <math.h> // function to add the elements of two arrays void add(int n, float *x, float *y) { for (int i = 0; i < n; i++) y[i] = x[i] + y[i]; }; } $ nvcc sample1.cpp $ ./a.out $ nvprof ./a.out # we can profile the performance # output should be like below ==10215== NVPROF is profiling process 10215, command: ./saxpy Max error: 0 ==10215== Profiling application: ./saxpy ==10215== Profiling result: Time(%) Time Calls Avg Min Max Name 100.00% 426.56ms 1 426.56ms 426.56ms 426.56ms add(int, float*, float*) ==10215== API calls: Time(%) Time Calls Avg Min Max Name 54.28% 426.56ms 1 426.56ms 426.56ms 426.56ms cudaDeviceSynchronize 45.33% 356.25ms 2 178.13ms 647.30us 355.60ms cudaMallocManaged 0.20% 1.5692ms 1 1.5692ms 1.5692ms 1.5692ms cudaLaunch 0.14% 1.1081ms 2 554.05us 504.10us 604.00us cudaFree 0.02% 172.60us 83 2.0790us 100ns 73.699us cuDeviceGetAttribute 0.02% 163.80us 1 163.80us 163.80us 163.80us cuDeviceTotalMem 0.00% 23.400us 1 23.400us 23.400us 23.400us cuDeviceGetName 0.00% 5.8000us 3 1.9330us 200ns 5.1000us cudaSetupArgument 0.00% 2.1000us 1 2.1000us 2.1000us 2.1000us cudaConfigureCall 0.00% 1.4000us 2 700ns 600ns 800ns cuDeviceGetCount 0.00% 900ns 2 450ns 400ns 500ns cuDeviceGet And here is the optimised code. Named, sample2.cu #include <iostream> #include <math.h> // Kernel function to add the elements of two arrays __global__ void add(int n, float *x, float *y) { int index = threadIdx.x; int stride = blockDim.x; for (int i = index; i < n; i+= stride), 256>>>; } $ nvcc sample2.cu $ ./a.out $ nvprof ./a.out #output should be like below ==10195== NVPROF is profiling process 10195, command: ./a.out Max error: 0 ==10195== Profiling application: ./a.out ==10195== Profiling result: Time(%) Time Calls Avg Min Max Name 100.00% 2.8100ms 1 2.8100ms 2.8100ms 2.8100ms add(int, float*, float*) ==10195== API calls: Time(%) Time Calls Avg Min Max Name 98.22% 322.33ms 2 161.17ms 652.50us 321.68ms cudaMallocManaged 0.86% 2.8223ms 1 2.8223ms 2.8223ms 2.8223ms cudaDeviceSynchronize 0.48% 1.5644ms 1 1.5644ms 1.5644ms 1.5644ms cudaLaunch 0.33% 1.0846ms 2 542.30us 459.90us 624.70us cudaFree 0.05% 171.80us 83 2.0690us 100ns 73.700us cuDeviceGetAttribute 0.05% 163.90us 1 163.90us 163.90us 163.90us cuDeviceTotalMem 0.01% 24.800us 1 24.800us 24.800us 24.800us cuDeviceGetName 0.00% 7.2000us 3 2.4000us 100ns 6.6000us cudaSetupArgument 0.00% 2.1000us 1 2.1000us 2.1000us 2.1000us cudaConfigureCall 0.00% 1.3000us 2 650ns 600ns 700ns cuDeviceGetCount 0.00% 600ns 2 300ns 200ns 400ns cuDeviceGet So as you can see at profiling result, it is optimised from 426ms to 2.8ms!! Very nice indeed. If you are interested, please try that link! Since my purpose is using tensorflow, I would like to leave the elaboration to it! 5. Architecture of GPU Please refer to this amazing post...
https://qiita.com/Rowing0914/items/59112d8b992156eaceef
CC-MAIN-2018-30
refinedweb
1,293
79.56
Is it possible to print a page without opening it? I was thinking in principal you could create a new window, write the JavaScript dynamically using write() and call the print() function. Is this possible? Thanks. Hello ! As far as i know, it is not possible.When you ask for printing with Javascript, you call the print dialog box, so in any case, the visitor must validate that window. May be you can dispose some scripts that wait for a blur of the window (when the dialog box opens), and when the focus returns, the window closes itself.I don't know if it works in any browser. Hope this helps.McBenny What I do is have an iFrame on the page that has it's location pointing to the page you want tp print. When you are ready, you first give it the focus by calling its focus() method, then print it using its print() method. Couple of things to remember: You can set the iFrame's location on the fly with Javascript You can make the iFrame 1px by 1px no matter how big the page is that it contains. It will still print the whole page. At 1px square, it looks like a period or dot. Use absolute positioning to park it somewhere it will not notice, like under another GIF. If you need actual code, post a message and I'll hunt some down. I have the same requirement of printing a page without opening it. Would appreciate if you could post some sample code here...I am an newbie, so any help is appreciated. Printing a page you haven't opened is only possible on intranets running Internet Explorer where you can attach a different page to be printed in place of the one displayed. The best you can do on the internet is to double up your page content with one version to display on the screen and the other to print. Dear mathopenref, I need to print a web page without showing the print dialog box. I understand that you know how to do it. Could you pleaes kindly send me the code? Many thanks and kind regards Sue2006 All browsers other than Internet Explorer will automatically open the print dialog so that the person can confirm where they want to print to. Only Internet Explorer running on an intranet can print directly to the printer and that is set up in the operating system on each individual computer rather than in the web page. This hack certainly works fine with IE6 under WinXP. The idea here is to use JavaScript to call VBScript in a way that confuses the issue enough so that the dialog does not come up even if you have your security settings to force ActiveX to ask permission. I hope it does not work in IE7 but I have not tested there yet. Brett function print() {var WebBrowser = '<object id="WebBrowser1" width=0 height=0</object>'; document.body.insertAdjacentHTML('beforeEnd', WebBrowser);execScript("on error resume next: WebBrowser1.ExecWB 6, -1", "VBScript");execScript('on error resume next: WebBrowser1.outerHTML = ""', 'VBScript');} IE7 has ActiveX turned off by default (since that is the web's most common cause of security holes). ActiveX was Microsoft's biggest mistake and they are abandoning it as quickly as they can. <<ActiveX was Microsoft's biggest mistake and they are abandoning it as quickly as they can.>> Microsoft would disagree. IE7, as previous versions, is neither more nor less than a collection of ActiveX controls. What they have done is change the user interaction behaviors of some of the controls. As I said, I hope the hack does not work in IE7 but I will not know until I actually test it tomorrow in IE7 RC1. Even before release, IE7 seems way out-moded by Firefox 1.5. Brett Merkey Here is how to have a print button which will print some other page from your site. NOTE: It will only run if it is on a web server (not C:) and the page to be printed is on the same server, same domain. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD> <script type="text/javascript">var okToPrint=false; function isIE(){ return (navigator.appName.toUpperCase() == 'MICROSOFT INTERNET EXPLORER');} function doPrint() { window.printFrame.location.href=""; okToPrint=true;} function printIt(){if (okToPrint) { if ( isIE() ) { document.printFrame.focus(); document.printFrame.print(); } else { window.frames['printFrame'].focus(); window.frames['printFrame'].print(); } }} </script></HEAD> <body>Press print button<button onclick="doPrint(); blur(this);">Print</button> <iframe width="0" height="0" name ="printFrame" id="printFrame" onload="printIt()"></iframe> </BODY></HTML> what it does:1 An iframe with zero size holds the page you want to print. It will work on any size page. 2 When the button is pressed the iframe is loaded with the desired page. Can be any page the browser will render, PHP etc. 3 We wait. Once the page has been loaded the iframe's onload handler fires and initiates the print. 4 The okToPrint flag is to prevent the iframe from initiating a print when the outer page is first loaded. hi mathopenref, thanks for posting your code! it works fine on Mac/FF & Mac/Safari but Opera prints the parent page and (dare i go here) Mac/IE5.2 nothing happens. I can live with Mac/IE not working because most things don't work on that waste of harddrive space. any ideas about Opera, though? also, if anyone has tested this could you post what browsers/OS it does and does not work on? thankseric Opera always gives the choice of which frame to print. You use the print preview option to select which frame or frames that you want to print out. The ones visible in the window at the time the print is selected are the ones that will be printed. So to get Opera to print a particular page all you need to do is to make that the only frame that is visible in the browser window and hide (or shrink to zero size) all the rest. My guess is that the browser test need improving. I haven't tried it but my hunch is that Opera wants to be treated like IE, but my code doesn't do that.It should probably be some thing like: if (IE or Opera) ....John Couple of other thoughts: On FF, even though the iframe is zero by zero, you still see a dot. You can get rid of it by setting it's border to zero either in line or with CSS. For debugging, just make the iframe say 400 by 200. You then see what is being loaded into it for checkout purposes. i got rid of the little box by using this:<iframe width="0" height="0" style="visibility:hidden; border-color: white; border-width: 0px; border-style: none;" it's a little redundant but it works. i'll try adding the opera code. all in all, it works in the major os/browser combinations. Are you sure the solution you gave there works? In my experience, when the visibility is set to hidden it refuses to print in IE. I would suggestborder-width:0; instead. John hmmm... that might be the reason why i was having problems in safari. i will delete the hidden line and hopefully that will help. thanks for your help!
https://www.sitepoint.com/community/t/can-you-print-a-page-without-opening-it/2784
CC-MAIN-2017-13
refinedweb
1,239
73.68
Sum of Numbers coderinme Sum of Numbers coderinme Finding the sum of two numbers entered by the user manually would be very hectic, frustrating as well as a time taking process. To make it simple Let us now write a program in Java that reads two integers from the user in the main program. It passes these two integers and then finds the sum of all these integers by adding the two and returns the sum as an output. Finally the sum is printed. What we are supposed to do here is very simple. Assuming that the first number is 5 and the second number is 8, then the required output is 5 + 8 = 13 Write a Java program to calculate sum of two numbers. import java.io.*; public class Q1 { public static void main(String[] args) throws IOException { BufferedReader inp = new BufferedReader(new InputStreamReader(System.in)); float a,b; System.out.print("Enter First number: "); a = Float.parseFloat(inp.readLine()); System.out.print("Enter Second number: "); b = Float.parseFloat(inp.readLine()); System.out.println("Sum of the two number
https://coderinme.com/sum-of-numbers/
CC-MAIN-2019-09
refinedweb
180
56.76
Type: Posts; User: terryeverlast Nevermind, I got it with using FtpGetCurrentDirectory and FtpSetCurrentDirectory I'm trying to upload files to a ftp server using WININET(windows internet). Trying to do this recursive. How can I get the full path of the WIN32_FIND_DATA member cFileName? I tried... My question, What happens when with the 32 bit register value exceeds 4 bytes while programming in c++? Im interested in encryption. Im programming and doing some calculations. The hex value... Nevermind. I Solved my own problem by creating a pointer to my main dialog and simply using GETDLGITEMINT I want to send a number to my OPENGL class from my main dlg. Im using a updated edit control. here is my open gl code that will draw what I want void COpenGLControl::oglDrawScene() { char... How can I write the list(or pattern like number) list into a loop or something equal to that in c++? 1=3 2=3 3=3 4=3 5=6 6=6 7=6 8=6 Hello. How are you. I'm programming an app that deals with large numbers. I have a do-while loop that I want to execute. I can not get it to work. The "while(d!=1)" part is the problem and I can... I created a object from the original dialog class I get the error Debug assertion failed Wincore.cpp line 3095 something to do with updatedata CIRCBOTDlg okok; Another question. My thread that I created is global and cannot access the varialbes for my dialgos. How do I fix this? UINT WritingThreadFunc(LPVOID pParam) { I have a tabbed dialog with a couple of Separate dialogs. I created classes of CDialog for each dialog. Im trying to get the text from the edit control from the tabbed dialog and it appears in a... Cool..i got it work with Igor Vartanov code here is the code void CSimpleftpclientDlg::OnButton4() { int index; CString strText; Still got a problem..now is is this line of code lvi.lParam = (LPARAM)node; which gives me the error error C2440: 'type cast' : cannot convert from 'struct testing' to 'long' No... 0k i handled the LVN_GETDISPINFO with this code void CThisDlg::OnGetdispinfoList1(NMHDR* pNMHDR, LRESULT* pResult) { LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR; if(pDispInfo->item.mask... Ok i see. I need to also handle LVN_GETDISPINFO in the message maps with ON_NOTIFY and form the columns in a switch statment Im trying to populate a list control with the filename and maybe some other thing when i push the OK button here is my code void CThisDlg::OnOK() { int iItem = 0, iActualItem = 0; ... Ok i got a picture in the attachments for understanding.. I put a red box into the list control that gets the files of the server with FTPFINDFIRSTFILE AND FTPFINDNEXTFILE the blue box list... Im programming a ftp client and im loading files from my computer into a list control. I want to upload files selected in the list control. How do I get the path for a seleced item in a list control? Im coding a music player and I want the timer to stop when the music stops. I got a static text with the lenght of the song. (the static text shows the position of the song in seconds....like... I fixed the problem. instead of using SIZEOF i just manually put i the bits in the RECV command. is there anythign else i can use instead of SIZEOF recv(current_client,buf2,sizeof(buf2),0); Im making a rat program and the recv function is not receiving. here is my code #include <windows.h> #include <stdlib.h> #include <stdio.h> #include <winsock2.h> #include <iostream>
http://forums.codeguru.com/search.php?s=8caf6c66ace0682d0a59bbd0c819b95d&searchid=8139691
CC-MAIN-2015-48
refinedweb
611
67.35
Some test text! Welcome to PDFTron. C++ C++ applications on Linux. Your free trial includes unlimited trial usage and support from solution engineers. tar xvzf PDFNetC64.tar.gzor tar xvzf PDFNetC.tar.gz. CPP. Navigate into the CPPdirectory and create a new CPP file called myApp.cpp. This guide will assume your application is named myApp. Open myApp.cpp with your favorite text editor and paste this inside: #include <iostream> #include <PDF/PDFNet.h> #include <PDF/PDFDoc.h> #include <SDF/ObjSet.h>: g++ myApp.cpp -I../../../Headers -L../../../Lib -lPDFNetC -lstdc++ -lpthread -lm -lc -Wl,-rpath,../../../Lib -Wl,-rpath$ORIGIN -o myApp Run the application via ./myApp. The output should read: PDFNet is running in demo mode. Permission: write Hello World! Check the output.pdf that the program output in the same directory. It should be a PDF with one blank
https://www.pdftron.com/documentation/guides/get-started/cpp/linux/
CC-MAIN-2019-43
refinedweb
141
64.98
only demonstrational - it does nothing more than that it logs an event in Site Manger -> Administration -> Event log for each creation, modification or deletion of a user or document. The following points summarize what needs to be done in order for the connector to be functional. Most of the steps have already been performed, so they are only described so that you can follow them when registering your own integration connectors. 1. The connector itself is implemented by the SampleIntegrationConnector.cs class located in ~/App_Code/Samples/Classes (or Old_App_Code if you installed the project as a web application). Open the file for editing in Visual Studio. To make it work, you need to ensure that the ConnectorName property initialized in the Init() method has the same value as the code name of the connector registered in the UI (see step 4 below for more details). For the purpose of this example, change the value of the property to "SampleIntegrationConnector". 2. A connector can either be implemented in a standard assembly, or in App_Code (or Old_App_Code if you installed the project as a web application), just as the sample connector. When it is stored in App_Code, you need to implement a module class with code that will ensure dynamic loading of the connector. See Customizing providers from App_Code in Kentico CMS Developer's Guide for more details. In ~/App_Code/Samples/Modules (or ~/Old_App_Code/Samples/Modules), you can find the SampleIntegrationModule.cs class, which ensures dynamic loading of the sample integration connector. You can see its code below. 3. In Kentico CMS user interface, integration connectors need to be registered on the Connectors tab in Site Manager -> Administration -> Integration bus. New connectors can be registered by clicking the New connector link above the grid. The Sample Integration Connector is already registered in the default installation and just not enabled, so let's inspect its properties by clicking the Edit ( ) icon. 4. When editing an integration connector (as well as when registering a new one), the following properties need to be specified: •Display name - name of the connector used in the system's administration interface. •Code name - name of the connector used in website code. This name must match the value of the ConnectorName property declared in the connector class (see step 1 above). •Assembly name - name of the assembly within the web project in which the connector class resides. •Class name - name of the class which implements the connector. If the class is located in a dedicated assembly (not in App_Code), the name should be entered including the namespace. •Enabled - indicates if logging and processing of tasks by this connector is enabled. Logging and processing of tasks needs to be enabled in Site Manger -> Settings -> Integration -> Integration bus as well in order for the connector to be functional. As the sample integration connector is not enabled by default, check the Enabled check-box and click OK to save the changes. 5. Now that the the connector is registered and enabled, you only need to adjust settings of the module. Go to Site Manger -> Settings -> Integration -> Integration bus and adjust the settings. Now performing the tasks.
http://devnet.kentico.com/docs/6_0/integrationguide/enabling_the_sample_integration_connector.htm
CC-MAIN-2017-17
refinedweb
523
53.61
This, and entity references..6 Summary of Presentation Elements. The content elements are the MathML elements defined in Chapter 4 Content Markup. The content elements are listed in Section 4.4 The Content Markup Elements..2.4 Content Markup Containedrows. Although the math element is not a presentation element, it is listed below for completeness. that 1*, since they are most naturally understood as acting on a single expression.. for details. Token elements (other than mspace and mglyph) 3.1 will be adding more than nine hundred Math Alphanumeric Symbol. The next section discusses the mathvariant attribute in more detail, and a complete technical description of the corresponding characters is given in Section 6.2.3 Mathematical Alphanumeric Symbols.) 7.1,. A issue arises in that the natural interpretations of the mathvariant attribute values only make sense for certain characters. For example, there is no clear cut rendering for a 'fraktur' alpha, or a 'bold italic' Kanji character. In general, the only cases that have a clear interpretation are exactly the ones that correspond to SMP Math Alphanumeric Symbol characters. Consequently, style sheet authors and application developers are encouraged in the strongest possible terms to respect the obvious typographical interpretation of the mathvariant attribute when applied to characters that have SMP Math Alphanumeric Symbol counterparts. In all other cases, it is up to the renderer to determine what effect, if any, the mathvariant attribute will have. For example, a renderer might sensibly choose to display a token with the contents ∑ (a character with no SMP counterpart) in bold face font if it has the mathvariant attribute set to "bold" or to "bold-fraktur", and to display it in a default Roman font if the mathvariant attribute is set to "fraktur". As this example indicates, authors should refrain from using the mathvariant attribute with characters that do not have SMP counterparts, since renderings may not be useful or predictable.phanumeric Symbols. Token <mstyle fontstyle='italic'> <mi mathvariant='bold'> a </mi> </mstyle> deprecated. The values of mathcolor, color, mathbackground,). % x0 would be a more strictly correct notation, but renders terribly in some browsers. These attributes can also be specified as an html-color-name, which is defined.2.3 Mathematical Alphanumeric Symbols Characters. and Section 3.2.1.1 Alphanumeric symbol characters) the value of the mathvariant attribute should be resolved first, including the special defaulting behavior described above. <mi> x </mi> <mi> D </mi> <mi> sin </mi> <mi mathvariant='script'> L < Many mathematical numbers should be represented using presentation elements other than mn alone; this includes complex numbers, ratios of numbers shown as fractions, and names of numeric constants. Examples of MathML representations of such numbers include: can be set by using the mstyle element as is further discussed in Section 3.3.4 Style Change (mstyle). <=.) <mo> + </mo> <mo> < </mo> <mo> ≤ </mo> <mo> <= </mo> <mo> ++ </mo> <mo> ∑ </mo> <mo> .NOT. </mo> <mo> and </mo> <mo> ⁢ </mo> <mo mathvariant='bold'> + < that for use in an mo element representing the differential operator symbol usually denoted by "d". The reasons for explicitly using this special entity are similar to those for using the special entities for invisible operators described in the preceding section. moelements 4.2.6 Syntax and Semantics), space added around an operator (or embellished operator), when it occurs in an mrow, can be directly specified by the lspace and rspace attributes.: <mrow> <mi> x </mi> <munder> <mo> → </mo> <mtext> maps to </mtext> </munder> ." or conveying meaning in Section 3.3.6 Adjust Space Around Content (mpadded). <mtext> Theorem 1: </mtext> <mtext>   </mtext> <mtext>      </mtext> <mtext> /* a comment */ </mtext> In some cases, text embedded in mathematics could be more appropriately represented using mo or mi elements. For example, the expression 'there exists such that f(x) <1'. meanings of the other values are described in the table below.. Adjust Space Around Content (mpadded). ms) The ms element is used to represent "string literals" in expressions meant to be interpreted by computer algebra systems or other systems containing "programming languages". By default, string literals are displayed surrounded by double quotes.". In practice, non-ASCII characters will typically be represented by entity references. For example, <ms>&</ms> represents a string literal containing a single character, &, and <ms>&amp;</ms> represents a string literal containing 5 characters, the first one of which is &..5 Operator, Fence, Separator or Accent (mo)), or for providing hints related to linebreaking when necessary (see Section 3.2.6 Text (mtext)), and the ability to use nested mrows to describe sub-expression structure (see below). mrowof Chapter 7 The MathML Interface. that occurs later in the suggested operator dictionary (Appendix F Operator Dictionary) can be assumed to have a higher precedence for this purpose.: <mrow> <mrow> <mn> 2 </mn> <mo> ⁢ </mo> <mi> x </mi> </mrow> <mo> + </mo> <mi> y </mi> <mo> - </mo> <mi> z </mi> </mrow> The proper encoding of (x, y) furnishes a less obvious example of nesting mrows: > mfrac In addition to the attributes listed below, this element permits id, xref, class and style attributes, as described in Section 2.4.5 Attributes Shared by all MathML Elements.).)> <mfrac> <mn> 1 </mn> <mrow> <msup> <mi> x </mi> <mn> 3 </mn> </msup> <mo> + </mo> <mfrac> <mi> x </mi> <mn> 3 </mn> </mfrac> </mrow> </mfrac> <mo> = </mo> <mfrac bevelled="true"> <mn> 1 </mn> <mrow> <msup> <mi> x </mi> <mn> 3 </mn> </msup> <mo> + </mo> <mfrac> <mi> x </mi> <mn> 3 </mn> </mfrac> </mrow> </mfrac> A more generic example is: <mfrac> <mrow> <mn> 1 </mn> <mo> + </mo> <msqrt> <mn> 5 </mn> </msqrt> </mrow> <mn> 2 </mn> </mfrac> Required Arguments. This element only permits id, xref, class and style attributes, as described in Section 2.4.5 Attributes Shared by all MathML Elements. Style Change (mstyle).) any number of arguments. If this number is not 1, its contents are treated as a single "inferred mrow" formed from all its arguments, as described in color, which can only be set on token elements (or on mstyle itself). There are two exceptional elements, mpadded and mtable, that have attributes which cannot be set with mstyle. The mpadded and mtable elements share attribute names with the mspace. Similarly, mpadded and mo elements also share an attribute name. Since the syntax for the values these attributes accept differs between elements, MathML specifies that when the attributes height, width or depth are specified on an mstyle element, they apply only to mspace elements, and not the corresponding attributes of mpadded or mtable. Similarly,.-expressions. start tag (discussed above), whether it is specified in the style sheet as an absolute or a relative change. (However, any subsequent scriptlevel-induced change to fontsize will still be affected by it.) As is required for inherited attributes in CSS, that that versus by attributes, see the appropriate subsection of CSS-compatible attributes in Section 2.4.4.3 CSS-compatible attributes. that judgment.-expression that it had in a surrounding expression results in the same fontsize for that sub-expression as for the surrounding expression. Color and background attributes are discussed in Section 3.2.2.2 Color-related attributes..> merror). This element only permits id, xref, class and style attributes, as described in Section 2.4. mpadded). .4.4.2 Attributes with.4.4.2 Attributes with units,.4.4.2 Attributes with units. In any of these formats, the length value specified is the product of the specified number and the length represented by the unit or pseudo-unit. The result is multiplied by 0.01 if % is given. that H Glossary the start of the rendering of its contents' bounding box.. If such constructs are used in spite of this warning, they should be enclosed in a semantics element that also provides an additional MathML expression that can be interpreted in a standard way. For example, the MathML expression <mrow> <mi> C </mi> <mpadded width="0em"> <mspace width="-0.3em"/> <mtext> | </mtext> </mpadded> </mrow> forms an overstruck symbol in violation of the policy stated above; it might be intended to represent the set of complex numbers for a MathML renderer that> <mi> C </mi> <mpadded width="0em"> <mspace width="-0.3em"/> <mtext> | </mtext> </mpadded> <.. In addition to the attributes listed below, this element permits id, xref, class and style attributes, as described in Section 2.4.5 Attributes Shared by all MathML Elements..4.6 Collapsing Whitespace in Input.)>pt' rowspacing='0pt'> > which renders roughly as).)row> <msubsup> <mo> ∫ </mo> <mn> 0 </mn> <mn> 1 </mn> </msubsup> <mrow> <msup> <mi> ⅇ </mi> <mi> x </mi> </msup> <mo> ⁢ </mo> <mrow> <mo> ⅆ </mo> <mi> x </mi> </mrow> </mrow> </mrow>> ⏞ </mo> </mover> <mtext> versus </mtext> <mover accent="false"> <mrow> <mi> x </mi> <mo> + </mo> <mi> y </mi> <mo> + </mo> <mi> z </mi> </mrow> <mo> , a left-to-right order..).) Two examples of the use of mmultiscripts are: 0F1(;a;z). <mrow> <mmultiscripts> <mi> F </mi> <mn> 1 </mn> <none/> <mprescripts/> <mn> 0 </mn> <none/> </mmultiscripts> <mo> ⁡ </mo> <mrow> <mo> ( </mo> <mrow> <mo> ; </mo> <mi> a </mi> <mo> ; </mo> <mi> z </mi> </mrow> <mo> ) </mo> </mrow> </mrow> (where k and l are different indices) <mmultiscripts> <mi> R </mi> <mi> i </mi> <none/> <none/> <mi> j </mi> <mi> k </mi> <none/> <mi> l </mi> <none/> </mmultiscripts>..4.4.2 Attributes with units).. A 3 by 3 identity matrix could be represented as follows: <mrow> <mo> ( </mo> <mtable> <mtr> <mtd> <mn>1</mn> </mtd> <mtd> <mn>0</mn> </mtd> <mtd> <mn>0</mn> </mtd> </mtr> <mtr> <mtd> <mn>0</mn> </mtd> <mtd> <mn>1</mn> </mtd> <mtd> <mn>0</mn> </mtd> </mtr> <mtr> <mtd> <mn>0</mn> </mtd> <mtd> <mn>0</mn> </mtd> <mtd> <mn>1</mn> </mtd> </mtr> </mtable> <mo> ) </mo> </mrow> This might be rendered as: Note that the parentheses must be represented explicitly; they are not part of the mtable element's rendering. This allows use of other surrounding fences, such as brackets, or none at.5 Alignment Markers. 2.0. <mtable> <mlabeledtr id='e-is-m-c-square'> <mtd> <mtext> (2.1) </mtext> </mtd> <mtd> <mrow> <mi>E</mi> <mo>=</mo> <mrow> <mi>m</mi> <mo>⁢</mo> <msup> <mi>c</mi> <mn>2</mn> </msup> </mrow> </mrow> </mtd> </mlabeledtr> </mtable>.): an mrow element, including an inferred mrow such as the one formed by a multi-argument Combining Presentation and Content MarkupAttributes In addition to the attributes listed below, the malignmark element permits id, xref, class and style attributes, as described in Section 2.4Attributes In addition to the attributes listed below, the maligngroup element permits id, xref, class and style attributes, as described in Section 2.4.4tr> <mtd> <mrow> row> </mtd> </mtr> <mtr> <mtd> <mrow> row> </mtd> </mtr> < that. 7.2.2 Handling of. For this action type, a renderer would alternately display the given expressions, cycling through them when a reader clicked on the active expression, starting with the selected expression and updating the selection attribute value as described above.. In this case, the renderer would display the expression in context on the screen. When a reader clicked on the expression or moved the mouse over it, the renderer would send a rendering of the message to the browser statusline. Since most browsers in the foreseeable future are likely to be limited to displaying text on their statusline, authors would presumably use plain text in an mtext element for the message in most circumstances. For non- mtext messages, renderers might provide a natural language translation of the markup, but this is not required. Here the renderer would also display the expression in context on the screen. When the mouse pauses over the expression for a long enough delay time, the renderer displays a rendering of the message in a pop-up "tooltip" box near the expression. These message boxes are also sometimes called "balloon help" boxes. Presumably authors would use plain text in an mtext element for the message in most circumstances. For non- mtext messages, renderers may provide a natural language translation of the markup if full MathML rendering is not practical, but this is not required. In this case, a renderer might highlight the enclosed expression on a "mouse-over" event. In the example given above, non-standard attributes from another namespace are being used to pass additional information to renderers that support them, without violating the MathML DTD (see Section 7.2.3 Attributes for unspecified data). The my:color attribute changes the color of the characters in the presentation, while the my:background attribute changes the color of the background behind the characters. This action type instructs a renderer to provide a pop up menu. This allows a one-to-many linking capability. Note that the menu items may be other <maction actiontype="menu">...</maction> expressions, thereby allowing nested menus. It is assumed that the user choosing a menu item would invoke some kind of action associated with that item. Such action might be completely handled by the renderer itself or it might trigger some kind of event within the browser that could be linked to other programming logic.
http://www.w3.org/TR/2003/WD-MathML2-20030411/chapter3.html
CC-MAIN-2015-18
refinedweb
2,167
53.71