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 |
|---|---|---|---|---|---|
- NAME
- SYNOPSIS
- DESCRIPTION
- CONTENT
- Table of Contents
- Naïve Sorting
- The Orcish Maneuver
- Radix Sort
- Sorting by Index
- Schwartzian Transforms
- Guttman-Rosler Transforms
- Portability
- AUTHOR
NAME
Resorting to Sorting
SYNOPSIS
A guide to using Perl's sort() function to sort data in numerous ways. Topics covered include the Orcish maneuver, the Schwartzian Transform, the Guttman-Rosler Transform, radix sort, and sort-by-index.
DESCRIPTION.
CONTENT
Table of Contents
- Naïve Sorting
Poor practices that cause Perl to do a lot more work than necessary.
- The Orcish Maneuver
Joseph Hall's implementation of "memoization" in sorting.
- Radix Sort
A multiple-pass method of sorting; the time it takes to run is linearly proportional to the size of the largest element.
- Sorting by Index
When multiple arrays must be sorted in parallel, save yourself trouble and sort the indices.
- Schwartzian Transforms
Wrapping a sort() in between two map()s -- one to set up a data structure, and the other to extract the original information -- is a nifty way of sorting data quickly, when expensive function calls need to be kept to a minimum.
- Guttman-Rosler Transforms
It's far simpler to let sort() sort as it will, and to format your data as something meaningful to the string comparisons sort() makes.
- Portability
By giving sorting functions a prototype, you can make sure they work from anywhere!
Naïve Sorting;
That is, ascending ASCIIbetical sorting. You can leave out the block in that case:
@sorted = sort @unsorted;;
- Note: There is a difference between these two sortings. There are some punctuation characters that come after upper-case letters and before lower-case characters. Thus, strings that start with such characters would be placed differently in the sorted list, depending on whether we use lc() or uc(). )
This gets to be tedious. There's obviously too much work being done. We should only have to split the strings once.
Exercises
- Create a sorting subroutine to sort by the length of a string, or, if needed, by its first five characters.@sorted = sort { ... } @strings;
- Sort the following data structure by the value of the key specified by the "cmp" key:@nodes = ( { id => 17, size => 300, keys => 2, cmp => 'keys' }, { id => 14, size => 104, keys => 9, cmp => 'size' }, { id => 31, size => 2045, keys => 43, cmp => 'keys' }, { id => 28, size => 6, keys => 0, cmp => 'id' }, );
The Orcish Maneuver } }
where mangle() is some function that does the necessary calculations on the data.
Exercises
- Why should you make the caching hash viewable only by the sorting function? And how is this accomplished?
- Use the Orcish Manuever to sort a list of strings in the same way as described in the first exercise from "Naïve Sorting".
Radix Sort (\@;$) { # ... }
You could combine the declaration and the definition of the function, but the prototype must be seen before the function call.
Exercises
- Why does radix sort start with the right-most character in a string?
- Does the order of the elements in the input list effect the run-time of this sorting algorithm? What happens if the elements are already sorted? Or in the reverse sorted order?
Sorting by Index );
But to actually sort these lists requires 3 times the effort. Instead, we will sort the indices of the arrays (from 0 to 5). This is the function we will use:
sub age_or_name { return ( $ages[$a] <=> $ages[$b] or $names[$a] cmp $names[$b] ) }
And here it is in action:
@idx = sort age_or_name 0 .. $#ages; print "@ages\n"; # 19 14 18 14 20 19 print "@idx\n"; # 1 3 2 5 0 4 print "@ages[@idx]\n"; # 14 14 18 19 19 20
As you can see, the array isn't touched, but the indices are given in such an order that fetching the elements of the array in that order yields sorted data.
- Note: the $#ages variable is related to the @ages array -- it holds the highest index used in the array, so for an array of 6 elements, $#array is 5.
Schwartzian Transforms;
We'll break this down into the individual parts.
- Step 1. Transform your data.
- We create a list of array references; each reference holds the original record, and then each of the fields (as separated by colons).@transformed = map { [ $_, split /:/ ] } @entries;
That could be written in a for-loop, but understanding map() is a powerful tool in Perl.for (@entries) { push @transformed, [ $_, split /:/ ]; }
- Step 2. Sort your data.
- Now, we sort on the needed fields. Since the first element of our references is the original string, the username is element 1, the name is element 4, and the shell is element 3.@transformed = sort { $a->[3] cmp $b->[3] or $a->[4] cmp $b->[4] or $a->[1] cmp $b->[1] } @transformed;
- Step 3. Restore your original data.
- Finally, get the original data back from the structure:@sorted = map { $_->[0] } @transformed;
And that's all there is to it. It may look like a daunting structure, but it is really just three Perl statements strung together.
Guttman-Rosler Transforms; } }
$NUL = "\0" x ++$nulls;;
Now, we can just send this to sort.
@sorted = sort @normalized;
And then to get back the data we had before, we split on the nulls:
@sorted = map { (split /$NUL/)[1] } @original;
Putting it all together, we have:
# implement our for loop from above # as a function $NUL = get_nulls(\@original); @sorted = map { (split /$NUL/)[1] } sort map { "\L$_\E$NUL$_" } @original;);
@sorted = map { substr($_, $maxlen) } sort map { lc($_) . ("\0" x ($maxlen - length)) . $_ } @original;
Common functions used in a GRT are pack(), unpack(), and substr(). The goal of a GRT is to make your data presentable as a string that will work in a regular comparison.
Exercises
- Write the maxlen() function for the previous chunk of code.
Portability
You can make a function to be used by sort() to avoid writing potentially messy sorting code inline. For example, our Schwartzian Transform:
@sorted = { $a->[3] cmp $b->[3] or $a->[4] cmp $b->[4] or $a->[1] cmp $b->[1] }
However, if you want to declare that function in one package, and use it in another, you run into problems.
#!/usr/bin/perl -w
package Sorting;
sub passwd_cmp { $a->[3] cmp $b->[3] or $a->[4] cmp $b->[4] or $a->[1] cmp $b->[1] }
sub case_insensitive_cmp { lc($a) cmp lc($b) }
package main;
@strings = sort Sorting::case_insensitive_cmp qw( this Mine yours Those THESE nevER );
print "<@strings>\n";
__END__ <this Mine yours Those THESE nevER>.
#!/usr/bin/perl -w
package Sorting;
sub passwd_cmp ($$) { local ($a, $b) = @_; $a->[3] cmp $b->[3] or $a->[4] cmp $b->[4] or $a->[1] cmp $b->[1] }
sub case_insensitive_cmp ($$) { local ($a, $b) = @_; lc($a) cmp lc($b) }
package main;
@strings = sort Sorting::case_insensitive_cmp qw( this Mine yours Those THESE nevER );
print "<@strings>\n";
__END__ <Mine nevER THESE this Those yours>
AUTHOR
Jeff japhy Pinyan, japhy@perlmonk.org | https://www.perlmonks.org/index.pl/?node_id=128722;displaytype=print | CC-MAIN-2020-10 | refinedweb | 1,143 | 68.1 |
Created on 2007-03-04 00:21 by phr, last changed 2013-10-04 09:31 by piotr.dobrogost. This issue is now closed.
Requested and assigned to Raymond at his suggestion:
There should be an identify function identity(x)=x.
I suggest it also take and ignore an optional second arg: identity(x1,x2)=x1. The second arg can be useful in some generator expressions:
foo = (x for x in bar if condition(x) and identity(True, memoize(x))
That allows calling memoize (or some other function) on the selected elements in the genexp, and disposing of the returned value. It's sort of like the const function (K combinator) to go along with the identity function's I combinator. OK, the above is not really in the functional spirit, but it's been useful.
There could conceivably be also an actual const function const(k)=partial(identity,k) but I can't remember needing that in Python code. The two-arg identity function (uncurried version of const) is probably enough.
1. If this proposal is accepted, it will make sense to deprecate the use of None as an identity function in map:
>>> map(None, range(10))
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
2. Some other languages have an dyadic identity function that returns the *second* argument.
For example, K has : primitive:
identity:(:)
identity[1;2]
2
The rationale in K is that it is useful in an ammed function that replaces entries of an an array with a result of a dyadic function applied to the old and the supplied value and it is natural to have old value first:
@[1 2 3;1;-;20]
1 -18 3
@[1 2 3;1;:;20]
1 20 3
This rationale does not apply to Python, but in the absence of other reasons to choose the order of arguments, Python may as well follow the precedent. Does anyone know a less exotic language that has a dyadic identity?
Not all x line functions should be built into Python. Further, Python's standard syntax offers an infix operator that does the same thing (though in slightly different order as described below, you can reorder with minimal effort).
identity(X, Y) -> (Y and False) or X
Also, the only use-case that you are provided and that I can imagine, are examples like you provide where one is changing state within a statement (if, elif, while, etc.) or expression (generator, list comprehension, conditional, etc.).
I can see adding the 1-argument form to operator or functools (as it's useful in functional programming), but the 2-argument form you've suggested is right out. If you really feel the need to torture a "for" loop into a genexp/listcomp like that,
foo = (x for x in bar if condition(x) and [memoize(x)])
does the same thing using today's capabilities.
I have just realized that the requested functionality is known in C as the comma operator. I often find myself writing "return Py_INCREF(o),o;" in my C code, but I cannot really defend that idiom against "Py_INCREF(o); return o;" alternative. My personal reason is entirely C-specific, if followed an if(), the first form does not require curly braces.
In any case, comma operator can be emulated in python as
exp1,expr2,expr3 -> (exp1,expr2,expr3)[-1]
Since multi-argument "identity" is likely to be rejected, my proposal to alter the order of arguments is moot. My other suggestion that with identity, map(None, ..) should be deprecated in favor of map(identity, ..) is probably an arument against the identity proposal now.
I also would like to have a built-in identity function (in fact, I found this by googling "python identity function"). My use-case is a bit different. I ofter find myself wanting to simply specify a function for be used in a loop, something like:
def f(items):
if something:
wrapper = int
else:
wrapper = identity
for item in items:
yield wrapper(item)
of course, usually it's a bit more complex than that, but you get the idea... and I supposed its actually more like the previous use-case than I thought.
I realize I could just use "lambda x: x", but I feel that comes with an unnecessary performance impact for something so trivial. I don't know how much python does to compile built-in functions, but I imagine that the identity function can be mostly optimized out at compile time if it were built-in.
Just my two-cents.
twobitsprite: your use-case is different from that of others. While you could use an identity function for your purposes, a lambda would work just fine. Regardless, there is call overhead, which can only be reduced by not performing a call at all.
In terms of an identity function versus tuple creation and indexing as per belopolsky's suggestion...
>>> timeit.Timer("x(1+2,3+4)", "x = lambda *args:args[-1]").timeit()
0.99381552025397468
>>> timeit.Timer("(1+2,3+4)[-1]", "").timeit()
0.49153579156927663
Tuple is faster. Just use a tuple.
It still feels like an ugly hack for something so simple. I can't believe there is such resistance for something as trivial as a function which returns it's first argument.
Also, map like functions start to look a bit ugly (of course, this is overly simplistic, but serves as an example):
def my_map(func, items):
acc = []
for item in items:
if func == None:
acc.append(item)
else:
acc.append(func(item))
return acc
which has the obvious overhead of a test for every iteration. Of course, you could just make two versions of the for loop, one which applies <func> and one which doesn't, but that immetiately violates once-and-only-once and also forces the function to be overly concerned with what it is passed.
this is _much_ cleaner:
def my_map2(func, items):
return [func(i) for i in items]
and the user of the function can simply pass <identity> as <func> and this keeps the details of what to do with the items outside of the function.
Without identity, whenever I want to allow the user to inject code to modify data, I have to account for the fact that they might want to do nothing with it, and so I have to test for None constantly. This is simply bad practice and, IMHO, violates everything python stands for, which is elegance, simplicity and "batteries included", right?
If you want I patch, I can try to provide one; however I have very minimal knowledge of how the vm works, and I've only looked at the code a couple of times. In fact, I might even go ahead and do that, it can't be that difficult.
> I can't believe there is such resistance for something
> as trivial as a function which returns it's first argument.
The resistance is precisely because it is so trivial. As josiahcarlson suggested before, "Not all x line functions should be built into Python." Compare the following two alternatives:
def identity(*args): return args[0]
and
from functools import identity
The first option is only slightly longer than the second, but it is actually much clearer. With the second option, it is not obvious that identity takes an arbitrary number of arguments and if it does, which argument it will return.
The only advantage is that if coded in C, functools.identity may be slightly faster. However, given that
>>> dis(lambda x: x)
1 0 LOAD_FAST 0 (x)
3 RETURN_VALUE
I am not sure a C coded identity can significantly beat it. The real savings would come if python compiler could optimize away calls to identity altogether, but nobody has explained how that could be done or why it would be easier to optimize away identity that lambda x:x.
Well, I'm suggesting that it be in __builtins__, but whatever... If I had it my way I'd program in Haskell every chance I got anyways, I only use python because my boss/co-workers prefer it.
--- bltinmodule-orig.c 2007-03-22 16:00:21.452245559 -0400
+++ bltinmodule.c 2007-03-22 15:56:19.353115310 -0400
@@ -69,6 +69,17 @@
return PyNumber_Absolute(v);
}
+static PyObject *
+builtin_identity(PyObject *self, PyObject *v)
+{
+ return v;
+}
+
+PyDoc_STRVAR(identity_doc,
+"identity(x) -> x\n\
+\n\
+The identity function. Simply returns is first argument.");
+
PyDoc_STRVAR(abs_doc,
"abs(number) -> number\n\
\n\
@@ -2281,6 +2292,7 @@
#endif
{"vars", builtin_vars, METH_VARARGS, vars_doc},
{"zip", builtin_zip, METH_VARARGS, zip_doc},
+ {"identity", builtin_identity, METH_O, identity_doc},
{NULL, NULL},
};
> Well, I'm suggesting that it be in __builtins__, but whatever...
You apparently didn't get the memo; map, filter, reduce, etc., are all going to be placed into functools and removed from __builtins__. Adding identity to __builtins__ is not going to happen.
Further, your preferred programming language not being Python is not topical to the discussion. If you want Haskell, and your boss isn't letting you use it, please don't complain here.
Your patch isn't what was asked for by other users. The Python equivalent to what was asked for was:
identity = lambda arg0, *args: arg0
Regardless, being that it is a functional language construct, it's not going to make it into __builtins__. Never mind that adding to __builtins__ has a higher requirement than in other portions of the standard library.
Raymond, please make a pronouncement.
+1 on adding it to the operator module. Lots of one liners go there.
-1000 to having it take more than one argument. If I saw this
identity(ob, 42)
for the first time (or second, or ...) I would have to look up what
it does. As a plain identity function it is obvious.
Patch to operator.c, liboperator.tex, test_operator.py, NEWS attached.
Raymond, there isn't a good section in the doc for this function so I added it to the logical operators. The fact that there isn't a good section for it might be a mark against it being included.
It is a couple times faster than the python version which isn't exciting.
sprat:~/src/python-rw> ./python Lib/timeit.py -s "from operator import identity" "identity(None)"
10000000 loops, best of 3: 0.161 usec per loop
sprat:~/src/python-rw> ./python Lib/timeit.py -s "def identity(ob): return ob" "identity(None)"
1000000 loops, best of 3: 0.421 usec per loop
File Added: identity.patch
Raising "Haskel is better than Python" argument is unlikely to win you friends here. Neither will submitting a patch with a reference count bug :-).
josiah,
My appologies for not being hip to the latest python dev news. I would have no problem with putting the function in a module like functools/itertools/operator/whatever, I just thought something like that might belong with map/filter/etc... so, if that's where they're going, I can just from functools import * and go on my merry way. I was just responding to your argument that defining it yourself would be just as easy as importing from a module.
+1 on Raymond's patch (not that I expect my vote to count much, being some random guy :P) execpt for it going into operator, being as map/etc are going somewhere else... either way, I think it's silly to mobe map/etc out of builtins, but hey... what am I gonna do about it? :P
I need to clarify that my comment about a buggy patch was responding to twobitsprite, not to jackdied whose post I noticed only after I hit submit. Jackdied's patch is correct, but my concern is that with identity in operators, functional programmers will start passing identity instead of None as func to map(func, ..) that will result in much slower code.
Let's put this thread on hold until we get a pronouncement. I don't think there is anything additional to be said.
Alexander, don't worry, I didn't think you were talking about my patch ;)
and don't worry about people writing sub-optimal code. If you start doing that you'll never get any sleep.
> Neither will submitting a patch with a reference count bug :-).
Bleh, generational garbage collectors are where its at anyways. ;P
-1 on adding the identity function anywhere in the stdlib. This isn't just a 1-line function, it's only 10 characters: "lambda x:x".
What's the conclusion of your discussion? Do you consent to close the
feature request?
Raymond Hettinger wrote in msg63027 (issue2186):
"""
.. it looks like there [is an] agreement on dropping None for map() and
going forward with the operator.identity() patch. Will check these in
in the next couple of days.
"""
This leaves open the issue of multi-argument identity. I would argue
that def identity(*args): return args[-1] # or args[0] will conflict
with the use of identity instead of None in map: map(identity, x, y, ..)
will silently produce results different from current map(None, x, y,
..). It is possible to make identity behave exactly like None in map by
defining it as
def identity(*args):
if len(args) == 1:
return args[0]
else:
return args
While there is certain cuteness in making identity(...) equivalent to
(...), it is a bit too cute for my taste. I am -1 on multi-argument
identity.
Also placement of identity in operator while map is in builtin, may
complicate implementation of passthrough map optimization. While it is
possible to avoid importing operator in builtin by implementing identity
in builtin but exporting it only from operator, a more straightforward
solution would be to keep map and identity in the same module. This
logic may be a slippery slope, however, because optimizing filterfalse,
would suggest that operator.not_ should be moved in the same module as
the ultimate location for filterfalse. I am +1 on implementing
optimization for map(identity, ..), +0 on that for filterfalse(not_,
..), 0 on the location of identity. (BTW, maybe we should implement
optimization for filter(not_, ..) and drop filterfalse altogether.)
I suggest closing per | http://bugs.python.org/issue1673203 | CC-MAIN-2017-04 | refinedweb | 2,347 | 63.59 |
Very of possibilities and combinations. And for good reason – the frameworks differ by browser compatibility, workflow logic, dependencies, licenses, performance, UI widgets availability, and so on. Things are further complicated when you must combine frameworks to meet your needs.
We will break down what we think are top 5 stacks for developing world-class HTML5 mobile experiences. So, read on!
Sencha Touch
Built using lessons learned from Ext JS (an enterprise class desktop web framework), Sencha Touch (simply known as “Touch” in some circles) is a mature framework built to fit the most demanding app needs..
Following the footsteps of its big brother, Sencha Touch will win your heart with plethora of widgets readily available out of the box.
Responsive Web Design (RWD), while possible to some degree, is not advisable. However, Touch comes with pre-defined Layouts that help position the widgets on screen and use CSS3 for flexibility and positioning to update UI quickly. This is in particularly useful on orientation change event. Rarely will you find a layout that can’t be done with any of the predefined models, but you can also easily build your own. Coupled with Profiles that help with dynamic adaptation based on specific rules such as Tablet vs Phone, RWD is not a necessity with Sencha Touch.
Backstage, Touch operates like a full-fledged philharmonic orchestra powered by probably the most advanced Class system of all JavaScript frameworks. Much of the functionality is based on Abstraction, allowing developers to create custom components, plugins, or extended features using these powerful design patterns. While Abstraction will help non-experienced JavaScript developers create world-class apps in no time, it will invite the curious to peek in under the hood, potentially offering a wonderful opportunity to learn how to leverage the framework in ways beyond its design.
That said, developing in Sencha Touch is sometimes more of configuring with a light touch of real JavaScript development. While that can help the learning curve, it makes their API documentation essential even to the seasoned Touch programmers. Fortunately, its documentation is also amongst the best out there.
New developers will probably appreciate the availability of Sencha Architect, a GUI tool that helps create interfaces as easy as drag and drop. Another useful tool is Sencha Cmd, a command line interface (CLI) that aims to provide support in scaffolding the app, theming, and perhaps most importantly, building and packaging. Using Cmd in build process won’t just concatenate and minify your code, but will optimize the entire app to work faster. If you want to use Cordova or PhoneGap, Cmd can talk to respective CLIs to package the app for you. With just one command and a few seconds of patience, you can get your .ipa and/or .apk files ready for publishing. Additionally, the API sports numerous handy features, such as device abstraction layer for direct communication through PhoneGap/Cordova, Sencha Packager or simulator.
MV* Pattern
The proven Model – Store – View – Controller is very powerful, meant for serious business. There is a performance penalty however to leveraging this pattern in the browser and is generally not advised for simple applications as there is a lot of behind-the-scenes code that makes this pattern possible. Models and Stores go hand in hand where Models define data, and Stores keep collections of data. CRUD with external sources, whether remote or local, is very nicely implemented through abstracted interfaces. Controllers use the built in event mechanism to connect Model, Stores and Views to business logic.
Class System
Sencha’s Class System is of the strongest features for developers. One can plainly see the influence of other languages in Sencha Touch’s Class System, which powers this heavily object-oriented framework. The internal, as well as the front facing, parts are well abstracted and defined to make it easy to extend and build on top of any component of an inheritance chain. The class system also takes care of dependencies, instructing Ext.Loader (in development) or Sencha Cmd builder (for production builds) where and how to find them. Other than a tool, Touch’s Class System enforces nicely structured application development
DOM control
There is no need for additional libraries (such as jQuery), as complete DOM manipulation interface is already bundled in Sencha Touch. Touch event recognizers work very well with all supported mobile devices. The built-in templating engine is amongst the fastest in the industry, which significantly benefits the speed of the entire framework.
UI and Theming
While Touch initially favored iOS styled interface, it’s main theme is vendor agnostic. Nonetheless, iOS, Android, and Windows lookalike themes are shipped with the entire package. SASS drives the theming, with plethora of variables and mixins supplied to make quick restyling a breeze. Since the framework is UI-centric, developers usually wind up modifying the default theme instead of writing the whole UI from scratch, which in turn requires some familiarity with the theming system.
Widgets
With well over 50 widgets, Sencha Touch gives a solid boost right out of the box. From the basic ones such as Component, Container, Form, various Fields to more complex Carousel, Lists, Pickers, Charts, Grid, and much more. The latter two, Touch Charts and Touch Grid are part of a separate Sencha Touch Bundle, offered commercially. No other mobile web framework offers such an extensive set of built in widgets.
Responsive Design (RWD)
Ext JS came to existence long before RWD was a term, when it fought similar challenges with a unique feature called Layout. Sencha Touch revamped the concept to use CSS3 and hardware acceleration where possible to deliver a dozen of modes for dynamic user interfaces. Nonetheless, Layouts cannot be considered as a full RWD substitute, rather an abstraction of commonly used CSS patters with welcome fixes for various platforms. A complete re-layout (e.g. on orientation change) may require an intervention from the JavaScript side.
The difference between using RWD and Touch Layouts is that RWD uses raw CSS3 to organize and size items based on rules defined in CSS (Media Queries) whereas Touch Layouts leverage the power of JavaScript to programmatically place and size items based on rules defined in JavaScript. This JavaScript influences the browser by injecting CSS3 attributes making the placing and sizing of the items in the browser. This practice is arguably more powerful, but much more expensive in terms of computation.
Desktop support
If you want to reuse most of the code for your mobile and desktop application, Sencha Touch is probably not a good option. While the internals work on all modern browsers (those supporting ECMAScript5 and CSS3), UI components will require additional effort to adapt to desktop environments. Even though Ext JS and Sencha Touch follow the same concepts, it is still virtually impossible to reuse code between the two. Touch is specialized for touchscreen mobile devices whereas Ext JS is meant to deliver apps to desktops. As a side note, Ext JS will technically work on tablets to some degree, although the performance will be heavily penalized due to the heavy nature of the framework. Sencha Touch and Ext JS are best suited when desktop and mobile offerings will differ substantially.
Third party plugins
The official set of extensions is offered through Sencha Touch Bundle. A decent number of community-managed plugins and extensions can be found on the Sencha Market. External companies offer premium extensions in forms of specialized widgets through their own distribution channels.
Extensibility
The framework’s namespace is Ext for Extensibility. Classes, methods, widgets, and all other components are made to be extended. The source code is so tidy that it actually makes a great resource to learn how huge apps can be nicely organized.
Building tools
Sencha Cmd, a separate proprietary (but free) utility from Sencha will scan the code, learn the dependencies, remove the unused code, concatenate, minify, and package the app for delivery. It’s as simple as a single command, but can also go much further than that. The instructions come from a web of commands issued in the app source code, comments, command line parameters, JSON, XML, and CFG files, which can be difficult to master, and impossible to keep in just one place. External grunt-style plugins for Cmd do not exist.
Packaging (native)
Through Sencha Cmd, Touch comes with their own native packager, but also supports Cordova and PhoneGap. Although it pushes the mobile app look and feel, Sencha Touch is an excellent choice for mobile sites. Through the production build, Cmd will optimize your app for web delivery, using various caching technologies to improve the loading time on subsequent visits.
Device API
If you are keen on using just one framework, Touch abstracts device APIs for their native packager and Cordova/PhoneGap. Of course, this applies only to the most commonly used plugins.
Documentation
Powered by Sencha’s very own JSDuck, Touch’s documentation is easily amongst the very best we’ve seen. It is very easy to navigate and even read the property-level comments coming from the developers and the community members. In a tabbed interface, the docs also come with written and video guides and examples. Even though there are several guides on how to write full apps, most examples are hello world simple. We strongly recommend Sencha Touch in Action to complement your learning experience.
License
Sencha Touch is licensed under free commercial and open source licenses for application development, and a paid commercial license for OEM uses.
Community
The community gathers at the official forums, which are very well managed. Most reasonable questions will be answered within a day. Stack Overflow is another popular resource, counting about 7000 questions to date. As a down side, many members are confused whether to call the framework Sencha Touch, Sencha, Touch, or Sencha Touch 2, making searches messy. SenchaCon is the official developer conference in the US, with ModUX and SourceDevCon being the community managed counterparts in Europe in the previous years. Additionally, many meetups are active, especially in the US and western Europe.
What would they say?
JavaScript developer:
A serious framework with “mature” written all over it. Given its size and complexity, takes some time to learn, but docs are the best friend, even to the most seasoned developers. Direct HTML access is rarely ever needed and core JavaScript mastery is less than a must-have with Sencha Touch projects. However, a JavaScript primer is a strong prerequisite.
With complementary apps such as Cmd and Architect, Sencha Touch is a one stop shop for all mobile web needs.
Designer:
Much of the framework is in the very CSS, meaning theming could impact the overall performance and stability. Designers should think like developers more than with any other framework. It will take beginners some time to get used to the theming system. The experienced will style apps very quickly. SASS and modern CSS3 approaches are required skills to have.
Product manager:
This is a robust and mature framework that also utilizes modern technologies available in the latest browsers. It can deliver close to native performance on mobile devices. Being shipped with so many widgets, tools, and themes, Touch can certainly cut development time significantly.
Five Best Mobile Web App Frameworks
- Sencha Touch review
- jQuery Mobile + Backbone review
- Kendo UI review
- Angular JS + Ionic review
- React review
Grgur Grisogono
Related Posts
- Touch DJ - A Sencha Touch DJ App
During the DJing with Sencha Touch talk at SenchaCon 2013 we finally unveiled and demonstrated…
- 5 Best Mobile Web App Frameworks: Kendo UI Mobile
Kendo UI Mobile Kendo UI Mobile is a performance focused UI framework top of jQuery.… | https://moduscreate.com/blog/5-best-mobile-web-app-frameworks-sencha-touch/ | CC-MAIN-2022-21 | refinedweb | 1,939 | 52.49 |
9.4 Protected Member
The private members of a class cannot be directly accessed outside the class. Only methods of that class can access the private members directly. As discussed previously, however, sometimes it may be necessary for a subclass to access a private member of a superclass. If you make a private member public, then anyone can access that member. So, if a member of a superclass needs to be (directly) accessed in a subclass and yet still prevent its direct access outside the class, you must declare that member protected.
Following table describes the difference
Following program illustrates how the methods of a subclass can directly access a protected member of the superclass.
For example, let's imagine a series of classes to describe two kinds of shapes: rectangles and triangles. These two shapes have certain common properties height and a width (or base).
This could be represented in the world of classes with a class Shapes from which we would derive the two other ones : Rectangle and Triangle
Program : (Shape.java)
/** * A class Shape that holds width and height * of any shape */ public class Shape { protected double height; // To hold height. protected double width; //To hold width or base /** * The setValue method sets the data * in the height and width field. */ public void setValues(double height, double width) { this.height = height; this.width = width; } }
Program : (Rectangle.java)
/** * This class Rectangle calculates * the area of rectangle */ public class Rectangle extends Shape { /** * The method returns the area * of rectangle. */ public double getArea() { return height * width; //accessing protected members } }
Program : (Triangle.java)
/** * This class Triangle calculates * the area of triangle */ public class Triangle extends Shape { /** * The method returns the area * of triangle. */ public double getArea() { return height * width / 2; //accessing protected members } }
Program : (TestProgram.java)
/** * This program demonstrates the Rectangle and * Triangle class, which inherits from the Shape class. */ public class TestProgram { public static void main(String[] args) { //Create object of Rectangle. Rectangle rectangle = new Rectangle(); //Create object of Triangle. Triangle triangle = new Triangle(); //Set values in rectangle object rectangle.setValues(5,4); //Set values in trianlge object triangle.setValues(5,10); // Display the area of rectangle. System.out.println("Area of rectangle : " + rectangle.getArea()); // Display the area of triangle. System.out.println("Area of triangle : " + triangle.getArea()); } }
Output :
Area of rectangle : 20.0
Area of triangle : 25.0 | http://www.beginwithjava.com/java/inheritance/protected-member.html | CC-MAIN-2018-30 | refinedweb | 389 | 50.33 |
my_cmd = {
'name': 'say',
'code': ref_to_say_func,
params = [
{'name': 'text', 'type': str},
{'name': 'target', 'type': actor, 'optional': True},
# etc.
]
}
@command("say", "text [player]")
def cmd_say(player, text, target=None):
if target is not None:
first_person = "You say to %s, \"%s\"" % (target.name, text)
third_person = "%s says to %s, \"%s\"" % (player.name, target.name, text)
else:
first_person = "You say, \"%s\"" % text
third_person = "%s says, \"%s\"" % (player.name, text)
player.send(first_person)
for p in player.room.players:
if p is player:
continue
p.send(third_person)
@decorator
def x(a,b,c):
# bla
def temp_func(a,b,c):
# bla
x = decorator(temp_func)
def command(name, pattern):Using the @ syntax to apply this to a function basically has this effect:
def decorator(func):
register_command(func, name, pattern)
return func
return decorator
def baz():Note that the inner decorator() function returns a reference to baz() which is then assigned to the name "baz" in the module. If the "return func" statement wasn't in the decorator() function then your decorated function wouldn't actually "exist" in its module - although if you'd stored a reference to it somewhere it obviously wouldn't be G/Ced.
pass
baz = command("foo", "bar")(baz)
## The above is the same as this:
@command("foo", "bar")
def baz():
pass
At the moment, for proof of concept testing purposes, my data layer is connected to a mock "database" which is composed mainly of arrays and hashes, and doesn't actually persist. This layer is implemented through singleton "stores", one for each type of data. (So there is an account store, a room store, a clientdata store… etc.). These stores are accessed statically through a GlobalData class where required.
For example, my "say" command, written in python, grabs the room store and the client store, and sends a message to each client in the room where the command was executed.
Commands dealing with objects get the object store, etc.
Now, obviously this isn't great. For starters, if I want to test my commands, I either need to a) prepare a set of GlobalData for each test, and set is up so I can measure the pre/post conditions of that data, or b) Test as though I were the client, which has timing issues. Both testing methods are slow and buggy. The first requires that I set up a test world in it's entirety, and reset it between tests. The second *also* requires that I do that, but adds the issue of dropped packets as a means for failure. Currently, my object creation/pickup/drop tests pass the first time they're run, but fail the second time if the server isn't restarted in between trials.
What I want to do is pass the required information from my commands into my commands. That's where I hit a snag, since python is dynamically typed. In Java, I could simply declare my command to require the objects it needs, but from Java looking at python, there's no way of knowing what types python expects to be passed in.
I was thinking of giving the Command classes a static "requires" list, which Java will read, and the command factory will attempt to supply. The python class can then just have *args as a parameter, and I can expect that args[0] will correspond to requires[0], etc. , or else throw an exception from the factory if a command is looking for data that doesn't exist. Is this an intuitive way of solving the problem, or are there better ways?
If it helps, you can pretend this is pure python, since I don't think the problem goes away. How does a class tell another class in python that it will fail if not given sufficient data? Does that just not happen? I have a feeling I'm actually trying to hammer a screw here, so if there's a more "pythony" way of dealing with the problem, I'd be happy to hear that too. | http://mudbytes.net/forum/topic/3353/ | CC-MAIN-2020-40 | refinedweb | 665 | 60.45 |
In anticipation of integrating NumPy’s shiny new datetime64 dtype into pandas, I set about writing some faster alignment and merging functions for ordered time series data indexed by datetime64 timestamps. Many people have pointed me to the widely used R xts package as a baseline for highly optimized joining functions.
Anyway, long story short, with a little NumPy- and Cython-fu I think I’ve matched or beaten xts for almost all of its supported join types by up to 40% (left/outer/inner) using the merge.xts function.
In a blog article earlier today I wrote about some of the performance problems I had to address to do this. The rest of the joining code is pretty straightforward Cython code. Though it’ll probably be a few weeks before this new code gets incorporated into DataFrame.join. You’ll just have to take my word for it that I’m doing an apples-to-apples comparison (or read the source yourself) =)
Python benchmarks
Here are the Python timings in milliseconds for joining two time series data sets. The column labels are the lengths (in scientific notation, from 100 through 1,000,000). The two timings are with two univariate time series and two collections of 5 time series.
EDIT (9/24/2011): after corresponding with the xts author, Jeff Ryan, I reran the benchmarks with the code modified to ensure that garbage collection time isn’t being included in the runtime. The results after the change to the benchmark are less disparate than before. I also tweaked the Cython algos to determine the outer/inner join time index and re-ran the benchmarks. In the 1e6 outer join case the new algo trimmed 8 ms off, 4-5ms in the inner join case. Whenever I develop a strong desire to hack up a pile of spaghetti-like Cython code (combining the index union/intersection routines with the take / row-copying code) I can probably shave off another few millis…
Joining two univariate time series
1e2 1e3 1e4 1e5 1e6
outer 0.0605 0.0637 0.1966 1.898 26.26
left 0.0187 0.02282 0.1157 1.023 13.89
inner 0.04526 0.05052 0.1523 1.382 22.25
Joining two 5-variate time series
1e2 1e3 1e4 1e5 1e6
outer 0.07944 0.0638 0.3178 6.498 67.46
left 0.0255 0.03512 0.2467 4.711 51.88
inner 0.06176 0.05262 0.2283 5.267 56.46
EDIT 9/28: I put in some work integrating the new merging routines throughout DataFrame and friends in pandas and added a new Int64Index class to facilitate fast joining of time series data. Here are the updated benchmarks, which now have pandas a bit slower than xts for outer/inner joins in the univariate case but still significantly faster in the multivariate case:
Joining two univariate time series
1e2 1e3 1e4 1e5 1e6
outer 0.4501 0.314 0.5362 3.162 30.78
left 0.2742 0.2879 0.408 2.025 19.84
inner 0.2715 0.2863 0.4306 2.504 26.64
Joining two 5-variate time series
1e2 1e3 1e4 1e5 1e6
outer 0.4507 0.3375 0.6158 7.028 71.34
left 0.2959 0.3184 0.4927 5.068 55.2
inner 0.2767 0.305 0.5368 5.782 59.65
As you can see in the 1 million row case there is an additional 4-5 ms of overhead across the board which largely has to do with handling types other than floating point. With some effort I could eliminate this overhead but I’m going to leave it for now.
And the source code for the benchmark:
import gc
import numpy as np
def bench_python(pct_overlap=0.20, K=1):
ns = [2, 3, 4, 5, 6]
iterations = 50
pct_overlap = 0.2
kinds = ['outer', 'left', 'inner']
all_results = {}
for logn in ns:
n = 10**logn
a = np.arange(n, dtype=np.int64)
b = np.arange(n * pct_overlap, n * pct_overlap + n, dtype=np.int64)
a_frame = DataFrame(np.random.randn(n, K), index=a, columns=range(K))
b_frame = DataFrame(np.random.randn(n, K), index=b, columns=range(K, 2 * K))
all_results[logn] = result = {}
for kind in kinds:
gc.disable(); _s = time.clock()
# do the join
for _ in range(iterations):
a_frame.join(b_frame, how=kind)
elapsed = time.clock() - _s; gc.enable()
result[kind] = (elapsed / iterations) * 1000
return DataFrame(all_results, index=kinds)
R/xts benchmarks
And the R benchmark using xts. The results for the smaller datasets are unreliable due to the low precision of system.time.
Joining two univariate time series
1e2 1e3 1e4 1e5 1e6
outer 0.30 0.26 0.48 3.12 28.58
left 0.22 0.24 0.36 2.78 24.18
inner 0.20 0.24 0.40 2.42 21.06
Joining two 5-variate time series
1e2 1e3 1e4 1e5 1e6
outer 0.26 0.46 1.30 11.56 97.02
left 0.34 0.28 1.06 10.04 85.72
inner 0.30 0.28 0.94 8.02 67.22
The Python code for the benchmark is all found here.
Here is the R code for the benchmark (GitHub link):
iterations <- 50
ns = c(100, 1000, 10000, 100000, 1000000)
kinds = c("outer", "left", "inner")
result = matrix(0, nrow=3, ncol=length(ns))
n <- 100000
pct.overlap <- 0.2
k <- 1
for (ni in 1:length(ns)){
n <- ns[ni]
rng1 <- 1:n
offset <- as.integer(n * pct.overlap)
rng2 <- rng1 + offset
x <- xts(matrix(rnorm(n * k), nrow=n, ncol=k),
as.POSIXct(Sys.Date()) + rng1)
y <- xts(matrix(rnorm(n * k), nrow=n, ncol=k),
as.POSIXct(Sys.Date()) + rng2)
timing <- numeric()
for (i in 1:3) {
kind = kinds[i]
for(j in 1:iterations) {
gc() # just to be sure
timing[j] <- system.time(merge(x,y,join=kind))[3]
}
#timing <- system.time(for (j in 1:iterations) merge.xts(x, y, join=kind),
# gcFirst=F)
#timing <- as.list(timing)
result[i, ni] <- mean(timing) * 1000
#result[i, ni] = (timing$elapsed / iterations) * 1000
}
}
rownames(result) <- kinds
colnames(result) <- log10(ns) | http://wesmckinney.com/blog/?p=232 | CC-MAIN-2014-42 | refinedweb | 1,030 | 65.83 |
DIY Light-Up Shoes
Introduction
These.
Required Materials
To follow along with this guide, you will need the following:
You Will Also Need:
- High Top Sneakers (Cloth or canvas is preferable to leather)
- Soldering Iron
- Solder
- Wire Cutters
- Wire Strippers
- Super Glue
- Hot Glue Sticks
- Hot Glue Gun
- White Felt
- Scissors
- Needle and Thread
- Velcro
Suggested Reading
If you aren't familiar with the following concepts, we recommend checking out these tutorials before continuing.
How to Solder: Through-Hole Soldering
Installing an Arduino Library
Working with Wire
What is an Arduino?
Installing Arduino IDE
Light-Emitting Diodes (LEDs)
Addressable LED Strip Hookup Guide
Hardware Overview
The two main components that the Light-Up Kicks use are the following:
- Qduino Mini - Arduino Dev Board
- WS2812 Addressable RGB LED Strip
Qduino Mini
Qduino Mini - Arduino Dev BoardDEV-13614
The brains behind the Light-Up Kicks are a set of Qduino Mini - Arduino Dev Boards, a small Arduino-compatible microcontroller that includes a switch AND a LiPo battery connector.
Qduino Mini Technical Specifications:
This board also features:
-
WS2812 Addressable RGB LED Strip
LED RGB Strip - Addressable, Sealed (1m)COM-12027
The WS2812 Addressable LED Strip is a long strip with WS2812 RGB LEDs. Each individual LED is addressable through your microcontroller. They are preterminated with 0.1" spaced 3-pin connectors as well as a 2 wire power connector. Hooking these LEDs up to a microcontroller can be done by either soldering leads to the connection pads or using the existing wire power connectors. DIN should always connect to a digital pin which will be assigned to the LED strip in your code. VCC and GND can connect to their respective pads on the Qduino Mini. A longer strip might need a more powerful or separate power source than this project requires.
Software Installation
Arduino IDE
The Qduino Mini - Arduino Dev Board is programmable via the Arduino IDE. If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE.
Installing Arduino IDE
March 26, 2013
Qduino Drivers and Board Add-On
If this is your first time working with the Qduino, you will need to add the board through the boards manager to your program. Please visit the Qduino hookup guide for detailed instructions on installing drivers and programming a Qduino via the Arduino IDE.
Addressable LED Library
If this is your first time working with addressable LEDs,
The below code is designed to animate a strip of 39 addressable LEDs. In order to test before soldering, our first step will be to program the microcontrollers.
language:c /****************************************************************************** LED Sneakers by Melissa Felderman @ SparkFun Electronics This sketch directly lifts code from Adafruits Neopixel Library. To learn more about the neopixel library and to view more sample code, please visit here: *****************************************************************************/ #include <Adafruit_NeoPixel.h> #ifdef __AVR__ #include <avr/power.h> #endif #define PIN 6 int numPix = 39 //UPDATE THIS WITH THE NUMBER OF LEDs ON YOUR STRIP Adafruit_NeoPixel strip = Adafruit_NeoPixel(numPix, PIN, NEO_GRB + NEO_KHZ800); void setup() { strip.begin(); strip.show(); // Initialize all pixels to 'off' } void loop() { rainbow(20); rainbowCycle(20); theaterChaseRainbow(50); }); }
When you are ready, copy and paste the below program into a new window in your Arduino IDE. Update the value for
int numPix to reflect the number of pixels on your strip around the shoe's sole. Make sure the correct board is selected by going to Tools > Board > Qduino Mini. Then, connect your Qduino to your computer via USB. Turn it on, and select the active port from Tools > Port. Now all you need to do is upload the program to your Qduino by hitting the upload button!
Testing Your Code
To test the program before putting it together on the shoe, try using a combination of IC hooks, alligator clips, and jumper wires to create the circuit shown below and turn on your Qduino. Make sure to connect the LiPo battery to the Qduino for sufficient power. If the LEDs animate with rainbow patterns, you are ready to move on!
Since each shoe will have a Qduino attached to control its own set of addressable LEDs, make sure to upload code to the second Qduino. Follow the steps to upload code. make sure to have the correct board and COM port selected when uploading to the second Qduino.
Putting It Together
Now that we have tested our program with our parts, it's time to put everything together.
STEP 1:
Measure the length of your shoe's sole with the LED strip. While taking note of the length, cut one LED strip to the desired shoe length between the gold pads. Cut part of the flexible silicon jacket that is used to seal the addressable LED strip so that there is room to solder to the pads.
Then cut three pieces of hook-up wire, around 3-4 inches each. Strip a tiny bit at one end of each piece.
Solder each wire to each of the three pads on the LED strip.
STEP 2:
Remove the backing from the clear rubber protection around the LED strip. Starting with the soldered pads at the inner heel, begin to wrap the strip around the shoe sole. While the clear rubber does have some adhesive on the back - it is not enough to weather walking. Use super glue to make sure the LED strip is secured to the shoe sole.
STEP 3:
Make a small hole in the shoe directly above the end of the strip with the leads attached.
STEP 4:
Thread the soldered leads through the hole from the outside to the inside of the shoe.
STEP 5:
Glue the programmed Qduino to the inner ankle area, making sure to place it in a way that it will not rub against your body.
STEP 6:
The following diagram illustrates the circuit we will be putting together visually.
Carefully solder the LED strip leads to the Qduino.
STEP 7:
Insulate all exposed wire and solder with hot glue.
STEP 8:
Add a small piece of Velcro to the outer side of the shoe, directly on top of the area with the Qduino glued on the other side.
STEP 9:
Add the complimentary piece of Velcro to one side of your battery.
STEP 10:
Poke another hole in the shoe, this time right below your Qduino.
STEP 11:
Thread the battery leads through the new hole from the outside to the inside.
STEP 12:
Attach the battery to the outer side of the shoe via the Velcro.
STEP 13:
Connect the battery to the Qduino via the JST connector.
STEP 14:
Cut out two small patches of white felt. One should be slightly larger than the Qduino and one slightly larger than the battery.
STEP 15:
Sew or super glue the felt patched over your electronics, protecting them from the elements as well as protecting your ankles from scratching against the hardware.
STEP 16:
Repeat steps 1-16 for the other shoe.
STEP 17:
Use the switch on the Qduino to turn your shoes on, and enjoy!
Resources and Going Further
Now that you've successfully made your own DIY Light-Up Kicks, it's time to design your own LED animation! If you'd like to learn more about the QDuino Mini or the Neopixels, you should check out these links:
- NeoPixel Library (ZIP)
- Qduino Mini Quickstart Guide
- Qduino Mini GitHub Repository
- Adafruit NeoPixel Überguide (PDF)
- Adafruit NeoPixel GitHub Repository
Need some inspiration for your next project? Check out some of these related tutorials: | https://learn.sparkfun.com/tutorials/diy-light-up-shoes | CC-MAIN-2020-34 | refinedweb | 1,251 | 69.41 |
[
]
Philip Zeyliger commented on AVRO-341:
--------------------------------------
bq. Does this need to be first-class in the protocol? Rather, can we reserve a namespace of
CALLs that are Avro-scoped? eg org.avro.getServerMetrics(), etc? This seems like it will be
less implementation work since it can share code with the rest of RPC.
We definitely need to put in a little bit more thought in how a server can be servicing many
Avro "user protocols" simultaneously, which would allow it, then. Then you might be able
to say "hey, also serve the following built-in services".
But then how do you discover whether those services are being served? I guess you could call
them, and get a MethodNotFound/Supported error.
bq. AUTHENTICATE could be framed as a CALL as well. Though it may be difficult to integrate
SASL here, it's worth exploring.
I'd draw the line here, though. I think the "user protocol" has things to do with the service
being offered, but there are commands that affect the state of the server in a way the client
shouldn't be aware of. AUTHENTICATE is one. "SET_COMPRESSION_LEVEL" might be another. These
affect how the server behaves for this connection in a way that's transparent to the "user
protocol" implementor.
bq. [bootstrapping]
Yes, we'd try never to change it? What, you don't believe me?
> specify avro transport in spec
> ------------------------------
>
> Key: AVRO-341
> URL:
> Project: Avro
> Issue Type: Improvement
> Components: spec
> Reporter: Doug Cutting
>
> We should develop a high-performance, secure, transport for Avro. This should be named
with avro: uris.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online. | http://mail-archives.apache.org/mod_mbox/avro-dev/201002.mbox/%3C1484463657.95141265432848000.JavaMail.jira@brutus.apache.org%3E | CC-MAIN-2017-51 | refinedweb | 285 | 66.84 |
On Thu, 1 Jul 2004 16:12:13 -0700, Graeme Lufkin <graeme.lufkin at gmail.com> wrote: > Okay, so you're embedding in your extension. I don't think you need > to call Py_Initialize(), as this should already have been done by the > python executable that you start to import your module. I don't think > it's wrong to call it multiple times, but should be unnecessary. > > On Thu, 1 Jul 2004 22:48:24 +0000 (UTC), Faheem Mitha > <faheem at email.unc.edu> wrote: >>. > > This looks like libbost isn't in your LD_LIBRARY_PATH. When you > make a Python extension with the 'extension' target in Boost.Build, it > will build a copy of libboost and your extension (look in the bin > directory). This one is the one that your extension gets linked > against, and so is the one it's looking for when you import the > module. Since you've got Debian's version of the compiled Boost > libraries installed, it might be better to link against them. Yes, I just realised that this is what was going on. > You can do that with a Jamfile entry similar to: > extension getting_started1-external > : getting_started1.cpp > <find-library>boost_python > ; > > Since you're doing embedding in the extension, you probably also need > the embedding flags, so it would look like: > > extension embed_in_extend_test > : embed_in_extend.cpp > <find-library>boost_python > $(BOOST_PYTHON_V2_PROPERTIES) > <find-library>$(PYTHON_EMBEDDED_LIBRARY) > ; > > where $(BOOST_PYTHON_V2_PROPERTIES) and $(PYTHON_EMBEDDED_LIBRARY) are > variables that are defined by the Boost.Python library Jamfile. > > The Jamfile entry for the test I ran (that compiled and ran fine) is: > exe simpletest > : > simpletest.cpp > : $(BOOST_PYTHON_V2_PROPERTIES) > <find-library>$(PYTHON_EMBEDDED_LIBRARY) > <find-library>boost_python-gcc > <library-path>$(HOME)/Projects/boost_install/lib > ; > Note the different name for the shared library to link against, that's > because I'm using the libraries built by running bjam in the root of > my Boost installation. They got put in a different directory (which > is also in my LD_LIBRARY_PATH), so I add that to the list of linker > paths.. Details below. Again, I really appreciate your help. The extension module file follows. When I try to load this I get In [1]: import embed_ext In [2]: embed_ext.foo() --------------------------------------------------------------------------- NameError> NameError: name 'file' is not defined So there is still some problem. It is not clear from your message whether you actually built and tried to run the extension module with the embedded interpreter. If you have not, then I'd be much obliged if you try out the following code, and see if you can reproduce this problem. Any idea what I am doing wrong at this point? Thanks, Faheem. The extension module file: ******************************************************************** embed_ext.cc ******************************************************************** #include <boost/python.hpp> using namespace boost::python; void foo() {())); } BOOST_PYTHON_MODULE(embed_ext) { def("foo",foo); } ****************************************************************** The executable file: ****************************************************************** embed.cc ****************************************************************** #include <boost/python.hpp> using namespace boost::python; int main() { Py_Initialize();())); Py_Finalize(); } ******************************************************************** The Jamfile: ******************************************************************** Jamfile ******************************************************************** # This is the top of our own project tree project-root ; # Include definitions needed for Python modules import python ; # Declare an executable called embed exe embed : embed.cc : $(BOOST_PYTHON_V2_PROPERTIES) <find-library>$(PYTHON_EMBEDDED_LIBRARY) <find-library>boost_python <find-library>python2.3 ; # Declare a Python extension called embed_ext extension embed_ext : embed_ext.cc : $(BOOST_PYTHON_V2_PROPERTIES) <find-library>$(PYTHON_EMBEDDED_LIBRARY) <find-library>boost_python <find-library>python2.3 ; *********************************************************************** | https://mail.python.org/pipermail/cplusplus-sig/2004-July/007317.html | CC-MAIN-2020-40 | refinedweb | 531 | 57.77 |
I have been exploring different new features that come with the .NET 4, beyond the most popular ones like dynamic types and covariance; I was interested in performance enhancements. For this reason I am going to publish a couple of blog entries were I explore these different features.
Memory mapped files may sounds alien to the managed code developer but it has been around for years, what is more, it is so intrinsic in the OS that practically any communication model that wants to share data uses it behind the scenes.:
· It is ideal to access a data file on disk without performing file I/O operations and from buffering the file’s content. This works great when you deal with large data files.
· You can use memory mapped files to allow multiple processes running on the same machine to share data with each other.
The memory mapped file is the most efficient way for multiple processes on a single machine to communicate with each other. What is more, if we check other IPC methods we can see the following architecture:
Impressive, isn’t it? Now you have the power of this technology available on the System.IO namespace (instead of using the Pinvoke approach).
Now let’s quickly explore how it works. We have two types of memory mapped files models, one model is using a custom file, this can be any file that the application accesses it and the other one using the page file that we are going to share it with the memory manager (this is the model that most of the technologies above use).
Let’s explore the custom file model. The first thing that we need to do is to create a FileStream to the file that we are going to use, this can be an existing file or a new file (keep in mind that you should open this file as shared, otherwise no other process will be able to access it!). With the stream in place, we can now create the memory mapped file. Let’s see an example:
using System.IO.MemoryMappedFile;
MemoryMappedFile MemoryMapped = MemoryMappedFile.CreateFromFile(
new FileStream(@”C:\temp\Map.mp”, FileMode.Create), // Any stream will do it
“MyMemMapFile”, // Name
1024 * 1024, // Size in bytes
MemoryMappedFileAccess.ReadWrite); // Access type
I have use one of the simplest constructor, we define the stream to use and we provide a name. The object needs to know the size of it in bytes and the type of access that we need. This will create the memory mapped file but to start using it we will need a map view. We can create one using the following syntax:
MemoryMappedViewAccessor FileMapView = MemoryMapped.CreateViewAccessor();
This map covers the file from the first byte until the end. If we need now to write or read information from it we just call the map view methods with the correct offset.
int Number = 1234;
FileMapView.Write(0, Number);
FileMapView.Write<Container>(4, ref MyContainer);
We can see that we can write built in types or custom types with the generic version. The good thing about the memory mapped files is persistence, as soon as you close it the contents will be dumped on the disk, this is a great scenario for sharing cached information between applications.
Now if we want to read from it, the other process needs also to create a memory mapped file, we can use the other static initialize that opens an existing one or creates one if it does not exist.
MemoryMappedFile MemoryMapped = MemoryMappedFile.CreateOrOpen(
new FileStream(@”C:\temp\Map.mp”, FileMode.Create), // Any stream will do it
“MyMemMapFile”, // Name
1024 * 1024, // Size in bytes
MemoryMappedFileAccess.ReadWrite); // Access type
Create the map view and read it:
using (MemoryMappedViewAccessor FileMap = MemoryMapped.CreateViewAccessor())
{
Container NewContainer = new Container();
FileMap.Read<Container>(4, out NewContainer);
}
That’s it, really simple isn’t it? Now, there is a small drawback with this approach and is related to the size of the memory mapped file. If you don’t know in advance you will need to create a large file
“just in case”, this can be a very large file with a lot of wasted space, it would be nice to have the ability to reserve the space instead of committing all of it, isn’t it?
In order to solve this issue you can use the page file, this has the advantage of allowing you to commit data on the fly but introduces another issue: you don’t own the file and the map will last until the last handle is destroyed. But think about it, for certain scenarios this is absolutely valid.
Now if we revisit the sample we will need to change some initialization parameters, for this particular one I will use the full constructor so I can introduce some other features that are also applicable to the custom files one.
MemoryMappedFileSecurity CustomSecurity = new MemoryMappedFileSecurity();
MemoryMappedFile PagedMemoryMapped = MemoryMappedFile.CreateNew(
@”Salvador”, // Name
1024 * 1024, // Size
MemoryMappedFileAccess.ReadWrite, // Access type
MemoryMappedFileOptions.DelayAllocatePages, // Pseudo reserve/commit
CustomSecurity, // You can customize the security
HandleInheritability.Inheritable); // Inherit to child process
The memory mapped file security allows you to customize who or which process can have access to the resource, this can be quite important when you want to protect sensitive information and you don’t want other processes changing the file map. You can explore that object and see all the different settings that you can change. The reference is here. If we explore the construction of the memory mapped file we can see that there is no stream, we just name the resource. This will create an association between a section of the file based on the size and the map name, this is how both processes will access the file. Note as well that I am setting the property “DelayAllocatePages”, this implements a pseudo reserve/commit model where we will use the space once is needed. Finally, the other interesting parameter is the handle inheritance model, this will allow to share this resource with a child process if is required.
The access to the file uses the same syntax as the previous example, remember that if you close the memory mapped file this will be non accessible, this issue catches many developer.
Finally, another interesting area is the creation of multiple map views, these can work on the same memory mapped file accessing different areas of the files. This will allow you to properly protect the content and allowing you to synchronize the access.
You can do this defining different offsets and lengths when you create your map view.
MemoryMappedViewAccessor WriteMap = MemoryMapped.CreateViewAccessor(0, 1024,
MemoryMappedFileAccess.ReadWrite);
MemoryMappedViewAccessor ReadMap = MemoryMapped.CreateViewAccessor(1025, 1024,
MemoryMappedFileAccess.Read);
Now you can enjoy the power of this high performance data sharing model on your applications when you compile them with .NET 4.0! Note that this blog is based on beta 1 information, I will check the post once is released.
PingBack from
.Net Framework 4.0 introduces memory mapped files. Memory mapped files are useful when you need to do
Is it possible to use memory mapped files in VS2008, with the Net Framework 4 beta 1 installed on a box?
Thank you,
Great article
Hi Cameron,
VS2008 does not know how to handle .NET 4 unfortunately. Therefore the IDE can not use the new compiler. You can write the code but you will need to manually call the VS2010 compiler to link it to .NET 4.
You can still use memory mapped files in VS2008 using PInvoke, but I imagine that is not the solution that you are looking after.
Regards,
Salvador
Salva,
Could you please elaborate more on how to "manually call the VS2010 compiler to link it to .NET 4." I am thinking that I would like to take the approach where I write a DLL in VS2010 .NET 4.0 to handle the reading-writing/caching of the data in the memory mapped file and reference this DLL in my VS2008 .NET 3.5 project. The reason is that my application is heavily dependent on MS Robotics Studio which is not 4.0 ready, but I need to process very large image data sets.
Thanks,
Scott
Hi E. Scott Anderson
The short answer is you can’t. You can do it the other way around as .NET 4 allows you to run side-by-side libraries (i.e running a .NET4 app and referencing a .NET 2/3/3.5 DLL). The problem is that the process running under CLR 2 (.net 2/3/3.5) does not know how to interpret a DLL compiled under CLR 4.
You can still access the memory mapped files using the PInvoke model, it works very well.
You can find more info here:
Regards
Do you know if memory mapped files will work for a file on a distributed file system?
Hi John,
No, it does not work with UNC or remote drives as is for same machine process intercom.
Regards
What is memory mapped file?
Is this new technology?
Never heard before.
is there a code link for this example?
Hi,
if MemoryMappedFile is created from <b>dbData.mdb</b> (1.5GB) file.
MemoryMappedFile MemoryMapped = MemoryMappedFile.CreateFromFile(FilePath);
MemoryMappedViewAccessor FileMap = MemoryMapped.CreateViewAccessor())
how do i put this in this connection string.
Microsoft.Jet.Oledb.4.0; Data Source=??
@Jetha
No, it's not really a new technique (though I haven't come across it before either). The MSDN article Salva linked to are more than 17 years old, so it has been around since the very first version of Windows NT! 🙂
So ,in memory maped file, can user updates in the file also?
If so, does it controls the versions?
What is the maximum size of the mapped file. Is it bounded or unbounded?
Does anyone know for sure if when you pull from MMF, does the local App process create it's own memory storage for the contents in the shared memory? or does it reference the memory directly?
I ask this question because I am in thinking about using a 4gb file in MMF, and if it pulls down a local memory for each app(process) that uses the resource, I will be looking at a lot of RAM. Any ideas?
1. I believe it is only sticking into memory chunks/pages of a file at a time. How does it release it back ? How does it know when we are done?
2. Should we still make a copy of the original file and put it in a temp location then read it into mmf from there or is it ok to just read it from the original now? (how does that play if someone overwrites the original as we are reading from it?
3. How do we ensure the mmf is always using the latest since we might constantly be updating a particular file?
4. What is the server hit of using this? I imagine its better than not using it but want to know more.
I tested 2 apps – one sending WM_COPYDATA (Windows Messaging) and other with out of proc COM server consumed by VB script. Both from All in One Code Framework. I second case Process Explorer shows handle of "ALPC port" with name "RPC ControlOLE44EE3FE7D3E04B7EA505A092387B". Seems it is en.wikipedia.org/…/Local_Procedure_Call. It differs from Named Shared Memory and "The memory mapped file is the most efficient way for multiple processes on a single machine to communicate with each other. " not always true. And COM/OLE and may be RPC uses not only shared memory but ALPC either. | https://blogs.msdn.microsoft.com/salvapatuel/2009/06/08/working-with-memory-mapped-files-in-net-4/ | CC-MAIN-2017-26 | refinedweb | 1,931 | 64.3 |
PERF_EVENT_OPEN(2) Linux Programmer's Manual PERF_EVENT_OPEN(2)
perf_event_open - set up performance monitoring
#include <linux/perf_event.h> #include <linux/hw_breakpoint.h> int perf_event_open(struct perf_event_attr *attr, pid_t pid, int cpu, int group_fd, unsigned long flags); Note: There is no glibc wrapper for this system call; see NOTES. current process/thread on any CPU. pid == 0 and cpu >= 0 This measures the current. Measurements such as this require the CAP_SYS_ADMIN capability or a /proc/sys/kernel/perf_event_paranoid value of less than 1. pid==-1 and cpu==-1 This setting is invalid and will return an error. */ __reserved_1 : perf_branch_sample_type */ __u64 sample_regs_user; /* user regs to dump on samples */ __u32 sample_stack_user; /* size of stack to dump on samples */ __u32 _.39,_ATR_SIZE_VER3 is 96 corresponding to the addition of sample_regs_user and sample_stack_user in Linux 3.34,. When an overflow interrupt occurs, requested data is recorded in the mmap buffer. only available). This new. Unfortunately for tools, there is no way to distinguish one system call versus the other.. Otherwise interrupts (since Linux 2.6.36) than). sample_regs_user (since Linux 3.7) This bit mask defines the set of user CPU registers to dump on samples. The layout of the register mask is architecture- specific and described in the kernel header arch/ARCH/include/uapi/asm/perf_regs.h. sample_stack_user (since Linux 3.7) This defines the size of the user stack to dump if PERF_SAMPLE_STACK_USER is specified. ENOSPC is returned run only 3.12 these are renamed to cap_bit0 and you should use the new (currently not used)., tid; char comm[]; struct sample_id sample_id; }; */ u64 weight; /* if PERF_SAMPLE_WEIGHT */ u64 data_src; /* if PERF_SAMPLE_DATA_SRC */ u64 transaction;/* if PERF_SAMPLE_TRANSACTION */ };. The entries are from most to least recent, so the first entry has the most recent branch. Support for mispred and predicted is optional; if not supported, both record the user stack to enable backtracing. size is the size requested by the user in stack_user_size or else the maximum record size. data is the stack data. dyn_size is the amount of data actually dumped (can be less than size).: PERF_MEM_LOCK_NA Not available PERF_MEM_LOCK_LOCKED Locked transaction mem_dtlb TLB access hit or miss, a bitwise combination of: PERF_TXN_ABORT_MASK. Signal overflow Events can be set to deliver a signal when a threshold is crossed. The signal handler is set up using the poll(2), select(2), epoll(2) and fcntl(2), system calls. provided for every overflow, even if wakeup_events is not set.. perf_event ioctl calls Various ioctls act on perf_event_open() file descriptors PERF_EVENT_IOC_ENABLE. A signal with POLL_IN set will happen on each overflow until the count reaches 0; when that happens a signal. On most architectures the new period does not take effect until after the next overflow happens; on ARM since Linux 3.7 the period is updated immediately.)_mlock_kb Maximum number of pages an unprivileged user can mlock (2) . The default is 516 (kB). Files in /sys/bus/event_source/devices/ Since Linux 2.6.34 the kernel supports having multiple PMUs available performance counter registers is allowed via the rdpmc instruction. This can be disabled by echoing 0 to the file. /sys/bus/event_source/devices/*/format/ (since Linux 3.4) This subdirectory contains information on the architecture-specific subfields available for programming the various config fields in the perf_event_attr struct. The content of each file is the name of the config field, followed by a colon, followed by a series of integer bit ranges separated by commas. For example, the file event may contain the value config1:1,6-10,44 which indicates that event is an attribute that occupies bits 1,6-10, and 44 of perf_event_attr::config1. separated.
perf_event_open() returns the new file descriptor, or -1 if an error occurred (in which case, errno is set appropriately).INVAL.); }
fcntl(2), mmap(2), open(2), prctl(2), read(2)
This page is part of release 3.61 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at. Linux 2014-01-23 PERF_EVENT_OPEN(2) | http://man7.org/linux/man-pages/man2/perf_event_open.2.html | CC-MAIN-2014-10 | refinedweb | 665 | 50.02 |
What does an ALT probability plot show me¶
An ALT probability plot shows us how well our dataset can be modeled by the chosen distribution. This is more than just a goodness of fit at each stress level, because the distribution needs to be a good fit at all stress levels and be able to fit well with a common shape parameter. If you find the shape parameter changes significantly as the stress increases then it is likely that your accelerated life test is experiencing a different failure mode at higher stresses. When examining an ALT probability plot, the main things we are looking for are:
- Does the model appear to fit the data well at all stress levels (ie. the dashed lines pass reasonably well through all the data points)
- Examine the AICc and BIC values when comparing multiple models. A lower value suggests a better fit.
- Is the amount of change to the shape parameter within the acceptable limits (generally less than 50% for each distribution).
The following example fits 2 models to ALT data that is generated from a Normal_Exponential model. The first plot is an example of a good fit. The second plot is an example of a very bad fit. Notice how a warning is printed in the output telling the user that the shape parameter is changing too much, indicating the model may be a poor fit for the data. Also note that the total AIC and total BIC for the Exponential_Power model is higher (worse) than for the Normal_Exponential model.
If you are uncertain about which model you should fit, try fitting everything and select the best fitting model.
If you find that none of the models work without large changes to the shape parameter at the higher stresses, then you can conclude that there must be a change in the failure mode for higher stresses and you may need to look at changing the design of your accelerated test to keep the failure mode consistent across tests.
Example 1¶
from reliability.Other_functions import make_ALT_data from reliability.ALT_fitters import Fit_Normal_Exponential, Fit_Exponential_Power import matplotlib.pyplot as plt ALT_data = make_ALT_data(>IMAGE_1<<
References: | https://reliability.readthedocs.io/en/stable/What%20does%20an%20ALT%20probability%20plot%20show%20me.html | CC-MAIN-2022-27 | refinedweb | 357 | 51.58 |
0
EDIT: I figured it out. I do not know how to delete threads. Sorry.
I need to return a pointer to a new array. The new array must be the same as the old one, just in reverse. I have it all done except for one little part. I can't seem to return the the pointer to show all the elements. I get 50, after that is all a bunch of random numbers being printed out. Any quick fixes in order for it to print out 50 40 30 20 10. Thanks
#include <iostream> using namespace std; int *reverseArray(int array1[], int const size); int main() {//start main const int size = 5; int array1 [size] = {10,20,30,40,50}; int *newArray; int count; int x; newArray = reverseArray(array1, size); for (count = 0; count < size; count ++){//start for cout << newArray[count]; }//end for cin >> x; }//end main int *reverseArray(int array1[], int const size) {//start function int count; int i=0; int newArray[5]; int *numptr = newArray; cout << "This is the orginal array: " ; for(count = 0; count < size; count++){//start for cout << array1[count] << " "; }//end for while (count > 0 ) {//start while numptr[i] = array1[count -1]; cout << numptr[i]; count--; i++; }//end while return numptr; }// end function
Edited by Rez11: n/a | https://www.daniweb.com/programming/software-development/threads/306173/trying-to-return-a-pointer | CC-MAIN-2017-09 | refinedweb | 214 | 74.73 |
Using the View .xib Template
- PDF for offline use
-
-
- Sample Code:
-
Let us know how you feel about this
Translation Quality
0/250
The iOS View XIB template in allows adding a stand-alone .xib file that can be attached to some backing class. This allows a reusable views to be designed in Xamarin Designer for iOS. However, to use such a view requires manually creating a backing view class. This recipe demonstrates creating a view in the iOS Designer and connecting it to a backing C# class in your IDE.
Recipe
First, create a new solution named
TestApp using the Single View Application template, and add a new file to it called
SomeView using the View file template,
as shown below:
This creates a new file called
SomeView.xib.
Double-click
SomeView.xib to open it in the Xamarin Designer for iOS.
At this point controls can be added to the .xib. As an example, search the toolbox for label drag a
UILabel onto the design surface as shown below:
However, since the .xib has not been connected to any backing class, we cannot yet manage properties nor handle events on the controls in the view. For example buttons should have behaviour that responds to the user's touch, and labels may need to be updated based on user input. To interact with the .xib programmatically we need to have two files:
- View partial class – This class handles everything that happens in the view from the frame size, event handling, and contains the constructor that describes the view whenever it is instantiated.
- Designer partial class – This maps the .xib controls to C# objects and is the glue that makes the controls we defined in the .xib available in the View partial class. The designer file is auto-generated by Xamarin Studio. It should never be edited by hand as Xamarin Studio will just overwrite manual changes the next time the .xib is updated.
To create these new C# class for our .xib file, select the root view on the design surface, and under Widget > Identity set the Class to
SomeView and press Enter:
This will create the two classes –
SomeView.cs and
SomeView.designer.cs – in our solution :
The result will be a reusable view that can be included in any view hierarchy as with any other view.
This differs from the ViewController template, whose Storyboard file comes already connected to a backing class that is auto-generated by Xamarin Studio when the project is created. In that case, the class is a
UIViewController.
We can now manage the properties of the controls in the view, such as the label we added earlier. To interact with our UILabel control using code, we must give it a unique identifier so that it can be accessed in the C# backing code for the view. To do this select the label on the designer surface, and under Widget > Identity > Name in the Properties Pad enter
MyLabel:
If we open SomeView.designer.cs, we can see that the label has been defined:
[Register ("SomeView")] partial class SomeView { [Outlet] [GeneratedCode ("iOS Designer", "1.0")] UILabel MyLabel { get; set; } void ReleaseDesignerOutlets () { if (MyLabel != null) { MyLabel.Dispose (); MyLabel = null; } } }
Now that we have everything connected, we can add code to create the View.
In the
SomeView class add the following namespaces and constructors to load
the view from the XIB file we just created:
using Foundation; using System; using System.CodeDom.Compiler; using UIKit; using ObjCRuntime; namespace TestApp { partial class SomeView : UIView { public SomeView (IntPtr handle) : base (handle) { } public static SomeView Create() { var arr = NSBundle.MainBundle.LoadNib ("SomeView", null, null); var v = Runtime.GetNSObject<SomeView> (arr.ValueAt(0)); return v; } public override void AwakeFromNib(){ MyLabel.Text = "hello from the SomeView class"; } } }
Here we also loaded the view from the XIB in the
Create method and edited the
Text property of the label.
The
SomeView class in now ready to use. In the
ViewController class, create an instance of
SomeView by calling the
Create method and add it to the view hierarchy, as shown below:
public partial class ViewController : UIViewController { SomeView v; public ViewController (IntPtr handle) : base (handle) { } public override void ViewDidLoad () { base.ViewDidLoad (); // Perform any additional setup after loading the view, typically from a nib. v = SomeView.Create(); v.Frame = View.Frame; View.AddSubview (v); } ... }
Run the application now and the view from the .xib is loaded and displayed:
Summary
The iOS View template allow custom view to be designed in Xamarin Designer for i. | https://developer.xamarin.com/recipes/ios/general/templates/using_the_ios_view_xib_template/ | CC-MAIN-2017-22 | refinedweb | 749 | 62.58 |
Previous Chapter: Introduction into the sys module
Next Chapter: Forks and Forking in Python
Next Chapter: Forks and Forking in Python
Python and the Shell
Shell
Understanding this, it's obvious that a shell can be either
- a command-line interface (CLI)
or
- a graphical user interface (GUI)
Most operating system shells can be used in both interactive and batch mode.
System programmingSystem programming (also known as systems programming) stands for the activity of programming system components or system software. System programming provides software or services to the computer hardware, while application programming produces software which provides tools or services for the user.
"System focused programming" as it is made possible with the aid of the sys and the os module, serves as an abstraction layer between the application, i.e. the Python script or program, and the operating system, e.g. Linux or Microsoft Windows. By means of the abstraction layer it is possible to implement platform independent applications in Python, even if they access operating specific functionalities.
Therefore Python is well suited for system programming, or even platform independent system programming. The general advantages of Python are valid in system focused programming as well:
- simple and clear
- Well structured
- highly flexible
The os ModuleThe os module is the most important module for interacting with the operating system. The os module allows platform independent programming by providing abstract methods. Nevertheless it is also possible by using the system() and the exec*() function families to include system independent program parts. (Remark: The exec*()-Functions are introduced in detail in our chapter "Forks and Forking in Python")
The os module provides various methods, e.g. the access to the file system.
Executing Shell scripts with os.system()It's not possible in Python to read a character without having to type the return key as well. On the other hand this is very easy on the Bash shell. The Bash command "
read -n 1waits for a key (any key) to be typed. If you import os, it's easy to write a script providing getch() by using os.system() and the Bash shell. getch() waits just for one character to be typed without a return:
import os def getch(): os.system("bash -c \"read -n 1\"") getch()The script above works only under Linux. Under Windows you will have to import the module msvcrt. Pricipially we only have to import getch() from this module.
So this is the Windows solution of the problem:
from msvcrt import getchThe following script implements a platform independent solution to the problem:
import os, platform if platform.system() == "Windows": import msvcrt def getch(): if platform.system() == "Linux": os.system("bash -c \"read -n 1\"") else: msvcrt.getch() print("Type a key!") getch() print("Okay")The previous script harbours a problem. You can't use the getch() function, if you are interested in the key which has been typed, because os.system() doesn't return the result of the called shell commands.
We show in the following script, how we can execute shell scripts and return the output of these scripts into python by using os.popen():
>>> import os >>> dir = os.popen("ls").readlines() >>> print dir ['curses.py\n', 'curses.pyc\n', 'errors.txt\n', 'getch.py\n', 'getch.pyc\n', 'more.py\n', 'numbers.txt\n', 'output.txt\n', 'redirecting_output.py\n', 'redirecting_stderr2.py\n', 'redirecting_stderr.py\n', 'streams.py\n', 'test.txt\n'] >>>The output of the shell script can be read line by line, as can be seen in the following example:
import os command = " " while (command != "exit"): command = raw_input("Command: ") handle = os.popen(command) line = " " while line: line = handle.read() print line handle.close() print "Ciao that's it!"
subprocess ModuleThe subprocess module is available since Python 2.4.
It's possible to create spawn processes with the module subprocess, connect to their input, output, and error pipes, and obtain their return codes.
The module subprocess was created to replace various other modules:
- os.system
- os.spawn*
- os.popen*
- popen2.*
- commands.*
Working with the subprocess ModuleInstead of using the system method of the os-Module
os.system('touch xyz')we can use the Popen() command of the subprocess Module. By using Popen() we are capable to get the output of the script:
>>> x = subprocess.Popen(['touch', 'xyz']) >>> print xThe shell command
>>> x.poll() 0 >>> x.returncode 0
cp -r xyz abccan be send to the shell from Python by using the Popen() method of the subprocess-Module in the following way:
p = subprocess.Popen(['cp','-r', "xyz", "abc"])There is no need to escape the Shell metacharacters like $, > usw..
If you want to emulate the behaviour of os.system, the optional parameter shell has to be set to true, i.e.
shell=Trueand we have to use a string instead of a list:
p=subprocess.Popen("cp -r xyz abc", shell=True)
As we have said above, it is also possible to catch the output from the shell command or shell script into Python. To do this, we have to set the optional parameter stdout of Popen() to subprocess.PIPE:
>>> process = subprocess.Popen(['ls','-l'], stdout=subprocess.PIPE) >>> print process.stdout.read() total 132 -rw-r--r-- 1 bernd bernd 0 2010-10-06 10:03 abc -rw-r--r-- 1 bernd bernd 0 2010-10-06 10:04 abcd -rw-r--r-- 1 bernd bernd 660 2010-09-30 21:34 curses.py
If a shell command or shell script has been started with Popen(), the Python script doesn't wait until the shell command or shell script is finished. To wait until it is finished, you have to use the wait() method:
>>> process = subprocess.Popen(['ls','-l'], stdout=subprocess.PIPE) >>> process.wait() 0
Functions to manipulate paths, files and directories
Further function and methods working on files and directories can be found in the module shutil. Amongst other possibilities it provides the possibility to copy files and directories with shutil.copyfile(src,dst).
Previous Chapter: Introduction into the sys module
Next Chapter: Forks and Forking in Python
Next Chapter: Forks and Forking in Python | http://python-course.eu/os_module_shell.php | CC-MAIN-2017-09 | refinedweb | 1,013 | 56.86 |
Summary
I recently had reason to work on some code a few years old and used Object Master and an older CodeWarrior IDE. I'd forgotten how much more productive coding could be with the assistance of a Smalltalk-style 3-pane browser. Here are a few points I've picked from my revisit.
I stopped using Object Master when I started using namespaces regularly because it was never upgraded to support them.
However, apart from the blazing speed (on an old 400MHz Mac with 144MB RAM) there are so many things that I still found useful I thought it was worth capturing a list of these goodies.
Object Master parses your code, in either plain C, C++, Object Pascal, Modula-2 or Java and builds an internal representation caching its object-oriented representation of your code. This parsed representation is saved back into the files - it is an editing environment as well as a browser.
It groups C functions into "classes" based on their file membership and obviously follows the OO logic of other languages.
It is dumb as far as C macros go and requires you to manually define them. There are shortcuts to make it relatively easy to define the complex macros such as used in MFC and preloaded standard sets so this doesn't actually amount to much work.
Where the ability to hand-define macro meanings becomes very useful is in the area of speed and smart presentation, as noted below.
The browser window, of which you can create many, is a typical Smalltalk-style browser with a triple pane presentation of classes, methods and member variables, with a code area underneath.
This is a list, in no particular order, of the things that have impressed me in the last few weeks as I revisit Object Master. This is after years of using XCode, CodeWarrior, Visual Studio (up to 2003) and Eclipse (for C++ and Python, no comment on Java tools).
Whilst it also has strong project, makefile and source-control integration, the target environments are long-since outmoded and now therefore mainly irrelevant.
For browsing old code, I still found these features useful and depressingly better implemented than in any of the environments I'm using elsewhere!
I reviewed an older version in MacTech magazine so you can look at some pretty pictures and read the full review: [Dent94].
Version 3 did come out with all the things they promised include a Windows version that still runs very nicely under Windows XP.
However, the codebase had major cobwebs. It was originally written in MacApp v2 which used Object Pascal (the elegant, lean Apple variant developed in consultation with Wirth, nothing to do with Borland).
It was ported to MacApp v3 using a conversion tool to convert it to c++ (I think) and then the Windows version created using a product Mac2Win from the same company that acquired the rights to Object Master.
As the c++ standard loomed and became dramatically harder to parse, with the new casts, heavy use of templates and namespaces, a business decision was apparently made that updating the parser was not going to be cost-effective. I don't really know - I think it was a one-man product all those years and maybe the resident genius just grew tired, left or suffered some less-desirable fate.
Have an opinion? Readers have already posted 5 comments about this weblog entry. Why not add yours?
If you'd like to be notified whenever Andy Dent adds a new entry to his weblog, subscribe to his RSS feed. | http://www.artima.com/weblogs/viewpost.jsp?thread=158259 | CC-MAIN-2017-09 | refinedweb | 596 | 58.21 |
Slash Commands allow users to invoke your app by typing a string into the message composer box. A submitted Slash Command will send the data from Slack to the associated app. In whatever way, the app can then respond to the sender using the context provided by that payload. These commands are the entry points for complex workflows, integrations with external services, or simple message responses.
To integrate your AWS Lambda function with Slash Commands, you will have to follow the below steps:
- Create a Lambda function to handle the payload sent from Slack Slash Command.
- Configure Amazon API Gateway to expose the Lambda function you built in the previous step as a RESTful API.
- Create a Slash Command in Slack.
- A user in Slack types in the message box with the command, AWS IAM username, and submits it.
- A payload is sent via an HTTP POST request to Amazon API Gateway RESTful API.
- Your Lambda function retrieves the AWS IAM user details and returns them.
Create a Lambda function
AWS Lambda is a compute service that lets you run code without provisioning or managing servers. Instead, Lambda runs your code only when needed and scales automatically, from a few daily requests to thousands per second.
- Choose Create function.
- Select Author from scratch.
- For Function name, enter AwsGetUserDetailsHandler.
- Under Runtime info, select Python 3.8.
- Leave the remaining settings as is.
Choose Create function.
Create a RESTful API using Amazon API Gateway
Amazon API Gateway is a fully managed service that makes it easy for developers to publish, maintain, monitor, secure, and operate APIs at any scale. With API Gateway, you can create RESTful APIs using either HTTP or REST APIs.
- Choose Create API.
- For REST API, choose Build.
- For protocol, select REST.
- For Create new API, select New API.
- For API name, enter AWS Bot Operations.
- Optionally, add a brief description in Description.
- For Endpoint Type, choose Regional.
Choose Create.
- To create the API resource, select the root, choose Actions, and then choose Create Resource.
- For Resource Name, enter User Details.
- For Resource Path, enter user-details.
Choose Create Resource.
- To expose a POST method on the /user-details resource, choose Actions and then Create Method.
- Choose POST from the list under the /user-details resource node and choose the check mark icon to finish creating the method.
- In the method’s Setup pane, select Lambda Function for Integration type.
- Choose Use Lambda Proxy Integration.
- For Lambda Region, choose us-east-1.
Choose Save.
- To deploy the API, select the API and then choose Deploy API from the Actions drop-down menu.
- In the Deploy API dialog, choose a stage (or [New Stage] for the API’s first deployment); enter dev in the Stage name input field; optionally, provide a description in Stage description and/or Deployment description; and then choose Deploy.
Once deployed, you can obtain the invocation URLs (Invoke URL) of the API’s endpoints.
Creating a Slash Command
Creating a command is simple; you need two things - a Slack App and the name of your new command. If you don’t already have a Slack App, click this link to create one.
Now let’s get to creating that command. First, head to your app’s management dashboard and click the Slash Commands feature in the navigation menu.
You will be presented with a button marked Create New Command, and when you click on it, you will see a screen where you will be asked to define your new Slash Command:
- For Command, enter /aws-user-details.
- For Request URL, enter the Invoke URL of the POST method we created in the previous step.
- Optionally, add a brief description in Short Description.
To save the command details, click Save.
A Slack app’s capabilities and permissions are governed by the scopes it requests. Go to your app’s management dashboard, and then click the OAuth & Permissions feature in the navigation menu.
Install your app to your Slack workspace to test it. You will be asked to authorize this app after clicking an install option.
Update Lambda Function Code and Settings
- Open the Functions page of the Lambda console.
- Choose your function.
- Scroll down to the console’s Code source editor Open lambda_function.py, and replace its contents with the following code:
import os import json import urllib.parse import hmac import hashlib import boto3 from botocore.exceptions import ClientError def lambda_handler(event, context): try: is_request_from_slack = check_if_request_from_slack(event) if is_request_from_slack == False: return send_failure_reason("Request not from Slack") command_input = extract_command_input(event) if not command_input: return send_failure_reason( "Send an aws username with the command to get user details. It is neither empty nor blank in the command input.") user = get_user(command_input) return send_success_response(user) except ClientError as error: print(error) return send_failure_reason(error.response['Error']['Message']) except Exception as e: print(e) return send_failure_reason( "Unable to process your request at this time. please try again later or contact the admin.") # Send success response to the Slack user def send_success_response(user): return { 'statusCode': 200, 'body': json.dumps({ "response_type": "in_channel", "blocks": [ { "type": "section", "text": { "type": "mrkdwn", "text": f"Here is the details about aws user *{user.user_name}*" } }, { "type": "section", "text": { "type": "mrkdwn", "text": f"ARN - {user.arn}" } }, { "type": "section", "text": { "type": "mrkdwn", "text": f"Account Created Date - {user.create_date}" } } ] }), 'headers': { 'Content-Type': 'application/json' } } # Send failure reason to the Slack user def send_failure_reason(message): return { 'statusCode': 200, 'body': json.dumps( { "response_type": "in_channel", "text": message } ), 'headers': { 'Content-Type': 'application/json' } } # Parse out command input from the posted message def extract_command_input(event): body = event['body'] command = body.split("text=")[1] command_input = urllib.parse.unquote(command.split("&")[0]) return command_input.strip() # Get AWS IAM user details with boto3 def get_user(username): try: iam = boto3.resource('iam') user = iam.User(username) return user except ClientError as boto3ClientError: raise boto3ClientError # Verify the request is from Slack def check_if_request_from_slack(event): body = event['body'] timestamp = event['headers']['X-Slack-Request-Timestamp'] slack_signature = event['headers']['X-Slack-Signature'] slack_signature_basestring = "v0:" + timestamp + ":" + body slack_signature_hash = "v0=" + hmac.new(os.environ['SLACK_SIGNING_SECRET'].encode( 'utf-8'), slack_signature_basestring.encode('utf-8'), hashlib.sha256).hexdigest() if not hmac.compare_digest(slack_signature_hash, slack_signature): return False else: return True
- The Lambda function code does the following:
- Choose Configuration, then choose Environment variables.
- Under Environment variables, choose Edit.
- Choose Add environment variable.
- Enter the following key and value:
- Slack creates a unique string for your app and shares it with you. Verify requests from Slack with confidence by verifying signatures using your signing secret.
- Head to your Slack app’s management dashboard, and then click the Basic Information feature in the navigation menu.
- Copy the Signing Secret value from App Credentials section.
- Paste the copied Signing Secret value in the Value column of SLACK_SIGNING_SECRET key.
- Choose Save.
Choose Permission, then click on Execution role name.
Add IAMReadOnlyAccess AWS managed policy so that your Lambda function can get the IAM user details requested by the user using slash command.
To deploy the Lambda function, press the Deploy button from the code editor panel.
Testing your new command
Go to a channel or the DM message window in Slack and enter the new Slash command into the message input field with the AWS IAM username and hit enter. I hope you got the expected response from Lambda. You have successfully deployed a custom slash command if the answer is yes.
You can add more commands to automate your IT needs and make Slack even more valuable(e.g., use case: To log off a hung Citrix session and more). | https://blog.josephvelliah.com/create-slack-slash-commands-using-aws-serverless-computing-services | CC-MAIN-2022-21 | refinedweb | 1,248 | 58.38 |
React’s Context API and Hooks libraries have been used together in the management of application state since the introduction of Hooks. However, the combination of the Context API and Hooks — the foundation on which many Hooks-based state management libraries are built — can be inefficient for large-scale applications.
This combo can also become tiring for developers since they have to create a custom Hook to enable access to the state and its methods before using it in a component. This defeats the true purpose of Hooks: simplicity. Yet for smaller apps, Redux can be overkill.
So today, we’ll be discussing an alternative that uses the Context API: Storeon. Storeon is a tiny, event-driven React state management library with principles similar to Redux. The state actions can be seen and visualized with the Redux DevTools. Storeon uses the Context API internally to manage state and employs an event-driven approach for state operations.
Stores
A store is a collection of data stored in an application’s state. It is created with the
createStoreon() function imported from the Storeon library.
The
createStoreon() function accepts a list of modules, wherein each module is a function that accepts a
store parameter and binds their event listeners. Here’s an example of a store:
import { createStoreon } from 'storeon/react' // todos module const todos = store => { store.on(event, callback) } export default const store = createStoreon([todos])
Modularity
Stores in Storeon are modular — that is, they are independently defined and not bound to a Hook or component. Every state and its operational methods are defined under functions known as modules. These modules are passed into the
createStoreon() function to register them as global stores.
The store has three methods:
store.get()– this method is used to retrieve the current data in the state.
store.on(event, callback)– this method is used to register an event listener to a specified event name.
store.dispatch(event, data)– this method is used to emit events passed in with optional data as required by the event defined.
Events
Storeon is an event-based state management library, and as a result, changes to the state are emitted by events defined in the state modules. There are three inbuilt events in Storeon beginning with the
@ prefix; other events are to be defined without the
@ prefix. The three inbuilt events are:
@init– this event is fired when the application loads. It is used to set the application’s initial state and executes whatever is in the callback passed to it.
@dispatch– this event is fired on every new action. It is useful for debugging.
@changed– this event is fired when there are changes in the application state.
Note:
store.on(event, callback)is used to add an event listener in our module.
What we will build
To demonstrate how application state operations are carried out in Storeon, we’ll build a simple notes app. We’ll also be using another package from Storeon to save our state data in
localStorage.
From here, I’ll assume you have basic knowledge of JavaScript and React. You can find the code used in this article on GitHub.
Setup
Before we dive in too deep, let’s map out the project structure and the installation of the dependencies needed for our notes application. We’ll start by creating our project folder.
mkdir storeon-app && cd storeon-app mkdir {src,public,src/Components} touch public/{index.html, style.css} && touch src/{index,store,Components/Notes}.js
Next, we initialize the directory and install the dependencies needed.
npm init -y npm i react react-dom react-scripts storeon @storeon/localstorage uuidv4
Now it’s time to write the parent component in our
index.js file.
index.js
This file is responsible for rendering our notes component. First, we’ll import the required packages.
import React from 'react' import { render } from 'react-dom'; function App() { return ( <> Hello! </> ); } const root = document.getElementById('root'); render(<App />, root);
Next, we’ll build our application store by writing the code for the initialization and operations of the state in
store.js.
store.js
This file is responsible for handling state and subsequent state management operations in our app. We must create a module to store our state alongside its supporting events to handle operational changes.
We’ll start by importing the
createStoreon method from Storeon and the unique random ID generator UUID.
The
createStoreon method is responsible for the registration of our state into a global store.
import { createStoreon } from 'storeon'; import { v4 as uuidv4 } from 'uuid' import { persistState } from '@storeon/localstorage'; let note = store => {}
We’ll be storing our state in an array variable
notes, which will contain notes in the following format:
{ id: 'note id', item: 'note item' },
Next, we’ll populate the note module first by initializing the state with two notes that’ll be displayed when we start our app for the first time. Then we’ll define the state events.
let note = store => { store.on('@init', () => ({ notes: [ { id: uuidv4(), item: 'Storeon is a React state management library and unlike other state management libraries that use Context, it utilizes an event-driven approach like Redux.' }, { id: uuidv4(), item: 'This is a really short note. I have begun to study the basic concepts of technical writing and I'\'m optimistic about becoming one of the best technical writers.' }, ] }); store.on('addNote', ({ notes }, note) => { return { notes: [...notes, { id: uuidv4(), item: note }], } }); store.on('deleteNote', ({ notes }, id) => ({ notes: notes.filter(note => note.id !== id), }); }
In the code block above, we defined the state and populated it with two short notes and defined two events and callback functions to be executed once the event is emitted from the
dispatch(event, data) function.
In the
addNote event, we return an updated state object with the new note added, and in the
deleteNote event, we filter out the notes whose IDs were passed to the dispatch method.
Finally, we register the module as a global store by assigning it to an exportable variable store so we can import it to our context provider later and store the state in
localStorage.
const store = createStoreon([ notes, // Store state in localStorage persistState(['notes']), ]); export default store;
Next, we’ll write our notes app component in
Notes.js.
Notes.js
This file houses the component for our notes app. We’ll start by importing our dependencies.
import React from 'react'; import { useStoreon } from 'storeon/react';
Next, we’ll write our component.
const Notes = () => { const { dispatch, notes } = useStoreon('notes'); const [ value, setValue ] = React.useState(''); }
On the second line in the code block above, the return values from the
useStoreon() Hook are set to a destructible object. The
useStoreon() Hook takes the module name as its argument and returns the state and a dispatch method to emit events.
Next, we’ll define methods to emit our state-defined events in our component.
const Notes = () => { ... const deleteNote = id => { dispatch('deleteNote', id) }; const submit = () => { dispatch('addNote', value); setValue(''); }; const handleInput = e => { setValue(e.target.value); }; }
Let’s review the three methods we defined the above:
deleteNote(id)– this method dispatches the
deleteNoteevent when triggered.
submit()– this method dispatches the
addNoteevent by passing the value of the input state, which is defined locally in our
Notescomponent.
handleInput()– this method sets the value of the local state to the user input.
Next, we’ll build the main interface of our app and export it.
const Notes = () => { ... return ( <section> <header>Quick Notes</header> <div className='addNote'> <textarea onChange={handleInput} value={value} /> <button onClick={() => submit()}> Add A Note </button> </div> <ul> {notes.map(note => ( <li key={note.id}> <div className='todo'> <p>{note.item}</p> <button onClick={() => deleteNote(note.id)}>Delete note</button> </div> </li> ))} </ul> </section> ); }
And that wraps up our
Notes component. Next, we’ll write the stylesheet for our app and the
index.html file.
index.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http- <link rel="stylesheet" href="style.css"> <title>Storeon Todo App</title> </head> <body> <div id="root"></div> </body> </html>
Next, we’ll populate our
style.css file.
style.css
* { box-sizing: border-box; margin: 0; padding: 0; } section { display: flex; justify-content: center; align-items: center; flex-direction: column; width: 300px; margin: auto; } header { text-align: center; font-size: 24px; line-height: 40px; } ul { display: block; } .todo { display: block; margin: 12px 0; width: 300px; padding: 16px; box-shadow: 0 8px 12px 0 rgba(0, 0, 0, 0.3); transition: 0.2s; word-break: break-word; } li { list-style-type: none; display: block; } textarea { border: 1px double; box-shadow: 1px 1px 1px #999; height: 100px; margin: 12px 0; width: 100%; padding: 5px 10px; } button { margin: 8px 0; border-radius: 5px; padding: 10px 25px; } .box:hover { box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2); }
Running our app
Now that we have successfully written our components and stylesheet, we haven’t updated our parent component in
index.js to render our notes component. Let’s render our notes component.
index.js
To access our global store, we will have to import our store and the Storeon store context component. We will also import our notes component to render it.
Replace the content of the component with React from 'react'; import { render } from 'react-dom'; import { StoreContext } from 'storeon/react'; import Notes from './Components/Notes'; import store from '../src/store'; function App() { return ( <> <StoreContext.Provider value={store}> <Notes /> </StoreContext.Provider> </> ); } const root = document.getElementById('root'); render(<App />, root);
On lines 8–10, we call the store context provider component and pass the notes component as the consumer. The store context provider component takes the global store as its context value.
Next, we’ll edit the scripts section in the
package.json file to the below:
"scripts": { "start": "react-scripts start", }
Then we run our app:
npm run start
Let’s go on to add and delete notes:
Storeon devtools
Storeon shares similar attributes with Redux, and as a result, state changes can be visualized and monitored in the Redux DevTools. To visualize the state in our Storeon app, we will import the
devtools package and add it as a parameter to the
createStoreon() method in our
store.js file.
... import { storeonDevtools } from 'storeon/devtools'; ... const store = createStoreon([ ..., process.env.NODE_ENV !== 'production' && storeonDevtools, ]);
Here’s a demonstration using the Redux DevTools to visualize state changes:
Conclusion
This tutorial should give you a basic understanding of what Storeon is all about and how it works. The main takeaway is that you don’t have to write a custom Hook and make container variables to be able to us state in your components.
Storeon is a very useful state management library that uses the event-driven approach and modular style adapted from Redux to manage state. Again, you can find the code used in this article “Event-driven state management in React using Storeon”
Why not just use Redux?
This is excellent! It brings the good tooling of Redux plus object orientation for creating business objects (in each store) of MobX | https://blog.logrocket.com/event-driven-state-management-in-react-using-storeon/ | CC-MAIN-2022-40 | refinedweb | 1,845 | 55.95 |
- Need ASAP help with a function (program)!!!
- Reading file while another process is writing to it.
- segmentation when cout
- Move cursor in cin input
- Simple Vector Problem
- Frustrating syntax problem
- WIll this program cause any memory leak?
- Creating modal dialog in vc++
- Run Time Check faliure # 3 it says the variable hours is being used with out being in
- Visual C++ 6.0 Undeclared Identifier Error
- pointer to array
- ofstream ambiguity problem
- server not able to send data
- error: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style
- Using a private method for threading
- 'itoa': The POSIX name for this item is deprecated?
- Files In C
- Windows API - GetAdaptersInfo()
- C++ class design - a class to inherit different functionality
- Float to wide char string conversion
- Link-time error when used _strdate() and _strtime()
- variable value shown to label text
- Insert items into a Binary Search Tree in ascending order
- programming OFDMA in C++
- OO techniques Get/Set functions
- Multiline Macro
- About Outp function in conio.h for c or c++?
- What is the advantage to declare destructor as a virtual in c++ ?
- how to use append function
- C++ Polymorphism/Abstraction. Multi-Class Abstraction.
- Using boost pool library!
- error C2447 Missing function header (old-style format list? )
- #define macro
- urgent: how to include header file
- inline Functions in C
- C++ Error
- Best way to contain / sort Baseball Statistics
- can't figure out how aggregation and compostion relates to my program
- Installing eclipse for c/c++
- MFC ..get a value from a previous dialog
- Triangle Validity
- About Matrix
- Data structure/Vector
- DNS Lookup
- c++ codes for searching specific word (code as dictionary)
- Quadratic equation
- problem with infinite loop
- string datatype
- CStatic and scrollbars
- structs
- I have a DOS program with an Icon how can I change it
- Lambda and Tuple question
- inline overload operation question
- friend functions
- C source code line count function
- population and industrial?
- strange read in of binary file
- Two classes share common data - How to?
- C++ coin toss simulation program
- IBM zos XML tool kit - The implementation does not support the requested type
- Rounding off in C
- Addition of duplicate values in Binary tree
- When an application crashes...
- single traverse in array problem......
- lint still useful?
- Dealing with illegal instruction
- Video Streaming
- How to set text with superscripts as button label?
- #include header
- Map problem
- extern pointers.
- Anticlockwise rotation of matrix
- the static identifier in the global scope
- callback functions
- What is wrong in this program ?
- What is wrong in this program ?
- Speech related problem
- struct declaration into another struct
- How to generate random numbers in C
- Why C dont allow the name of a variable start with a digit?
- preprocessor: how to operate on strings
- How to get more precision in C ?
- Function return values...
- How to be a better C programmer?
- How to be a better C programmer?
- Honestly what am I doing wrong here?
- another locale Q: lose thousands sep
- [OpenCV] Extract en recognize barcode from image file.
- lost. Help
- Linking with a particular shared library by full path overridingLD_LIBRARY_PATH
- Parentheses and compiler optimzation
- Problem opening multiple files through command line
- Problem with hdparam
- scanf
- run incorrecly using -O?
- How do you force a computed float value to be stored in a variable?
- #define a macro that #includes
- "ab" mode in fopen
- c function call performance
- efficient way of saving class objects ?
- Lack of pointer Typedef in STL container
- Do you use a garbage collector?
- priority_queue cannot update element value
- list all characters available
- does C allow this ?
- K&R2, exercise 5.5
- function pointer and pointer to function
- what is NULL pointer dereferencing
- C++/Tcl/C++ Interface
- volatile const
- wav to mp3 conversion in c language
- it is not printing the right values
- K&R2, page 106 <strcmp>
- Is there a mean to pass Pinny Pointer to native code?
- Char Comparison Logic error
- How to connect with data base and c
- extra character when writing file
- Decimal Value of the Ratios of Consecutive Fibonacci Numbers
- a question about efficiency of STL
- CPPUnit for VS2005
- Check my C++ code please? I'll PM you.
- IBM ZOS Unresolved static references detected
- x&(x-1) ... why only 2's complement system?
- Hash key for vector of 3 ints
- Static attribute
- print output
- Need globbing function
- SDL_draw and Dev-C++
- C or C++
- help needed with if- else cases
- SLOC Counter in C/C++
- #ifdef __cplusplus
- Logical error - same output no matter what the input
- variable/object passing from 1 form to another form in MSVC++
- Comparing double in for loop
- member function vs standalone func in cpp
- How to put the value in dynamically in the constructor of class
- int main(int argc, const char * argv[]) ??
- spin_lock
- new int?
- recursion.
- incompatible type conversion
- Reading words from a text file
- need help with IF statment
- C FAQs 6.12
- function pointer
- STL pool allocator performing very slow!
- How to obtain a slim version of a code...
- Help with getline
- implementation of FFT algorithm in C
- selection structure problem
- Returning a value.
- IOCP question.
- Need help with static linking Allegro with C++ and making it work...
- data type
- reference
- Is it in the C++ culture to use Dependency Injection/Inversion ofControl?
- HANDLE
- program converting Celsius to Fahrenheit
- process.h
- Run Time Error #0 MSVS 2003, with COM
- detect non reentrant function
- if statement error! please help!
- integer-input ONLY textbox in GUI c++
- reading an internet page
- Questions about mmap()
- I need a book and/or resource.
- Function lookup problem
- Program that diplays corresponding ASCII code for the numbers 0-127, 16 per line.
- How to use qsort function of C library ?
- What is the error on building solution mean ?
- finding memory leaks
- Function issue
- need help for socket programming in C
- inline
- Help with RogueWave RWHashDictionary
- printing a leading zero
- Information hiding
- string type to char type with same effect
- dynamic struct array with in a struct
- problem with multiple source file
- Take control over ActiveX by hwnd.
- multithreading
- sizeof()'s strange behviour
- length of binary file
- What is the difference between bind() and connect() in windows socket programing
- K&R2, exercise 5.3
- An allocator for your perusal
- K&R2 , section 5.4
- What are the differences in EOF & FEOF in the
- Any idea why this program is not generating an output ?
- Polymorphic constructor
- Traversing backwords through a text file.
- code for boost shared safe pointer
- Creating directory and writing files in that directory ?
- Why would someone use c++ compiler on a C code?
- Having trouble calling an array!
- How serializing xml
- Data Structures C++
- Prog question
- 2 Matrices
- tools for C and C++
- Iterations, matrix replacement
- Program that diplays corresponding ASCII code for the numbers 0-127, 16 per line.
- Dining Philosophers / C++/ Linux question
- Sharing a variable across multiple files
- replicating default constructor's "non-initializing state"
- string type to char type in Windows Form application
- How to make it faster?
- gmtime_r or strftime problem or just my code?????
- c++ books
- Problem with dlopen
- New to C++, which IDE?
- Upsigning or downsigning
- confused with cin in C++
- Restricting template parameters to signed or unsigned types, but notboth
- all about c++
- Student Line up
- Function calls takes up memory
- long double
- What is the >> maths operator in C++
- Unicode character in C++
- std::tr1::array iterator types
- Plain Table Optimization Problem (not database, just a plain table)
- source tree organization for large-scale C++ projects
- magic square
- save self-defined object to file?
- C++ Matrix Multiplication
- for loop increment condition ?
- storing 1,000,000 records
- Portability
- conversion from 'int' to 'float', possible loss of data ??
- Reading USB port and saving a file with the comunication data
- Base Converter Calculator
- putting a subclass in a pointer to baseclass?
- C90 long long
- including header files
- Help with Parent Pointer in Recursive AVL Tree
- Multiple Vectors Output/Input into binary file?
- C: How to check if the float is not a char?
- How to compute 1/(2*i)?
- not all control paths return a value??
- worst fit code
- Print number of times an input was given, and take the average of the inputs
- C++ more efficient than C?
- music file in C
- Regarding Scanf and other similar functions
- [Q]const char *const * ??
- char comparison error
- out
- fetching two numbers separated by a whitespace (noob question)
- Problem with cyclic dependency
- Left brace on a single line -- Question
- C++ Program to read and compare two files
- Fast hash lookup
- Having troube understanding obfuscated code
- getline() and newlines
- Number for space character in C
- using gets() to output a string to a file in C
- How to reduce code length
- using the shm_open() function for shared memory access in linux --regarding
- How to show accuracy differences?
- float/ieee 745
- vector/valarray initialization
- Problem in using the Graph object in different function
- freeing a NULL pointer
- Includes In Visual C++ Express
- Can 'gprof' show profile info on lib routines such as 'malloc'?
- Two Dimensional Array
- Regarding Function
- coding style
- boolean
- pointer vs reference
- char *
- strings
- enum
- C++ reading from a file
- Errors when executing linked program
- What's the most efficient way to transform a 2d array into a 2dvector
- padding and enums
- A* algorithm
- Not a number problem
- Which function header do you prefer?
- if statement problem?
- To run dos commands in C programming
- size of returning pointer
- dynamic multidimensional array question
- Displaying .bmps on screen + BitBlt problem
- preprocessor question
- pointer.
- problem in seprating interface from implementation
- -atof- function , example from section 4.2 K&R2
- Error with typedef inside a class...
- Reading BSD system code
- string merge
- Macro constants
- STL map: reverse iterator for lower_bound?
- #define constants
- changing font properties
- Iterators in Java and C++
- Not quite standard... but socially acceptable
- Is it possible to have two main functions in a c program?
- Debug statements
- would C be easier to read if...
- simple program
- K&R2, exercise 4-2
- L-value Required Error
- Launch Failed No Binaries! Eclipse
- Again a simple question about std::vector
- how to use the virtual destructor?
- Optimization
- TCP File Transfer behind NAT
- TCP File Transfer behind NAT
- TCP File Transfer behind NAT
- Read optional data from webserver sent thru HttpSendRequest
- to create the pushbuttons in VC++
- Problem in creating Graph Object using Boost Graph Library
- C- quicksort in-place and non-recursive
- cout
- to deallocate the memory
- How to configure gdb ?
- To create folders in c
- Error after i set MS access a password
- Text Editor Project
- Need help with vector matrix
- Error while creating and linking libraries
- global variables with the same name in different C files
- Vector malloc
- C compiler version check
- need help! replacing substing in a string with another substring
- strcat
- Try/Catch/Throw...Can't get data read in right, and stuck in an infinite loop!
- <string.h> vs <string>
- const confusion
- A conundrum in C: found this fragment in Steve McConnell's CODECOMPLETE
- implementing a generic tree
- Recursive function won't compile
- C elements of style
- Directshow - Extra frames on video capture to file
- Accent problem
- Accessment of dynamic variables.
- Lint free program
- Compiling Error
- Need of clarification - Thinking in C++ Vol 2 - Practical Programming
- Is finding definitions of explicitly specialized template functionscompiler-defined?
- Working out best line of fit in C++
- C programmers have a phobia of Java/C++ programmers
- extern declaration
- my doubts in C
- opinion poll: who is better programmer navia or heathfield ?
- naming convention
- How To Use Map Of Maps
- Any one has problem to access this group
- ip address naming convention
- How to parse the file using C++
- Printing simple shapes on screen
- Strange sintax
- Question about function "settimeofday"
- Differnce between function pointers and pointers to function
- How to convert string into character array
- Regular expressions (multiple match problem)
- C++ Mailing Server Address
- delete POD array - on which platforms does it not work?
- solving differential equation
- Help, am getting this error C2784 message
- Can we do regular expression processing in C ?
- basic questions
- CRT (C runtime library)
- Standard C++ Library
- error C2065
- Mixing C and C++ Code in the Same Program
- Makes it sense to get a copy of the ANSI standard documents?
- fgets() and fopen() with "w"
- printing doubles and robustness of setw()
- Can a poninter of base class hold object of class derived from the derived class
- SDL threads and gcc optimization
- Disabling printf, enabling something else
- creating an array in a function
- Priority Queue
- Random numbers
- how to use functors as ordinary functions argument?
- strtok_r or strtok_s
- How to save wxListBox contents to a text file?
- global pointer variables in C++
- More bit shifting issues
- Sleep process
- GDB debugger problem
- C++ capabilities
- Making a zone plate in C++
- Unicode aware VCL components
- warning: use of C99 long long integer constant
- hi
- forming an ipv6 address string from unsigned char array
- any error in the code
- Best Prometric Test center in Bangalore (like Microsoft, SunMicrosystems, Exin - ITIL, Dell, HP)
- Fastest way to get minimum of four integer values?
- simple question about cout
- Append values to a vector?
- [Makefile]How can I deal with multi-dirs?
- static array
- How to write scrollbar
- C++ byte
- File opening
- Functions and Arrays (C)
- How to print vector element address ?
- Compare two binary files
- Fist time useing C\C++
- font size and saveing/loading
- Writing code help
- conversion problem int <-> double ?
- Reading files word by word
- Pointer array / slider question
- srand with big numbers
- Accessing elements in a stack?
- NULL struct at end of declared array of structs
- Converting an Input String to a Variable Name
- mesothelioma cancer treatment
- Multiplication Optimization
- How to parse data from a buffer into an array of structs?
- Question on adding strings
- why do the following crash
- how is the do loop in the switch code
- netinet/in.h
- "dereferencing pointer to incomplete type" error while compiling on VxWorks.
- Add as reading from file
- Compiling Errors
- Word alignment - Why doesn't this crash?
- A Log Book
- we need some data on line
- Whats wrong with my || operator
- Dynamic Memory Allocation
- difftime
- Help to read from EXCEL sheet
- file Input question
- how to connect database through c++
- strcat strncat and strlen
- Question about bits (debugging>
- How to use GDB watching data in istringstream object
- Coding Style
- type casting a pointer (to a structure) to a pointer (to a different structure)
- sizeof(x)
- Strange bit shifting result with gcc - am I missing somethingobvious?
- size of dynamic array
- Problems with constructors
- teen girls
- can I define istream_iterator behavior?
- Reentrant functions and memory allocation
- converting from IPADDRESS string to unsigned char array
- ?: as an lvalue
- lactating
- creating a testfile for catv
- Why do they cast it twice?
- Quick Q about Vectors
- C++ Understanding the find_prime(bool prime[ ]) function below
- parsing tree help
- parse tree help
- The purpose of references to functions
- cut a string in file
- Character Arrays in C
- question on complicated pointer/reference declarations
- how to read tab delim file into 2D Array
- How does this function call work: functionOne().functionTwo()
- Write a callback function in C++ CLI and invoke this function in a native DLL
- memory block -> C++ strings
- cin space to string ?
- std::locale ctor fails (L10n with C++)
- c++ introduction
- Help! Heap Corruption
- break exit what?
- How to do this in most simple way? about list of arrays
- Lovely play girl 4
- What's the best C++ website?
- Best C algorithms
- prono movies
- you to me open
- I don't get the compile error
- Modular reduction
- the game of life
- Check unnecessary Header file inclusion
- maximum,minimum matrix elements
- access formula
- "std::endl or "\n" "
- Help! Free C memory :(
- Socket programming in C..trouble with send and receive
- Convert Double to string issues
- restrict keyword questions
- Latin Square algorithm problem
- replace string file
- New version of C++ standar
- Help with c++ syntax for wxcheckbox
- help with counting substings in strings???
- C++ pages
- Macro to indicate directories in filenames
- Public Access Compilers
- Mature Sucker
- Backtrace function
- How to usc GDB watch contents of istringstream object
- C++ Highest Concepts
- ctype.h for string type?
- Strings and arrays
- Problems on ActiveX Messages / Events of VC++ 6.0 programming
- Include file in a different location
- best way to manage the headers..
- How to get a string with the solution directory in the code?
- Padding bits and char, unsigned char, signed char
- Padding bits and char, unsigned char, signed char
- string::assign for int type?
- Lovely play girl 4
- error handlling in C
- error handlling in C
- How to convert a $(macros) into a string
- remove random element from priority queue
- Structure padding
- CPP
- Best book ?
- compiling multiple source files
- Counting commented lines in C code
- Calculation of sine values in C
- DEBUGGING problem
- Scatologic Dream
- case labels
- Converting an int into seperated int in C
- Which option is better to use
- Implementation-defined behaviour
- SFINAE
- Copy dynamically allocated array of ints
- counting vars
- pointer problem
- Homework assignment
- import vs include
- best compiler to use on fedora
- Too Many Initializers With Visual Studio?
- c program help
- How to group objects from static library in a section?
- Error
- error
- A binary tree problem
- Execute a program from TMainMenu drop down item
- Finding Median
- mysql connection
- C++98 or C++03?
- Does STL vector guarantee contagious memory Allocation
- About namespace std
- UNICODE I/O
- Related to including SSE Pentium instructions in C
- Inline initialization of a struct containing a string array
- World Time Clock software for Windows. Over 500 cities covered.
- invoking progressbar in another cpp file | https://bytes.com/sitemap/f-308-p-25.html | CC-MAIN-2019-43 | refinedweb | 2,888 | 50.77 |
how To import modules such as pygame etc
Hi all - new to coding and Pythonista but loving learning
So, I have a script that I want to run that contains the pygame module. When I run the script which has on a line...
Import pygame
I get an error message informing me the module is not found.
How does one install additional modules please? Is this possible?
Thanks.
The i is lowercase...
import pygame
Yep, I think it was just capitalised automatically on the forum. In my pythonista code, it is lowercase.
@hmartin, pygame is not available in Pythonista as it contains C components, and only C components you can run on iOS are those that come installed with an app.
But you can ”pip install” pure Python components - search for ”stash ywang” in the search engine of your choice.
The scene module comes natively with pythonista, and there are a few examples that might help
Super responses, thanks folks.
I shall take a look into 'scene' and try to figure it out. I have been working on learning python and came up with a version of Connect4 on the Mac using PyCharm. I'll see if I can use 'scene' or even the UI that is provided with pythonista to do it, thanks for the heads up @Drizzel.
I'll look into stash ywang too, @mikael - many thanks. | https://forum.omz-software.com/topic/5522/how-to-import-modules-such-as-pygame-etc | CC-MAIN-2020-29 | refinedweb | 229 | 81.53 |
libst_intro, libst - symbol table and object file access
library
#include <st.h>
The library function can also be used to access objects namedemangling
operations for C++ objects. By default, name
demangling is enabled by libst when an object is opened.
Functions allow you to manage both a single object and
lists of objects. Object lists are useful when a callshared example. If a thread
changes name demangling for an object, you should both set
the name-demangling option and perform the name translation
before another thread makes a name-translation call,
such as st_sym_name. Generally, most calls to libst are
read requests and do not require synchronization.zero return status is the recommended
method for detecting an error return from a libst function.
The following code example shows how to use libst routines
to list the file and procedure names in an object file.
The build command for this program is:
cc -g test.c -o test -lst -lmld
This command ensures that libst will use any newer C++
demangler that has been installed along with a C++ compiler.
The program is linked as a call-shared program, so
the demangler in libmld.a loads libdemangle.so dynamically
using ldopen(3), and it runs the shared library's demangler
if that one is newer. To link a non-shared program so
that libst uses a newer (or older) demangler in libdemangle.a,
use this build command:
cc -non_shared test.c -o test -lst -all -qldemangle -none
); }
Header file that contains all definitions and function
prototypes for libst.a functions Header file that controls
name-demangling operations for C++ objects
Commands: atom(1)
Functions: st_addr_to_file(3), st_cm_setup(3),
st_file_lang(3), st_get_known_versions(3), st_lang_str(3),
st_obj_calls(3), st_obj_file_start(3), st_obj_open(3),
st_objlist_append(3), st_proc_addr(3), st_pt_setup(3),
st_strerror(3), st_sym_value(3)
libst_intro(3) | https://nixdoc.net/man-pages/Tru64/man3/libst_intro.3.html | CC-MAIN-2022-27 | refinedweb | 301 | 56.15 |
1. Setting the Stage
As you create applications with Xamarin.Forms, you will no doubt like the simplicity of creating user interfaces. Using Xamarin.Forms, you are able to use the same terminology for controls across multiple platforms..
In order to get into the process of customizing the user interface for specific platforms, you must first understand the rendering process of Xamarin.Forms.
2. Control Rendering
When it comes to using Xamarin.Forms to create a user interface for your cross platform mobile application, there are two important pieces to the puzzle that you must understand.
Element
The first piece of the puzzle is the element. You can think of an element as the platform agnostic definition of a control within Xamarin.Forms. If you have read through the documentation at all, you will know that these controls are also referred to as View objects. To be even more specific, every element within Xamarin.Forms derives from the
View class. renderer.
Renderer
A renderer comes into play when you run your application. The job of the renderer is to take the platform agnostic element and transform it into something visual to present to the user.
For example, if you were using a
Label control in your shared project, during the running of your application, the Xamarin.Forms framework would use an instance of the
LabelRenderer class to draw the native control. If you are starting to wonder how this happens from a shared code project, that's a very good question. The answer is, it doesn.
In Visual Studio, create a new project and select the Mobile Apps project family on the left and choose the Blank App (Xamarin.Forms Portable) project template on the right. You can name your project anything you like, but if you wish to follow along with me, then use the name Customization, and the click OK.
Now, depending on your IDE, you should see either three or four projects in your solution. If you expand the References folder in your Customization (Portable) project, you will see an assembly reference to Xamarin.Forms.Core. This is where all the different elements are defined for you to use in your shared user interface project. Nothing out of the ordinary there.
If you open each of the platform specific projects and expand their References folders, you'll see that each one contains a platform specific implementation of that Xamarin.Forms library, named Xamarin.Forms.Platform.Android, Xamarin.Forms.Platform.iOS, and Xamarin.Forms.Platform.WP8 respectively.
It's in these assemblies that you'll find the renderers for each of the Xamarin.Forms elements. Now you are beginning to see the layout of the process. The platform agnostic elements, or
View objects, are in the shared code project, but all the specific renderers for the elements are in the platform specific projects.?".
3. When to Customize.
Depending on what you are building, this can be a rather extensive project. That being the case, I will save that for another tutorial in and of itself. Instead, in this tutorial, we will be focusing on the second scenario in which you will need some customization.
The second situation that you'll find yourself needing some customization is when a built-in element doesn't support a specific feature of a platform you wish to support. An example of this would be on the
Label.
4. Adding Customization
Let's start this process by setting up the basic structure of our application so we can see our baseline and then make changes. Start by opening your App.cs file in the Customization (Portable) project in the Solution Explorer. Modify the
GetMainPage method to look like this:
public static Page GetMainPage() { var iLabel = new Label { TextColor = Color.Black, Text = "I want to be italicized!", HorizontalOptions = LayoutOptions.CenterAndExpand }; var bLabel = new Label { Text = "I want to be bold!", TextColor = Color.Black, HorizontalOptions = LayoutOptions.CenterAndExpand }; var bothLabel = new Label { Text = "I want to be italicized and bold!", TextColor = Color.Black, HorizontalOptions = LayoutOptions.CenterAndExpand }; return new ContentPage { BackgroundColor = Color.White, Content = new StackLayout { Padding = 100, Spacing = 100, Children = { iLabel, bLabel, bothLabel } } }; }
As you can see here, we have created three simple
Label controls. One wants to be italicized, one wants to be bold, and the third is greedy and wants to be both. If you were to run this application on iOS, Android, and Windows Phone, they would look something like this:
iOS
Android
Windows Phone
As you can see, they don't want to be this boring. Well, don't just sit there, help them out.
Step 1: Creating a New Element
The first thing we need to do is create a new element that we can use to provide additional customizations to the existing
Label control. Start by adding a new class to your Customization (Portable) project and name it StyledLabel. Replace its contents with the following:
public enum StyleType { Italic, Bold, BoldItalic } public class StyledLabel : Label { public StyleType Style { get; set; } }
We define a very simple enumeration and class. We have defined the enumeration to allow for italic, bold, and bold plus italic values. We then create a class
StyledLabel that derives from the
Label base class and add a new property,
Style, to hold the appropriate style we want to apply to the control.
To make sure everything still works, and it should, let's modify the App.cs file once more and replace the
Label elements in our first example with our new
StyledLabel elements. Because the
StyleLabel class inherits from the
Label class, everything should still work.
public static Page GetMainPage() { var iLabel = new StyledLabel { TextColor = Color.Black, Text = "I want to be italicized!", HorizontalOptions = LayoutOptions.CenterAndExpand, Style = StyleType.Italic }; var bLabel = new StyledLabel { Text = "I want to be bold!", TextColor = Color.Black, HorizontalOptions = LayoutOptions.CenterAndExpand, Style = StyleType.Bold }; var bothLabel = new StyledLabel { Text = "I want to be italicized and bold!", TextColor = Color.Black, HorizontalOptions = LayoutOptions.CenterAndExpand, Style = StyleType.BoldItalic }; return new ContentPage { BackgroundColor = Color.White, Content = new StackLayout { Padding = 100, Spacing = 100, Children = { iLabel, bLabel, bothLabel } } }; }
Once again, here are the results of this change.
iOS
Android
Windows Phone
As you can see, nothing has changed. Now that we have a new custom element, it is time to create the custom renderers to take care of the native controls.
Step 2: Android Renderer
The first step to creating a renderer is to add a new class to the platform you are targeting. We will be starting with the Xamarin.Android project. Within this project, create a new class file and name it StyledLabelRenderer and replace its contents with the following:.
[assembly: ExportRenderer(typeof(StyledLabel), typeof(StyledLabelRenderer))]
We start with a special
assembly attribute that tells Xamarin.Forms to use this
StyledLabelRenderer class as the renderer every time it tries to render
StyledLabel objects. This is required for your customizations to work properly.
Just like when we created a new
StyledLabel element, we inherited from the
Label class, we will have our new
StyledLabelRenderer class inherit from the
LabelRenderer class. This will allow us to keep the existing functionality so we only have to override what we want to change or customize.
In order to apply our new formatting, we are going to need to jump into the rendering process and we do that via the
OnElementChanged method. In this method, we can do all of our customizations.
When doing your customizations, there are two very important properties you will be using. First, you will need to get a reference to the original element that you created and that is being rendered in our custom renderer method. You do this by using the
Element property. This is a generic object so you will have to cast this to whatever type you are rendering. In this case, it is a
StyledLabel.
var styledLabel = (StyledLabel)Element;
The second important property you need is the
Control property. This property contains a typed reference to the native control on the platform. In this case, since you have inherited from the
LabelRenderer class, the code already knows that the
Control in this case is a
TextView.
From this point, you will use some simple logic to determine which customization to perform and apply the appropriate native customizations. In this case, you will use the Android mechanism for modifying the typeface of a
TextView by using the
SetTypeface method.; }
If you were to run this application now, you should see something like the following in the Android Emulator, which is exactly what we aimed for.
Step 3: iOS Renderer
The process of creating the iOS renderer is exactly the same up until the point of overriding the
OnElementChanged method. Begin by creating a new class in your Customization.iOS project. Name it StyledLabelRenderer and replace the contents with the following:
assembly attribute, you are overriding the same
OnElementChanged method, you are casting the
Element property to a
StyledLabel, and you have the same shell of a
switch statement to work through the
Style property.
The only difference comes in where you are applying the styling to the native
UILabel control.; }
The way you make a
UILabel's
Font property either bold or italic in iOS is through a static helper method on the
UIFont class named either
BoldSystemFontOfSize or
ItalicSystemFontOfSize. That will work in the case of either a bold font or an italic font, but not both. If you try to apply both of these to a
UILabel, only the last one will render.
To get both styles, we will cheat a little and use a built-in font in iOS named Helvetica-BoldOblique. This font has both bold and italic built-in so we don't have to do them individually.
Running this in the iOS Simulator will give you the following result:
Step 4: Windows Phone Renderer
Finally, we come to Windows Phone. As you may have already guessed, the process is exactly the same. Create a new class in the Customization.WinPhone project, name it StyledLabelRenderer and replace the contents with the following:; } } } }
Once again, everything is the same except for the logic. In this case, to make the text italic, you set the
TextBlock's
FontStyle property to
Italic. Then to make the text bold, you set the
FontWeight property to
Bold. If you want to apply both, you simply set both.
Running this application in the Windows Phone emulator will give you the following result:
You have now successfully created a fully functional, customized, cross platform element that renders itself perfectly on all three platforms. You should now feel ready to take on the world. Well, almost..
5. XAML and Data-Binding XAML for Xamarin.Forms page.
Step 1: Building the XAML Page
Let's start by building a simple XAML page that duplicates the user interface we've previously created in code. Start by adding a new file to your Customizations (Portable) project, selecting the Forms XAML Page file type and giving it a name of StyledLabelPage.
Once the file is created, replace the contents with the following:
<="Italic" /> <local:StyledLabel <local:StyledLabel </StackLayout> </ContentPage>
This XAML will create the exact same page that we have been working with before. Note the addition of the
xmlns:local namespace declaration at the top of the file as well as the
local: prefix before each reference to the
StyledLabel objects. Without these, the XAML parser won't know what a
StyledLabel is and ultimately won't be able to run.
In order to run this, you will need to make two small modifications. First, open the App.cs file and modify the
GetMainPage method to look like this:
public static Page GetMainPage() { return new StyledLabelPage(); }
Second, open the StyledLabelPage.xaml.cs file and change it to look like this:
public partial class StyledLabelPage : ContentPage { public StyledLabelPage() { InitializeComponent(); } }
Now, when you run your applications, you should get the same results on all three platforms. Pretty neat, huh?
iOS
Android
Windows Phone
Step 2: Adding Data-Binding
If you are familiar with the concept of the Model View View-Model pattern (MVVM), you will know that one of its primary characteristics is data-binding. In fact, this pattern was designed around the use of XAML.
Data-binding is the process of allowing the properties of two objects to be linked together so that a change in one will create a change in the other. The process of data-binding within XAML is achieved through the use of the Binding Markup Extension.
Markup extensions are not a feature of Xamarin.Forms, or even of XAML. It is actually a feature of XML that allows additional functionality to be applied to the process of setting the value of an attribute in an element.
For example, let's give a closer look to the first
StyledLabel element in the above example.
<local:StyledLabel
The problem with this markup is that all of the properties (attributes) are being explicitly assigned. This creates a rather inflexible design. So what happens if for some reason during the execution of our application, we want to change the
Style attribute to have a value of
Bold? Well, in our code-behind file, we would need to watch for an event, catch that event, get a hold of this instance of the
StyledLabel element and modify this attribute value. That sounds like a lot of work. Wouldn't it be nice if we could make that process easier? Well, we can.
Binding Markup Extension
The way that you are able to make this design more flexible for modification is through the use of the
Binding markup extension. The way you use this extension is by modifying the markup to look like the following:
<local:StyledLabel
As you can see, we've changed the value of the
Style property to
{Binding FirstStyle}. The use of a markup extension is typically signified by the use of curly braces
{}. This means that whatever is contained inside the curly braces is going to be a markup extension.
In this case, we are using the
Binding extension. The second part of this extension is the name of a property that we want to bind to this property (attribute). In this case, we will call it
FirstStyle. That doesn't exist yet, but we will take care of that in a moment. First, let's completely update this file to take advantage of data-binding.
<="{Binding FirstStyle}" /> <local:StyledLabel <local:StyledLabel </StackLayout> </ContentPage>
BindingContext.
Create a new class within the Customizations (Portable) project and name it SampleStyles and replace the contents with the following:
public class SampleStyles { public StyleType FirstStyle { get; set; } public StyleType SecondStyle { get; set; } public StyleType ThirdStyle { get; set; } }
This is a very simple class that contains three properties of type
StyleType with the same names that we used in our
Binding of the attributes. We now have the XAML using the
Binding markup extension and a class that contains properties with the same name as we see in the bindings in the XAML. We just need glue to put them together. That glue is the
BindingContext.
To link the properties of these objects together, we need to assign an instance of the
SampleStyles class to the
BindingContext property of
StyledLabelPage. Open the StyledLabelPage.xaml.cs file and modify the constructor to look like the following:
public StyledLabelPage() { InitializeComponent(); BindingContext = new SampleStyles { FirstStyle = StyleType.Italic, SecondStyle = StyleType.Bold, ThirdStyle = StyleType.BoldItalic }; }
In theory, if you were to run your application, the XAML file would get populated with the values from our
SampleStyles properties and everything would be rendered on the screen as we saw before. Unfortunately that is not the case. You wind up getting an exception at runtime that looks like this:
If you look at Additional information, you will see the problem is that No Property of name Style found. This is a result of the way we created the
StyledLabel in the beginning. To take advantage of data-binding, your properties need to be of type
BindableProperty. To do this, we will need to make a small modification to our
StyledLabel class.
public class StyledLabel : Label { public static readonly BindableProperty StyleProperty = BindableProperty.Create<StyledLabel, StyleType>( p => p.Style, StyleType.None ); public StyleType Style { get { return (StyleType)base.GetValue( StyleProperty ); } set { base.SetValue(StyleProperty, value);} } }
As you can see, we have added a static property named
StyleProperty of type
BindableProperty. We then assigned to it the result of a the
CreateMethod that defines the owner of the property we are working with.
The property is
Style, but the owner is
StyledLabel. The second generic parameter is the return type of the property, which is a
StyleType. Then the only argument we are supplying to the method is an expression that defines what is being returned and a default value. In our case, we are returning the value of the
Style instance property and the default will be
None, or no styling.
We then need to modify the
Style property implementation to defer the getting and setting functionality to the base class so that the
BindingProperty is updated properly if the value of the
Style property changes.
Now, if you were to run your application again, you should see that everything is working as expected.
iOS
Android
Windows Phone
Conclusion
In this tutorial, you learned about a very important concept in the world of Xamarin.Forms, customization. Customization is one of the key features that allows them to stand out from the competition.
Knowing how, when, and where to customize is a very important skill to have as a mobile developer. I hope you find these skills useful and are able to put them to good use in your next project.
Envato Tuts+ tutorials are translated into other languages by our community members—you can be involved too!Translate this post
| https://code.tutsplus.com/tutorials/getting-started-with-xamarinforms-customizing-user-interface--cms-22144 | CC-MAIN-2018-17 | refinedweb | 2,969 | 55.24 |
0
I have a problem where I am writing a program that has a predefined costs for tickets. The program asks what city you want to go to and then it asks how many tickets you want to buy and it calculates the cost. If you want more it will ask you a city code and then how many tickets you want to buy. Then it gives you a grand total of the cost of all of the tickets in one line.
My code is not doing that. It displays a grand total for each ticket sales entry. I need it to total everything at the end.
#include <iostream> #include <iomanip> using namespace std; int Get_Valid_Code(); char response; int main() { cout << setprecision(2) << setiosflags(ios::fixed) << setiosflags(ios::showpoint); Get_Valid_Code(); } int Get_Valid_Code() { bool invalid_data; int cities, NUM_TICKETS; double grand_total, CHARGE; grand_total = 0.00; double price[6] = {86.79, 149.69, 193.49, 55.29, 81.40, 93.91}; { cout << "What is the number of your destination city? "; cin >>cities; if (cities < 1 || cities > 7) { cerr << endl; cerr << "You entered an invalid city number. The program will now terminate." << endl; invalid_data = true; return 0; } else invalid_data = false; cout << "How many tickets do you wish to purchase? "; cin >> NUM_TICKETS; CHARGE = NUM_TICKETS * price[cities - 1]; cout << "The total cost is $" << CHARGE << endl << endl; grand_total += CHARGE; cout << "Do you want to purchase more tickets? " ; cin >> response; } while (response == 'Y' || response == 'y') Get_Valid_Code(); cout << endl << endl; cout << "The Grand Total is $" << grand_total << endl; return 0; } | https://www.daniweb.com/programming/software-development/threads/198193/need-help-with-grand-total-of-ticket-sales | CC-MAIN-2017-26 | refinedweb | 250 | 72.46 |
Sweet Swift
Make Swift Sweet by Gracefully Introducing Syntactic Sugar, Helper Functions and Common Utilities.
Design Principles
For Apple, Swift should be a clean and tidy language. For developers, the cleanness and tidiness could sometimes cause a lack of features which could be very painful. This package aims to solve this problem! I’m determined to help developers be happier and make swift sweeter!
However, to add new features, we should follow these guidelines. Otherwise, the language will become bulky and clumsy.
- Modular
Organize features into sub-modules so that developers can import the library partially.
- Grouped into Different Flavors
Everyone has his preference for flavors. When imported, developers can choose according to their style.
- Correctness
Setup complete test suites for every feature.
- Efficiency
Always choose the implementation with the best space and time complexity.
Usage
import sweet_swift // Now you can use the features introduced by this library // Some of the examples: var num = 0 // unary increment print(++num) // unary decrement print(--num) var string = "abc" // integer indexing for string print(string[0..<2]) // indexing acts as deleting string[0..<2] = nil
RoadMap
- Unary Increment and Decrement Operator
- Integer String Indexing
- Find SubString More Easily
How to Contribute
Contribute Code
- Follow the Design Principles
- Each Commit Should Serve Only One Purpose
Contribute Ideas
- Raise Issues to Suggest New Features and Ideas to Me
About Me
Hi, I’m Yanzhan
. I’m interested in all kinds of algorithmic problems. If you want to learn more about algorithmic problems, please visit my Youtube Channel 📹, Twitter Account 📱, GitHub Repo 📝 or My HomePage 🏠. | https://iosexample.com/make-swift-sweet-by-gracefully-introducing-syntactic-sugar-helper-functions-and-common-utilities/ | CC-MAIN-2022-33 | refinedweb | 259 | 56.66 |
Leonhard Euler created the following magic square.
This magic square has three properties:
- Each row and each column sums to 260.
- Each half-row and each half-column sums to 130.
- The sequence of squares containing 1, 2, 3, …, 64 form a knight’s tour.
The following Python code verifies that the magic square has the advertised properties.
# Euler's knight's tour magic square a = [[ 1, 48, 31, 50, 33, 16, 63, 18], [30, 51, 46, 3, 62, 19, 14, 35], [47, 2, 49, 32, 15, 34, 17, 64], [52, 29, 4, 45, 20, 61, 36, 13], [ 5, 44, 25, 56, 9, 40, 21, 60], [28, 53, 8, 41, 24, 57, 12, 37], [43, 6, 55, 26, 39, 10, 59, 22], [54, 27, 42, 7, 58, 23, 38, 11]] # Divide the chess board into four 4x4 blocks. # Verify that in each block the rows and columns sum to 130. # It follows that each entire row and entire column sums to 260. for hblock in [0, 1]: for vblock in [0, 1]: for i in range(0,4): row_sum = col_sum = 0 for j in range(0,4): row_sum += a[hblock*4 + i][vblock*4 + j] col_sum += a[hblock*4 + j][vblock*4 + i] assert(row_sum == 130) assert(col_sum == 130) # Report whether it is legal for a knight to move from a to b. def knight_move(a, b): return ((abs(a[0] - b[0]) == 2 and abs(a[1] - b[1]) == 1) or (abs(a[0] - b[0]) == 1 and abs(a[1] - b[1]) == 2)) # Map each square to its coordinates. coordinate = {} for row in range(0, 8): for col in range(0, 8): coordinate[ a[row][col] ] = (row, col) # Verify that the sequence of numbers are legal knight moves. for i in range(1, 64): assert knight_move( coordinate[i], coordinate[i+1] ) # If the script gets this far, no assertion failed. print "All tests pass." | https://www.johndcook.com/blog/magic_knight/ | CC-MAIN-2019-30 | refinedweb | 316 | 75.34 |
The next big problem is finding a way to display a depth frame.
As the data take the form of a 13-bit image the most obvious thing to do is convert it into a grey scale image.
This is where we hit a small snag. While Windows Forms supports the Format16bppGrayScale constant it doesn't actually support the type. That is you can't load up a Bitmap object with grey scale data and then display it using a PictureBox - it just shows as a big red cross.
So what can we do?
One answer, although it is a bit of a cheat, is to simply use the Format16bppRgb555 format which is supported. This treats a 16-bit value so that 5 bits are used for each of R,G and B and the topmost bit is ignored.
We can use the same technique as explained in the previous chapter to move the data into a Bitmap.
First we create a Bitmap object of the right size and color format:
Bitmap bmap = new Bitmap( PImage.Width, PImage.Height, PixelFormat.Format16bppRgb555);
Next we create and lock a BitMapData object using the same size and format:.Height);bmap.UnlockBits(bmapdata);
To make this work we need to add:
using System.Drawing.Imaging;using System.Runtime.InteropServices;
at the start of the program.
If you now place a PictureBox control on the form you can view the depth data:
pictureBox1.Image = bmap;.
If you want to use WPF then things are a little easier but there are still some odd problems to sort out. The WPF BitmapSource class does support a much wider range of pixel formats. including gray16.
To convert the PlanarImage to a BitmapSource is almost trivial:
BitmapSource DepthToBitmapSource(. | http://www.i-programmer.info/ebooks/practical-windows-kinect-in-c/3802.html?start=1 | CC-MAIN-2016-40 | refinedweb | 289 | 72.26 |
Microsoft
Version 2.0
October 2002
Download Petshop.msi.
Abstract
Comparison of Lines of Code Required
Introduction
Overview of Java Pet Store
Functional Walkthrough
The Microsoft .NET Pet Shop
Comparing the Code Size
XML Web Services
Conclusion
Appendix 1: Counting the Lines of Code
The original purpose of this study was to take Sun's®'primary J2EE BluePrint application, the Sun Java Pet Store, and implement the same functionality using Microsoft .NET. Based on the .NET version of Sun's J2EE best-practice sample application, customers could directly compare Microsoft .NET to J2EE-based application servers across a variety of implementations. In addition, the study compared the architecture and programming models of each platform to evaluate relative developer productivity.
In addition to the original purpose, .NET Pet Shop has now been extended to demonstrate how to implement distributed transactions in .NET. In addition to distributed transactions, there is also a demonstration of the .NET Data Cache API, some examples of Server Controls, and an example of extending the ASP.NET repeater control as an alternative to DataGrids.
Source code to the Java Pet Store application is publicly available at the Java 2 Platform Enterprise Edition BluePrints Web site.
Figure 1: Lines of Code Comparison
The .NET Pet Shop was first published in November 2001 to demonstrate a best practices architecture when developing .NET applications. A secondary goal was to compare and contrast the .NET best practices with those put forward by Sun for developing J2EE applications. Two metrics were chosen for this comparison and these were performance, how fast does the application respond to user requests under load, and lines of code to develop the application.
The lines of code metric was chosen to try and measure the productivity of developers creating the application and how easy it is to maintain the application. This may seem a little arbitrary given automatic code generation in some IDEs but should a developer want to make modifications to an application then they will need to look at and understand all the code in the application. Another reason this metric has relevance is that in general application contain less bug and perform better the fewer the lines of code they have.
After four weeks of development a team of two software engineers had taken the functional features of Sun's Java Pet Store and created a functionally equivalent application using the Microsoft .NET framework. They had accomplished this in a quarter of the lines of code of the original Sun version and when tested in a lab, was over 10 times faster than a tuned version published earlier in the year by Oracle.
Having shown the advantages of developing an application in the .NET framework we wanted to extend the .NET Pet Shop to demonstrate some more aspects of .NET. The main feature we wanted to demonstrate was how to implement a distributed transaction in .NET by using Enterprise Services. We have also added some examples of data caching.
Learn more about implementing database transactions in Implementing Database Transactions with Microsoft .NET.
The Java Pet Store is a reference implementation of a distributed application according to the J2EE BluePrints maintained by Sun Microsystems. The Java Pet Store was created by Sun to help developers and architects understand how to use and leverage J2EE technologies, and how J2EE platform components fit together. The Java Pet Store BluePrint includes documentation, full source code for the Enterprise Java Beans™ (EJB) architecture, Java Server Pages (JSP) technology, tag libraries, and servlets that build the application. In addition, the Java Pet Store BluePrint demonstrates certain models and design patterns through specific examples. The Java Pet Store is a best-practices reference application for J2EE, and is redistributed within the following J2EE-based application server products:
The full Java Pet Store contains three sample applications:
The Java Pet Store application is designed as a J2EE "best-practices" application. The application provides an emphasis on the features and techniques used to show real world coding examples.
Java Pet Store is an e-commerce application where customers can buy pets online. When the application is started, users can browse and search for various types of pets.
A typical session using the Java Pet Store is as follows:
The goal of the .NET Pet Shop was to focus on the Java Pet Store application itself (the administration and mailer component were not ported to .NET in this implementation). In addition to reproducing the functionality of the Java Pet Store application, two additional objectives were added:
Figure 2: The Microsoft .NET Pet Shop
The logical architecture of the .NET Pet Shop is detailed in Figure 3.
There are three logical tiers: the presentation tier, the middle tier, and the data tier. The tiers allow for clean separation of the different aspects of a distributed application. The business logic is encapsulated into a .NET Assembly (implemented as a C# Class Library).
The database access is funneled through a class that handles all interaction with the SQL Server Managed provider. In the original version of the .NET Pet Shop, access to the data stored in the database was accomplished through stored procedures. Although this architecture is the best way to access data in SQL Server, it was decided to convert the application to use dynamic SQL from the middle tier. The application represents a complete logical three-tier implementation using .NET and illustrates coding best-practices for the Microsoft .NET platform.
Figure 3. .NET Pet Shop Logical Architecture
Figure 4. Sample .NET Pet Shop Physical Deployment Diagram
Many changes have been made to .NET Pet Shop since its original creation in October 2001. The main piece of new functionality is the inclusion of distributed transactions using .NET Enterprise Services and the Microsoft Distributed Transaction Controller (MS DTC). Here is a list of all the key changes that have been made to the application.
One of the most obvious changes is the move from stored procedures in the database to inline SQL in the middle tier. This change was made to demonstrate that the .NET Pet Shop and the .NET framework can perform equally well using middle tier SQL as opposed to stored procedures. One of the main reasons for the small performance difference between the two different database access approaches is that in the .NET Pet Shop the stored procedures wrapped simple database calls only. To ensure that the only performance benefit from the stored procedure was in the precompiled execution plan, no business logic was placed in the stored procedures. SQL Server caches all execution plans for queries, and since the .NET Pet Shop uses parameterized queries, the SQL Server engine will be able to use the execution plan cache.
Another important change is that, internally, the .NET SQL Server Data Provider uses the sp_executesql stored procedure when executing SQL statements which again takes advantage of cached execution plans. Best practices would still highly recommend the use of stored procedures for database access. In many cases there are real performance benefits from using stored procedures and it also provides an excellent way to encapsulate your database access. It allows database administrators to ensure that database access is properly tuned, because the database administrators have access to the exact SQL code that will run in the database.
Data caching has been added to demonstrate caching at multiple levels in the application. You can output cache the ASP.NET page itself, in this case the page rendering is cached on the web server based on properties such as the query string and post parameters.
It is also possible to cache data from the middle tier. Using the Data Cache API you can store the results of a middle tier method in the web tier. This allows you to store non-volatile data from the middle tier and provide un-cached fully dynamic pages in the web tier. It is also possible to use a combination of both caching techniques however we decided to just use data caching in this case.
The previous section addressed the high-level architecture of the application. This section will walkthrough a section of the code to gain a better understanding of how the application works. This will demonstrate the interaction between the presentation tier, the middle-tier, and the data tier. To further illustrate the design, we will take a detailed look at the interaction and implementation details at each tier for the shopping cart as shown in Figure 5.
In designing n-tier applications, there are a variety of approaches. In implementing the .NET Pet Shop, a data-driven approach was used.
Figure 5. Architecture Walkthrough
The database for the Java Pet Store is available in several database vendor formats. The first step taken was to port the Java Pet Store database schema to SQL Server 2000. This required no changes from the Sybase version of the schema. The database has the following overall structure of tables:
Table 1. Database Table Names
The complete physical database schema for the .NET Pet Shop is illustrated in Figure 6.
To demonstrate distributed transactions in .NET we decided to split the schema across two physical databases. The account, products and inventory data was left in the first database while the order related tables were moved to a second database. This can be seen in Figure 7. This means that the Place Order scenario the system now needs to modify data in two databases. The Order, OrderStatus, and LineItems data needs to be inserted into the second database and then the inventory tables need to be updated based on the products quantities purchased. As this is an atomic operation we needed to use the Microsoft Distributed Transaction Controller to ensure that either both databases commit their changes or neither database commits their changes.
Figure 6. .NET Pet Shop Physical Database Schema
Figure 7. Pet Shop schemas in the Distributed Transaction Scenario
The Sun Java Pet Store makes heavy use of Bean Managed Persistence (BMP) in its middle-tier Enterprise Java Beans (EJB). Essentially, this provides objects a mechanism to persist their state to the database. The .NET Pet Shop takes a different approach. The middle-tier components make specific database calls for each business method invoked. Version two varies from version one in that for .NET Pet Shop Version 2, we have moved the SQL code to the middle tier rather than residing in the database as stored procedures. Using stored procedures at the database level is well established as a best practice for distributed applications. It provides a cleaner separation of code from the middle-tier and also helps clarify the transaction context and scope. In the original Pet Shop the stored procedures had only contained basic queries; with all the business logic kept in the middle tier .NET classes. With the new version of Pet Shop, we wanted to show that the performance of the application did not originate from the use of stored procedures, and that the underlying .NET framework used in the web and middle tiers was the source of the .NET Pet Shop's superior performance.
Version 1 of the .NET Pet Shop used the OpenXML feature of SQL Server 2000 and was used to return XML documents instead of traditional rowsets. This was relied upon heavily in the order checkout process, because it simplified the number of parameters to be managed between the middle-tier component and the database stored procedures. With the move to the distributed database model and away from stored procedures, the architecture of the application was changed to use simple SQL queries. With the stored procedure model, we would recommend the use of OpenXML in your applications.
Sun uses Enterprise Java Beans (EJBs) to implement the business logic of the application. Sun implemented the application using a mix of Entity and Session Beans to handle all of the logic.
Table 2. Java Pet Store Business Logic
The .NET Pet Shop middle-tier business logic is encapsulated into a single .NET Assembly containing multiple C# clases. The namespace is called Pet Shop.Components as illustrated in Figure 8.
Figure 8. Middle-Tier Component Class View and Solution Explorer File View
There are eight core classes, each one is implemented in its own .cs file.
Table 3. Key Middle-Tier components
All middle-tier code is compiled into a single assembly. The code-behind logic for the web tier is compiled into a separate assembly.
For the code walkthrough, we will examine the shopping cart functionality for Java and .NET, starting with the Java Pet Store.
The ShoppingCart EJB is a Stateful Session Bean, meaning the object maintains its contents for a specific amount of time on the server while the client is making a request. One common task of any shopping cart page is to add items to the user's basket. Before adding an item, the application must first determine which product is being added. In order to get the product information we will take a look at CatalogDAOImpl.java:
public Product getProduct(String productId, Locale locale) throws
CatalogDAOSysException
{
String qstr =
"select productid, name, descn " +
"from " +
DatabaseNames.getTableName(DatabaseNames.PRODUCT_TABLE, locale) +
" where " +
"productid='" + productId + "'";
Debug.println("Query String is:" + qstr);
Product product = null;
Statement stmt = null;
ResultSet rs = null;
try {
getDBConnection();
stmt = dbConnection.createStatement();
rs = stmt.executeQuery(qstr);
while (rs.next()) {
int i = 1;
String productid = rs.getString(i++).trim();
String name = rs.getString(i++);
String descn = rs.getString(i++);
product = new Product(productid, name, descn);
}
} catch(SQLException se) {
throw new CatalogDAOSysException("SQLException
while getting " +
"product " + productId + " : " + se.getMessage());
} finally {
closeResultSet(rs);
closeStatement(stmt);
closeConnection();
}
return product;
}
Code Snippet from the Java Pet Shop
public static IList GetProductsByCategory(string category) {
IList productsByCategory = new ArrayList();
SqlParameter parm=new SqlParameter(PARM_CATEGORY,
SqlDbType.Char, 10);
parm.Value = category;
using (SqlDataReader rdr=Database.ExecuteReader(Database.CONN_STRING1,
CommandType.Text,
SQL_SELECT_PRODUCTS_BY_CATEGORY, parm)) {
while (rdr.Read()){
Product product = new Product(rdr.GetString(0),
rdr.GetString(1), rdr.GetString(2));
productsByCategory.Add(product);
}
}
return productsByCategory;
}
Code Snippet for .NET Pet Shop
Note that .NET version is making a call to ExecuteReader(). This is a method in our reusable Database class and in this case will execute a dynamic SQL statement returning a SqlDataReader (very similar to a read-only, forward-only cursor in ADO). We also make use of the using keyword, which will automatically call dispose on the SqlDataReader object at the end of the code block.
public static SqlDataReader ExecuteReader(string connString,
CommandType cmdType, string cmdText, params SqlParameter[] cmdParms) {
SqlCommand cmd = new SqlCommand();
SqlConnection conn = new SqlConnection(connString);
try {
PrepareCommand(cmd, conn, null, cmdType, cmdText, cmdParms);
SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
cmd.Parameters.Clear();
return rdr;
}
catch {
conn.Close();
throw;
}
}
Code Snippet from .NET Pet Shop Data Tier
The snippets of code for the .NET Pet Shop are essentially the skeleton for all data access in the application. The Java application data access mechanisms vary from EJB to EJB. There are some sessions objects, but for the most part the components are bean-managed, meaning that the object itself is responsible for persisting itself to the database, hence the inline SQL code.
The .NET Pet Shop is using ASP.NET Session state to store the contents of the shopping cart (matching the functionality of the Java Pet Store). The session state is stored in-process, but ASP.NET also includes the ability to run a dedicated State Server and supports SQL Server database session state as well. This becomes important when you want to create a clustered web tier for redundancy and scalability. By storing the Session state in a dedicated state server or in a SQL Server database the session data can be shared amongst the various servers running the application.
The presentation-tier for the Pet Shop was written using ASP.NET Web Forms combined with User Controls. The site was created with Visual Studio .NET and therefore uses code-behind where the code for each ASPX page is encapsulated into a separate file. The Java Pet Store makes heavy use of Servlets (or mini java-server programs that emit HTML). The Servlets are using a design pattern called the Model View Controller, allowing the data to be displayed and manipulated in several different ways. The .NET Pet Shop accomplishes this same functionality using the ASP.NET Server Controls in addition to the User Controls.
Since the .NET Pet Shop application makes uses of Server Controls and Session State, careful consideration was given to their parameters to achieve high performance. The configuration is detailed in Table 4. To ensure high performance, ViewState and SessionState were turned off for the entire web application using the web.config file, and then enabled in the pages that required these features.
Table 4. WebForm Session State and View State settings. These settings are included as 1-line directives at the top of the individual aspx files.
One of most effective ways to improve the performance of a database driven application is to eliminate accessing the database for every query. ASP.NET offers a variety of caching mechanisms that add considerable performance benefits to the application. The two foremost ways to use caching in ASP.NET are output caching and data caching.
Output caching takes the response from an ASP.NET web page and stores the page in a cache while the data cache is designed to work between the web tier and the middle tier and caches the data from middle tier methods, or the results of database calls in the case of two tier apps. The first .NET Pet Shop distribution was offered in an output-cached version and a non-cached version. With this version, we have removed all output caching and added data caching. This means that each web request results in a new page rendering.
ASP.NET Output Caching
Output caching is used to capture the contents of a page and store the results in memory. Subsequent requests for that page are served from the cache and do not require accessing the database. The Java Pet Store does not have a way to do this easily. While various J2EE application servers have output cache capabilities (for example, IBM Websphere 4.0 and BEA Weblogic Server), these features vary from product to product. Using these features may require modifying the Java Pet Store source code to work with a given J2EE application server.
The original .NET Pet Shop application (version 1.5, available at) also used Partial Page (Fragment) Caching to cache various Caching
The data cache (Cache API) allows you to store the results of a method call or database query in the internal caching engine with the .NET Framework. Since you have gone further through the application pipeline, the data cache may not offer the same performance boost that Output Caching yields. However, it does offer a good compromise between fully dynamic pages and reducing the load on the database by storing nonvolatile data in the middle tier. For example you may want to display the same piece of data differently in two web pages.
// Check the cache to see if the product data is in the cache
// If it is in the cache then use the cached copy otherwise fetch
it from the // middle tier components
if(Cache[Request[catKey]] != null){
products.DataSource = (IList)Cache[Request[catKey]];
}else{
IList productsByCategory = null;
productsByCategory = Product.GetProductsByCategory(Request[catKey]);
Cache[Request[category]] = productsByCategory;
products.DataSource = productsByCategory;
}
ASP.NET Data Cache Code Snippet
The sample code above shows how you would access the ASP.NET cache API and retrieve information from the cache. The example is based on the category query in the Pet Shop application where a user can select one of the five predefined categories of Pet and view of list of animals in the category. The first thing the code does is check to see if the data has already been cached by using the category id as a key to look up an element in the data cache, if this element does not exist (the data has not yet been cached), it will return null. If the element exists, the data from the cache is pulled and cast to the appropriate type. If the data is not in the cache, the standard mechanisms are used to pull the data from the middle tier objects.
Caching Options in ASP.NET
Entire page output is cached
Simple to implement
Limited to time invalidation
(Cache user controls)
Cached controls can be shared across pages
More control over what is cached
Cached data can be shared throughout web application
Finer control over the cached data. The Cache API provide ability to specify cache priorities, dependencies and callback functions to invalidate the cache from external applications. A sample graph is shown below, see Figure 9. It is also possible to monitor the turnover rate and the hit rate within Perfmon to detect whether the item is being used in the cache.
Figure 9. Using Perfmon to Monitor ASP.NET Caching
The error handling in the .NET Pet Shop has been simplified by using custom errors for ASP.NET. All thrown exceptions are now being caught in the Application_Error() method in the Globabl.asax.cs file.
/// <summary>
/// Global application level error handling. This method is invoked
/// anytime an exception is thrown.
/// </summary>
/// <param name="sender">Sender</param>
/// <param name="e">Event arguments</param>
private void Application_Error(object sender, System.EventArgs e) {
string err = "Microsoft .NET PetShop Application Error\n\n";
err += "Request: " + Request.Url.ToString() + "\n\n";
err += "Strack Trace: \n" + Server.GetLastError().ToString();
// write the error message to the NT Event Log
Components.Error.Log(err);
}
This allows the Pet Shop to have a global application-level error handling. If an error occurs, the user is directed to a default error page (Error.aspx). The full stack trace and requested URL that generated the error is then written to the Application Event Log for the system administration, preventing the end user from seeing an unhanded exception error in the browser.
Both the Java Pet Store and the .NET Pet Shop leverage a variety of security mechanism to prevent break-ins and attacks. The .NET Pet Shop uses ASP.NET Forms-based Authentication. These settings are centralized in the web.config file:
<!-- AUTHENTICATION
This section sets the authentication policies of the application.
Possible modes are "Windows", "Forms", "Passport" and "None"
-->
<authentication mode="Forms">
<forms name="Pet ShopAuth"
loginUrl="SignIn.aspx"
protection="All"
path="/" />
</authentication>
The Java Pet Store exhibits similar functionality, but security meta data is expressed in Web component deployment descriptors:
<web-app>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>login.jsp</form-login-page>
<form-error-page>login.jsp</form-error-page>
</form-login-config>
<login-config>
<web-app>
The security behavior of the Java Pet Store and the .NET Pet Shop are the same: ASP.NET allows the entire security configuration to be centralized into one configuration file while the Java version has several configuration files.
During the development of the .NET Pet Shop, we discovered bugs easily with the Visual Studio .NET integrated debugging. Before we could debug, we needed to ensure that our web.config had the debug attribute in the compilation element set to true.
<compilation defaultLanguage="c#" debug="true" />
Here is a typical debugging session for the Search.aspx WebForm. We have set a breakpoint right before we are going to do our data binding. You can also note that the input search text in this session was dog (see the lower left hand side of the screenshot).
Figure 10. Debugging in Visual Studio .NET
It is interesting to compare the overall lines of implementation code in the two versions of the application to get an understanding of the relative developer productivity in Microsoft .NET versus Sun's J2EE development platform. A comprehensive code-count reveals that the lines of code required to implement the Java Pet Store is over 5 times the amount of code required to implement the same functionality in the .NET Pet Shop. The following tables give a more complete break down by tier.
Table 5. Lines of code broken down by tier.
Figure 11. Lines of code broken down by tier.
The mechanism used to perform the code count is detailed in Appendix 1.
The Java Pet Store contains several complex design patterns that result in making the J2EE BluePrint application very challenging for developers to reuse. The Java Pet Store takes a complete object-oriented approach which results in very heavy middle-tier objects. The use of the J2EE-recommended bean managed persistence and other EJB functionality adds to the complexity of the design. The .NET Pet Shop takes a streamlined component approach with very small, light-weight objects that take advantage of several .NET features that significantly reduce the overall code size and increase developer productivity. For example, the use of ASP.NET Server Controls and ASP.NET Web Forms help reduce the server-side and client-side programming burden on developers significantly. In addition, the Java code has to manually update pages using its Model View Controller design pattern as opposed to the .NET code that uses DataBinding with ASP.NET Server Controls like the DataGrid.
On the data tier, the core database schema (the tables and all of the relationships and constraints) are virtually identical for both versions of the application. In both, the schema is roughly 400 lines of SQL code.
Using Visual Studio.NET, we quickly added an XML Web Service (based on the SOAP and UDDI standards) that returns the order details given an order ID. The sample XML output of the GetOrderDetails() SOAP method in OrderWebService.asmx Web Service is shown in Figure 12.
Figure 12. Results from .NET Web Service Call
The Java Pet Store is Sun's reference BluePrint application for building enterprise Web applications with the J2EE technology. The .NET Pet Shop is a BluePrint application that serves to highlight the key Microsoft .NET technologies and architecture that can also be used to build enterprise Web applications. Now architects and developers can compare .NET and J2EE side by side using functionally identical reference applications that illustrate best coding practices for each platform.
We were very careful to count Java Pet Store code only for the precise functionality implemented in the .NET Pet Shop application. Lines of code for the Administration functionality and the BluePrint Mailer application were not counted, since this functionality was not included in the .NET Pet Shop. In addition, we factored out code in the Java Pet Store used for supporting databases other than Oracle. To come up with line counts for both the Java and .NET versions of the code, we created a program that looks only at those lines considered important in each file. For instance, to count the lines of code in a file containing C# or Java code, we wanted to ignore blank lines and lines containing comments.
Table 6 describes in more detail what lines where counted in which types of files.
Table 6. Lines of code counted
In addition, for .asax, aspx, and .jsp files, if more than one server-side block (delimited by "<%" and "%>") appeared on the same line, each was counted as a separate line. For all other file types (e.g. .xml), all lines were counted. The line counting program was written as a lexical specification for lex, a readily-available lexical analyzer and code generator. In our case, we used flex, the GNU equivalent whose source code is freely available from the Free Software Foundation. Either can be used to produce a C source file from the specification file. The C file can, in turn, be compiled into an executable. A makefile for VC6 and VC7 is included in the distribution.
The usage of the program is quite simple. It accepts zero, one, or two command line arguments, depending on what kind of file is to be counted and whether the file to be counted is specified on the command line or piped in from another source. Table 7 describes the accepted command line arguments and how they are intended to be used.
Table 7. cloc command line arguments
Since the line counting program accepts no more than one file at a time, we also created a collection of batch files to help count all of the lines in all of the directories for both the Java and .NET versions. These files are also included in the distribution.
In our makefile, we decided to have flex produce a C source file with a .cpp extension. Since VC compiles files such as C++, this allowed us to use the bool type and gave us better type safety. However, it also expects an include file called unistd.h. This is a standard include file on many systems but is not part of Visual C++. This file does not contain any declarations relevant to our line counting tool, so using an empty file is fine.
If you would like to reproduce our line count results, you may run the batch files yourself. The first one, Extensions Used.bat, produces a listing of the file extensions used in a directory hierarchy. The path of the top-level directory of the directory hierarchy is specified as the only command line argument. Files without extensions do not show up in the listing, but there are no files without extensions we needed to count. This batch file was run on the Java and .NET versions to determine which file extensions each used. Table 8 shows the file extensions found in each version the extensions used to compute the total line counts for each.
Table 8. Extensions
The other two batch files, Count Java Lines.bat and Count .NET Lines.bat, count the number of lines in the files in the Java and .NET versions, respectively. These are separate batch files since the extensions those batch files looks for are different, as shown in Table 8. Both batch files take a single command line argument (the path of the top-level directory of the directory hierarchy) to search for files to count.
To get the line counts for the different tiers, we ran the batch files on specific subdirectories and only included specific extensions, as shown in Table 9.
Table 9. Final code breakdown
Determining a satisfactory line count across different file types is difficult enough without also attempting to count across different platforms. For instance, we did not count HTML files, because the tools used to generate them may format the code differently on different platforms, thus producing different line counts. Although this also applies to how the logic tier files are formatted, it is certainly illuminating that the difference in the line counts between the java files and the cs files is as large as it is. These numbers reveal the amount of infrastructure in the .NET platform in place to help developers concentrate on their problem domain, instead of concentrating on accounting for a lack of infrastructure.
We are required by the Sun Java Pet Store License to include the following legal information regarding the Java Pet Store application:
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
-Redistribution in binary form must reproduct. | http://msdn.microsoft.com/en-us/library/ms954626.aspx | crawl-002 | refinedweb | 5,229 | 56.15 |
online
Download and Installing Struts 2
Download Struts 2.0
In this section we will download and install the Struts 2.0 on the latest
version... development server. Then we will download Struts 2.0 and install the
struts
Download Struts 2.3.15.1
Download Struts 2.3.15.1
In this tutorial I will explain you how you can Download Struts 2.3.15.1 from
apache website and run the blank application... the website and download the latest version of Struts 2.
Website URL for downloading
Download Struts 2.1.8, Downloading and installing
Download Struts 2.1.8, Downloading and installing Struts 2.1.8... to download and then install Struts 2.1.8.
The latest version of Struts 2.1.8 can be downloaded from Struts
why cant i close this ??
why cant i close this ?? import java.util.Scanner;
public class square
{
public static void main ( String [] args)
{
Scanner keyboard = new Scanner (System.in);
int N;
N = keyboard.nextInt
Download and Build from Source
Download and Build from Source
Shopping cart application developed using Struts 2.2.1 and MySQL can be
downloaded from. Books
, and learn the
Struts HTML, bean, and logic tags. Type or download program...
Struts Books
Professional
Struts Books
versions of servlets and JSPs?
versions of servlets and JSPs? can you tell me the all versions of servlets and JSPs
Download
Download JDK How to Download the latest Version of JDK?
Download OST to PST converter from:
Download.
Download. I need a swing program to download a file from the server
hibernate versions
In this section, you will find links to the official documentation of different hibernate versions
download
download how to download the file in server using php
code:
"<form method="post" action="">
enter the folder name<input type="text" name="t1" >
<input type="submit" value="search" name="s1">
</form>
<
Struts Video Tutorials
to download Struts Official Examples
Struts 2 Tutorials - 3 - Introduction...Struts Video Tutorials - Now you can learn the Struts programming easily and
in less time. Struts Video tutorials are very extensive and explained
Download Tomcat
Download Tomcat
In this section we will discuss about downloading tomcat... what is Tomcat, tomcat components how to download Tomcat, tomcat releases, how... and some components are added in the newer
versions like Tomcat 7. Components
versions - Java Beginners
Struts 2.1.8 - Struts 2.1.8 Tutorial
, download and
install and then see the examples shipped with Struts distribution...
Struts 2.1.8
This section shows you how to download the latest version...
Struts 2.1.8 - Struts 2.1.8 Tutorial
http
iBufferedinput-cant read character # - Swing AWT
iBufferedinput-cant read character # i am using a buffersed stream to read some text.
ie inR=new InputStreamReader(in);
buf = new BufferedReader(inR) ;
buf.readLine()
actaually
Thanks
Struts 2.0.3 Released
download Struts 2.0.3 from.
...
Struts 2.0.3 Released
The Struts 2.0.3 is released and available for download. In this release
experimental features
Struts file uploading - Struts
Struts file uploading Hi all,
My application I am uploading files using Struts FormFile.
Below is the code.
NewDocumentForm... can again download the same file in future.
It is working fine when I.
MVC - Struts
MVC Can any one help me in good design of an struts MVC....tell me any e-book so that i can download from site
MySQL Download
MySQL Download
The
MySQL Download
MySQL software is published under an open source license... versions of Unix and Windows MySQL servers
*Converts indexes with2 - Struts
struts2 hello, am trying to create a struts 2 application that
allows you to upload and download files from your server, it has been challenging for me, can some one help Hi Friend,
Please visit the following
Textarea - Struts
characters.Can any one? Given examples of struts 2 will show how to validate... the value more then 250 characters and cant left blank.Index.jsp<ul><...;%@ taglib prefix="s" uri="/struts-tags" %><html><head>
download excel
download excel hi i create an excel file but i don't i know how to give download link to that excel file please give me any code or steps to give download link
Struts File Upload and Save
Struts File Upload and Save
... regarding "Struts file
upload example". It does not contain any... directory of server.
In this tutorial you will learn how to use Struts
What is Struts?
the latest download link from the
Struts download page.
Struts technologies...What is a Struts? Understand the Struts framework
This article tells you "What is a Struts?". Tells you how
Struts learning is useful in creating
Spring Integration 3.0 Release is released and available for download
Spring Integration 3.0 Release is released and available for download - It
supports Enterprise Integration Patterns
The Spring Integration project supports... of
deprecated API from previous versions
Maven dependency
If you are using
How to download JDK 1.6?
.
There are many versions of JDK for each platform, you can learn how to
download...Steps to download JDK 1.6
Video tutorial shows you the steps to download... if your are downloading the JDK for windows 7 64
bit.
Steps to download the JDK
Hii.. - Struts
://
Thanks.
Amardeep and Download
FileUpload and Download Hello sir/madam,
I need a simple code for File upload and Download in jsp using sql server,that uploaded file should... be download with its full content...can you please help me... im in urgent i have
What is Struts Framework?
What is Struts Framework? Learn about Struts Framework
This article is discussing the Struts Framework. It is discussing the main
points of Struts framework. If you are trying understand Struts and searching
for "What is Struts
Struts Projects
Struts project. Download
the source code of Struts Hibernate Integration Tutorial...
Struts Projects
Easy Struts Projects to learn and get into development ASAP.
These Struts Project will help you jump the hurdle of learning complex
Integrate Struts, Hibernate and Spring
.
Download Struts:
The latest version of Struts can be downloaded from.
We are using Struts version
Download Hibernate... website. To
download the code click here.
Extract "struts
Duplicate name in Manifest - Struts
Duplicate name in Manifest Hello I'm facing the following error when I run the struts application.
Mar 16, 2009 6:05:41 PM... profile.
Clean up the classpath for some older versions of Java/related JARs
Easy Struts
Easy Struts
The Easy
Struts project provides plug-ins for the Eclipse... by the Jakarta Struts framework.
Easy Struts is FREE and OPEN-SOURCE
Hibernate Tutorial
of Hibernate, How to download hibernate, Hibernate Versions etc.
What is Hibernate ?
Hibernate is a persistence tool for Java (supported versions Java SE... Community time-to-time releases its new versions, each
newer version contains
Struts 2.0.1
resources
You can download Struts 2.0.1 from http...
Struts 2.0.1
Now the new release of Struts 2 framework is available with new features and
enhancements. Now
shopping cart using sstruts - Struts
shopping cart using sstruts Hi,
This is question i asked ,u send one link.but i cant able to ddownload the file .please send the code file.
--------------
I need the example programs for shopping cart using struts | http://roseindia.net/tutorialhelp/comment/37564 | CC-MAIN-2015-48 | refinedweb | 1,203 | 68.47 |
ITWorx Geek
I was trying to include my ASP.NET MVC project in a TFS team build today but the build failed so I've investigated this issue and thought it will be helpful to share it with the community.
To get the MVC project build successfully with the team build make sure of the following:
- Your build server has the WebApplication targets file located in <Program Files> \MSBuild\Microsoft\Visual Studio\v9.0\WebApplications , if not . copy this file from your development machine to the same path in the build server.
- You have installed ASP.NET MVC framework in the Build server, this is the most important step otherwise you application will not build successfully in the team build you may faces some errors like :
error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
or
Controllers\RuleController.cs(31,10): error CS0246: The type or namespace name 'AcceptVerbs' could not be found (are you missing a using directive or an assembly reference?)
** Update
This will work with Beta version of ASP.NET MVC since the installation register the MVC assembly in GAC.
For preview versions , you can reference the DLL from your build project
<AdditionalReferencePath Include="C:\Program Files\Microsoft ASP.NET\ASP.NET MVC CodePlex Preview 4\Assemblies" />
Thanks !
Pingback from ASP.NET MVC Archived Blog Posts, Page 1 | http://weblogs.asp.net/hosamkamel/archive/2008/11/20/asp-net-mvc-project-and-team-build-issue.aspx | crawl-002 | refinedweb | 234 | 57.16 |
Jean-Marc Orliaguet a écrit :
I've done some work with ElementTree for CPSIO, and I haven't found it very easy to use because of all the extra namespace URI, and xpath stuff used for the tree navigation (xpath_findall, ..) which seem to get in the way. Also it could be that I find the DOM approach easier since I'm used to it in javascript already.
Advertising
The iterparse approach is by far the mots pythonic approach ever (tm): the URL, here is the RSS-reader-in-less-than-eight-lines example which is quite expressive:
""" from urllib import urlopen from cElementTree import iterparse for event, elem in iterparse(urlopen("")): if elem.tag == "item": print elem.findtext("link"), "-", elem.findtext("title") elem.clear() # won't need the children any more """This combines the simplicity of the ElementTree data structure with the possibility to stream-process your input in similar way to SAX, cleaning the memory as you go.
-- Olivier _______________________________________________ Zope3-dev mailing list Zope3-dev@zope.org Unsub: | https://www.mail-archive.com/zope3-dev@zope.org/msg02872.html | CC-MAIN-2016-44 | refinedweb | 170 | 50.16 |
#include <lvt/State.h>
Inheritance diagram for State:
[inline]
Default constructor.
Enables the State.
Disables the State.
Enables the State.
Returns true if the State is enabled, false if it is not.
Note that this does not return the current value of the portion of OpenGL state that the object represents. That is, this is not a wrapper around glGet*(). If a State object is enabled, it will enable and set the corresponding piece of OpenGL state when it is rendered.
[pure virtual]
Activates the State.
If the State is enabled, the corresponding piece of OpenGL state is enabled and its value is set, if appropriate. If the State object is disabled, the corresponding piece of OpenGL state is disabled.
Implements Node.
Implemented in Shader, Blending, MatrixMode, Culling, DepthTest, StencilTest, TextureState, TexGen, TexEnv, Texture, Texture1D, and Texture2D. | http://liblvt.sourceforge.net/doc/ref/class_l_v_t_1_1_state.html | CC-MAIN-2017-17 | refinedweb | 137 | 68.47 |
When you add a new volume to an existing VxVM device group, perform the procedure from the primary node of the online device group.
After adding the volume, you need to register the configuration change by using the procedure SPARC: How to Register Disk Group Configuration Changes .administer RBAC authorization on any node of the cluster.
Determine the primary node for the device group to which you are adding the new volume.
If the device group is offline, bring the device group online.
Specifies the name of the node to which to switch the device group. This node becomes the new primary.
Specifies the device group to switch.
From the primary node (the node currently mastering the device group), create the VxVM volume in the disk group.
Refer to your Veritas Volume Manager documentation for the procedure used to create the VxVM volume.
Synchronize the VxVM disk group changes to update the global namespace.
# cldevicegroup sync
SPARC: How to Register Disk Group Configuration Changes (Veritas Volume Manager). | http://docs.oracle.com/cd/E19316-01/820-4679/cihdggdc/index.html | CC-MAIN-2015-22 | refinedweb | 167 | 57.37 |
In this video we see how Microsoft ASP.NET AJAX helps web developers make network callbacks directly from client-side script code. We see also how an ASP.NET AJAX-enabled web service generates the JavaScript needed to call the web service.
Presented by Joe Stagner
Duration:
15 minutes,
26 seconds
Date: 26 January 2007
Watch
Video
|
Download
Video
|
VB Code
C# Code
Video downloads:
WMV
|
Zune
|
iPod
|
PSP
|
MPEG-4
|
3GP
Audio downloads:
AAC
|
WMA
|
MPEG-4
|
MPEG-3
|
MPEG-2
Hi,
Can I invoke server side calls from javascript without invoking a web service?
Sure - you can use GET and OST directly.
When you are calling web service class from JavaScript, remember to call with full qualifier for the web service class.
my javascript is weak so correct me here. You misspelled 'return' in the script and the popup still shows. There is an error on the page still though. How is this possible? I would have expected no popup.
darthocellaris: I had the same problem encountering javascript error stating 'SimpleService' is undefined. I figured out that a namespace is needed. Here, the namespace I used is AJAXEnabledWebSite1.
ret = AJAXEnabledWebSite1.SimpleService.SayHello(document.getElem entById('Text1').value, OnComplete, OnTimeOut, OnError);
darth.... browsers handle JS errors differently but often try to keep going, especially if you have client errors turned off in the browser.
Suppose the Name entered is 'Anat' and I want to keep this value in a session field or somewhwere in the server. How can I use the web service to get this value?
Thankyou
Anat
Anat raises an interesting point - is there a way to sync server-controls with what gets changed as a result of the callback? I.E. - if we change a list of values (say, a dropdownlist), viewstate is not updated on the server and any selections may no longer be valid...
When i try to return a data table from the web service it is throwing a error "A circular reference has been detected while serializing an object of type 'System.Reflection.Module'
", why this error is comming and how can i over come this error
You can't automagically pass all server side objects to your client side code.
Try manually serializing your Table to JSON or POX and then you can process the data sumply in your clint side Javascript code.
Hi Sir!
I'm from Iran.
As you see my name is hasan.
These Videos are really helpfull.
Special Thanks to you.
But Ineed Your Help because really i want to learn AJAX.
When i need your help, Do you help me?
JoeStagner, you have mentioned that we have to use GET and POST directly, to invoke invoke server side calls from javascript without invoking a web service.
Do you have any sample for this? or can you please let me know in detail how can I achieve this?
I would like to use it.
In 3.5 or 2008 it shows for the
var ret = SimpleService.SayHello(document.getElementById('Text1').val ue, OnSuccess,OnFailure, "UserContextDataHere");
Only OnSuccess and OnFailure, no OnTimeout and allows UserContext data being sent around etc.
This correct?
Sarkie
Sarkie - that's correct. If the error is a time-out the error message will contain that data,
Great show case...
Questions: If my business logic need to wait until server callback complete before I can proceed to the next line of code, how I can do it? Any sample?
For example, before save a record, I validate on duplicate entry against database records. If web method return "0", then only I proceed with the next validation. Please advise.
Thanks!
I'm having the same error that eunicep was having - a Javascript error that states that the service name is undefined. I'm not sure where to find the namespace for the site?
Can anyone point me in the right direction?
I solved my problem by registering the web service in VS.
Hi Joe,
How can I call server side method (public method in codebehind class) from javascript similar to the call that you made to web service?
Thanks,
-Asif
It is simple and good....
Hi Asif,
You can call server side method by calling onserverclick=method() on html button in source rather than calling onclick for html button.
Thanks
hello
I followed the vedio and do what he did in the vedio,then run the website,and i click the button,but no popup .there is nothing while I am clicking,what happened? could any one tell me about it .thank u
Many thanks Joe for the excellent video series
Hello Joe,
I would be interested to know if the same calls you made in this example in an aspx page can be made from a simple html page.
The reason is that I have some existing web services I would like to use on some old html pages.
very good article... really helpful....
I appreciate these series a lot htnak you!
May I ask you sth tough .. which server side types are ready to go for this and which need to be manually serialized?
string and int only I suppose .. you know web is big .. its easy just to pop up a question here .. you know the best programmer is the lazy one :)
cheers!
Thanks for videos!
I've got a question: is there any way to call client javascript after UpdatePanel postback is done?
Thanks !
I open your sample project as a Web Site in VB 2008. Everything works fine.
But when I import the 2 items .aspx & .asmx into an ASP.NET web application. I keep getting "SimpleService" is undefined error.
What I need to do to fix this problem for it to run under ASP.NET web application?
I m also getting the same error that SimpleService is undefined. The application compile fines.
No issues with references but fails when click on button to invoke service.
Joe
I've been using your technique for over a year now and just moved to VS 2008. I tried the same technique and got the service is undefined error in Javascript.
I noticed when creating the web service under 2008 it didn't add the simpleservice.cs file to the App_Code as it does in 2005. I manually created an App_Code folder, moved the SimpleService.cs file into it (can't do this in VS, use file manager) and edited the .aspx file to have one line, thus:
<%@ WebService Language="C#" CodeBehind="~/App_Code/SimpleService.cs" Class="SimpleService" %>
And all works!
In a nutshell if you want this to work, do it in VS 2005, test and then upgrade to 2008 and all is well. Looks like a bug in the web service creation process in VS 2008. I would be really interested to know it this is the case.
very good thanks!
Joe done well!
I would have saved a lot of hassle if I would have looked at your video first before trying all the other 'examples' out there. Nice job, you got me started only, but in the right direction. However,
the VB gave me an error in the SimpleService.vb in the App_Code folder on this line: <System.Web.Script.Services.ScriptService()> _ why? even though I prefer C#, I want to know. But the C# works fine if I upgrade to 3.5 thanks.
Hello Sir,
Its Cool to see how you explain this so elegantly. Anyways you might want to check the retunr(true) typo on your Javascript button clic event handler.
Hi, I have been using this for some small pages for a while thanks to your video and it works very quickly. However, I've come across a method I had to make that is slow (gathering records) and I need to adjust the timeout. I've found other pages that mention httpRuntime executionTimeout="seconds" in the Maching or Web.config, but that didn't do anything for me with this set up of a ScriptService called from js rather than a normal WebService().
Does anyone know how to set OnTimeOut to wait longer?
Thank you for the video Joe. I has some error when i changed the ret name to retrieved value.So, is there any way we can see the different functions syntax in
System.Web.Script.Services.ScriptService
Thank you.
Thanks Joe..Its very nice..coool
hari(eis-trivandrum)
Thanks, lately I need this
hi Joe, thanks for your videos, they are very helpful.
I had a question:
On this example when you run it you have a javascript error, I can see it on then status bar. If you had turned on alerts you'd had an error popup.
Have you checked that?
it very Good Example
Thanks for the video.
I am getting an error...."SimpleService is undefined"
Plz resolve this.
You must be logged in to leave a comment.
Advertise |
Ads by BanManPro |
Running IIS7
Trademarks |
Privacy Statement
© 2009 Microsoft Corporation. | http://www.asp.net/learn/videos/video-79.aspx | crawl-002 | refinedweb | 1,491 | 75.91 |
pyitect 0.1.15
A package for structuring a modeler project architecture via plugin like modules
A architect inspired plugin framework for Python 3.4+
a plugin to pyitect is simply a folder with a .json file of the same name inside
/Im-A-Plugin Im-A-Plugin.json file.py
A plugin has a name, a version, an author, a .py file, and it provides Components used to build your aplication. components are simply names in the module’s namespace after the file is imported
a plugin’s json file provides information about the plugin as well as lists components it provides and components it needs on load
here’s an example, all feilds are manditory but the consumes and provides CAN be left as empty containers, but then the plugin would be useless would it not? not providing components and all?
{ "name": "Im-A-Plugin", "author": "Ryex", "version": "0.0.1", "file" : "file.py", "consumes": { "foo" : "*" }, "provides": [ "Bar" ] }
a plugin can provid version requierments for the components it’s importing
a version string is formated like so
plugin_name:version_requierments
both parts are optional and an empty stirng or a string contaiing only an ‘*’ means no requierment a version requierment can include logical operators to get version greater than or less than the spesifiyed value, you can evem select ranges
here are some examples
"" // no requierment "*" // no requierment "FooPlugin" // from this plugin and no other, but any version "FooPlugin:*" // from this plugin and no other, but any version "FooPlugin:1" // from this plugin and no other, verison 1.x.x "FooPlugin:1.0" // 1.0.x "FooPlugin:1.0.1" // version 1.0.1 or any post releace "FooPlugin:1.0.1-pre123" // 1.0.1-pre123 -> this exact version "FooPlugin:1.0.1.1" // oh did I not menchin that your version strings cna basicly go on forever? chouse your own style! "FooPlugin:1.2" // 1.2.x and any pre/post/dev releace "FooPlugin:>1.0" // greater than 1.0 "FooPlugin:>=1.2.3" // greater than or equal to 1.2.3 "FooPlugin:<=2.1.4" // less than or equal to 2.1.4 "FooPlugin:>1.0 <2.3" // greater than 1.0 and less than 2.3 "FooPlugin:1.0.5 - 2.4.5" // between 1.0.5 and 2.3.x inclusive "FooPlugin:1.0 || 2.5.1" // either 1.0.x or 2.5.1 "FooPlugin:1.0 || 2.3.3 - 3.1.0 || >=4.3 <5.2.6-pre25" // get real complicated, cause you know, you might need it.
inside your plugin files you need to get acess to your consumed components right? heres how you do it
#file.py from PyitectConsumes import foo class Bar(object): def __init__(): foo("it's a good day to be a plugin")
Here’s how you set up a plugin system
from pyitect import System #incase you need to spesify versions for plugins that dont have a default #or you need to besure a spesfic version is used, #you can suply a mapping of compoent names to version strings on system setup system = System({foo: "*"}) system.search("path/to/your/plugins/tree") Bar = system.load("Bar")
For more information checkout the tests directory, it sould be a farily straite forward explination
- Downloads (All Versions):
- 28 downloads in the last day
- 378 downloads in the last week
- 2033 downloads in the last month
- Author: Ryexander
- Keywords: architect project modeler plugin
- License: ISC
- Categories
- Development Status :: 4 - Beta
- Intended Audience :: Developers
- Intended Audience :: Information Technology
- License :: OSI Approved :: ISC License (ISCL)
- Natural Language :: English
- Operating System :: OS Independent
- Programming Language :: Python
- Programming Language :: Python :: 3
- Programming Language :: Python :: 3.4
- Topic :: Software Development
- Topic :: Software Development :: Libraries
- Topic :: Software Development :: Libraries :: Application Frameworks
- Package Index Owner: Ryexander
- DOAP record: pyitect-0.1.15.xml | https://pypi.python.org/pypi/pyitect/0.1.15 | CC-MAIN-2016-07 | refinedweb | 636 | 55.34 |
Maven: 400 Bad Request uploading packages to GitLab - issue introduced in 12.10.14
SummarySummary
Customers are reporting that when they upgrade from 12.10.x to 12.10.14, Maven package uploads to the GitLab package repo fail with
400 Bad Request
- Customers are confirming that downgrading to 12.10.13 resolves the issue for them.
This was also encountered internally doing testing for another ticket.
- Downgrading GitLab to 12.10.13 fixed the issue - ie, re-running the exact same job succeeds.
WorkaroundWorkaround
- Downgrade to GitLab 12.10.13
- Upgrade to GitLab 13.0.9 or higher as soon as possible.
Work requiredWork required
As 12.10 is now not receiving bug fix updates, this issue is tracking and documenting the regression in 12.10.14
When the issue becomes scheduled for work, please investigate why the regression was not identified prior to 12.10.14 being released. Automatic testing should have identified that pushing Maven packages was not possible?
Customer tickets (internal)Customer tickets (internal)
-
-
-
-
Steps to reproduceSteps to reproduce
- Deploy example project to 12.10.13
- Run the manual maven repository job.
- It should succeed, and upload a small package to GitLab.
- Upgrade to 12.10.14
- Re-run the job. It'll fail.
Example ProjectExample Project
(This doesn't reproduce on GitLab.com, but this was pushed from a project that reproduces it on 12.10.14)
What is the current bug behavior?What is the current bug behavior?
What is the expected correct behavior?What is the expected correct behavior?
Relevant logs and/or screenshotsRelevant logs and/or screenshots
See attachments linked above for full output
12.10.1312.10.13
[INFO] [INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) @ maven-smoke-test --- Downloading from gitlab-maven: Uploading to gitlab-maven: Uploaded to gitlab-maven: (2.8 kB at 1.9 kB/s) Uploading to gitlab-maven: Uploaded to gitlab-maven: (3.2 kB at 3.7 kB/s) Downloading from gitlab-maven: Downloaded from gitlab-maven: (356 B at 890 B/s) Uploading to gitlab-maven: Uploaded to gitlab-maven: (785 B at 1.1 kB/s) Uploading to gitlab-maven: Uploaded to gitlab-maven: (399 B at 570 B/s) [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 19.218 s [INFO] Finished at: 2020-07-16T07:34:51Z [INFO] ------------------------------------------------------------------------ Job succeeded
12.10.1412.10.14
[INFO] [INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) @ maven-smoke-test --- Downloading from gitlab-maven: Uploading to gitlab-maven: Uploading to gitlab-maven: [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 16.389 s [INFO] Finished at: 2020-07-16T07:23:12Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project maven-smoke-test: Failed to deploy artifacts: Could not transfer artifact com.gitlab:maven-smoke-test:jar:1.0.3915-20200716.072311-1 from/to gitlab-maven (): Transfer failed for 400 Bad Request -> [Help 1] [ERROR]
Output of checksOutput of checks
Results of GitLab environment infoResults of GitLab environment info
This is run on 12.10.13; the only change made was
yum downgrade gitlab-ee-12.10.13
Expand for output related to GitLab environment info
System information System: Proxy: no Current User: git Using RVM: no Ruby Version: 2.6.6p146 Gem Version: 2.7.10 Bundler Version:1.17.3 Rake Version: 12.3.3 Redis Version: 5.0.7 Git Version: 2.26.2 Sidekiq Version:5.2.7 Go Version: unknown GitLab information Version: 12.10.13-ee Revision: ec145a32727 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 11.7 URL: HTTP Clone URL: SSH Clone URL: [email protected]:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers: GitLab Shell Version: 12.2.0 Repository storage paths: - default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
Results of GitLab application CheckResults of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 12.2.0 ? ... OK (12.2? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 2/1 ... yes 2/2 ... yes 2/3 ... yes 2/4 ... yes 2/6 ... yes 2/7 ... yes 4/8 ... yes 2/9 ... yes 2/10 ... yes 2/11 ... yes 2/12 ... yes 2/13 ... yes 2/14 ... yes 6/15 ... yes 6/16 ... yes 2/17 ... yes 8/19 ... yes 8/20 ... yes 8/21 ... yes 4/22 ... yes 4/23 ... yes 2/24 ... yes 14/26 ... yes 14/27 ... yes 2/28 ... yes 2/29 ... yes 15/31 ... yes 15/32 ... yes 15/33 ... yes 2/34 ... yes Redis version >= 4.0.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.6) Git version >= 2.22.0 ? ... yes (2.26.2) Git user has default SSH configuration? ... yes Active users: ... 3 Is authorized keys file accessible? ... yes Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
Possible fixesPossible fixes
Support identified the follow as the root cause: | https://gitlab.com/gitlab-org/gitlab/-/issues/229482 | CC-MAIN-2020-40 | refinedweb | 889 | 53.17 |
I am developing a ticketing system using JavaFx. When the user selects a particular ticket in the table and clicks the "Edit" button, the data in the selected row is loaded into the corresponding fields in the form below. The user can then make changes and update the information.
However, I am having problems figuring out how to set the text in the choice boxes for "Status" and "Severity" to the text in the selected row. This is the code I have for the edit button so far:
@FXML
private void editButtonFired(ActionEvent event) {
try {
int value = table.getSelectionModel().getSelectedItem().getTicketNum();
JdbcRowSet rowset = RowSetProvider.newFactory().createJdbcRowSet();
rowset.setUrl(url);
rowset.setUsername(username);
rowset.setPassword(password);
rowset.setCommand("SELECT * FROM s_fuse_ticket_table WHERE ticket_id = ?");
rowset.setInt(1, value);
rowset.execute();
while(rowset.next()) {
ticketNumber.setText(rowset.getString(1));
summary.setText(rowset.getString(2));
}
}catch (SQLException e){
}
}
Call
choiceBox.setValue() to set the value of the choice box:
import javafx.scene.control.ChoiceBox; ChoiceBox cb = new ChoiceBox(); cb.getItems().addAll("item1", "item2", "item3"); cb.setValue("item2");
Answers to follow-up questions
So I have already set the values for the choice box in the fxml
Probably not. Probably you have set the items and not the value (which is fine). For your use case, you couldn't set the value in FXML because the value is not known until the user selects the related line item in your master table.
When I try to use the setValue() method to set the value retrieved from the table I get an error saying: incompatible types:
String cannot be converted to CAP#1 where CAP#1 is a fresh type-variable: CAP#1 extends Object from capture of
I have never experienced such an error message before. For what it is worth, there is some info on it here: incompatible types and fresh type-variable, though I confess I do not directly see the relevance to your situation. My guess is that you are not defining the type of items for the ChoiceBox or are defining them as something other than a String. You can set the type explicitly using:
ChoiceBox<String> cb = new ChoiceBox<>();
As you are using FXML, the choicebox definition would not use the new keyword and would just be similar to below:
@FXML ChoiceBox<String> cb;
If the type of your ChoiceBox is something other than String, then you may need to set a converter on it.
There are too many unknowns from your question to provide a more specific answer. | https://codedump.io/share/fOcJwBbuiPcK/1/how-to-set-text-in-a-javafx-choice-box-based-on-selected-row-in-a-table | CC-MAIN-2018-13 | refinedweb | 419 | 52.49 |
I need some assistance writing syntax to pick the last four data points for a hospital. IN my data set hospitals report data on a monthly basis. The challenge is that not all hospitals have data for each month. So I need to select the last four data points which could represent the last four months or sporadic reporting over the past year. I have tried the select top scores and and a series of if statements but I can't get it to work. Any assistance would be appreciated.
Answer by dmatheson (216) | Jun 18, 2013 at 02:32 AM
Clay,
Given the structure of your data, the following would let you select the last 4 reports for each measure for each hospital. I didn't see anything in the data that corresponded to topic, but you can generalize the nesting of variables that are listed after the BY keyword in the rank command.
AUTORECODE VARIABLES=OrganizationID MeasureID
/INTO hosp_num measure_num
/PRINT.
rank variables = enddate (d) by hosp_num measure_num
/rank into recency .
select if (recency <= 4).
EXECUTE.
I autorecoded the hospital and measure variables because they're string and RANK requires numeric variables. Note that if you applied the commands to a different data set where the set of hospitals and measures did not match those of the current file, the numeric codes for
hosp_num and measure_num may refer to different hospitals or measures than they do for this file. You may want to use a RECODE command to specify the numeric recodes specifically, rather than an autorecode, if that scenario is likely to unfold.
I noticed that the 4 most recent hospital-measure combinations included the baseline data point. You didn't mention whether you wanted to keep or discard the baseline in the selection.
Jon, could you comment on whether using RANK with several different BY combinations is likely to lead to resource or overflow problems?
David
Answer by JonPeck (4671) | Jun 06, 2013 at 04:46 PM
The basic command for this is USE, but you need to know the number of cases in order to back off from that. The easiest way to do this would be to use a little Python code (requires the Python Essentials available through this site). Here is an example.
begin program.
import spss, spssaux
casecount = spssaux.getShow("N")
spss.Submit("use %s thru last" % (int(casecount)-3))
end program.
Note that the case count is not always known until the data have been passed if the data source is not a Statistics sav file.
Answer by ClayGemmill (0) | Jun 10, 2013 at 02:32 PM
Jon,
Thank you for your response. I have never used Python so I will have to try this. I do have some additional questions. When using the example above, how should the file be organized? For example I have a rate for falls. I can structure my file with many records for each hospital or one record with Falls1, Falls2, to represent each data point.
Secondly in the code provided where do I insert the name of my variable that list each case? Currently I have falls1, falkls2, etc...
Answer by dmatheson (216) | Jun 10, 2013 at 04:26 PM
I interpreted the question somewhat differently than Jon. His Python code selects the last 4 cases in the file. My reading was that there were many hospitals represented in the file and that the goal was to save the 4 most recent cases for each hospital.
Suppose that your data is organized so that there is one case for each monthly report by each hospital, where hospital is the ID variable and report_date is a date variable with the date of the case report. The following syntax will select the last 4 cases for each hospital.
rank variables = report_date (d) by hospital/ rank into recency .
select if (recency <= 4).
EXECUTE.
The date for each case is ranked in descending order for each hospital and that rank is stored in the variable recency. Recency will equal 1 for the most recent report by a hospital, 2 for its next most recent report, etc. Note that Hospital must be a numeric variable to be used by RANK. If your current hospital ID variable is a string, then you could use the AUTORECODE command to save a numeric version of the variable where the original string value is the value label. For example:
AUTORECODE VARIABLES=hospital
/INTO hosp_num .
I hope this applies to your data. When you mention falls1, falls2, etc., are these referring to falls for a given hospital at month 1, month 2, etc? This suggests a different data structure with 1 case for each hospital over all months.
David Matheson
Answer by JonPeck (4671) | Jun 10, 2013 at 05:49 PM
On reflection, David's interpretation of the question sounds more plausible to me. But then setting split files by hospital and using the SHIFT VALUES command with four different shifts would access the preceding cases without crossing split groups.
Answer by ClayGemmill (0) | Jun 17, 2013 at 03:36 PM
David,
Your syntax worked perfectly and gave me the result I was looking for. With this syntax can I run it with for multiple measures at once? My guess is no, I will have to do one measure at a time and build a master file for analysis. See attached example.
All my hospitals are working on Falls. As you can see in the attached example I have three fall measures. I want the most recent four data points for each measure. However each may not be have the same months of data. I would like to be able to pull the most four recent points by hospital then topic then measure.
Answer by ClayGemmill (0) | Jun 18, 2013 at 02:00 PM
Thank you to both of you for your assistance.
Answer by ClayGemmill (0) | Jun 18, 2013 at 08:27 PM
David, I have a follow up question. Where did you get the recency command from? When heading down this path I looked at the Rank command but did not see where recency was an option. In fact, I searched the syntax reference guide and could not find a reference to recency command.
Answer by dmatheson (216) | Jun 18, 2013 at 09:03 PM
Clay,
Recency is just a variable name that I made up to store the result of the rank procedure.
/rank into <variable name> stores the ranking result in the specified variable. I could have used any valid SPSS variable name that did not already exist in the active data set. If I had not specified a variable name.the RANK procedure would have created the variable rendgame, i.e. placed an r in front of the variable being ranked. Other letters are used for other ranking functions. If you run Rank directly from the dialogs, generic names like renddate will be used. Recency just made sense as a variable name, given that it indicated the most recent enddates.
David | https://developer.ibm.com/answers/questions/220913/select-last-four-data-points.html?sort=votes | CC-MAIN-2019-43 | refinedweb | 1,172 | 72.26 |
I am developing a web using symfony2 framework. In this web the users upload file(.mdb). The web read the file and if the information is correct it pass to database.(This is the idea)
The problem is that i try to used "COM class of PHP". First i think that i forget too put the extension "extension=php_com_dotnet.dll" but no.
Hay use this code to read de mdb
$count =0; $db_path = $path; $constr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . $db_path . ";"; $odbc_con = new COM("ADODB.Connection"); $odbc_con -> open($constr);
But Symfony say me
Attempted to load class "COM" from namespace "PintxoNosti\MyTellBundle\Controller" in C:\Symfony\WebD\src\PintxoNosti\MyTellBundle\Controller\PintxoController.php line 62. Do you need to "use" it from another namespace?
someone know the solution? Or maybe have some idea to read mdb in symfony2
Thanks. | https://www.howtobuildsoftware.com/index.php/how-do/fbj/php-class-symfony2-ms-access-attempted-to-load-class-com-from-namespace-symfony2 | CC-MAIN-2019-47 | refinedweb | 140 | 61.93 |
06 August 2012 09:28 [Source: ICIS news]
Correction: In the ICIS news story headlined “China’s Sanfangxiang Group shuts PET bottle chip unit for 20 days” dated 6 August 2012, please read in third paragraph … Sanfangxiang Group has 7 PET bottle lines…instead of … Sanfangxiang Group has 12 PET bottle lines …. A corrected story follows.
SINGAPORE (ICIS)--?xml:namespace>
The plant will remain off line for 20 days but the shutdown may be extended if the PET bottle chip market remains weak, the source added.
Sanfangxiang Group has 7 PET bottle lines with a total capacity of
The company had taken off line a 200,000 tonne/year PET bottle chip unit in June and had not decided on its restart time yet, | http://www.icis.com/Articles/2012/08/06/9584063/corrected-chinas-sanfangxiang-group-shuts-pet-bottle-chip-unit-for-20-days.html | CC-MAIN-2015-22 | refinedweb | 124 | 58.66 |
Scope Functions
In Kotlin, scope functions allow to execute a function, i.e. a block of code, in the context of an object. The object is then accessible in that temporary scope without using the name. Although whatever you do with scope functions can be done without, they enable you to structure your code differently. Using them can increase readability and make your code more concise.
The Kotlin standard library offers four different types of scope functions which can be categorized by the way they refer to the context object and the value they return. A scope function either refers to the context object as a function argument or a function receiver. The return value of a scope function is either the function result or the context object.
The available functions are
let,
also,
apply,
run, and
with. The following table summarizes the characteristics of each function based on the way the context object can be accessed and the return type as described above:
The difference between
run and
with lies only in the way they are called. While all other scope functions are implemented as extension functions,
with is a regular function.
Now that I've mentioned concepts such as function receivers and extension functions it makes sense to briefly explain them before we move on into the detailed descriptions of the scope functions. If you are already familiar with function receivers and extension functions in Kotlin you can skip the next section.
Function Arguments, Extension Functions, Receivers
Kotlin allows treating functions as values. This means you can pass functions as arguments to other functions. Using the
:: operator you can convert a method to a function value. To increase readability, the last function argument can be placed outside of the argument list.
The following example illustrates how to do that by defining a higher order function
combine, which takes a function argument
f. We're invoking it with the
plus method from the
Int class and with an anonymous function literal both within the and outside of the argument list:
// Apply function argument f to integers a and b fun combine(a: Int, b: Int, f: (Int, Int) -> Int): Int = f(a, b) // Using the plus method as a function value combine(1, 2, Int::plus) // Passing a function literal combine(1, 2, { a, b -> val x = a + b x + 100 }) // Passing it outside of the argument list combine(1, 2) { a, b -> val x = a + b x + 100 }
Extension functions are a way to extend existing classes or interfaces you do not necessarily have under your control. Defining an extension function on a class lets you call this method on instances of that class as if it was part of the original class definition.
The following example defines an extension function on
Int to return the absolute value:
fun Int.abs() = if (this < 0) -this else this (-5).abs() // 5
Function literals with receiver are similar to extension functions as the receiver object is accessible within the function through
this. The following code snippet defines the extension function from before but this time as a function literal with receiver:
val abs: Int.() -> Int = { if (this < 0) -this else this } (-5).abs() // 5
A common use case for function literals with receivers are type-safe builders. Now that we have covered the basics let's look at the five scope functions individually.
Let, Also, Apply, Run, With
Let
The
let scope function makes the context object available as a function argument and returns the function result. A typical use case is applying null-safe transformations to values.
val x: Int? = null // null-safe transformation without let val y1 = if (x != null) x + 1 else null val y2 = if (y1 != null) y1 / 2 else null // null-safe transformation with let val z1 = x?.let { it + 1 } val z2 = z1?.let { it / 2 }
Also
The
apply scope function makes the context object available as a function argument and returns the context object. This can be used when you are computing a return value inside a function and then want to apply some side effect to it before you return it.
// assign, print, return fun computeNormal(): String { val result = "result" println(result) return result } // return and also print fun computeAlso(): String = "result".also(::println)
Apply
The
apply scope function makes the context object available as a receiver and returns the context object. This makes it very useful for "ad-hoc builders" of mutable objects, such as Java Beans.
// Java Bean representing a person public class PersonBean {; } }
// Initialization the traditional way val p1 = PersonBean() p1.firstName = "Frank" p1.lastName = "Rosner" // Initialization using apply val p2 = PersonBean().apply { firstName = "Frank" lastName = "Rosner" }
Run and With
The
run scope function makes the context object available as a receiver and returns the function result. It can be used with or without a receiver. When using it without a receiver you can compute an expression using locally scoped variables. By using a receiver,
run can be called on any object, e.g. a connection object.
// compute result as block result val result = run { val x = 5 val y = x + 3 y - 4 } // compute result with receiver val result2 = "text".run { val tail = substring(1) tail.toUpperCase() }
The
with function works exactly as
run but is implemented as a regular function and not an extension function.
val result3 = with("text") { val tail = substring(1) tail.toUpperCase() }
Summary
In this post we learned about the scope functions
let,
also,
apply,
run, and
with. They differ in the way they refer to the context object and the value they return. Combined with the concepts of function arguments, extension functions and receivers, scope functions are a useful tool to produce more readable code.
What do you think about scope functions? Have you ever used them in one of your projects? Can you remember which one to use when? Let me know your thoughts in the comments!
References
Posted on by:
Frank Rosner
My professional interests are cloud and big data technologies, machine learning, and software development. I like to read source code and research papers to understand how stuff works.
Read Next
Top 10 Programming Languages to Learn to Get a Job on Investment Banks like Goldman Sachs, Citi, and Morgan Stanley
javinpaul -
Can you apply SOLID principles to your React applications ?
Shadid Haque -
101 Coding Problems and few Tips to Crack Your Next Programming Interviews
javinpaul -
Discussion
👏👏I appreciate that title. Had to read it a few times to make sure there wasn't one missing. | https://practicaldev-herokuapp-com.global.ssl.fastly.net/frosnerd/let-s-also-apply-run-with-kotlin-scope-functions-1ci4 | CC-MAIN-2020-40 | refinedweb | 1,086 | 62.98 |
- Start Date: 2015-09-11
- RFC PR:
- Ember Issue: #12224 / #12990 / #13688
Summary
Introduce
Ember.WeakMap (
@ember/weakmap), an ES6 enspired WeakMap. A
WeakMap provides a mechanism for storing and retriving private state. The
WeakMap itself does not retain a reference to the state, allowing the state to
be reclaimed when the key is reclaimed.
A traditional WeakMap (and the one that will be part of the language) allows for weakness from key -> map, and also from map -> key. This allows either the Map, or the key being reclaimed to also release the state.
Unforunately, this bi-directional weakness is problemative to polyfil. Luckily, uni-directional weakness, in either direction, "just works". A polyfil must just choose a direction.
Note: Just like ES2015 WeakMap, only non null Objects can be used as keys
Note:
Ember.WeakMap can be used interchangibly with the ES2015 WeakMap. This
will allow us to eventually cut over entirely to the Native WeakMap.
Motivation
It is a common pattern to want to store private state about a specific object. When one stores this private state off-object, it can be tricky to understand when to release the state. When one stores this state on-object, it will be released when the object is released. Unfortunately, storing the state on-object without poluting the object itself is non-obvious.
As it turns out, Ember's Meta already solves this problem for
listeners/caches/chains/descriptors etc. Unfortunately today, there is no
public API for apps or addons to utilize this.
Ember.WeakMap aims to be
exactly that API.
Some examples:
-
- (will soon utilize the user-land polyfil of this) to prevent common leaks.
Detailed design
Public API
import WeakMap from '@ember/weak-map' var private = new WeakMap(); var object = {}; var otherObject = {}; private.set(object, { id: 1, name: 'My File', progress: 0 }) === private; private.get(object) === { id: 1, name: 'My File', progress: 0 }); private.has(object) === true; private.has(otherObject) === false; private.delete(object) === private; private.has(object) === false;
Implementation Details
The backing store for
Ember.WeakMap will reside in a lazy
ownMap named
weak on the key objects
__meta__ object.
Each
WeakMap has its own internal GUID, which will be the name of its slot,
in the key objects meta weak bucket. This will allow one object to belong in
multiple weakMaps without chance of collision.
Concrete Implementation: Polyfill:
Drawbacks
- implementing bi-direction Weakness in userland is problematic.
- Using WeakMap will insert a non-enumerable
metaonto the key Object.
Alternatives
- Weakness could be implemented in the other direction, but this has questionable utility.
Unresolved questions
N/A | https://emberjs.github.io/rfcs/0091-weakmap.html | CC-MAIN-2019-43 | refinedweb | 430 | 59.7 |
Hi,I'm new in netcdf Java and I'm wondering if it's possible to change the netcdf header without changing the data. I've tried to do that but it doesn't work (v2.2.10 API):
------------------------------------- import java.io.*; import ucar.ma2.*; import ucar.nc2.*; public class test2 { public static void main(String[] args) { String filename="/home/netcdf/foo.nc"; try { //Load netcdf: NetcdfFileWriteable ncfile=new NetcdfFileWriteable(filename);//Modify a netcdf variable (lattitude): from float datatype to double datatype Variable varLat=ncfile.findVariable("lat");
varLat.setDataType(DataType.DOUBLE);//lat from float to double//ncfile.create(); -> doesn't work //Close:
ncfile.flush(); ncfile.close(); } catch (IOException ioe){ ioe.printStackTrace(); System.err.println("ERROR creating file"); } -------------------------------------I think that I'm missing a method that actally writes the changes to the nc file but I don't know wich is it. I've tried ncfile.create() but I've got "not in define mode".
Any help would be appreciate. Thanks in advance, Roger Olivella
netcdf-javalist information:
netcdf-javalist
netcdf-javaarchives: | http://www.unidata.ucar.edu/mailing_lists/archives/netcdf-java/2005/msg00149.html | CC-MAIN-2016-26 | refinedweb | 172 | 52.97 |
Hi Everyone:!
Download center link:
David B. Cross
Product Unit Manager
PingBack from
Hi David,
congratulations on releasing the Beta 2 of the TMG.
Could I have a question and a "feature request"?
I want to use a FetchUrl method for purging objects from the cache.
According to the ISA 2004/2006 and Forefront TMG domumentations of SDK, the fpcFetchSynchronous flag of the method is obsolete.
I found that here:
May I ask why it is obolete?
I am developing an application where I would need to call the method FetchUrl synchronously, because I need to know that my web app can safely continue, as it will rely on the fact that there is not an old object in the cache.
I would suggest to fully support this flag again as I think it is very useful.
For me, it would be even better to have the purge available though the HTTP DELETE request. This functionality would be configurable to be available only from the internal network.
I found a mention about it in this doc which is about ISA 2000:"> but it does not seem to work.
For reference, the whole doc can be found here:
Also in this case, I would need the method to be synchronous.
Regards,
Miroslav Sekera
developing
sorry for posting it twice, it was a mistake
If you're changing the content that often, it may be better not to have it cached at all.
We can't answer for what someone wrote in a course file, but if you would have a read in,, and, you will discover that by default, neither ISA 2006 nor TMG allow either "PUT" or "DELETE" methods in HTTP requests by default.
You'll have to set the WebProxy.ApplyPutAnDeleteInForeward (or WebProxy.ApplyPutAnDeleteInReverse for web publishing) property to TRUE before TMG will allow this method at all.
Well it went live last week friday and it's looking great ;-) There are a tone of new features since
Hi,
thanks a lot for your info about enabling the HTTP DELETE, I could not find that, it works now.
May I ask, is there any more documentation about the HTTP DELETE? I spent hours googling and did not find anything more.
I would need to know:
- When I send HTTP DELETE, the cached item is deleted which is good, but the HTTP delete is (like other requests) also forwarded to the web server. Is there a way to confugure ISA (TMG) just to delete the cached item and return (and not to also forward the HTTP DELETE to web server)?
-If I would have multiple TMG servers in array, is it assured that the HTTP DELETE command will automatically be executed on the single array member that is the designated owner of that object according to the CARP algorithm?
developing
TMG is a proxy and assumes that any HTTP method you send to a remote host is intended for that remote host. There are no "proxy-only" methods in the HTTP protocol, so no; you cannot configure ISA or TMG to "absorb" the DELETE method.
Jim Harrison
FF Edge CS
OK
Thanks Jim.
Please, I would still need to answer my question regarding to fpcFetchSynchronous flag:
May I ask why it is obolete?
On page: there is:
"To delete an object from the cache, set FetchUrl to an empty string, and set CacheUrl to the URL of the object to be removed from the cache. When you delete an object using FetchUrl, you can perform the operation synchronously or asynchronously, and the TTL must be set to 0."
It looks strage to me that there is "you can perform the operation synchronously or asynchronously" when the fpcFetchSynchronous flag is obsolete (I would assume it is not recomended to use the flag). Or, is there another way to call the FetchUrl synchronously?
I am developing an application where I would need to call the FetchUrl method synchronously, because I need to know that my web app can safely continue, as it will rely on the fact that there is not an old object in the cache.
The reason for moving to asynchronous only is to avoid the expectation that content is removed immediately from all array members after the script is run.
The cache content on disk is not an exact copy of the cache in memory; nor is it guraanteed that the cache on one server is a copy of that on another server, although they may share common elements. When content is added or removed, the cache menagement waits until the scheduled cache synchronization period before actually synchronizing the disk content.
HTH,
I see,
thanks a lot Jim
And what about the HTTP DELETE?
Is it assured the content is deleted immediately after the end of the HTTP DELETE call? Or is it the same situation as the FetchUrl?
Regards
The Forefront TMG Team released to the web the Beta 2 Version of the ISA 2006 EE replacement. Additionally
I haven't found TMG SDK in this release. When it will be available?
how do we log bugs for this beta? i cant find it in connect and i didnt see in release notes or on download page | http://blogs.technet.com/b/isablog/archive/2009/02/06/forefront-tmg-beta-2-is-released.aspx | CC-MAIN-2014-41 | refinedweb | 869 | 68.1 |
There seems to be a bit of interest in the Ruby community lately in putting together handy libraries for creating Ruby daemons, so I thought I’d throw our own particular solution into the mix. Our solution intentionally avoids a lot of the common daemonizing tasks (like detaching from the terminal) so it might not be quite appropriate to call it daemonizing, but it fills our requirements nicely. (As an aside, check out Kenneth Kalmer’s new library daemon-kit for a nice actual-daemon implementation in Ruby.)
We originally tried coding things by hand using Daemons, and then modularizing our oft-repeated code to stay DRY, but we kept running into stability issues. Also, when you fork a Ruby daemon, particularly one that’s loaded up a large stack in memory, you end up at least briefly using twice as much memory. So, memory hogging and crashing needed to be avoided.
None of our daemons required advanced process handling, either. They were simple, single instance workers that had very particular tasks (like schedulers and message handlers for PingMe). We found ourselves asking, “do we really need to be forking child processes for this?”
The answer is no. Instead we are using a module we just pushed to Github that we call Looper. It allows us to take any bit of code or a class and run it as a kind of daemon. Or, more specifically, the class uses Looper to take advantage of its simple signal trapping, loop handling (including sleeping), and the class can rely on Looper to catch any unhandled exception, report it, and keep on keepin’ on.
The
loopme method takes a block that it runs for you, handles sleeping between runs, and will catch any unhandled exceptions that bubble up. Thus, if you want to exit on a particular exception, you’ve got to rescue it in your code and set
@run to false. It also sets up signal trapping so that signals TERM, INT and HUP will all cause the loop to end (I’d be open to changing this behavior or adding additional signal responses if anybody has an interest).
Here’s an example “daemon” that uses looper to kick it:
require 'looper'
require 'twitter'
class DoSomething
include Looper
def initialize(config)
@run = true
# do config stuff, etc...
@sleep = config[:sleep].nil? ? 60 : config[:sleep]
end # initialize
def run
loopme(@sleep) do
begin
# this is where the meat of your code goes...
messages = twitter.direct_messages({:since => Time.now
Pretty simple, right? No coding up the signals, the sleeping, the global exception handler, etc. You can take a look at looper.rb to see exactly what it does for you. From here, starting and stopping our script is really easy, and can be re-used for each of our daemons. It boils down to starting it up with nohup (and script/runner because we like having our rails stack), and then killing it later with the PID:
$ nohup script/runner -e RAILS_ENV /path/to/DoSomething.rb
There’s no need to use Rails’ script/runner, you could just call ruby itself and save yourself a lot of memory ;-)
The following is an init script that we use to start and stop any of our Looper daemons:
#!/bin/bash
#
# chkconfig: 345 70 30
# description: control script for daemons
#
usage(){
echo $"Usage: $0 {start|stop|restart} {daemon1|godzilla|voltron}"
}
# daemon name is required as second param
if [ "$2" = "" ]
then
usage
exit 5
fi
# RAILS_ENV?
if [ "$RAILS_ENV" = "" ]; then
RAILS_ENV='development'
fi
# RAILS_DIR?
if [ "$RAILS_ENV" = "production" ]; then
RAILS_DIR='/www/app/current'
else # assume development
RAILS_DIR='/www/dev.app/current'
fi
PROGRAM="${RAILS_DIR}/daemons/${2}/looper.rb"
RUNNER="${RAILS_DIR}/script/runner"
LOG="/var/log/app/daemon_${RAILS_ENV}.log"
# if the daemon is missing, well, the daemon is missing!
test -f $PROGRAM || exit 5
# See how we were called
case "$1" in
start)
nohup $RUNNER -e $RAILS_ENV $PROGRAM >> $LOG 2>&1 &
;;
stop)
PID=`ps auxw | grep ${PROGRAM} | grep -v grep | awk '{ print $2 }'`
echo "Stopping PID: ${PID}"
kill $PID
sleep 2
;;
restart)
$0 stop
$0 start
;;
*)
usage
exit 1
;;
esac
exit 0 | https://www.zetetic.net/blog/2009/1/21/dead-simple-ruby-daemons-using-looper.html | CC-MAIN-2019-26 | refinedweb | 682 | 60.04 |
I am trying to write to flash in a sketch so I can save some data that is being collected (I’m not worried about accidentally deleting the bootloader because I am writing the sketch via ICSP). I found an example of using avr/boot.h and wrote the test sketch included below (it just writes a few pages and then looks for the written data).
But the flash is not being written. When run only a single matching string, which I assume is the string in the compiled program. Are there fuse bits or something that need to be set to enable writing of flash from sketches?
I am seeing the “boot lock protection bits” in the 328p spec but I am having trouble figuring out the ramifications of the various settings (other then to change the size reserved for the bootloader). I have no bootloader since I am writing the sketch via ICSP… (note, please ignore the USB.print stuff in the sketch below; it is similar to Serial.print but goes to a usb chip over SPI instead of serial).
Cheers!
Andrew
#include <inttypes.h> #include <avr/interrupt.h> #include <avr/pgmspace.h> #include <avr/boot.h> #include <lightuino5.h> // Pulled from boot.h example code: void programFlash ; } // Printf-style to the USB void p(const char *fmt, ... ) { char tmp[128]; // resulting string limited to 128 chars va_list args; va_start (args, fmt ); vsnprintf(tmp, 128, fmt, args); va_end (args); Usb.print(tmp); } void setup(void) { Usb.begin(); } char c[128]; #define FLASH_PAGES 32768/SPM_PAGESIZE void loop(void) { strcpy (c,"!ATHIS IS A TEST OF THE FLASH WRITE CAPABILITY"); int lastpage = FLASH_PAGES-1; programFlash(32768UL-SPM_PAGESIZE,(uint8_t*)c); c[1] = 'B'; programFlash(32768UL-(SPM_PAGESIZE*2),(uint8_t*)c); c[1] = 'C'; programFlash(32768UL-2048,(uint8_t*)c); delay(5000); Usb.print("Flash write test\n"); p("Page size: %d\n", SPM_PAGESIZE); // Now search for my written string: for (unsigned long int i=0;i<32768;i++) { char c = pgm_read_byte(i); if ((c>='A') && (c<='Z')) Usb.write(c); // Dump everything readable and caps if (c=='!') // This may be my string's beginning { p("\nFound ! at: %lu\n", i); } } Usb.print("Done!\n"); delay(20000); while(1); } | https://forum.arduino.cc/t/write-flash-in-a-sketch/64512 | CC-MAIN-2021-43 | refinedweb | 366 | 68.16 |
okay so im trying to test out my code with the virtual keywords and i dont seem to know what is happening here with this error
ERRORERRORCode:
#include <iostream>
using namespace std;
int main()
{
{
cout << "hello my name is dominic test";
}
int myass;
myass = 1 + 1 =;
int dooshbag 2 + 2 =;
virtual bool myass *dooshbag;
system ("pause");
return 0;
}
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4. 1\..\..\..\libmingw32.a(main.o):main.c|| undefined reference to `WinMain@16'|
iv looked at forums on this and i have made my file a c++ file tbh i think its a linker issue with dlls from windows 7 but thats just a guess at it
or a code error that im not seeing which would be very typical :P
i know my code is not cleaner *cba*
i also tried doing the hashinclude <iostream.h>
maybe im using the virtual keyword wrong and the meaning of it is wrong? doubt it tho | http://cboard.cprogramming.com/cplusplus-programming/139424-problem-undefined-reference-%60winmain%4016-code-blocks-version-10-5-2011-a-printable-thread.html | CC-MAIN-2015-48 | refinedweb | 162 | 51.55 |
We're using Concordion, which reads html files as xhtml. They must have an html extension to be picked up by Concordion. But as far as I can tell, IDEA only validates XHTML if it has an '.xhtml' file extension -- a strange convention if this link is right. Is there another way to get these validations in a standard html file?
Assign .html to XHTML file type (Settings -> File Types)
That's an IDE-wide setting. If I change that, then all my html files for all my projects will have to conform to xhtml. I would have assumed IDEA would just use the doctype or the namespace to identify xhtml. There should be a file-specific way to handle this, although a project-specific solution would work in my case.
There is no way to do it currently. Feel free to submit a request about it.
Thanks. I added IDEA-99549 | https://intellij-support.jetbrains.com/hc/en-us/community/posts/206157549-Validate-html-file-as-xhtml- | CC-MAIN-2020-16 | refinedweb | 152 | 84.47 |
Magento2 e-commerce site to the next level. So read on::
- Community edition (CE)
- Enterprise edition (EE)
1. Installing Varnish
In case you also do not have Varnish, you will need to follow the instructional section on how to Install Varnish before we can continue.
2. How to place Magento2 behind Varnish.
3. Restarting services after making changes
sudo systemctl restart varnish.service sudo systemctl restart apache2.service
4. Basic caching; } }
5. Excluding certain URLs
Not all URLs should be cached. Especially not in sites that deal with personal information such as credit cards or financial details.
if (req.url ~ "magento_admin|magento_login") { return (pass); }
6. Extended caching.
7. Specific TTL-based caching
Varnish creates a TTL value for every object in the cache. The most effective way of increasing a website’s hit ratio is to increase the time-to-live (TTL) of the objects.
8. Go further.
9. For more guidance. | https://info.varnish-software.com/blog/magento2-varnished | CC-MAIN-2019-18 | refinedweb | 152 | 60.31 |
175
Related Items
Preceded by:
Lake City reporter and Columbia gazette
This item is only available as the following downloads:
( PDF )
Full Text
PAGE 1
By TONY BRITTtbritt@lakecityreporter.comAfter narrowing their list of potential assistant police chief candidates to two, officials at the Lake City Police Department have decided to renew their search to fill the position. We have re-advertised the position and we are still searching for candidates, said Steve Shaw, Lake City Police Department public information officer. We are still accepting applications and well continue to do so until the position is filled. Last month the Lake City Police Department held interviews and were able to narrow a list of more than 50 applicants to two final-ists. One was a former chief of police in St. Albans, W. Va. who retired as a major from the Florida Highway Patrol and is an adjunct fac-ulty member at the Institute of Police Technology and Management at the University of North Florida in Jacksonville and who was also director of the FHP Academy. The other candidate was a former deputy chief of police in Altamonte Springs, who cur-rently works as a protective service lieutenant at South Seminole Hospital. He is a graduate of the FBI National Academy. Its my understanding that at this time they are not being con-sidered, Shaw said. Last month LCPD Chief Argatha Gilmore said the police department has not set a deadline to fill the position. Were going to be taking applications until the position is filled, Shaw said. So were basically taking applications and interview-ing, like we did to get to those two. People.................. 2AOpinion ................ 4AObituaries .............. 5AAdvice & Comics......... 5BPuzzles ................. 3B TODAY IN PEOPLE New racquetball courts shaping up. COMING WEDNESDAY Local news roundup. 91 70 T-Storm Chance WEATHER, 2A CALL US:(386) 752-1293SUBSCRIBE TOTHE REPORTER:Voice: 755-5445Fax: 752-9400 Vol. 139, No. 164Lake City ReporterTUESDAY, SEPTEMBER 17, 2013 | YOUR COMMUNIT Y NEWSPAPER SINCE 1874 | 75¢ LAKECITYREPORTER.COM 113 DEAD IN NAVY SHOOTINGBRETT ZONGKER,ERIC TUCKER and LOLITA C. BALDOR Associated PressWASHINGTON A former Navy man opened fire Monday morning inside a building at the heavily secured Washington Navy Yard, spraying bullets at office work-ers in the cafeteria and the halls, authori-ties nations capital, less than four miles from the White House and two miles from the Capitol. As for whether it may have been a terrorist attack, Mayor Vincent Gray said: We dont patriNo motive established for Navy Yard rampageby former reservist. Art for the ages Photos by JASON MATTHEW WALKER and JEANNE VAN ARSDALLTOP: Yvette Kiss and her daughter, Kailey, 13, share what they see viewing Dottie Lists mixed media sculpture titled G enerationsat the Ninth Annual Art League of North Florida Fall Art Show at the Florida Gate way Colleges Alfonso Levy Performing Arts Center on Fri day. I like how it is 3-D, Kailey said. I like how it shows how electronics have changed throughout the years. ABOVE LEFT: Lake City Reporter staff photographer Jason Matthew Walker stands next to his photograph titled Newborn Pass enger at North Florida Fall Art Show. Walkers photograph won first place in the photography category. ABOVE RIGHT: Rex Feagley (from left), Ed Houry and Wayne Grendahl ad mire several pieces of art on display at the FGC Alfonso Levy Performing Arts Center. Spiritsingerhitting it big X Factor judges were Blown Away by area music park regular. By STEVEN RICHMONDsrichmond@lakecityreporter.com HOLLYWOOD, Calif. S tanding under the spotlight and singing for an audience of millions is no easy feat, but 13-year-old X Factor contestant Rion Paige has overcome much more than stagefright to be where she is today. Paige, a Jacksonville native, is a regular performer at the Spirit of the Suwannee Music Park in Live Oak, having participated in multiple competitions and concerts. She was the winner of the 2012 WQHL North Florida Texaco Country Showdown and sang at the Suwannee River Jam music festival. She is a great entertainer, Spirit of the Suwannees media relations director Sue Lamb said. She has a voice that is beyond a normal 13-year-old. We feel shes going to make it all the way. As she took the stage, the RION continued on 6A Gilmore By STEVEN RICHMONDsrichmond@lakecityreporter.comLIVE OAKThe company behind a proposed medi-cal waste incinerator facility for Suwannee County will be holding a town hall meeting Thursday to field questions from concerned citizens about the environmental and public health implications of the proj-ect. Pennsylvanias Integrated Waste Management Systems Inc. has proposed building a new medical waste incinera-tor facility at the intersection of 175th Road and 50th Street about nine miles northwest of Live Oak. The facility will con-sist of four hospital, medical, Suwanneeincineratorsubject oftown hallWASTE continued on 3A SHOOTING continued on 6ASearch begins anew for assistant chief COURTESY G. PEAVEYRion Paige Police officials pass on finalists for LCPD2nd-in-command. Lakers, Bulls head coach Phil Jackson is 67.Q Elmo voice actor Kevin Clash is 52. Q Friday Night Lights actor Kyle Chandler is 47.Q New York Undercover actor Malik Yoba is 45. AROUND FLORIDA State ready to pick Ed. Comm. TALLAHASSEE Florida is ready to move quickly to find a perma-nent commis-sioner and has a proven track record.Springs closes, to be state park SILVER SPRINGS One of Floridas.Dems meet with grant recipients BOYNTON BEACH South Florida Democrats are planning to meet with organizations who received federal grant money to hire counselors trained to help people sign up for insurance under the new health care laws. Reps. Ted Deutch and Lois Frankels Monday round-table comes as state officials are pushing back against implementing the Affordable Care Act. Last week, state health officials ordered county health departments to ban the counselors, also known as navigators, from con-ducting outreach on their property. The move has brought harsh criticism from Democrats who have accused Gov. Rick Scott and his cabinet of putting politics ahead of people.Bobcat prompts school lockdown PALM BEACH GARDENS said the bobcat was caught by a private con-tractor hired by the district. According to the Florida Fish and Wildlife Conservation Commission, bobcats have a natural fear of people. Commission spokeswoman Carli Segelson says bobcats are shy and reclusive. She also says that the only time there might be a concern would be if the bobcat had rabies.Ex-teacher asks to end probation TALLAHASSEE A former Tampa teacher con-victed over-turned by an appeals court that called the decision an abuse of judicial power. Lafaves attorney told Supreme Court justices that the appeals court overstepped its authority. Attorneys for the state argued it would be a mis-carriage of justice to end probation early for a sex offender. If you want happiness for an hour take a nap. If you want happiness for a day go fishing. If you want happi-ness for a year inherit a fortune. If you want happiness for a lifetime help someone else. Chinese proverb A new polygamous family on reality TV ATLANTIC CITY, N.J. M oments after win-ning tal-ent routine was a Bollywood fusion dance. Im so happy this organization has embraced diversity, she said in her first press conference after winning the crown in Atlantic City, N.J.s Boardwalk Hall. Imuris victory led to some negative comments on Twitter from users upset that someone of Indian heritage had won the pageant. She brushed those aside. I have to rise above that, she said. I always viewed myself as first and foremost American.Billboard names Pink woman of the year NEW YORK Billboard has named Pink its woman of the year. Billboard announced Monday that the pop singer will receive the honor at its annual Women in Music event Dec. 10 in New York City. Pinks sixth album, The Truth About Love, has sold 1.7 million albums since it was released last year. It launched three Top 10 hits, including the No. 1 jam Just Give Me a Reason.Deen makes first public appearance in months HOUSTON Celebrity cook Paula Deen fought back tears as she was greeted by a supportive crowd at a Houston cooking show. Saturdays event was Deens. About 1,500 people gave Deen a standing ovation Saturday when she appeared at the Metropolitan Cooking & Entertaining Show. She told them their hearts were as big as your state. Deen held two cooking demonstrations, including tips on how to make peanut butter pie.Miley Cryus, Hemsworth call off engagement NEW YORK A wrecking ball has hit Miley Cyrus and Liam Hemsworths relationship. Representatives for both celebrities confirmed Monday that the cou-ple have called off their engagement. The 23-year-old Hemsworth proposed to 20-year-old Cyrus last year. They met on the set of the 2010 movie The Last Song. Cyrus, whose hits include We Cant Stop and Wrecking Ball, will release a new album called Bangerz on Oct. 8. Q Associated Press Sunday: 1-13-14-16-30 2A LAKE CITY REPORTER DAILY BRIEFING TUESDAY, SEPTEMBER 17, 2013 Page Editor: Jason M. Walker, 754-0430 Monday: Afternoon: 5-9-0-0 Evening: N/A Monday: Afternoon: 5-6-7 Evening: N/A Saturday: 15-17-22-40-41-45 TONY BRITT/ Lake City ReporterU.S. Rep. Ted Yoho talks with Carol Knighton after addressi ng an audience on the importance of making their voices heard during a politi cal rally Saturday morning in Columbia County. JASON MATTHEW WALKER/ Lake City ReporterA motorist passes by the new Lake City Recreation Department Racquet Ball Facility at Memorial Stadium on Monday. Daily Scripture Who is wise and understanding among you? Let them show it by their good life, by deeds done in the humility that comes from wisdom. James 3:13
PAGE 3
infectious waste incinera tors (HMIWIs), associated air pollution control devic es, two dry sorbent storage silos, an emergency gener ator and an emergency fire pump. The HMIWIs will each burn up to 30 tons of waste daily at a rate limited to 2,500 pounds per hour. Though the Suwannee County Commission approved changes to Land Development Regulations and the Comprehensive Plan that allows a wider range of businesses on the catalyst site, it has not voted on whether to allow IWMS to build on the land. Any vote from commissioners would only be in regards to IWMS building on the land, and not on the nature of the proposed facility. If the company wins the bid for the catalyst site, they are in the clear to build a medical waste incinerator if they so choose. We dont have an agreement with the com pany right now, Suwannee County Administrator Randy Harris said. I think the company just wanted to provide an opportunity for those who have an inter est to come and listen to whatever information they have to offer by answering questions. According to published reports, IWMS president Marvin Jay Barry said he anticipates hiring 40-60 employees during the facil itys first sage, and hopes to expand its staff to 100 once the company is oper ating at full capacity. Harris was unable to confirm whether elelcted officials would be attend ing the town hall meeting. While IWMS would have the authority to build upon the catalyst site without a public hearing, their abil ity to do so is contingent upon county commission ers approving their bid for the land in the first place. Im disappointed with the Suwannee County com missioners for abdicating responsibility, said Save Our Suwannee Director Annette Long. Its mind boggling that theyd leave citizens out of the loop. A lot of these rules are put in place by bigger cities and states. ... Our local guys are all we got. Barry and the compa nys consultant Alberta Hipps will be in attendence to answer questions from the public. The town hall meeting will be held Thursday, Sept. 19 at 7 p.m. at Live Oak City Hall at 101 White Avenue SE. Staff writer Amanda Williamson contributed to this story. Page Editor: Robert Bridges, 754-0428 LAKE CITY REPORTER LOCAL TUESDAY, SEPTEMBER 17, 10132 90th Trail, Live Oak, Florida The Bayway Group, LLC dba Bayway Services 1005 W. Howard St. Live Oak, FL 32060 MZ6128 Zero turn hp Briggs & Stratton Endurance V-twin Fabricated cutting deck Blades $ 158 mo. 36 mos. equal payments No Interest Wake Forest at Army Tulane at Syracuse on a set of four select tires Plus price match guarantee Bridgestone, Continental, Goodyear, Hankook, Pirelli Coolant Flush 99.95 Fuel System Service 99.95 Power Steering Flush 89.95 Brake Fluid Service 49.95 Diesel Injection Serv. 139.95 Purchase a complete Detail for 119.95 Get a free oil change (Up to 5 qts.) Pittsburgh at Duke Arkansas at Rutgers Auburn at LSU City council adopts $48 million budget By STEVEN RICHMOND srichmond@lakecityreporter.com The Lake City City Council approved the 2013-14 budget and millage rate after a final public hearing during Monday nights council meeting. The citys $48,740,673 budget saw a roughly one percent reduction from last years $51.5 million. Much of the decrease was due in large part to a $3.2 million reduction in the Water/Sewage Construction Funds expenditures. Its because of the capital reduction in capital projects, City Manager Wendell Johnson said prior to the meeting. We completed an automated meter reader system and a couple of other projects that cost about $3 million. The current 3.9816 millage rate remained the same despite a $5 million drop in prop erty value. Although the council could have increased millage to the 4.0127 rollback rate, it would have only accounted for a $4,000 shortfall from the current rate, according to Johnson. Were not raising the millage rate because its a fairly insignificant differ ence, Johnson said. No members of the community spoke for or against the budget during the meet ing. I think you all did a good job and made the budget fairly easy to follow, Mayor Stephen Witt said to the council. In other business the council: Approved permits for the CHS home coming parade Oct. 4 and the VFWs Veterans Day parade Nov. 11 Approved a resolution to appoint mem bers to serve on the various standing advi sory committees of the city council for two year terms beginning Oct. 1 Agreed to enter into a contract with the Florida Department of Corrections for the use of inmate labor Tabled a discussion about the Richardson Monument outside Richardson Community Center until the next council meeting. WASTE: Meeting Thurs. Continued From Page 1A JASON MATTHEW WALKER/ Lake City Reporter Still life Graphic design major Kimberly Williams, 28, of Live Oak, works on a still life drawing at the Florida Gateway College art stu dio on Monday. Williams said the trick to drawing is to always look at the subject rather than the drawing itself. From staff reports The Art League of North Florida is hold ing its monthly meeting on Tuesday September 17 at 6:30pm at the Fellowship Hall of the First Presbyterian Church in Lake City. The speaker this month will be Del Porter. Del is the master in painting with wood. He is internationally know for his work. The community is invited to the meeting. Art League meeting set
PAGE 4
T he older you get, some-one said years ago, the more funerals youll attend. It makes sense, but no one realizes the truth of that observation until well, until hes older. I suppose I have now reached that stage. Ive been to a number of funerals, family visitations and cel-ebrations of life just in the past few weeks. But, you know, death encourages us to think about life and the les-sons and stories left behind. From my Aunt Dora Stevens, I learned that a person should always look her best in public. And even at home. The only hair appointment she missed in years came on the day she died. After my sister admit-ted she no longer ironed clothes, Dora said, Well, I guess thats OK if you dont care what you look like. Dora, the most persnickety housekeeper in the Western Hemisphere, could spot a tiny spider web in her home or somebody elses from 50 paces. She was just as particular in car-ing for her family. She was devoted to her daughter, who was ill most of her life. She cared daily for her son-in-law, who was beaten and robbed while serving as a Marine on Okinawa and left maimed for life. When her husband was admitted to a nursing home, she took him three meals a day. She never flagged in her caregiving. And when a neigh-bor needed help, Dora was there. From my friend Dan McGill, I learned the importance of facing life and death with optimism. I dont have any reason not to be optimistic, he said, just two days before he died. My faith is strong. A man of wit and wisdom, Dan also could have taught us about patience, just as two mules he plowed taught him as a boy. The mules, he said, had been trained to take two steps and stop, take two steps and stop, giving Dans uncle, a victim of polio, a chance to catch up. Dan learned to cope and to be patient. From Loyd Strickland, I learned that it pays to be generous. Loyd did well in the egg business and eventually formed a foundation to help countless people and institu-tions. His contributions are legend, but I remember most his determi-nation to get a junior college estab-lished in his home county. He was a giver. Each of these people was granted opportunities and responsibili-ties, two words that hold hands all through life. And each embraced them willingly. The great sports commentator Red Barber wrote: I believe very firmly that our lives are guided by forces that we are unaware of, and that there is very much a per-sonal, watchful God. Otherwise, I dont think you can account for the dimension or direction of your life. Who else would have known that Dora Stevens would be called on to be the consummate caregiver, that Dan McGill would be an inspira-tion to all who knew him, that Loyd Strickland would be able to give generously? Who else? No one. F lorida is home to 11 of the worst 50 charities in the country, which too often take peoples money, then enrich their executives and fundraisers but spend little on the charitys ostensible cause. It is a multimillion dollar legal fleecing that Adam Putnam, Floridas commis-sioner of agriculture and consumer services, says is about to get new scrutiny. With the help of Florida law-makers, Putnam wants to create stronger regulations. His leadership is needed to make it less attractive for wasteful charities to call Florida home. [A recent investigation] unearthed charities that exploited kids and veterans and other sympathetic causes to collect tax-free contributions to richly reward the charitys operators and for-profit fundraising com-panies while pennies on the dollar went to the adver-tised beneficiaries. The worst charity was in Florida a black eye on the state, Putnam says and named Kids Wish Network, which raised $127.8 million through solicitors in the last decade. Its solicitors kept $109.8 million. The nations worst charities overall did relatively little actual good, paid fundraisers the lions share of contributions and often had family members on boards of directors who benefited financially. People wrongly assume that the state aggressively ensures that charities spend donations on the needy. Putnam wants to make a series of legal changes to start meeting peoples expectations. He suggests treat-ing for-profit fundraising companies as telemarketers with mandatory background checks; increasing fines for nonprofit wrongdoing; establishing standards for charity boards of directors; and increasing reporting requirements. He is working on a legislative package with Sen. Jeff Brandes, R-St. Petersburg. One of Putnams most important reforms is to get more information into donors hands. He intends to create an easily navigated website that highlights how much charities spend on their advertised cause com-pared to administration and fundraising. And he would like to see a requirement that charities spend a set por-tion of donations on the charitys express purpose or lose their state tax exemption. That idea that has been opposed by mainstream nonprofits before and is tricky to enforce. But large, established charities should wel-come the opportunity to stand against the hucksters in their midst. One area that needs attention is increasing cooperation among states. Operators of some of the worst charities and fundraising operations know that if they are shut down in one state, they can open up in anoth-er. Putnam wants the power to reject licenses for any charity or solicitor banned by another state, which is an essential reform. And he wants to be able to suspend charities immediately if his office identifies fraud. If the Legislature toughens the regulations, Putnam will need to direct sufficient resources toward enforce-ment. Bringing real scrutiny to the states nonprofit sector would do wonders to dissuade unscrupulous charity operators and fundraisers and make clear that Florida is not open for their kind of business. I s there a double standard as to how we treat girls sexuality versus boys? I dont pro-cess. Right now Im waging that battle. Their tops I seem to have covered, literally and figuratively, but we are fighting over the length of their shorts. Colder weather cant come soon enough for me. ... But I will never worry that my sons ... attire will send a girl on the other side of the lunchroom into hormone-laden sexual overdrive. I deal in reality.The parenting blogosphere has gone wild after a mom of three teen-age boys banned from their social-media life the girls who were send-ing sexy selfies to her sons. Selfies are photos that kids -and others -take of themselves and then post.... Whats driving some people crazy is that this mom is supposedly hold-ing girls responsible for sexualizing her sons. Cant boys just be taught to look beyond the towel, not under-neath it, and respect a girl no mat-ter what? And what about that photo of her boys on the beach flexing their muscles while wearing swim trunks -a photo she herself had posted for a while? Isnt this all a double standard? No. In general, men are more sexually oriented, more likely to be promiscuous and more easily sexually aroused by visuals than are women. Countless studies have backed up this intuitive if politically incorrect understanding. In other words, theres a reason Playgirl magazine never really went any-where, and why women prefer to see men in swim trunks as opposed to tiny Speedos. Conversely, the erotic thriller novel Fifty Shades of Grey never gained traction with men -no visu-als! But it was wildly successful with women -as soft-core bodice-rippers have been for decades -in large part because the eroticism was wrapped up in an intense and osten-sibly romantic relationship. And, it seems, the safety and distance of the printed word. No visuals. Now heres the crux of things: I believe there is no moral difference to boys and girls, men and women, behaving sexually outside of mar-riage or, for that matter, indulging in pornography via words or image. But theres a popular Rodney Atkins song that says it well: Come on in boy sit on downAnd tell me about yourselfSo you like my daughter do you now?Yeah we think shes something elseShes her daddys girlHer mommas worldShe deserves respectThats what shell getNow aint it son?Yall run along and have a little funIll see you when you get backProbably be up all nightStill cleanin this gunNow its all for showAint nobody gonna get hurtIts just a daddy thing vul-nerable. OPINION Tuesday, September Bay Times Putnams plan to stop bad charities in Florida Double, and different, standards Q Phil Hudgins is senior editor of Community Newspapers Inc. Every life lived well keeps on teaching even after its gone Phil Hudginsphudgins@cninewspapers.com Q Betsy Hart hosts the It Takes a Parent radio show on WYLL-AM 1160 in Chicago. Betsy Hartbetsysblog.com4AOPINION
PAGE 5
Sept. 17 Columbia Co. History The Friends of Columbia County Public Library invite you to join them for Columbia Countys History, presented by Dr. Sean McMahon, Professor of History at Florida Gateway College. Dr. McMahon will give an overview of Columbia Countys rich history at 7 pm at the Main Library. Art League meeting The Art League of North Florida is holding its month ly meeting on Tuesday September 17 at 6:30pm at the Fellowship Hall of the First Presbyterian Church in Lake City. The speak er this month will be Del Porter. Del is the master in painting with wood. He is internationally know for his work. The community is invited to the meeting. On the Constitution Youre invited to attend an ongoing six-part work shop that will provide you with a practical, common sense understanding of how the Constitution was intended to limit the gov ernment, not the citizens. This understanding will equip you to work with oth ers to solve many of the problems Americans face every day that were cre ated). Sept. 18 Grape Workshop UF.. Mens Bible study Our. Volunteer opportunity Hospice of the Nature Coast has opportunities for volunteers in the Lake City and Live Oak areas. There will be a general orientation on September 18t at 9:30 a.m. at the Hospice of the Nature Coast clinical offic es at 857 SW Main Blvd. Suite 125 in the Lake City Plaza. Volunteers provide general office support and non-medical assistance to patients and their families. Hospice volunteers support hospice patients/families through activities such as: telephone calls, socializa tion, light meal preparation, spiritual support, shopping or errands, and staffing information booths at sea sonal festivals. Specialized training will be provided. Contact Volunteer Manager Alvia Lee at 386-755-7714 or email alee@hospiceof citrus.org for more infor mation and reservations. Walk-ins are welcome but space is limited. Sept. 19 Barbecue class A free professional barbecue cooking class will be held at 7 p.m. at the Columbia County Fairgrounds Extension office. The instructor will be Thomas Henry. For informa tion, call (386) 752-8822. Sept. 20 members and non members. The art is received from 10am until 3 pm at the college. There will be a reception on Friday September 13th at 6 pm at the Performing Arts Center. There will be art, food and the awards presentation. The entire community is invited to attend. Applications are available at the Gateway Art Gallery 461 SW Main Blvd. or at the College at check in time. For more, call the Gallery at 752-5229 Tuesday through Saturday 10 am-6 pm. Page Editor: Robert Bridges, 754-0428 LAKE CITY REPORTER LOCAL TUESDAY, SEPTEMBER 17, 2013 5A 5A Formerly Boyette Plumbing Full Service Plumbing Commercial & Residential Over 25 years experience 386-752-0776 Senior citizen and Military discount CFC1428686 Backow prevention (Installation and Certication) A Different Kind of Nursing Rate Per Hour Up To RN $ 40.00 LPN $ 25.50 CNA $ 13.00 RT $ 26.00 EMT $ 13.75 APPLY ONLINE 1-866-DIAL-CMS 386-752-9440 West Virginia at Maryland Jay Poole, AAMS Financial Advisor 846 S W Baya Drive Lake City FL 32025 386-752-3545 Curb Appeal Specialists! (386) 243-5580 Tennessee at Florida ResidentialCommerical Property Maintenance Tree Limb /Debris Removal General Cleanup Customer Landscaping Pressure Washing Handyman Services Mulch/Flower Beds Holiday Decor Install Tree Trimming Free Estimates Licensed and Insured Call for a Free Estimate Locally owned & operated Troy at Mississippi State Bethune-Cookman at Florida State North Texas at Georgia Missouri at Indiana COMMUNITY CALENDAR Submit Community Calendar announcements by mail or drop off at the Reporter office located at 180 E. Duval St., via fax to (386) 752-9400 or e-mail jbarr@ lakecityreporter.com. Mrs. Gladys Bielling Bivins Providence; Mrs. Gladys Eliza beth Bielling Bivins, age 90, of Providence, passed away peace fully Sunday morning Septem ber 15, 2013 at the North Florida Regional Medical Center after an sudden illness. Mrs. Bivins was born in Jacksonville, Fl on April 27, 1923 to the late Addis Ashley and Clara Brooks Biel ling. Mrs. Bielling lived most of her life in Providence and was a faithful member of the Provi dence Village Baptist Church. Mrs. Bivins was a homemaker and she worked for Lake But ler Apparel some ten years until they went out of business. Mrs. Bivins never met a stranger; in fact Mrs. Bivins always put her friends needs before her own. She loved to read; she also loved gospel music and her church; if you were ever hungry and need ed a meal, Mrs. Bivins always had that special home cooked meal at her house for you. Mrs. Bivins is preceded in death by her loving husband of 41 years: Mr. F.M. Bivins; her daughter: Mrs. Bivins is survived by her daughters: Linda Clara Kent of Providence; Ann Tanner (Duck) of Ft. White and Marilyn Bivins of Providence; son-in-law: John Hilton of Lake City; brother: Leroy Bielliing (Cynthia) of Titusville; sister-in-laws: Bil lie Bielling of Micanopy and Hazel Bivins of Lake Butler; grandchildren and two greatgreat-grandchildren also survive. Funeral services for Mrs. Bivins will be conducted on Thursday September 19, 2013 at 11 A.M in the Providence Village Baptist Church with Rev. Bo Hammock ating. Internment will follow at the Philippi Baptist Church Cem etery. The family will receive friends from 6-8 P.M. on Wednes day evening at the funeral home. ARCHER FUNERAL HOME of Lake Butler is in charge of arrangements, 386-496-2008. Please sign the guestbook at. Obituaries are paid advertise ments. For details, call the Lake City Reporters classified depart ment at 752-1293. OBITUARIES
PAGE 6
ots. He promised to make sure whoever carried out this cowardly act is held responsible. The FBI took charge of the investigation and iden-tified the gunman killed in the attack as 34-year-old Aaron Alexis of Texas. He died after a running gun battle with police, investi-gators said. A federal law enforcement official who was not authorized to discuss the case publicly and spoke on condition of anonymity said Alexis was believed to have gotten into the Navy Yard by using someone elses identification card. But Navy officials said it was not yet clear how he got onto the base. Alexis was a full-time reservist from 2007 to early 2011, leaving as a petty offi-cer con-tractor, but it was not clear if the information technol-ogy worker was assigned at the Naval Yard, accord-ing to two defense offi-cials who spoke on condi-tion of anonymity because they were not authorized to discuss the matter pub-licly. He was also pursuing a bachelors degree in aeronautics online with Embry-Riddle Aeronautical University, the school said. He started classes in July 2012. In addition to those killed, more than a dozen people were hurt, including a police officer and two female civil-ians who were shot and wounded. They were all expected to survive. The Washington Navy Yard is a sprawling laby-rinth of buildings and streets protected by armed guards and metal detec-tors, and employees have to show their IDs at doors and gates to come and go. About 20,000 people work there. The rampage took place at Building 197, the headquar-ters for Naval Sea Systems Command, which buys, builds and maintains ships, submarines and combat sys-tems.management specialist, said she was in the cafete-ria getting breakfast. It was three gunshots straight in a row pop, pop, pop. Three seconds later, it was pop, pop, pop, pop, pop, so it was like about a total of seven gun-shots, and we just started running, Ward said. Todd Brundidge, an executive assistant with Navy Sea Systems Command, said he and other co-work-ers encountered a gunman in a long hallway on the third floor. The gunman was wearing all blue, he said. He just turned and started firing, Brundidge said. Terrie Durham, an executive assistant with the same agency, said the gun-man firing toward her and Brundidge. He aimed high and missed, she said. He said nothing. As soon as I real-ized he was shooting, we just said, Get out of the building. Police would not give any details on the gunmans iden-tified and was not involved in the shooting. 6A LAKE CITY REPORTER LOCAL TUESDAY, SEPTEMBER 17, 2013 Page Editor: Robert Bridges, 754-04286A MILLAGE PER $1,000 General Fund 8.015 GENERALENTERPRISE TOTAL FUNDFUNDS BUDGET CASH BALANCE BROUGHT FORWARD 13,000,000 $ 4,050,000 $ 23,315,000 $ 40,365,000 $ ESTIMATED REVENUES: TAXES: Millage per $1,000 Ad Valorem Taxes 8.015 17,785,024 17,785,024 Non-Ad Valorem Assessments 9,517,000 9,517,000 Sales & Use Taxes 3,437,000 5,420,000 8,857,000 Intergovernmental Revenues 4,292,345 70,580 7,679,774 12,042,699 Charges for Services 643,018 2,739,200 3,382,218 Licenses & Permits 346,100 346,100 Fines & Forfeitures 351,500 143,000 494,500 Franchise Fees 50,000 50,000 Interest Earned/Other 1,315,290 25,000 173,620 1,513,910 T O T A L R E V E N U E S 27,824,177 2,834,780 23,329,494 53,988,451 Less 5% of Estimated Revenue (1,391,209) (141,739) (1,115,377) (2,648,325) Transfers In 300,000 4,900,000 5,200,000 T O T A L E S T I M A T E D R E V E N U E S A N D B A L A N C E S 39,432,968 $ 7,043,041 $ 50,429,117 $ 96,905,126 $ EXPENDITURES/EXPENSE General Government 6,573,351 $ $ 673,519 $ 7,246,870 $ Public Safety 15,154,654 5,082,687 20,237,341 Physical Environment 991,200 2,503,765 3,845,594 7,340,559 Transportation 17,341,950 17,341,950 Economic Environment 185,919 1,038,911 1,224,830 Human Services 2,460,676 2,460,676 Culture/Recreation 1,014,417 1,787,957 2,802,374 Debt Service 135,521 1,734,279 1,869,800 Total Expenditures/Expenses 26,380,217 2,639,286 31,504,897 60,524,400 Reserves 13,052,751 4,403,755 13,724,220 31,180,726 Transfers Out 5,200,000 5,200,000 T O T A L A P P R O P R I A T E D E X P E N D I T U R E S A N D R E S E R V E S 39,432,968 $ 7,043,041 $ 50,429,117 $ 96,905,126 $ THE TENTATIVE ADOPTED AND/OR FINAL BUDGETS ARE ON F ILE IN THE OFFICE OF THE ABOVE MENTIONED TAXING AUT HORITY AS A PUBLIC RECORD. REVENUE/ CAPITAL PROJECTS FUNDS B U D G E T S U M M A R Y C O L U M B I A C O U N T Y B O A R D O F C O U N T Y C O M M I S S I O N E R S F I S C A L Y E A R 2 0 1 3 2 0 1 4 N O T I C E O F B U D G E T H E A R I N G The Columbia County Board of County Commissioners ha s tentatively adopted a budget for the fiscal year ending Septemb er 30, 2014. A public hearing to make a FINAL DECISION on the budge t AND TAXES will be held on: Thursday, September 19, 2013 5:30 p.m. at the Columbia County School Board Auditorium, 372 West Duva l Street, Lake City, Florida SHOOTING: 13 dead, including shooter, after rampage at DCs N avy Yard Continued From Page 1A shows stoically dry creator and executive producer Simon Cowell asked Paige to tell them something interesting about herself. I have arthrogryposis multiplex congenita, Paige said. Basically a whole bunch of words to describe something really simple. AMC is a rare congenital disorder characterized by muscle weakness and improper joint formation. Paige is also nearly blind in her right eye and is unable to hold a microphone with-out assistance. She earned a unanimous yes from the four-judge panel after singing a cover of American Idol season four winner Carrie Underwoods Blown Away. Audiences and judges were giving Paige a standing ovation before the end of her audition. I think you are literally extraordinary, Cowell said. I remember the first day I met Carrie Underwood and I remem-ber predicting that this girl was going to go on and do special things. ... I am going to say the same about you. Paige will continue on to the shows middle section where she will receive coaching from music industry experts and compete against other female singers under the age of 25. Votes from the public will determine which contest receives a $1 million recording contract at the seasons end. RION: Star potential Continued From Page 1A COURTESY GEORGE PEAVEYRion Paige By STEVEN RICHMONDsrichmond@lakecityreporter.comA 16-year-old was arrested after police say he tried to steal the same car twice in a five day period, according to LCPD. Gilmore L. Newkirk, 16, of 1198 SE Putnam Street, was arrested after the owner of a 2008 BMW informed police that a group of indi-viduals attempted to steal his car Sunday after burglarizing one of his other vehicles, the release said. The same BMW was stolen and recovered last Wednesday when the suspect located the keychain device that allows keyless entry and ignition, according to police. After the owner of the vehicle reported the second attempted theft on Sunday, police located three teens outside a nearby conve-nience store while conduct-ing a search of the area, the release said. The individuals consented to a pat-down for weapons when the officer located the keychain device in Newkirks back pocket, authorities said. Police report that the device was able to open the BMW. Newkirk was arrested and booked into the Columbia County Detention Center. However, the Department of Juvenile Justice said Newkirk did not meet the DJJs criteria and was later released to his legal guardian. Police: Teen tried to steal same car twiceFrom staff reportsFlorida Gateway College will host auditions for the December performance of The Nutcracker this Saturday at the Levy Performing Arts Center. The show, presented by Dance Alive National Ballet of Gainesville, will take place December 7 as part of the FGC Entertainment series. Because of demand, two shows will take place a matinee at 2:30 p.m. and an evening show at 7:30 p.m. While the popular ballet took place in Lake City just a year ago, this years spectacle will be even brighter for residents as local dancers will take part in the production. Auditions will begin at 9 a.m. Saturday, followed by various rehearsals throughout the rest of the day. Were looking for children between the ages of 7-18, and they should have some dance experience, said director Kim Tuttle, noting that different parts require different levels of expertise. Tuttle said she is looking at casting between 30-40 local dancers. Tickets are available for both performances of the Nutcracker, and can be purchased at or by calling (386) 754-4340. Nutcracker auditions set for Sat.
PAGE 7
By CAROLYN THOMPSON Associated PressHENRIETTA, N.Y. A diabetic 11-year-old whose family paid $20,000 for a dog trained to sniff out blood sugar swings at school is being tutored at home after the school district refused to allow the service animal in class. Madyson Siragusas parents say her dog named Duke is no different than the seeing eye dogs allowed inside public buildings and are pressing the Rush Henrietta Central School District to reconsider. We have no idea what changed their mind, Keri Siragusa said of dis-trict sub-urbannt medi-cally dis-trict statement provided to The Associated Press said. They use long-estab-lished, well-tested proto-cols including the pru-dent monitoring of blood glucose levels to safe-guard the health and well-being of students. The presence of a service animal trained to mon-itor these levels is redun-dant, the statement said. The animals can supplement school care by detecting highs and lows in between visits to the nurses office, said Lily Grace, founder and chief executive of the National Institute for Diabetic Alert Dogs, which provided the dog. Thats especially important for Madyson, whose Type 1 diabetes makes her prone to rapid fluctuations in her blood sugar levels. Within a 10-minute window, this child can go from having a good number to a dangerous number, Grace said. Yes, the nurse is there, too. Thats a great thing to have, she said from Cottonwood, Calif., where her company is based, but the more tools the better. CLASS NOTESQ To leave an anonymous call on a possible dangerous situation concerning Columbia County schools, call toll-free, (866) 295-7303.Q To leave an anonymous call on a possible truancy problem in Columbia County schools, call 758-4947.Q Items for the school page should be dropped off or mailed to: Leanne Tyo, Lake City Reporter 180 E. Duval St., Lake City, FL 32055; faxed to (386) 752-9400; or e-mailed to ltyo@lakecityreporter.com by 5 p.m. Thursdays. Q L BulletinBoard NEWS ABOUT OUR SCHOOLS 7ASCHOOL 234 SW Main Blvd. 752-5866 Af_e9liej#@@@ 8^\ek DXip?%Jldd\iXcc =`eXeZ`XcJ\im`Z\jI\g% For Life Insurance Go With Someone You Know Limited time offer.The time to purchase our featured Certicate of Deposit through State Farm Bank is NOW. Bank with a good neighbor. CALL AN AGENT FOR MORE INFORMATION OR VISIT US ONLI NE TODAY.1001298.1State Farm Bank, F.S.B., Bloomington, ILstate North Carolina at Georgia Tech Suzannah RainesAge: 10Parents: Chris and Beth Raines Grade: 5th Grade at Eastside Elementary Clubs and/or organizations, both in and out of school, to which you belong: Suzannah is a member of the Broadcast Team at school and was a Student Council Representative for her class in the fourth grade. She is also part of a gymnastic and cheerleading team. What would you like to do when you complete your education? When she graduates from High School, she would like to attend FSU or UF. She would like to be a veterinarian because she loves animals. Achievements:Suzanah has received P.E. and Art Awards. She has earned the A/B Honor Roll certificate every year so far in her elementary years. She has also received the Citizenship Award and the Tiger of the Month Award. What do you like best about school? Suzannah enjoys everything about school, especially science, which she loves! She also enjoys being with her friends at school. Teachers comment about student: Suzannah is an outstanding student. She always has a positive attitude and is always eager to learn new things. She is a great role model for her classmates and other students on campus. Principals comment concerning student: Suzannah is very deserving of this award. She is an outstanding student and a joy to be around. She is leader on our campus. Students comment on being selected for Student Focus. Suzannah is very proud to have been chosen for this honor. She said she will continue to do her best in school. STUDENT PROFILE e-mailed to jbarr@lakecityreporter.com by 5 p.m. Thursdays. BulletinBoard NEWS ABOUT OUR SCHOOLS COURTESY 7A LAKE CITY REPORTER SCHOOLS TUESDAY, SEPTEMBER 17, 2013 Page Editor: Robert Bridges, 754-0428 California school district monitors kids social mediaThe Associated PressGLENDALE, Calif.. Gl report-ed Sunday (). The company expects to be monitoring about 3,000 schools worldwide by the end of the year, said its founder, Chris Frydrych. In Southern California, the district is paying $40,500 to Geo Listening, and in exchange, the com-panys computers scour public posts by students on Twitter, Instagram, Facebook, blogs and other sites. Analysts are alerted to terms that sug-gest suicidal thoughts, bullying, vandalism and even the use of obsceni-ties, among other things. When they find posts they think should spur an inter-vention or anything that violates schools student codes of conduct, the com-pany alerts the campus. The Glendale district began a pilot program to monitor students online last year at its three high schools, Glendale, Hoover and Crescenta Valley. We think its been working very well, said t Some students say they are bothered by the moni-toring, even if its intended to help them. We all know social media is not a private place, not really a safe place, said Young Cho, 16, a junior at Hoover High. But its not the same as being in school. Its stu-dents expression of their own thoughts and feelings to their friends. For the school to intrude in that area I understand they can do it, but I dont think its right.NY school district says no to diabetes service dog
PAGE 8
8A LAKE CITY REPORTER LOCAL TUESDAY, SEPTEMBER 17, 2013 Page Editor: Robert Bridges, 754-0428 8A Vann Since 1947 Carpet One 131 W. Duval St., Downtown Lake City 752-3420 vanncarpetonelakecity.com Vann Carpet One HARDWOOD HARDWOOD CERAMIC TILE CERAMIC TILE CARPET IN STOCK C ARPET FROM 59 SQ FT Bruce P restige P lank A rmstrong A scot Strip A rmstrong A rtesian C lassics A rmstrong 5th A venue P lank Brazilian C herry M aple N atural M ohawk T erra 18x18 A merican O lean 18x18 D A L T ile N apa Gold 18x18 Wood Look T ile 6x24 M ulti C lassic Slate 12x12 D A L T ile 12x12 D A L T ile 18x18 Safari 16x16 A rmstrong Vinyl T ile A rmstrong Luxury Vinyl P lank A rmstrong C ushion Step Vinyl $8.99 $8.99 $9.99 $7.99 $7.99 $7.99 $2.99 $2.99 $5.19 $3.99 $3.49 $1.49 $1.99 $3.99 $ 2 99 $ 2 99 $ 2 99 $ 1 99 $ 2 99 $ 2 99 $ 1 29 $ 1 19 $ 1 99 $ 2 49 $ 1 99 69 79 99 49 $ 1 99 99 RE G. RE G. NO W! NO W! NO W! CARPET VINYL VINYL Clemson at NC State Woman used corkscrew to stab husband, say police By STEVEN RICHMOND srichmond@lakecityreporter.com A woman was arrested after allegedly stabbing her husband with a corkscrew Monday morning, accord ing to LCPD. Crystal Marie Kay, of 2990 SW Windsong Circle, was arrested after authori ties said they found several cuts on her husbands left arm and right foot. The man told police he and Kay were engaged in a verbal argument when she began choking him, hit ting him with a plastic wine glass, and grab bing his genitals, the report said. The cuts on his arm occurred when Kay picked up a corkscrew and attempt ed to stab him in the neck, police said. Authorities said they also found slight scratches on each of Kays buttocks, but that neither individual could say how they got there. While analyzing the corkscrew, police said they found a bloody chunk of flesh still on the tip. Police felt Kay was the aggressor based on state ments from each individual and the severity of the hus bands injuries. When police arrested Kay, the husband stated numer ous times that he did not her to be sent to jail, claim ing prescription pills caused her violent outbursts. Kay was detained in Columbia Country Detention Facility without bond. She faces a second degree felony charge for aggravated battery with a deadly weapon. Kay Habitat going strong with sixth home From staff reports Nearly 130 volunteers have helped Habitat for Humanity of Lake City/ Columbia County Inc. over the last 10 weeks start con struction on a five-bedroom, two-bath home for Gilmore and Brandi Newkirk and their six children. The home is expected to be completed by the end of the year. The not-for-profit held a groundbreaking ceremo ny in late June to kick off its sixth home being con structed in the area. The organizations mission is to end poverty and substan dard housing in Lake City and it has been part of this community for 10 years. So far on the home, the foundation has been poured. The outer walls of the home have been put up, as have the trusses. Even the tar paper has been put in place on the roof in prep aration for the shingles to go up. On Saturday, Sept. 14, Habitat for Humanity of Lake City was joined by about 20 volunteers from two local businesses Odom Moses & Company LLC. and Hearing Solutions, both of Lake City. The volunteers spent the morning getting all of the homes bracing in order, as well as putting a facial on the roof so shingles can be placed down and the roof completed. Habitat works Saturdays from about 8 a.m. to 1 p.m. Lunch is provided. LEFT: Debbie Bedell braces a board while Sam Hall cuts the wood using a skill saw Saturday to help Habitat for Humanity construct its sixth home in Lake City. BELOW LEFT: Habitats sixth Lake City home is well under way. BELOW RIGHT: Daniel Carlucci nails some sid ing into place Saturday on the five-bedroom, two-bath home Habitat for Humanity of Lake City/Columbia County, Inc. is constructing for its latest partner family. Carlucci is one of nearly 130 volunteers who have given up a Saturday morning over the last 10 weeks to help Habitat end poverty and sub standard housing in the Lake City area. Photos courtesy Christopher Shumaker
PAGE 9
By TIM KIRBYtkirby@lakecityreporter.comFORT WHITE Fort White Highs football team ground up another oppo-nent on Friday. The Indians rushed for 393 yards in a 37-27 win at Bradford High. In the Sept. 6 win over Newberry High, the Indians had 308 yards on the ground. Tavaris Williams had his second 200-yard rushing game, this time racking up 260 yards and scoring four touchdowns. Fort White brings in Chiles High on Friday for homecoming. Kickoff is 7:30 p.m. Chiles (0-2) lost 54-53 in overtime to visiting Mosley High. Like Fort White, the Timberwolves opening game was canceled. They lost to Godby High in week two, 64-14. Fort White trailed at halftime against the Tornadoes, but fellow District 2-4A teams Taylor County High and Fernandina Beach had few troubles. Both rolled up 40-0 wins, Taylor County at home over Potters House Christian Academy and Fernandina Beach at Hilliard Middle-Senior High. Taylor County (1-2) hosts Wakulla High this week and Fernandina Beach (2-1) plays at Episcopal High. Madison County High dropped its second straight game, a 20-12 decision to Gainesville High at Citizens Field. Madison County (1-2) hosts Trinity Christian Academy this week. Suwannee High is the first team on Fort Whites schedule to play a district game. The Bulldogs beat visiting Santa Fe High 12-6 in District 5-5A. Suwannee (2-0) continues district play this week with a game at North Marion High. Buchholz High suffered its first loss, as Columbia High beat the Bobcats 34-10 in Lake City on Friday. Buchholz (2-1) opens District 3-7A play this week at Fleming Island High. Hamilton County High lost 26-14 at Chiefland High. The Trojans (0-2) travel to Maclay School this week. Newberry High bounced back from its loss to Fort White with a 35-12 win at Jefferson County High. The Panthers (2-1) open play in tough District 7-1A this week at Chiefland. Bradford (0-2) hosts The Villages High this week in a District 4-4A game. Lake City Reporter SPORTS Tuesday, September 17, 2013 Section B Story ideas?ContactTim KirbySports Editor754-0421tkirby@lakecityreporter.com 1BSPORTS Indians will bring in Chiles High for the celebration. JASON MATTHEW WALKER /Lake City ReporterFort White Highs Kellen Snider (7) heads towards the en d zone and a collision with Bradford Highs Jameaze McNeal during the Indians 3727 win in Starke on Friday Bradford 0 20 0 7 27 Fort White 2 14 7 14 37 First Quarter FWSafety, ball snapped into end zone, :27 Second Quarter FWWilliams 17 run (Sanders kick), 11:45 BDinkins 54 pass from Luke (kick failed), 10:50 BDinkins 30 pass from Luke (Barron kick), 7:09 FWWilliams 55 run (Sanders kick), 4:59 BBarron 10 pass from Luke (Barron kick), :41 Third Quarter FWSnider 5 run (Sanders kick), 2:43 Fourth Quarter FWWilliams 60 run (Sanders kick), 7:14 BDinkins 91 kickoff return (Barron kick), 6:55 FWWilliams 20 run (Sanders kick), 3:08 Fort White BradfordFirst downs 11 13Rushes-yards 42-393 28-86Passing 46 246Comp-Att-Int 5-14-1 12-28-2Punts-Avg. 2-28 2-35Fumbles-Lost 2-1 1-0Penalties 7-95 5-40 INDIVIDUAL STATISTICS RUSHINGFort White, Williams 26-260, Baker 10-54, Snider 3-49, Chapman 3-30. Bradford, Desue 15-60, Luke 9-20, Thomas 4-6. PASSINGFort White, Baker 5-14-461. Bradford, Luke 12-28-246-2. RECEIVINGFort White, Sanders 3-21, Snider 1-22, Chapman 1-3. Bradford, Dinkins 6-142, Barron 4-71, Thomas 1-22, Ardley 1-11.Fort White wins heading into homecoming week
PAGE 10
SCOREBOARD TELEVISIONTV sports Today MINOR LEAGUE BASEBALL 7 p.m. NBCSN Triple-A National Championship, at Allentown, Pa. SAILING 3:30 p.m. NBCSN Americas Cup, race 13 and 14, at San Francisco (if necessary) SOCCER 2:30 p.m. FSN UEFA Champions League, CSKA Moskva at Bayern Munich FS1 UEFA Champions League, Leverkusen at Manchester United 8 p.m. FS1 UEFA Champions League, Manchester City at Plzen (same-day tape)BASEBALLAL standings East Division W L Pct GB Boston 92 59 .609 Tampa Bay 81 67 .547 9 Baltimore 79 70 .530 12New York 79 71 .527 12 Toronto 68 81 .456 23 Central Division W L Pct GB Detroit 86 63 .577 Cleveland 81 68 .544 5Kansas City 78 71 .523 8 Minnesota 64 84 .432 21 Chicago 58 91 .389 28 West Division W L Pct GB Oakland 88 61 .591 Texas 81 67 .547 6 Los Angeles 72 77 .483 16 Seattle 66 83 .443 22 Houston 51 98 .342 37 Todays Games N.Y. Yankees (Pettitte 10-9) at Toronto (Dickey 12-12), 7:07 p.m. Seattle (Maurer 4-8) at Detroit (Ani. Sanchez 14-7), 7:08 p.m. Baltimore (Feldman 5-4) at Boston (Dempster 8-9), 7:10 p.m. Texas (Tepesch 4-6) at Tampa Bay (Hellickson 11-8), 7:10 p.m. Cincinnati (Leake 13-6) at Houston (Lyles 7-7), 8:10 p.m. Cleveland (Kluber 9-5) at Kansas City (Duffy 2-0), 8:10 p.m. Minnesota (Pelfrey 5-12) at Chicago White Sox (Quintana 7-6), 8:10 p.m. L.A. Angels (Richards 7-6) at Oakland (Griffin 14-9), 10:05 p.m. Wednesdays Games Minnesota at Chicago White Sox, 2:10 p.m. L.A. Angels at Oakland, 3:35 p.m.N.Y. Yankees at Toronto, 7:07 p.m.Seattle at Detroit, 7:08 p.m.Baltimore at Boston, 7:10 p.m.Texas at Tampa Bay, 7:10 p.m.Cincinnati at Houston, 8:10 p.m.Cleveland at Kansas City, 8:10 p.m. NL standings East Division W L Pct GB Atlanta 89 60 .597 Washington 79 70 .530 10Philadelphia 69 80 .463 20 New York 67 82 .450 22 Miami 55 94 .369 34 Central Division W L Pct GB Pittsburgh 87 62 .584 St. Louis 87 62 .584 Cincinnati 84 66 .560 3 Milwaukee 65 83 .439 21Chicago 63 86 .423 24 West Division W L Pct GB Los Angeles 86 63 .577 Arizona 75 73 .507 10 San Francisco 69 81 .460 17 San Diego 68 80 .459 17 Colorado 68 82 .453 18 Todays Games Atlanta (F.Garcia 1-1) at Washington (Roark 6-0), 7:05 p.m. Miami (Flynn 0-1) at Philadelphia (Halladay 3-4), 7:05 p.m. San Diego (Stults 8-13) at Pittsburgh (Locke 10-5), 7:05 p.m. San Francisco (Petit 3-0) at N.Y. Mets (Z.Wheeler 7-5), 7:10 p.m. Chicago Cubs (Samardzija 8-12) at Milwaukee (Estrada 6-4), 8:10 p.m. Cincinnati (Leake 13-6) at Houston (Lyles 7-7), 8:10 p.m. St. Louis (J.Kelly 8-4) at Colorado (Nicasio 8-7), 8:40 p.m. L.A. Dodgers (Greinke 14-3) at Arizona (Corbin 14-6), 9:40 p.m. Wednesdays Games Atlanta at Washington, 7:05 p.m.Miami at Philadelphia, 7:05 p.m.San Diego at Pittsburgh, 7:05 p.m.San Francisco at N.Y. Mets, 7:10 p.m.Chicago Cubs at Milwaukee, 8:10 p.m.Cincinnati at Houston, 8:10 p.m.St. Louis at Colorado, 8:40 p.m.L.A. Dodgers at Arizona, 10:10 p.m.FOOTBALLNFL schedule 0 1 0 .000 21 24Pittsburgh 0 1 0 .000 9 16Cleveland 0 2 0 .000 16 37 West W L T Pct PF PAKansas City 2 0 0 1.000 45 18Denver 2 0 0 1.000 90 50Oakland 1 1 0 .500 36 30San Diego 1 1 0 .500 61 61 NATIONAL CONFERENCE East W L T Pct PF PADallas 1 1 0 .500 52 48Philadelphia 1 1 0 .500 63 60 New England 13, N.Y. Jets 10 Sundays Games Kansas City 17, Dallas 16Houston 30, Tennessee 24, OTGreen Bay 38, Washington 20Chicago 31, Minnesota 30Atlanta 31, St. Louis 24San Diego 33, Philadelphia 30Miami 24, Indianapolis 20Baltimore 14, Cleveland 6Buffalo 24, Carolina 23Arizona 25, Detroit 21New Orleans 16, Tampa Bay 14Oakland 19, Jacksonville 9Denver 41, N.Y. Giants 23Seattle 29, San Francisco 3 Mondays Game Pittsburgh at Cincinnati (n)1. Alabama (59) 2-0 1,499 12. Oregon (1) 3-0 1,413 23. Clemson 2-0 1,347 34. Ohio St. 3-0 1,330 45. Stanford 2-0 1,241 56. LSU 3-0 1,134 87. Louisville 3-0 1,092 78. Florida St. 2-0 1,058 109. Georgia 1-1 1,051 910. Texas A&M 2-1 1,001 611. Oklahoma St. 3-0 848 1212. South Carolina 2-1 821 1313. UCLA 2-0 757 1614. Oklahoma 3-0 692 1415. Michigan 3-0 672 1116. Miami 2-0 641 1517. Washington 2-0 496 1918. Northwestern 3-0 487 1719. Florida 1-1 412 1820. Baylor 2-0 355 2221. Mississippi 3-0 300 2522. Notre Dame 2-1 277 2123. Arizona St. 2-0 229 NR24. Wisconsin 2-1 87 2025..Top 25 results No. 1 Alabama (2-0) beat No. 6 Texas A&M 49-42. Next: vs. Colorado State, Saturday. No. 2 Oregon (3-0) beat Tennessee 59-14. Next: vs. California, Saturday, Sept. 28. No. 3 Clemson (2-0) did not play. Next: at N.C. State, Thursday. No. 4 Ohio State (3-0) beat California 52-34. Next: vs. Florida A&M, Saturday. No. 5 Stanford (2-0) beat Army 34-20. Next: vs. Arizona State, Saturday. No. 6 Texas A&M (2-1) lost to No. 1 Alabama 49-42. Next: vs. SMU, Saturday. No. 7 Louisville (3-0) beat Kentucky 27-13. Next: vs. Florida International, Saturday. No. 8 LSU (3-0) beat Kent State 45-13. Next: vs. Auburn, Saturday. No. 9 Georgia (1-1) did not play. Next: vs. North Texas, Saturday. No. 10 Florida State (2-0) beat Nevada 62-7. Next: vs. Bethune-Cookman, Saturday. No. 11 Michigan (3-0) beat Akron 28-24. Next: at UConn, Saturday. No. 12 Oklahoma State (3-0) beat Lamar 59-3. Next: at West Virginia, Saturday, Sept. 28. No. 13 South Carolina (2-1) beat Vanderbilt 35-25. Next: at UCF, Saturday, Sept. 28. No. 14 Oklahoma (3-0) beat Tulsa 51-20. Next: at Notre Dame, Saturday, Sept. 28. No. 15 Miami (2-0) did not play. Next: vs. Savannah State, Saturday. No. 16 UCLA (2-0) beat No. 23 Nebraska 41-21. Next: vs. New Mexico State, Saturday. No. 17 Northwestern (3-0) beat Western Michigan 38-17. Next: vs. Maine, Saturday. No. 18 Florida (1-1) did not play. Next: vs. Tennessee, Saturday. No. 19 Washington (2-0) beat Illinois 34-24. Next: vs. Idaho State, Saturday. No. 20 Wisconsin (2-1) lost to Arizona State 32-30. Next: vs. Purdue, Saturday. No. 21 Notre Dame (2-1) beat Purdue 31-24. Next: vs. Michigan State, Saturday. No. 22 Baylor (2-0) did not play. Next: Louisiana-Monroe, Saturday. No. 23 Nebraska (2-1) lost to No. 16 UCLA 41-21. Next: vs. South Dakota State, Saturday. No. 24 TCU (1-2) lost to Texas Tech 20-10, Thursday. Next: vs. SMU, Saturday, Sept. 28. No. 25 Mississippi (3-0) beat Texas 44-23. Next: vs. No. 1 Alabama, Saturday, Sept. 28.USA Today Top 25 The USA Today Top 25 football coaches poll, with first-place votes in parentheses, records through Sept. 14, total points based on 25 points for first place through one point for 25th, and previous ranking: Record Pts Pvs1. Alabama (61) 2-0 1,549 12. Oregon (1) 3-0 1,477 23. Ohio State 3-0 1,398 34. Clemson 2-0 1,331 55. Stanford 2-0 1,314 46. Louisville 3-0 1,128 77. LSU 3-0 1,121 88. Florida State 2-0 1,113 99. Texas A&M 2-1 1,033 610. Georgia 1-1 1,022 1011. Oklahoma State 3-0 908 1112. Oklahoma 3-0 839 1313. South Carolina 2-1 811 1414. Michigan 3-0 743 1215. UCLA 2-0 699 1716. Northwestern 3-0 582 1617. Miami 2-0 559 1818. Florida 1-1 398 2019. Baylor 2-0 375 2220. Washington 2-0 361 2321. Notre Dame 2-1 331 2122. Mississippi 3-0 303 2523. Arizona State 2-0 176 NR24. Michigan State 3-0 131 NR25. Fresno State 2-0 75 NR Others receiving votes: Nebraska 55; Wisconsin 53; Texas Tech 49; Georgia Tech 37; Arkansas 34; UCF 33 ; Arizona 29; Northern Illinois 26; Auburn 15; Virginia Tech 9; Brigham Young 8; Southern California 7; Kansas State 6; Boise State 5; Utah State 5; Rutgers 2.AUTO RACINGGeico 400 At Chicagoland SpeedwayJoliet, Ill. Sunday (Start position in parentheses) 1. (10) Matt Kenseth, Toyota, 267 laps, 136.7 rating, 48 points, $334,891. 2. (12) Kyle Busch, Toyota, 267, 129.4, 43, $261,048. 3. (17) Kevin Harvick, Chevrolet, 267, 101.1, 42, $221,326. 4. (16) Kurt Busch, Chevrolet, 267, 102.1, 40, $169,960. 5. (9) Jimmie Johnson, Chevrolet, 267, 123.9, 40, $176,926. 6. (6) Jeff Gordon, Chevrolet, 267, 115, 39, $161,976. 7. (2) Brad Keselowski, Ford, 267, 107.4, 38, $164,431. 8. (5) Ricky Stenhouse Jr., Ford, 267, 89.9, 36, $158,976. 9. (24) Clint Bowyer, Toyota, 267, 88.5, 35, $148,273. 10. (20) Ryan Newman, Chevrolet, 267, 86.6, 35, $143,123. 11. (8) Carl Edwards, Ford, 267, 83.4, 34, $142,180. 12. (4) Kasey Kahne, Chevrolet, 267, 97.2, 32, $119,355. 13. (15) Aric Almirola, Ford, 267, 91.1, 32, $140,891. 14. (21) Jeff Burton, Chevrolet, 267, 70.2, 30, $111,180. 15. (26) Marcos Ambrose, Ford, 267, 72.4, 29, $130,994. 16. (7) Greg Biffle, Ford, 267, 88.3, 29, $116,030. 17. (29) Mark Martin, Chevrolet, 267, 70.4, 27, $143,905. 18. (14) Martin Truex Jr., Toyota, 267, 92.9, 26, $132,555. 19. (27) Jamie McMurray, Chevrolet, 267, 64.7, 26, $126,025. 20. (23) Danica Patrick, Chevrolet, 267, 61.2, 24, $100,180. 21. (13) A J Allmendinger, Toyota, 267, 62.1, 23, $124,438. 22. (11) Paul Menard, Chevrolet, 267, 69, 22, $127,571. 23. (41) Dave Blaney, Chevrolet, 267, 53.2, 21, $113,013. 24. (37) Travis Kvapil, Toyota, 266, 51.6, 20, $118,313. 25. (30) J.J. Yeley, Chevrolet, 266, 53.5, 20, $96,005. 26. (19) David Ragan, Ford, 266, 54.3, 19, $114,388. 27. (36) Justin Allgaier, Chevrolet, 266, 50.1, 0, $111,577. 28. (35) David Gilliland, Ford, 266, 40.3, 16, $93,430. 29. (32) Landon Cassill, Chevrolet, 266, 43.7, 0, $90,230. 30. (31) Casey Mears, Ford, 266, 47, 14, $101,980. 31. (42) Joe Nemechek, Toyota, 266, 32.5, 0, $89,780. 32. (3) Juan Pablo Montoya, Chevrolet, 261, 57.5, 12, $116,794. 33. (22) Denny Hamlin, Toyota, engine, 247, 67, 11, $109,180. 34. (39) Timmy Hill, Ford, engine, 225, 33, 10, $89,180. 35. (18) Dale Earnhardt Jr., Chevrolet, engine, 224, 71.2, 10, $106,945. 36. (33) David Reutimann, Toyota, engine, 195, 36.9, 8, $88,755. 37. (1) Joey Logano, Ford, engine, 175, 88.5, 8, $122,433. 38. (25) Brian Vickers, Toyota, engine, 161, 62.1, 0, $90,860. 39. (28) Cole Whitt, Toyota, engine, 151, 40.1, 0, $78,860. 40. (43) Tony Raines, Chevrolet, vibration, 87, 26.3, 0, $74,860. 41. (34) Josh Wise, Ford, brakes, 84, 32.6, 0, $70,860. 42. (40) Reed Sorenson, Ford, vibration, 68, 28.9, 0, $66,860. 43. (38) Michael McDowell, Ford, brakes, 29, 28.9, 1, $63,360. Race Statistics Average Speed of Race Winner: 125.855 mph. Time of Race: 3 hours, 10 minutes, 56 seconds. Margin of Victory: 0.749 seconds.Caution Flags: 9 for 46 laps.Lead Changes: 25 among 16 drivers..BASKETBALLWNBA final standings EASTERN CONFERENCE W L Pct GB z-Chicago 24 10 .706 x-Atlanta 17 17 .500 7 x-Washington 17 17 .500 7x-Indiana 16 18 .471 8 New York 11 23 .324 13 Connecticut 10 24 .294 14 WESTERN CONFERENCE W L Pct GB z-Minnesota 26 8 .765 x-Los Angeles 24 10 .706 2 x-Phoenix 19 15 .559 7 x-Seattle 17 17 .500 9 San Antonio 12 22 .353 14 Tulsa 11 23 .324 15 x-clinched playoff spotz-clinched conference Saturdays Games Minnesota 79, Chicago 66Seattle 85, Tulsa 73 Sundays Games Connecticut 82, Indiana 80, OTLos Angeles 89, Phoenix 55Washington 70, New York 52San Antonio 97, Atlanta 68 End of Regular Season 2B LAKE CITY REPORTER SPORTS TUESDAY, SEPTEMBER 17, 2013 Page Editor: Tim Kirby, 754-04212BAGATE TUESDAY EVENING SEPTEMBER 17, 2013 Comcast Dish DirecTV 6 PM6:307 PM7:308 PM8:309 PM9:3010 PM10:3011 PM11:30 3-ABC 3 -TV20 NewsABC World NewsEntertainment Ton.Inside Edition (N) Iron Man 2 (2010) Robert Downey Jr. The superhero must forge new alliances and confront a powerful enemy.) Latino Americans (Series Premiere) The history and people from 1565-1880. (N) Frontline Egypt in Crisis To Be AnnouncedTavis Smiley (N) 7-CBS 7 47 47Action News JaxCBS Evening NewsJudge Judy Two and Half MenNCIS Damned If You Do NCIS: Los Angeles Descent Person of Interest God Mode Action News JaxLetterman 9-CW 9 17 17Meet the BrownsMeet the BrownsHouse of PayneHouse of PayneWhose Line Is It?Whose Line Is It?Capture A strong team is sabotaged. TMZ (N) Access HollywoodThe Of ce The Of ce 10-FOX 10 30 30Are We There Yet?Family Guy Family Guy The SimpsonsDads PilotBrooklyn Nine-NineNew Girl All In The Mindy ProjectNewsAction News JaxTwo and Half MenHow I Met/Mother 12-NBC 12 12 12NewsNBC Nightly NewsWheel of FortuneJeopardy! (N) The Million Second Quiz Day 8 (N) Americas Got Talent Six acts perform for the nal time. (N) (Live) NewsJay Leno CSPAN 14 210 350(5:00) U.S. House of Representatives Capitol Hill Hearings WGN-A 16 239 307Americas Funniest Home VideosAmericas Funniest Home Videos Analyze This (1999, Comedy) Robert De Niro, Billy Crystal. WGN News at Nine (N) How I Met/MotherRules/Engagement TVLAND 17 106 304(5:48) M*A*S*H(:24) M*A*S*HBoston Legal Boston Legal Love-RaymondLove-RaymondLove-RaymondLove-RaymondLove-RaymondKing of Queens OWN 18 189 279Iyanla, Fix My Life A radio DJs family. Iyanla, Fix My Life-TexasStorage-TexasBarter Kings Driving Home the Deal (:01) Barter Kings HALL 20 185 312Little House on the Prairie Little House on the Prairie The Race Wedding Daze (2004, Comedy) John Larroquette, Karen Valentine. Frasier Frasier Frasier Frasier FX 22 136 248Two and Half MenTwo and Half Men Moneyball (2011, Drama) Brad Pitt, Jonah Hill. Premiere. A baseball manager challenges old-school traditions. Sons of Anarchy Jax deals with collateral damage. Last Call Castle Nikki Heat Rizzoli & Isles We Are Family Rizzoli & Isles Partners in Crime Cold Justice Home Town Hero (N) CSI: NY Shop Till You Drop NIK 26 170 299SpongeBobSpongeBobVictorious Drake & JoshFull House Full House Full House Full House The Nanny The Nanny Friends (:33) Friends SPIKE 28 168 241Ink Master Animal Instinct Ink Master Allies become enemies. Ink Master Baby Dont Go Ink Master Skulls and Villains Ink Master Eyelid tattoos. (N) Tattoo NightmaresTattoo Nightmares MY-TV 29 32 -The Ri emanThe Ri emanM*A*S*H M*A*S*H House You Dont Want to Know House An over-the-hill rock star. Seinfeld Taxi The Twilight ZonePerry Mason DISN 31 172 290Good Luck CharlieJessie Shake It Up! Dog With a Blog Princess Protection Program (2009) Selena Gomez. Dog With a Blog(:05) Jessie Good Luck CharlieAustin & Ally A.N.T. Farm LIFE 32 108 252Abbys Ultimate Dance CompetitionAbbys Ultimate Dance CompetitionDance Moms (N) Abbys Ultimate Dance Competition (N) Double Divas (N) Double Divas (N) (:01) Double Divas(:31) Double Divas USA 33 105 242Law & Order: Special Victims UnitLaw & Order: Special Victims UnitLaw & Order: Special Victims UnitCovert Affairs Levitate Me (N) (:01) Suits An old nemesis returns. (:02) Graceland Pawn (DVS) BET 34 124 329106 & Park: BETs Top 10 Live Top 10 Countdown (N) Friday After Next (2002, Comedy) Ice Cube, Mike Epps. Death at a Funeral (2010, Comedy) Keith David, Loretta Devine, Peter Dinklage. ESPN 35 140 206SportsCenter (N) (Live) E:60 (N) Hispanic Heritage Month Special (N) 2013 World Series of Poker 2013 World Series of PokerSportsCenter (N) (Live) ESPN2 36 144 209Around the HornInterruptionNFL Live (N) NFLs Greatest Games (N) Pro le: 60Baseball Tonight (N) (Live) Olbermann (N) (Live) SUNSP 37 -FSU First LookRays Live! (N)a MLB Baseball Texas Rangers at Tampa Bay Rays. From Tropicana Field in St. Petersburg, Fla. (N) Rays Live! (N) Inside the RaysFOX Sports Live (N) (Live) DISCV 38 182 278Amish Ma a Amish Ma a Brothers Keeper Amish Ma a: The Devils Cut (N) Amish Ma a Sacri cial Lamb (N) Tickle (N) Porter Ridge (N) Amish Ma a TBS 39 139 247Seinfeld Seinfeld Seinfeld Cleveland ShowFamily Guy Family Guy Big Bang TheoryBig Bang TheoryBig Bang TheoryBig) True Hollywood Story Ceelo Green Total Divas A Leg Up Total DivasChelsea Lately (N) E! News TRAVEL 46 196 277Bizarre Foods With Andrew ZimmernMan v. Food Man v. Food Bizarre Foods America Airport 24/7: MiamiAirport 24/7: MiamiExtreme Yachts Extreme Yachts HGTV 47 112 229Income PropertyIncome PropertyHunters IntlHouse HuntersProperty VirginsProperty VirginsProperty VirginsProperty VirginsHouse Hunters (N) Hunters IntlIncome Property Dan & Tania TLC 48 183 28019 Kids-Count19 Kids-Count19 Kids and Counting 19 Kids and Counting 19 Kids and Counting Big Changes The Little CoupleThe Little Couple19 Kids and Counting Big Changes HIST 49 120 269Pawn Stars Pawn Stars Pawn Stars Pawn Stars Counting CarsCounting CarsTop Gear (N) Counting Cars(:31) Counting Cars(:02) Top Gear Alaskan Adventure ANPL 50 184 282To Be AnnouncedRiver Monsters Goes Tribal Madagascar Madagascar was left untouched by man. Wild SerengetiMadagascar FOOD 51 110 231Chopped When Chefs Collide Chopped Canned Cheese, Please! Chopped Momumental Chopped Amazing Amateurs Chopped We Love Leftovers! (N) Cutthroat Kitchen Wing It TBN 52 260 372(5:00) Praise the Lord Way of the MasterThe Potters TouchBehind the ScenesJoyce MeyerJoseph PrinceRod ParsleyPraise the Lord FSN-FL 56 -UFC InsiderMarlins Live! (N)a MLB Baseball Miami Marlins at Philadelphia Phillies. From Citizens Bank Park in Philadelphia. (N) Marlins Live! (N) Inside PanthersFOX Sports Live (N) (Live) SYFY 58 122 244Face Off Mother Goose character. Face Off Artists explore tunnels. Face Off Mother Earth Goddess Face Off A gag element must be added. Heroes of Cosplay Planet Comicon Face Off A gag element must be added. AMC 60 130 254 Starsky & Hutch (2004, Comedy) Ben Stiller, Owen Wilson. Meet the Parents (2000, Comedy) Robert De Niro, Ben Stiller, Blythe Danner. (:31) Meet the Parents (2000) Robert De Niro. Reba Coyote Ugly (2000) Piper Perabo. A struggling songwriter cuts loose in a rowdy New York bar. Cops ReloadedCops ReloadedCops Reloaded NGWILD 108 190 283Dog WhispererUltimate Animal Countdown Sex America the Wild Gator Country The Incredible Dr. PolThe Incredible Dr. Pol Flu the Coop America the Wild Gator Country NGC 109 186 276The Devils Playground Amish teens. Doomsday Castle Learn to Fear Me Snake SalvationSnake SalvationCIA Con dential Hunt for Bin Laden CIA Con dentialCIA Secret Experiments SCIENCE 110 193 284When Dinosaurs Ruled How Its MadeHow Its MadeThe Secret History of Evolution (N) The Secret History of Evolution (N) Species of Mass Destruction (N) The Secret History of Evolution ID 111 192 285Homicide Hunter: Lt. Joe Kenda Homicide Hunter: Lt. Joe Kenda Surviving Evil Underground Terror On Death Row Blaine Milam (N) Evil, I (N) Evil, I Surviving Evil Underground Terror HBO 302 300 501(5:00) Behind the CandelabraReal Time With Bill Maher Parental Guidance (2012) Billy Crystal. PG Enough SaidREAL Sports With Bryant Gumbel (N) The Newsroom Election Night, Part II MAX 320 310 515(4:45) Closer Journey 2: The Mysterious Island (2012) PG (:05) Magic Mike (2012, Comedy-Drama) Channing Tatum. R Tower Heist (2011, Comedy) Ben Stiller, Eddie Murphy. PG-13 SHOW 340 318 545(5:45) Adventures in Babysitting (1987) PG-13 Gone (2012) Amanda Seyfried. PG-13 (:15) The Double (2011, Action) Richard Gere, Topher Grace. PG-13 Web Therapy (N) Dexter BRIEFS GAMES Today ZUMBA Pink Party Zumbathon A Pink Party Zumbathon is 9-10:30 a.m. Oct. 12 at Lake City Skating Palace. Donation is $10 with all proceeds going to the Tough Enough to Wear Pink crisis fund. Participants are asked to wear pink and enjoy the lights, music and dancing. For details, call Sarah Sandlin at 438-9292.Q From staff reports
PAGE 11
From staff reportsColumbia Highs boys golf team faced a Chiles High squad on Monday that shot lights-out. Playing at Golden Eagle Golf Club in Tallahassee, the Timberwolves fired a 3-over 291 for the win. Columbias Tim Bagley was medalist with a 3-under 69. Jacob Soucinek shot 77, Nick Jones shot 78 and Luke Soucinek shot 80. The Tigers fell behind with a 156 on the front, but rebounded with a 4-over 148 on the back. Chiles is one of the best teams in the state, coach Steve Smithy said. Golden Eagle is typically one of the tougher courses we play and they shot an unbeliev-able round. Tim shot a great round for us, probably the best we have ever had on that course. Columbia (7-1) plays Gainesville High at The Country Club at Lake City at 4 p.m. Sept. 24.Bradford golfBranford Highs boys golf team closed last week with a pair of wins and are nearing .500 at 3-4. The Buccaneers beat Union County High 196-203 at Starke Country Club on Thursday and defeated Madison County High 201-241 at Quail Heights Country Club on Thursday. Rylee McKenzie was medalist in the Madison County match with a 45. Tyler Allen, Hunter Hawthorne and Tyler Bradley all shot 52. Against Union County, Allen and McKenzie each shot 46. Hawthorne had a 49 and Bradley shot 53. Bradford hosts Aucilla Christian Academy at 4 p.m. today at Quail Heights. Page Editor: Tim Kirby, 754-0421 LAKE CITY REPORTER SPORTS TUESDAY, SEPTEMBER 10, 2013 3B3BSPORTS BOWLING League reportsLake City Bowl league play: HIT & MISS Team standings: 1. Strike 3 (12-4); 2. Ten In The Pit (12-4); 3. Silver Ladies (11-5). High team handicap game: 1. Strike 3 815; 2. Ten In The Pit 784; 3. Silver Ladies 762. High team handicap series: 1. High Five 2,452; 2. Legal Ladies 2,330; 3. Git Up & Bowl 2,177.(Results from Sept. 10) GOLDEN ROLLERS Team standings: 1. Your Up; 2. Quirky Quad; 3. Gamblers. High team scratch game: 1. Gamblers 706; 2. Jos Crew 633; 3. Power E.N.D.S. 628. High team scratch series: 1. Your Up 1,931; 2. Knock em Down 1,909; 3. Quirky Quad 1,772. High team handicap game: 1. Power E.N.D.S. 857; 2. Gamblers 848; 3. Knock em Down 844. High team handicap series: 1. Quirky Quad 2,459; 2. Jos Crew 2,426; 3. 2 Girls & 2 Guys 2,414. High scratch game: 1. Joyce Hooper 175; 2. Betty Carmichael 172; 3. Vy Ritter 167. 1. David Duncan 246; 2. Earl Hayward 203; 3. Bill Price 200. High scratch series: 1. DeDe Young 477; 2. Debbie Walters 449; 3. Louise Atwood 447. 1. Ric Yates 561; 2. Mike Murray 556; 3. Lee Evert 537.(Results from Sept. 5) TUESDAY NITE MIXED High team handicap game: 1. 10 In The Pitt 843; 2. Wolf Pack 833; 3. O 2 Cool 820. High team handicap series: 1. Wolf Pack 2,395; 2. Bowlistic 2,387; 3. 10 In The Pitt 2,372. High scratch game: 1. Mary Lobaugh 202; 2. (tie) Mary Lobaugh, Mary Lobaugh, Maggie Battle 180; 5. Sherri Miller 172. 1. Jim Lobaugh 209; 2. Bill Dolly 193; 3. Bobby Robinson 190. High scratch series: 1. Mary Lobaugh 562; 2. Sherri Miller 504; 3. Maggie Battle 479. 1. Bill Dolly 549; 2. Jim Lobaugh 536; 3. George Mulligan 492. High handicap game: 1. Mary Lobaugh 238; 2. Debbie Walters 228; 3. Sherri Miller 224. 1. Jim Lobaugh 233; 2. Bobby Robinson 230; 3. Bill Dolly 221. High handicap series: 1. Mary Lobaugh 670; 2. Sherri Miller 660; 3. Lau Sapp 613. 1. Bill Dolly 633; 2. Josh Duff 619; 3. Dess Fennell 614. High average: Mary Lobaugh 172; (tie) Jim Lobaugh, Bill Dolly 179.(Results from Sept. 10) TGIF Team standings: 1. Back At You Again (10-2, 7,437 pins); 2. Missing One (10-2, 7,430 pins); 3. Trinity (10-2, 7,183 pins). High team handicap game: 1. Da Spares 879; 2. Back At Ya Again 859; 3. Five Alive 850. High team handicap series: 1. Back At Ya Again 2,513; 2. Da Spares 2,487; 3. Fun Tyme Travel 2,483. High scratch game: 1. Chris Pauwels 215; 2. Chrissy Fancy 205; 3. Samantha Jolliffe 193. 1. George Mulligan 224; 2. Jason Howell 220; 3. Dustin Howard 216. High scratch series: 1. Chris Pauwels 546; 2. Donna Duncan 526; 3. Ida Hollingsworth 512. 1. Dustin Howard 599; 2. George Mulligan 589; 3. (tie) Jason Howell, Zech Strohl 587. High handicap game: 1. Chris Pauwels 264; 2. Chrissy Fancy 250; 3. Samantha Jolliffe 247. 1. Mark Pentolino 252; 2. George Mulligan 248; 3. (tie) Jason Howell, Dustin Howard 243. High handicap series: 1. Chris Pauwels 693; 2. Donna Duncan 682; 3. Samantha Jolliffe 651. 1. Dustin Howard 680; 2. Blake Landen 668; 3. George Mulligan 661.(Results from Sept. 6) LAKE CITY BOWL Team standings: 1. Handicappers (12-4, 4,785 handicap pins); 2. Jos Crew (12-4, 4,643 handicap pins); 3. Spoilers (10-6, 4,790 handicap pins); 4. Outcasts (10-6, 4,693 handi-cap pins); 5. Pin Busters (10-6, 4,596 handicap pins). High team handicap game: 1. Handicappers 858; Pin Droppers 825; 3. Double Up 807. High team handicap series: 1. Spoilers 2,466; 2. Outcasts 2,383; 3. Keglers 2,328.(Results from Aug. 27) MONDAY NIGHT MAVERICKS Team standings: 1. Team 6 (50-10); 2. Bias Well Drilling (44-16); 3. Budweiser (36-24). High scratch game: 1. Bill Duncan 290; 2. Robert Stone 246; 3. (tie) Josh Fancy, David Adel 243. High scratch series: 1. Bill Duncan 743; 2. Robert Stone 713; 3. Josh Fancy 649. High handicap game: 1. Bill Duncan 297; 2. Dalton Coar 263; 3. Josh Fancy 260. High handicap series: 1. Bill Duncan 764; 2. Robert Stone 746; 3. Doug Fennell 701. High average: 1. Robert Stone 225; 2. Bill Duncan 217.17; 3. Dale Coleman 210.(Results from Sept. 2)Youth leaguesJUNIORS Team standings: 1. Lucky Strike (6-2, 3,226 pins); 2. Team 8 (6-2, 3,133 pins); 3. Hot Shots (5.5-2.5). High team handicap game: 1. Team 6 597; 2. Lucky Strike 590; 3. Hot Shots 565. High team handicap series: 1. Lucky Strike 1,679; 2. Team 6 1,669; 3. Hot Shots 1,615. High handicap game: 1. Heaven Camacho 200; 2. Biancah Billingsley 194; 3. Jennifer Allen 192. 1. Vincent Cavallero 245; 2. Phillip Whitehead 224; 3. David Becker 217. High handicap series: 1. Jennifer Allen 566; 2. Heaven Camacho 200; 3. Jadyn Freeman 541. 1. Vincent Cavallero 649; 2. Phillip Whitehead 598; 3. Trey Warren 594.(Results from Sept. 7) COURTESYSepulveda ATA Martial Arts winnersMaster Robert Sepulveda hosted the tri-annual inter-schoo l tournament in St. Cloud on Aug. 2-3. There were more than 200 competitiors during the two-day event in traditional forms and sparring, creative and mixed martial arts divi sions. Winning medals were team members (front row, from left) Brody Green, Tommy Suh and Braden Thompson. Second row (from left) are Jessie Braden, Phillip Dorris and C olby Thompson. Back row (from left) are Daniel Bryant, Jeff Thompson, Seth Booz, Jacob Waschec k and Laurence Whitmore. JASON MATTHEW WALKER /Lake City ReporterFort White Highs Rykia Jackson sets up a shot in Thursda ys game against Columbia High. Columbia golf falls to Chiles Columbia High football great Scott Adams diesFrom staff reportsFormer Columbia High football great Scott Adams died of an apparent heart attack in Athens, Ga., on Monday. Adams would have been 47 on Sept. 28. Adams played college football at the University of Georgia and had a six-year career in the NFL, playing for Minnesota, New Orleans, Chicago, Tampa Bay and Atlanta. He started 10 games for the Vikings in 1993. Adams graduated from CHS in 1984. A lineman, Adams played on the 1982 district cham-pionship football team that advanced to the second round of the state playoffs. The Tigers (10-2) lost 31-28 to eventual state champion Woodham High. In his senior year, Columbia went 9-2 and beat Ed White High 35-0 in the Meninak Bowl. Adams is the son of Charlotte Swink and the late Larry Adams. Funeral arrangement were incomplete Monday. Fort White volleyball beaten by ChieflandBy TIM KIRBYtkirby@lakecityreporter.comFORT WHITE Fort White Highs volleyball team lost to Chiefland High on Monday. The visiting Lady Indians won the first two sets 26-24, 25-12. Fort White fought back to take the third set 25-23 and Ashley Cason served the first eight points of the fourth set. Chieflands Marjorie Cothran went one better on service, and Kira Telgen also served for nine points in the 25-19 clinching set. Cason finished with 15 service points and 16 assists. Arianna House had 12 kills and Leah Johnson had four aces. I wanted to see how some of the girls that dont start respond and I think they did pretty good, coach Kelbie Ronsonet said. Fort White (3-7, 1-2) plays Suwannee High at 6 p.m. today in Live Oak.
PAGE 12
4B LAKE CITY REPORTER SPORTS TUESDAY, SEPTEMBER 17,WAKE FOREST GEORGIA TECH SYRACUSE PITTSBURGH WEST VIRGINIA FLORIDA STATE CLEMSON FLORIDA MISSISSIPPI STATE ARKANSAS LSU GEORGIA INDIANA BRIAN LEWISLEWIS INSURANCEWAKE FOREST GEORGIA TECH SYRACUSE PITTSBURGH WEST VIRGINIA FLORIDA STATE CLEMSON FLORIDA MISSISSIPPI STATE RUTGERS LSU GEORGIA MISSOURITIEBREAKER: (SCORES)Lawton Chiles @ Ft. WhiteThis weeks reader winner: DONALDBORERJOHN BURNS AND JOHN KASAKSTATE FARM INSURANCEWAKE FOREST GEORGIA TECH SYRACUSE PITTSBURGH WEST VIRGINIA FLORIDA STATE CLEMSON FLORIDA MISSISSIPPI STATE ARKANSAS LSU GEORGIA MISSOURI DAVID POTTER ANDCHRISCONERONSONET BUICK GMC TRUCKS WAKE FOREST GEORGIA TECH SYRACUSE PITTSBURGH MARYLAND FLORIDA STATE CLEMSON FLORIDA MISSISSIPPI STATE ARKANSAS LSU GEORGIA MISSOURICOV WOODLEY ANDJOHNWOODLEYJ.W. WEAPONRY & OUTDOORS WAKE FOREST GEORGIA TECH SYRACUSE PITTSBURGH MARYLAND FLORIDA STATE CLEMSON FLORIDA MISSISSIPPI STATE ARKANSAS LSU GEORGIA INDIANA CORY DEPRATTERFLORIDA GRASSMASTERS WAKE FOREST GEORGIA TECH SYRACUSE PITTSBURGH WEST VIRGINIA FLORIDA STATE CLEMSON FLORIDA MISSISSIPPI STATE ARKANSAS LSU GEORGIA MISSOURIDR. BRADYPRATT ANDDR.KEVINHAWTHORNELAKE CITY ANIMAL HOSPITAL WAKE FOREST GEORGIA TECH SYRACUSE DUKE WEST VIRGINIA FLORIDA STATE CLEMSON FLORIDA MISSISSIPPI STATE ARKANSAS LSU GEORGIA MISSOURI DR.JIMBO HALEYOLYMPIC HEALTH CHIROPRACTORWAKE FOREST GEORGIA TECH SYRACUSE DUKE WEST VIRGINIA FLORIDA STATE CLEMSON FLORIDA MISSISSIPPI STATE RUTGERS LSU GEORGIA MISSOURI SHIRLEY MIKELLMIKELLS POWER EQUIPMENT WAKE FOREST GEORGIA TECH SYRACUSE PITTSBURGH MARYLAND FLORIDA STATE CLEMSON FLORIDA MISSISSIPPI STATE RUTGERS LSU GEORGIA MISSOURICHRIS DAMPIER AND ROBIN GREENPEOPLES STATE BANKWAKE FOREST GEORGIA TECH SYRACUSE PITTSBURGH MARYLAND FLORIDA STATE CLEMSON FLORIDA MISSISSIPPI STATE ARKANSAS LSU GEORGIA MISSOURI JANA HURST ANDBEVERLY BASSBAKERS COMMUNICATIONWAKE FOREST NORTH CAROLINA SYRACUSE DUKE MARYLAND FLORIDA STATE CLEMSON FLORIDA MISSISSIPPI STATE RUTGERS LSU GEORGIA MISSOURI MATT VANN AND MARC VANNVANN CARPET ONEWAKE FOREST GEORGIA TECH SYRACUSE DUKE MARYLAND FLORIDA STATE CLEMSON FLORIDA MISSISSIPPI STATE RUTGERS LSU GEORGIA MISSOURI CHRISPOTTLEWHOLESALE SLEEP/FURNITURE SHOWPLACEWAKE FOREST GEORGIA TECH SYRACUSE PITTSBURGH MARYLAND FLORIDA STATE CLEMSON FLORIDA MISSISSIPPI STATE RUTGERS LSU GEORGIA MISSOURI 33-6 31-8 30-9 31-8 33-6 29-10 31-8 31-8 32-7 32-7 32-7 31-8 30-9
PAGE 13
DEAR ABBY: My younger sister, Tanya, is 22 and a single mother. Her son is 2. Shes pregnant again, and this time her baby will be a girl. My sister is very dramatic and emotional. She gets angry easily and has a short fuse. Shes great with her son, except he picks up on her drama and is some-what dramatic himself. My worry is that girls are more likely to imitate that behav-ior, and Im concerned my niece will be just like her mother. Although Tanya has a good heart, her emo-tional issues have caused her to have horrible rela-tionships with men, as our mother did. When I suggested to my sister that she talk to some-one wasnt rude; it was a loving thing to do. Your sister reacted defen-sively because she isnt ready to admit she needs help. What you must do is hope that one day she will be receptive, but also accept that it may never happen. ** ** **DEAR ABBY: How does a person quit being a quitter? At 46, I have realized that this is what I am. I have quit everything -church, jobs, school. If I dont like a friend, I just drop the person. The same goes for books, exercise -everything! How do you stop the lifelong habit of quitting? -QUITTER IN CHARLESTON DEAR CHARLESTON: I hate to see you give yourself a pejorative label. Its time to have yourself evaluated because it is possible you suffer from attention deficit disorder -and if you do, there is help for it. If thats not the case, then start small, give yourself a goal you CAN accomplish and dont stop until you have reached it. It doesnt have to be any-thing complicated, but see it through. Then give your-self relation-ships. ** ** **DEAR ABBY: I am a married woman with sever-al single friends. They are always eager to do things with me, but married life is a lot different than being single. Id love to connect these friends, who dont know each other. I real-ize making friends can be hard, and Id love to help them in that way. What would be the best way to do this? I dont have a lot of time to spend invit-ing everyone together and having them get to know each other. Id like to do a quick introduction, then let them go have fun doing single people things. Is this possible? -UNIFIER IN PITTSBURGH DEAR UNIFIER: Absolutely. Call or email your friends and tell them there are people you want them to meet because you think theyd enjoy each other. Then arrange a group lunch at a convenient location and introduce them. After that, if the chemistry is right, theyll become friendly. DILBERT BABY BLUES HOROSCOPES DEAR ABBY ARIES (March 21-April 19): Discuss important issues with colleagues and make adjustments accord-ing to the information you receive. Stick to whatever decision you agree upon and postpone expanding until you are sure you can handle whats already expected of you. +++ TAURUS (April 20May 20): The knowledge and experience you gain through helping others will help you in your per-sonal and business life. Last-minute plans to travel should be reconsidered. Unexpected difficulties are likely to lead to delays. Express your feelings. ++++ GEMINI (May 21-June 20): Keep personal infor-mation a secret. Put a price on what you do and have to offer, or someone will try to get you to work for nothing. Speak up and make adjustments that will ensure that you get what you want. ++ CANCER (June 21July 22): What you do for someone special will speak volumes about the way you feel. Love and romance are highlighted, and being romantic will make a posi-tive impact on your day. Short trips will enhance your life. +++ LEO (July 23-Aug. 22): Find out as much information as possible so that you can maintain control. Expect someone to put demands on your time. Do your best to deal with chores so you can move on to more lucrative and inter-esting pastimes. +++ VIRGO (Aug. 23-Sept. 22): Broaden your vision by interacting with people from unusual backgrounds. What you discover will enable you to have a fresh outlook on an old idea, plan or project. Love is in the stars, and sharing romantic plans will improve your per-sonal life. +++ LIBRA (Sept. 23-Oct. 22): Share your thoughts, beliefs and the things you enjoy doing with someone who has similar interests. Fixing up your home may meet with opposition from someone who has alterna-tive ideas or plans. Find a way to compromise before you begin. +++++ SCORPIO (Oct. 23-Nov. 21): Slow down and dont allow anyone to push you into something you dont care to do. Follow what-ever path you feel most comfortable with, and you will satisfy your curiosity and discover a skill or tal-ent you didnt realize you had. +++++ SAGITTARIUS (Nov. 22Dec. 21): An emotional sit-uation will cause you grief if you arent honest about the way you feel. Dont commit to do something unless you plan to follow through. A loss of reputa-tion will cost you when you want a favor or help. ++ CAPRICORN (Dec. 22Jan. 19): Dont hesitate to move forward, even if it is at someone elses expense. You mustnt feel guilty when its time to collect whats owed to you. Plan to celebrate your good fortune with someone you love. Nurture important relationships. ++++ AQUARIUS (Jan. 20Feb. 18): Follow through with any promise you make, or you will be ques-tioned. Find an interest and develop your skills. Being prepared will ensure that you can make positive changes to the way you earn a living. Focus on financial, legal and medical matters. +++ PISCES (Feb. 19-March 20): Emotions coupled with creativity and passion will all lead to an interest-ing day with plenty of memories. Expand your friendships or romance someone special to you. Live in the moment and do your best to enjoy every experience you encounter. +++ CELEBRITY CIPHER Abigail Van Buren BLONDIE BEETLE BAILEY B.C. FRANK & ERNEST FOR BETTER OR WORSE ZITS HAGAR THE HORRIBLE SNUFFY SMITH GARFIELD THE LAST WORD Eugenia Last Volatile younger sister must reach out for help on her own Q Write Dear Abby at or P.O. Box 69440, Los Angeles, CA 90069. CLASSIC PEANUTS Page Editor: Emogene Graham, 754-0415 LAKE CITY REPORTER ADVICE & COMICS TUESDAY, SEPTEMBER 17, 2013 5B
PAGE 14
LAKECITYREPORTER CLASSIFIEDTUESDAY, SEPTEMBER 17, 2013 Classified Department: 755-5440 6B LegalIN THE CIRCUITCOURTOF THE THIRD JUDICIALCIRCUIT, IN AND FOR COLUMBIACOUNTY, FLORIDACASE NO.: 12-2012-CA-0000623FIRSTFEDERALBANK OF FLORIDA, a FEDERALLYCHAR-TERED SAVINGS BANK, Plaintiff,Vs.JOHN M. HAGER, et al., Defend-ants.NOTICE OF ACTIONTO: ESTATE OF JOHN M. HAGER A/K/AJOHN MASON HAGER AND ALLUNKNOWN HEIRS OF JOHN M. H HAGER A/K/AJOHN MASON HAGERLast Known Address: UnknownYou are notified that an action to foreclose a mortgage on the follow-ing property in COLUMBIACounty, Florida, has been instituted against you:Lot 23, SHERWOOD FOREST, Unit 2, according to he map or plat thereof as recorded in Plat Book 4, Page 14-14A, of the Public Records of Columbia County, Florida.TOGETHER WITH A2001, FLEETWOOD, 28X40, DOUBLE-WIDE MOBILE HOME, ID#S GA-FLY39A14992F221 & GA-FLY39B14992F221.Property Address: 439 SE Robin Hood Place, High Springs, FL32643-1343The action was instituted in the Cir-cuit Court of the THIRD Judicial Circuit in and for COLUMBIACounty, Florida; Case No. 2012-CA-0000623; and is styled FIRSTFED-ERALBANK OF FLORIDA, a FEDERALLYCHARTERED SAV-INGS BANK v. JOHN M. HAGER A/K/AJOHN MASON HAGER; WANDAL. SIMMONS A/K/AWANDALATRELLASIMMONS; ESTATE OF JOHN M. HAGER A/K/AJOHN MASON HAGER; UNKNOWN HEIRS OF JOHN M. HAGER A/K/AJOHN MASON HAGER; UNKNOWN SPOUSE OF WANDAL. SIMMONS A/K/AWANDALATRELLASIMMONS; UNKNOWN PERSONALREPRE-SENTATIVE OF JOHN M. HAGER A/K/AJOHN MASON HAGER; UNKNOWN TENANTIN POSSES-SION and UNKNOWN TENANT2 POSSESSION.You are required to serve a copy of your written defenses, if any, to the action on R. Howard Walton, Plain-tiffs attorney, whose address is One Independent Drive, Suite 1650, Jack-sonville, Florida 32202, email: serv-icecopies@qpwblaw.com and rhwal-ton@qpwblaw.com, on or before 30 days from the first date of publica-tion of this Notice, and file the origi-nal with the clerk of this court either before service on the foregoing Plaintiffs Attorney or immediately after such service; otherwise, a de-fault will be entered against you for the relief demanded in the complaint or petition.The Court has authority in this suit to enter a judgment or decree in the Plaintiffs interest which will be binding upon you.DATED: August 21, 2013P. DeWitt CasonAs Clerk of the CourtBy: -sB. ScippioAs Deputy ClerkSEAL05540760September 10, 17, 2013 REGISTRATION OFFICTITIOUS NAMESWethe undersigned, being duly sworn, do hereby declare under oath that the names of all persons interest-ed in the business or profession carried on under the name of BRYAN ZECHER HOMES INC d/b/a ARTHUR RUTENBERG HOMES at P.O. BOX 815 LAKE CITY, FL32056Contact Phone Number: (386)752-8653 and the extent of the interest of each, is as follows:Name: BRYAN ZECHERExtent of Interest: 100%by:/s/ BRYAN ZECHERSTATE OF FLORIDACOUNTYOF COLUMBIASworn to and subscribed before me this 13TH day of AUGUST, A.D. 2013.by:/s/ ROBIN W. NICHOLS05540937SEPTEMBER 17, 2012 IN THECIRCUITCOURTFOR COLUMBIACOUNTY, FLORIDAPROBATE DIVISIONFILE NUMBER: 13-180-CPIN RE: ESTATE OF MARGARETLOUISE RAULERSON,Deceased.NOTICE TO CREDITORSThe administration of the estate of MARGARETLOUISE RAULER-SON deceased, whose date of death was June 2, 2012, is pending in the Circuit Court for Columbia County, Florida, Probate Division, the ad-dress of which is 173 NE Hernando Avenue, Lake City, Florida 32055. The name and address of the Person-al Representative the court WITHIN THE LATER OF 3 MONTHS AFTER LegalTHE TIME OF THE FIRSTPUBLI-CATION OF THIS NOTICE OR 30 DAYS AFTER THE DATE OF SERVICE OF ACOPYOF THIS NOTICE ON THEM.All the creditors of the Decedent and other persons having claims or de-mands September 17, 2013.Personal Representative:/s/ Margaret SelsorMARGARETSELSOR4875 Pelican Colony Blvd. #1501Bonita Springs, Florida 34134Attorneys for Personal Representa-tive:DARBY& PEELEBy : /s/ Bonnie S. GreenBONNIE S. GREENFlorida Bar No. 010785285 Northeast Hernando AvenuePost Office Drawer 1707Lake City, Florida 32056-1707Telephone: (386) 752-4120Facsimile: (386) 755-4569Primary email: bonniegreen@darby-peele.comSecondary email: deloresbrannen@darbypeele.com05540845September 10, 17, 2013 IN THECIRCUITCOURTFOR COLUMBIACOUNTY, FLORIDAPROBATE DIVISIONFILE NO. 13000197CPAXMXIN RE: ESTATE OF DORIS MAE FARDEN LING, a/k/a DORIS MAE LING, a/k/a DORIS M. LING,Deceased.NOTICE TO CREDITORSThe administration of the estate of DORIS MAE FARDEN LING, a/k/a DORIS MAE LING, a/k/a DORIS M. LING, deceased, whose date of death was August 2, 2013; File Number 13000197CPAXMX other creditors of the decedent and other persons having claims or demands against decedents estate, on whom a copy of this notice is re-quired to be served must file their claims with this court ON OR BE: Sept. 12, 2013/s/ Donald Reese Ling, Jr.DONALD REESE LING, JR.Personal Representative 15 North Indian River Drive, Unit 701Cocoa, FL32922/s/ Steven C. AllenderSTEVEN C. ALLENDERAttorney for Personal RepresentativeEmail: sallender@allenderlaw.comSecondary Email: ashley@allender-law.comFlorida Bar No. 0428302Titusville, FL32796Telephone: (321) 269-1511Fax: (321) 864-767613-206-AK05540908September 17, 24, 2013 IN THECIRCUITCOURTOF THE THIRD JUDICIALCIRCUITOF THE STATE OF FLORIDA, IN AND FOR COLUMBIACOUNTYCIVILDIVISIONCASE NO. 2009-CA-260BANK OF AMERICA, N, LegalASSIGNEES, CREDITORS, LIE-NORS, AND TRUSTEES, AND ALLOTHER PERSONS CLAIM-ING BY, THROUGH, UNDER OR AGAINSTTHE NAMED DE-FENDANT(S); UNKNOWN TEN-ANT#1; UNKNOWN TENANT#2Defendant1/4 1427.47 FEET; THENCE N 88 DEGREES 4523 E, 955.24 FEETTO THE POINTOF BEGINNING, ALSO BEING APOINTON THE SOUTH RIGHT-OF-WAYLINE OF A60.00 FOOTEASEMENT; THENCE N 00 DE-GREES 4107 W, 60.42 FEET; THENCE N 88 DEGREES 4546 E, 109.91 FEET; THENCE S 00 DE-GREES 4107 E TO THE SAID SOUTH RIGHT-OF-WAYLINE OF EASEMENT, 60.42 FEET; THENCE CONTINUE S 00 DE-GREES 4107 E, 145.21 FEET; THENCE N 87 DEGREES 3524 W,110.07 FEET; THENCE N 00 DEGREES 4107 W, 138.21 FEETTOTHE SAID SOUTH RIGHT-OFWAYLINE OF EASEMENT, AL63B79848SH21 97532083at public sale, to the highest and best bidder, for cash, West door of the Columbia County Courthouse, 173 NE Hernando Avenue, Lake City, FL32056 at 11:00 AM, on October 16, 2013Any person claiming an interest in the surplus from the sale, if any, oth-er than the property owner as of the date of the lis pendens, must file a claim within 60 days after the sale.Witness, my and seal of this court on the 29th day of August, 2013.P. DeWitt CasonCLERK OF THE CIRCUITCOURTBy: /s/ B.40822September 10, 17, 2013 IN THECIRCUITCOURTOF THE THIRD JUDICIALCIRCUITIN AND FOR COLUMBIACOUNTY, FLORIDAJUVENILE DIVISIONIN THE INTERESTOF:CASE NO. 2012-30-DPG. W. J-SDOB: 2/26/2009MINOR CHILD.SUMMONS AND NOTICE OF AD-VISORYHEARING FOR TERMI-NATION OF PARENTALRIGHTS AND GUARDIANSHIPSTATE OF FLORIDA:TO: Gene Robert Sim OCTOBER 9, 2013, AT10:20) NAMED IN THE PETITION ON FILE WITH THE CLERK OF THE COURT******Pursuant to Sections 39.802(4)(d) and 63.082(6)(g), Florida Statutes, you are hereby informed of the availLegalability of private placement with an adoption entity, as defined in Section 63.032(3),WITNESS my hand and seal of this Court at Lake City, Columbia Coun-ty, Florida, on the __ day of _____ 2013.P. DEWITTCASONClerk of Circuit Court(SEAL)By: /s/ Deputy ClerkErin Londraville, Esq.Florida Bar No. 91816Childrens Legal Services1389 West US Highway 90, Suite 110Lake City, FL32055(386) 243-6037IN ACCORDANCE WITH THE, 173 NE Hern5540843September 10, 17, 24, 2013October 1, 2013 IN THE CIRCUITCIVILCOURTOF THE THIRD JUDICIALCIR-CUITOF FLORIDA, IN AND FOR COLUMBIACOUNTYCIVILDIVISIONCase No. 12-2011-CA-000062U.S. BANK NATIONALASSOCIATIONPlaintiff,Vs.MARAWINGFIELD AND UNKNOWN as COLUMBIACOUNTYCOURTHOUSE, 173 N.E. HER-NANDO AVENUE, LAKE CITY, FL32055 ON 11/20/13 AT11:00AM,Any person claiming an interest in the surplus from the sale, if any, oth-er than the property owner as of the date of the lis pendens must file a claim within 60 days after the sale.Dated this 29th day of August, 2013.Clerk of the Circuit CourtP. DeWitt CasonBy: /s/ B. ScippioDeputy ClerkSEAL05540821September 10, 17, 2013 IN THECIRCUITCOURTOF THE THIRD JUDICIALCIRCUITOF FLORIDAIN AND FOR COLUM-BIACOUNTYGENERALJURIS-DICTION DIVISIONCASE NO. 2010CA000565BANK OF AMERICA, N.A.Plaintiff,vs.ROGER W. HAIRSTON, ETAL.,Defendants.NOTICE OF FORECLOSURE SALENOTICE IS HEREBYGIVEN pur-suant to a Final Judgment of Foreclo-sure filed June 27, 2103 entered in Civil Case No. 2010CA000565 of the Circuit Court of the THIRD Judi-cial Circuit in and for Columbia County, Lake City, Florida, wherein BANK OF AMERICA, N.A. is Plaintiff and, MARIAWHAIR-STON A/K/AMARIAHAIRSTON, ROGER W. HAIRSTON A/K/AROGER HAIRSTON, MARIAHAIRSTON, are Defendants, the Clerk of Court will sell to the highest and best bidder for cash at Columbia County Courthouse, 173 Northeast Hernando Ave. 3rd Floor, Lake City, FL. 32055 in accordance with Chap-ter 45, Florida Statues on the 2nd day of October, 2013 at 11:00 AM on the following described property as set forth in said Final Judgment, to-wit:LOT4, FOXBORO, ACCORDING TOTHE MAPOR PLATTHEREOF PLATBOOK 6, PAGE(S) 207, PUBLIC RECORDS OF COLUM-BIACOUNTY, FLORIDATO-GETHER WITH A2003 DOUBLE-WIDE MOBILE HOME WITH VIN'S PH0914268AFLAND PH0914268BFLAny person claiming an interest in the surplus from the sale, if any, othLegaler953September 17, 24, 2013 IN THECIRCUITCOURTFOR COLUMBIACOUNTY, FLORIDAPROBATE DIVISIONFile No. 2013-195-CPIN RE: ESTATE OF RUTH ANN DOWLINGDeceased.NOTICE TO CREDITORSThe administration of the estate of Ruth Ann Dowling, deceased, whose date of death was August 2, 2013, and the last four digits of whose so-cial security number are 1949, is pending in the Circuit Court for Co-lumbia County, Florida, Probate Di-vision, the address of which is 173 NE Hernando Ave., Lake City, Flori-da 10, 2013.Personal Representative:/s/ Raphael Eddie A. HaverlandRaphael Eddie A. Haverland4721 216th StreetLake City, FL32024Attorney for Personal Representative:/s/ John E. NorrisJohn E. NorrisAttorney for Raphael Eddie A. HaverlandFlorida Bar Number: 058998Norris & Norris, P.A.253 NWMain BlvdLake City, FL32055Telephone: (386) 752-7240Fax: (386) 752-1577E-Mail: jnorris@norrisattorneys.com05540850September 10, 17, 2013September 6, 2013 IN THE CIRCUITCOURTOF THE THIRD JUDICIALCIRCUITIN AND FOR COLUMBIACOUNTY, FLORIDACASE N.: 12-2012-CA-000046BANK OF AMERICA, NA, SUC-CESSOR BYMERGER TO BAC HOME LOANS SERVICING, LP, FKACOUNTRYWIDE HOME LOANS SERVICE, LPPlaintiff,v.LAURAHAGGERTY; KEVIN HAGGERTY; ANYAND ALLUN-KNOWN Au-gust 30, 2013, entered in Civil Case No. 12-2012-CA-000046 of the Cir-cuit Court of the Third Judicial Cir-cuit in and for Columbia County, Florida, wherein the Clerk of the Cir-cuit Court will sell to the highest bid-der for cash on 2nd day of October, 2013, at 11:00 a.m. on the Third Floor of the Columbia County Court-house, 173 NE Hernando Avenue, Lake City, Florida 32055, in accord-ance with Chapter 45 Florida StatLegalutes, relative to the following descri-bed property as set forth in the Final Judgment, to wit:LOT17, BLOCK 5, OAK HILLES-TATES REPLAT, ACCORDING TOTHE MAPOR PLATTHEREOF AS RECORDED IN PLATBOOK 3, PAGE 52, OF THE PUB-LIC RECORDS OF COLUMBIACOUNTY, FLORIDA.Property Address: 130 SOUTH-EASTCALOB COURT, LAKE CITY, FL32025Anyi-nator, 173 NE Hernando Avenue, Room 408, Lake City, FL32055 Phone: (386) 719-7428DATED ATLAKE CITY, FLORI-DATHIS 3RD DAYOF SEPTEM-BER, 2013-sB. ScippioP. DEWITTCASONCLERK OF THE CIRCUITCOURTCOLUMBIACOUNTY, FLORIDASEAL05540880September 17, 24,39276The Lake City Reporter, a daily newspaper seeks Independent Contractor Newspaper Carrier for the Fort White / Ellisville route. Apply in person during normal business hours Monday Friday 8am 5pmNO PHONE CALLS 055. 0554039FLOOR TECH Avalon Healthcare Center is currently accepting applications for the full time position of Floor Tech. Competitive Salary and Excellent benefit package offered. Please apply at Avalon Healthcare and Rehabilitation Center. 1270 S.W. Main Blvd. Lake City, Florida 32025 386-752-7900 EOE F/T Finance Assistant needed. QuickBooks, Excel, A/P, A/R, payroll experience required. Email resume to kkahler@lakecity-carc.com or mail to CARC 512 SWSisters Welcome Rd., 32025
PAGE 15
LAKECITYREPORTER CLASSIFIEDTUESDAY, SEPTEMBER 17, 2013 7B Classified Department: 755-5440 1999 Alegro 28Ft.Clean, 75K, one owner. No smoke/pet. Ref, ice maker, elec-gas hot water, air w/heat pump, 3 burner cooktop w/oven.$11,500 386-758-9863 rn nr 100Job Opportunities05540917: krose@flcu.org M/F/D/VEOE Drug Free Workplace All purpose mechanic tune ups and a little body work Hafners755-6481 307859 & ref. job #4348336. Dutchman Tree Farms Looking for Experienced Maintenance/Painter References Needed. Mon. Fri. Contact 386-697-4814 Service Technician needed Florida Pest Control. Apply in person 536 SE Baya Drive, LC 100Job Opportunities12 Temp Potato Equip. Operators needed 10/14/13-7/14/14. 24 mo. verifiable exp reqd operating & performing Seminole, Decatur Cos GA. Jackson Co. FL. Report/send a resume to nearest local FLAgency of Workforce Innovation office or call 386-7559026 & ref Job #GA8115928. L. Walther & Sons Inc #3. 30 Temp Potato Equip. Operators needed 10/14/13-6/15/14. 24 mo. verifiable exp reqd operating & performing routine Allendale, Aiken Cos. Report/send a resume to nearest local FLAgency of Workforce Innovations office or call 386-755-9026 & ref Job #564381. L. Walther & Sons Inc #2. Windsor SC. 130Part Time P/TChild care worker needed for church services on Wednesdays & Sundays. Contact 386-755-5553 for additional information QUALITYINN now Hiring P/T housekeeper and night auditor. Apply within 285 SWCommerce Blvd., LC ARTISTS WANTED North Florida Fine Arts Festival, on Feb. 22 & 23 is seeking applicants for the show. Contact Linda at linmit9545@ yahoo.com, or go to festival.com Mobile home on 4 acres that needs some TLC. Large square footage and very private. MLS# 84500 Results Realty $35 3/2 on .27 acres. Split floor plan & master bedroom, 2 car garage & storage out back. MLS# 84297 Results Realty $74 dep. No pets 386-697-4814 710Unfurnished Apt. ForRent2BR/1BA. CLOSE to town. $580.mo plus deposit. Includes water & sewer. 386-965-2922/1 neat, clean. Just completely re-done inside Eadie Street (In Town) $850mth & $850 dep. 386-752-4663 or 386-854-0686 750Business & Office Rentals05540532#!$)#%$() %$%))%$) %"$()"*#)) ) #(#$) "&)r %$") $'")"())$)"$)) )r$()r)) n Beautiful 3/2, 2,500 sqft brick home on 15 wooded acres, large bedrooms, $252,000 David Mincey 386-590-0157 Poole Realty MLS# 84388 $299,900 83730 $475,000 Missy Zecher 623-0237 Remax Professionals MLS 84561 Custom built home, open floor plan, 44x14 ft screened in back porch, custom outdoor kitchen. $219,000 Century 21 Darby Rogers 752-6575 acres with w/ss/pp. Owner financed, low down payment Deas Bullard/BKLProperties 386-752-4339 820Farms & Acreage
PAGE 16
8B LAKE CITY REPORTER SPORTS TUESDAY, SEPTEMBER 17, 2013 Page Editor: Tim Kirby, 754-0421 8BSPORTS JUMP Lake City Reporter New Patient Exam and Necessary X-rays DO150, DO330 First-time patient Reg. $136 $ 29 SAVINGS OF $107 Expires September 30, 2013 ASPEN DENTAL GROUP G. W. HUNTER, INC. 1130 US Hwy 90 W (386) 752-5890 WE NOW HAVE ETHANOL FREE PLUS GASOLINE ONLY AT INTENDED USES: BOATS & WATERCRAFTS COLLECTABLE VEHICLES OFF-ROAD VEHICLES MOTORCYCLES SMALL ENGINES Tigers, Indians run in UF Mountain Dew From staff reports Columbia Highs and Fort White Highs cross country teams ran in the UF Mountain Dew Invitational on Saturday. Estero High won the girls competition which consisted of 56 teams. Oak Hall School placed second and Winter Park High placed third. Julie Woolroth of Holy Trinity Episcopal Academy was individual winner in 18:17.85. Columbia entered a fiverunner team and placed 43rd: Bernita Brown, 22:27.34; Alex Faulstich, 24:35.42; Sydni Jones, 24:42.48; Dimple Desai, 27:08.08; Caroline Cribbs, 29:48.06. The Lady Indians had four runners: Sheridan Placensia, 25:53.56; Katrina Patillo, 31:14:10; Isabelle Hair, 31:23.31; Amanda Bradbury, 33:23.31. St. Thomas Aquinas High topped the boys field of 61 teams. Fort Myers High was second and Estero was third. Tyler Bennett of Fort Myers was the individual winner in 15:24.29. Columbias team placed 50th: Cody Bass, 19:27.24; Chris Sellers, 20:01.72; Noah Henderson, 20:06.98; Zachary Peterson, 21:10.57; Zachary Smith, 25:11.05. Elijah Henderson (29:08.45) and Brandon Wine (29:13.94) ran junior varsity for the Tigers. Fort White had four run ners: Richard Eli MorenoRodriguez, 19:07.26; Jeremie Thompson, 22:04.15; Jordan Hair, 26:21.81; Jesus Eli MorenoRodriguez, 28:54.46. Columbia is hosting the Alligator Lake Invitational on Saturday, and Fort White is scheduled to attend. Gates open at 5:30 a.m. with an awards ceremony at 11:10 a.m. Start times are girls var sity, 7:45 a.m.; boys var sity, 8:15 a.m.; girls varsity green, 8:40 a.m.; boys var sity green, 9:10 a.m.; mid dle school girls, 9:25 a.m.; middle school boys, 9:45 a.m.; girls JV green, 10:05 a.m.; boys JV green, 10:25 a.m.; community open, 10:55 a.m. TIM KIRBY /Lake City Reporter Members of the 2013 Fort White High cross country team are (front row, from left) John Reid, Jesus Eli Moreno-Rodriguez, Jeremie Thompson, Richard Eli Moreno-Rodriguez and Trevor Seals. Back row (from left) are coach Marco Martinez, manager Adrielle Plasencia, Isabelle Hair, Katrina Patillo, Sheridan Plasencia and Kamry Morgan. Not pictured are Amanda Bradbury, Jordan Hair and head coaches Amber Bussey Parks and Kemberly Jackson. TIM KIRBY /Lake City Reporter Members of the 2013 Columbia High boys cross country team are (front row, from left) Brandon Wine, Cody Bass and Zachary Smithy. Back row (from left) are Elijah Henderson, Zachary Peterson, Noah Henderson and Chris Sellers. Brooke Solowski is coach. TIM KIRBY /Lake City Reporter Members of the 2013 Columbia High girls cross country team are (front row, from left) Sydni Jones, Dimple Desai and Alexandra Faulstich. Back row (from left) are Aleshia Ouimette, Bernita Brown, Ashley Jones, Kayle Nelson and Caroline Cribbs. Brooke Solowski is coach. From staff reports Blayne Barber of Lake City was named NGA Tour Rookie of the Year. Barber finished fourth on the NGA money list with $56,405.51 that included a victory in the Savannah Lakes Village Classic in McCormack, S.C. He lost in a playoff for the Florida Marine Open in Mandeville, La. Barber had four top-five finishes. During the season, Barber also won $52,110 on the PGA Tour in three starts and $56,586 on the Web.com Tour in seven starts including a tie for second. He earned condi tional status for the 2014 Web.com Tour. Barber is NGA Tour Rookie of the Year Courtesy of Auburn University Lake Citys Blayne Barber hits during a college tournament with Auburn University. | http://ufdc.ufl.edu/UF00028308/02175 | CC-MAIN-2017-04 | refinedweb | 18,608 | 67.25 |
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
Build Identifier:
Current Thunderbird versions do not allow the user to select a port when
using the Account Wizard. More POP3 and IMAP4 servers are running on
secure ports (993, 995).
This extension checks based on the host name whether the account is
IMAP4 or POP3 and detects the Port and Security settings (TLS, SSL).
The extension is a proof of concept and would be a good starting
point for a real implementation.
-Brian
Reproducible: Always
Steps to Reproduce:
1. Launch the Account Wizard
2. Enter an IMAP4 or POP3 server that only runs on secure ports.
3. Complete the Account Wizard
4. Try to download mail
.
Actual Results:
An error will be raised unable to connect to server.
The user must then manually edit the Account Settings to
set the correct security and port information.
Created attachment 309264 [details]
XPI that ties in to the Account Wizard to add port / security discovery
Here is the source code for the example Account Wizard Auto Discovery XPI.
David, this is the extension we were talking about.
My first inclination was to add these capabilities to the core protocol handlers, who know how to parse capabilities, etc, but I'm warming to the approach in this bug of just doing it from js, since it doesn't touch the core code. I'll try to make a patch where this is integrated into the account wizard, and test it out.
Hi Brian K, didn't notice it was you at first :-)
I've tried the xpi, and it seems to install and work, though I haven't tried it with a real server. It adds an "auto discover" button to the page where you give the server type (imap or pop3) and name. I would think we would do auto-discovery automatically (perhaps when the user clicks the next button?) but cc'ing Bryan for his UE input.
related to bug 342242?
related but not the same, since this xpi, at least, does port probing and capability testing, not auto-config via dns
Created attachment 328424 [details] [diff] [review]
first stab at moving this into core account manager
This moves the autoconfigure stuff into the core account wizard. It works like the extension, in that you click an autoconfigure button to make us do port and capability probing for imap/pop3. I've got it so it works in TB, but I have a little work to do to get it working for SM (mostly string changes).
Hacking the account wizard is never fun, and I may not be putting things in all the right places. I'm going to make a stab at making a patch that will work with SM and then run it past Neil.
Created attachment 328483 [details] [diff] [review]
take a stab at working w/ suite
Neil, I've basically taken the xpi code and moved it directly into the account manager. I've tried to put things in reasonable places. I didn't create a whole new dtd for the AutoConfigureDialog code (I'm not sure that should even be a separate dialog, but it does allow for "Cancel" and "Apply"). The patch seems to work and is a start on doing more autoconfig stuff.
It should probably be extended for SMTP as well.
Not having reviewed the UI or the cod, I think this is extremely valuable work, and setting flags to indicate such.
Comment on attachment 328483 [details] [diff] [review]
take a stab at working w/ suite
OK, so I took this patch for a spin, and while I like the idea, I think it needs some serious UI love, so I'm disappointed that Bryan hasn't commented.
I don't really understand the networking code.
(In reply to comment #10)
> (From update of attachment 328483 [details] [diff] [review])
> OK, so I took this patch for a spin, and while I like the idea, I think it
> needs some serious UI love, so I'm disappointed that Bryan hasn't commented yet
> ;-)
Yes, I'm a little reluctant to spend a lot more time on it w/o getting that UI).
Those I can do.
>
>.
That's something I'm interested in Bryan's opinion on. I'm torn about making it a dialog or not (i.e., automatic or explicit). I believe mail.app does it automatically. It would be a bit more work to make it happen automatically in the account wizard...we'd want to have a way for the user to cancel the process, for example, which makes doing it on "Next" a little odd.
>
> I don't really understand the networking code.
>
Conceptually, all the network code does is connect to different ports on the server, and if successful, sends the appropriate command to get the server to respond with capabilities, to see if STARTTLS is enabled, and then quits/logs out. But looking at it a bit more, I could clean it up a little...
I'm going to try this extension out to see how it works, we do have a wiki page for improvements to the account wizard. See page 3 especially:
We should probe 587 as SMTP port too if not doing so already.
Yes, see #c8 - but I am thinking of taking a quick whack at that.
I've updated my account wizard mockups to match the wiki page, take a look at that in general and let me know what you think. This may need to be broken into other bugs, but I think it is all connected to get the user experience right.
I've made the auto-detect more inline/automatic about checking the hostname, but we should discuss issues related to network timeouts or other problems. It seems like we should be able to keep checking (on input) for valid hostnames and then probe the hostname.
Note the spinner in there so the person can have some idea of network activity going on. There's a possibility of a person losing entered information when the probe results return (perhaps taking a while). One option could be to make the entries insensitive, but that would likely require us to let the person cancel the probing. Instead I think we can just create an undo-scheme where probed results return and we show an undo link besides the spinner for getting back whatever was in the entries before we auto-filled them. (still need to work on this - not in mockups)
Weave uses a system very similar to this for password checking in their wizard code.
Mockups are in my account wizard folder here, with relevant links below; feedback appreciated.
IMAP w/ auto-detection
POP w/ auto-detection
Note, I seemed to have gotten my spinners mixed up in the pre vs. post detection and that's fixed now.
Also added some prototype mockups with 'undo'. This would revert the settings back to whatever they were before the auto-detect changed them.
As well as one with a 'try again'. This action would appear after any attempt to auto-detect failed (like offline) or after an undo. We could try to have both actions available as there is a choice, but I'd like to be a bit minimal and the actions will appear in the same location so you could click twice for undo, try again.
Oh, and bug 326076 and bug 221030 have some code for using a menu list or radio group, though not exactly what is specified on the wiki page.
Created attachment 330326 [details]
add support for smtp port probing and STARTTLS detection (untested)
I took a stab at extending the auto discovery code to handle smtp. I haven't hooked it up to the account wizard, so it's completely untested. I won't be able to test it too much, since my ISP blocks SMTP servers other than its own, and doesn't support STARTTLS.
Created attachment 330327 [details]
untested, and the wrong file :-)
Brian, what would trigger the initial autoconfigure in the proposed UI? I assume the try again link is for subsequent autoconfigure attempts. Would it start off as a "configure" link or button? Apolgies if it's already in a screen shot...
I'm not sure undo is going to be that useful
I was suggesting we watch the text input box for a valid hostname and when the person has paused/finished typing. Though there can be lots of valid looking hostnames unintentionally created, for instance when a person starts entering the initial imap of imap.gmail.com; imap could be considered valid. So there might be some spinning during typing.
The 'try again' would only appear after failure to successfully return information and if the person hadn't typed anymore information. (for a network down case)
I don't think we easily know when the user has finished typing (Neil can correct me if I'm wrong). I suppose we could use timers and check if the text field value has not changed in a few seconds...We know when the text widget loses focus, but it's very likely that it will lose focus because the user has clicked the "Next" button. I worry about the spinning when typing, because I know when I'm adding a new account, I'm usually referring back and forth between the account wizard and an e-mail or web page that tells me the host name, which means it looks like I've stopped typing.
Completely unrelated comment - we also want to check for secure auth capabilities, and set that for the user if the server supports a secure authentication mechanism.
I suggest start detecting after user press next button and show of page of what we detected (if any) and in case user misspells name of server it can always come back at retype name of server press next again.
I think it would have to be based on a timer a second or two after typing. Likely the real value can only be determined with some testing.
Not that user correction are going to be that likely since we should be detecting for the most secure possible connection and defaulting to that. (as a side note I wondered if we should be keeping all possible valid connections for the person to choose) However we want to show that we've found the right setup before they leave the page.
I think bienvenu's comment about how people enter this information is completely correct, and what we're targeting. A person is probably looking at something else for the information and so after typing in the hostname has to read the port / security connection type from the same place. During the time they are reading t-bird should have auto-detected the settings.
Over irc, we discussed taking advantage of autoconfig to simplify the process - Bryan posted this for a first page -
The idea is that we'd do auto-config when the user presses next from this screen, and figure out if the server is imap or pop3, supports tls or ssl, and whether it supports secure authentication. If authentication fails, we tell the user and allow them to correct the password or server name. Bryan also suggested on the final page, we give the user the opportunity to remember the password, with a check box, turned on by default.
One issue is that we need the user name to logon with. We could try both the full e-mail address and the part before the @ as user names, but guessing about user name isn't ideal, when we'll be sending a password along with it. And there are situations where the username is neither.
If we ask for the username explicitly, this page starts to overflow. We could make the account wizard a little bigger.
An other possibility is to break auto config into two steps - in the first, the user enters their identity name, e.g., John Smith, along with the incoming server name and outgoing server name. Then we autoconfig the servers, making sure we can connect to them, figuring out a port and corresponding server type (IMAP vs. POP3), and connection type (SSL/TLS, etc). Then, on the next screen, the user enters their email address, user name, and password, and we verify that all works, and figure out if we should use secure auth. Then, the user would go to the verification page.
There might be edge cases, e.g., we can connect to the server on the imap port, but the user is only enabled for pop3 access, and we've preferred imap over pop3. If we have a way for the user to go into edit settings despite errors, that would be one work around. Or we could detect that both protocols work and let the user pick. What we need to enable is account setup even when autoconfig fails. Or a way to bypass autoconfig, perhaps to go straight to account settings - power users have asked for that, so we could solve two problems at once.
Can we also detect identity name of current logged in user (John Doe) on Windows platform too? I know we had this functionality on Linux at least but never seen such thing on Windows platform.
Created attachment 333632 [details] [diff] [review]
don't use a separate dialog for autoconfig...
This starts in the direction Bryan has proposed - ask for person's name and e-mail address, and try to figure out mail server name, type (IMAP or POP3) and connection type (TLS, SSL, plain). It shows a progress button, and tells you which host its trying.
The dialog is messy, and I left in the autoconfigure button for ease of testing.
I'm going to hand this off to DavidA, and go work on the second part of the backend for this; once we've discovered a server, type, and port, verify that the user can logon to the server with the password they give us, and determine the most secure authentication mechanism that will work with that server. I'll probably add a method to nsIMsgIncomingServer that does this, so the front end code would create an incoming server object and call the logon method. In order to make it easier to communicate results back to the front end, I may make the calling js poke the use secure auth property on the server object directly, try that logon, if it fails, fall back to insecure auth. The logon method will take a url listener, so the calling code will get called back with success or failure, once we've tried to logon.
That's all speculation at this point; I need to start implementing it to see what's going to work in the backend...
Created attachment 333826 [details]
WIP of an extension to do the auto-detection.
Attaching this for sharing w/ ben bucksch and bienvenu, for discussion. Not ready for review.
Created attachment 333841 [details]
AccountConfig JS class to hold the data
As promised, here's the JS class I propose to hold the account data, within the dialog. One instance would hold the values shown in the UI, and various autoconfig functions would return instances, and there'll be an createAccount function which takes that and creates the account in the backend.
Created attachment 333891 [details] [diff] [review]
wip to verify imap logon
this doesn't quite work yet, and I had to actually create the imap server object w/ the account manager in order to get the logon verification url to run (it doesn't create the account, but we will need a way to clean up the server object after we're done with it - I'll probably need to add a method to the account manager to remove the server object, and we will need to be very dilligent about cleaning up after ourselves).
I have to write similar code for POP3, and SMTP, as well as getting this to work correctly for IMAP (I think the problem is in my test harness, so converting over to David's code would probably help)
Cool, I'll try to merge my front-end code with the back-end part of this patch, hopefully tomorrow.
I might even try it with an hg clone of comm-central, which is probably where we need to end up anyway.
*** Bug 387421 has been marked as a duplicate of this bug. ***
TODO (to myself) from that last bug: figure out where port 587 fits in.
Created attachment 333997 [details] [diff] [review]
pop3 autodetection (completely untested)
Port 587, as described in RFC 4409, is the standard port for mail submission.
Traditionally, port 25 was used for mail submission, but it is now good
practice for ISPs to block outbound port 25 at their firewalls as a spam
prevention mechanism, so 25 just isn't viable for traveling users or users
on a random WiFi network. There is also use of port 465 for SSL
submission although this port isn't even registered for that purpose.
RFC 5068, an Internet Best Current Practice states:
MUAs SHOULD use the SUBMISSION port for message submission.
So my advice would be to use 587 if it works, and fall back to port 25 if it
doesn't. Also, if you ever see STARTTLS advertised in response to EHLO,
attempt to negotiate it and if it succeeds, require STARTTLS for all future
connections.
I don't think it's worth probing 465 since it's non-standard (and could be
something else).
FYI, I've created a c-c clone at, and committed the backend parts of davidb's last two patches to it. I'll be doing my front-end work there, but most likely won't have anything committed until early next week.
(I don't care where we do this, but I wanted to learn a bit about hg clones, so this seemed a good practice area)
Also FYI, rough front-end code is currently in an extension at but it's not worth looking at yet.
(In reply to comment #35)
> Traditionally, port 25 was used for mail submission, but it is now good
> practice for ISPs to block outbound port 25 at their firewalls as a spam
> prevention mechanism
I wouldn't call blocking port 25 by providers "good practice" as it prevents use cases for people running their own legitimate mail servers, which may be forced to go with (higher priced, but otherwise identical) business accounts then to avoid that block. Anyway, that's beyond the scope of this RFE...
> I don't think it's worth probing 465 since it's non-standard (and could be
> something else).
While port 587 is now used by many if not most providers, some providers offer 465 for SSL. Thus, it should be probed if 587 and 25 fail or if neither of them offers TLS for encryption, and 465 with SSL tested as a fallback otherwise.
Created attachment 334349 [details] [diff] [review]
aw-autoDiscover.js that calls verifyLogon
this shows how to create a server object, init it, and call verifyLogon on it.
Created attachment 334358 [details] [diff] [review]
smtp logon verification (wip, untested)
I will land this in your/our repository, David, once I've figured out a way of testing it a little. Normal message sending still works. I've mostly restrained myself from cleaning up the code around the stuff I added, but I did change the password stuff to use (ns)ACString, and I cleaned up whitespace in places
I should also mention that I did land an additional change to the imap code in the repository to suppress error messages during logon verification.
- I refactored the wizard dialog's JS code a lot
- Added AccountConfig
- Rewrote most of emailWizard.js
- Wrapped guessConfig to return an AccountConfig and be UI-less.
- Rewrote most of verifyLogon() (now in verifyLogin.js) to
be UI-less and take an AccountConfig.
- Moved accountCreation.xul/js to emailWizard.xul/js and autoconfig to guessConfig.js
I left the old files in place, so you can just change mailnews/base/prefs/resources/content/accountUtils.js
- window.openDialog("chrome://messenger/content/accountcreation/emailWizard.xul",
+ window.openDialog("chrome://messenger/content/accountcreation/accountCreation.xul",
to get the "old" dialog and code back.
My changes are mostly dry-coded and not much tested, DOES NOT FULLY WORK YET.
Outstanding:
- Test, fix
- onblur is called twice
- Re-add gussing of username and secure auth
(see verifyLogin.js, move to guessConfig.js)
- fetchConfig.js implementations
I hope to get the code fixed and working soon. In the meantime, David A., can you take a look at it and see whether you like it?
bienvenu, if you want to continue work on autoConfig.js / guessConfig.js, go ahead, either file will be fine, as I didn't touch the autoConfig.js code, just copied it and added a wrapper at the top, so merging should be trivial.
Note:
- log4moz.js is not built by default and breaks the whole dialog when it's not there
- I get verifyLogon is not a function(). I guess I need to update and rebuild.
setting target milestone to b1
Switching for b1 flags to target milestones, to avoid flag churn.
*** Bug 422755 has been marked as a duplicate of this bug. ***
Created attachment 337116 [details] [diff] [review]
backend changes for logon verification
These are the set of backend changes we've made for auto config. They fall into three main areas:
1. Adding verifyLogon methods for imap,pop3, and smtp. These methods verify that with the passed in password, the user can logon to the server. The process should not alert the user or failure, nor put up a password prompt.).
3. Add the ability to remove a server from the account manager, since the new account wizard has to create temporary server objects.
Apologies in advance if I've messed this patch up - I had to edit the diff by hand quite a bit to get a diff between the two repositories.
Comment on attachment 337116 [details] [diff] [review]
backend changes for logon verification
>+ /* dead code. */
> readonly attribute boolean isSecureServer;
Is there a bug to remove it then?
>+ void verifyLogon(in ACString aPassword, in nsIUrlListener aUrlListener);
All the implementations of verifyLogon simply set the password immediately.
IMHO it makes more sense for the caller to set the password separately.
>+ // invalidate the FindServer() cache if we are removing the cached server
>+ if (m_lastFindServerResult) {
>+ nsCString cachedServerKey;
>+ rv = m_lastFindServerResult->GetKey(cachedServerKey);
>+ NS_ENSURE_SUCCESS(rv,rv);
>+
>+ if (serverKey.Equals(cachedServerKey)) {
Is there any reason why we can't compare the pointers?
>- // clear out all identity information if no other account uses it.
>- if (!identityStillUsed)
>- identity->ClearAllValues();
>+ identity->ClearAllValues(); // clear out all identity information.
I think there are people who tweak their prefs to share identities...
>+ void verifyLogon(in ACString aPassword, in nsIUrlListener aUrlListener);
(Same as above)
> if (incomingServerToUse)
> {
> nsCString tmpPassword;
> nsresult rv = incomingServerToUse->GetPassword(tmpPassword);
>- *aPassword = ToNewCString(tmpPassword);
>+ aPassword = tmpPassword;
> return rv;
> }
Will this simplify to return incomingServerToUse->GetPassword(aPassword); ?
>+ rv = NS_MsgBuildSmtpUrl(aFilePath, smtpServer,
> aRecipients, aSenderIdentity, aUrlListener, aStatusFeedback,
> aNotificationCallbacks, &urlToRun, aRequestDSN); // this ref counts urlToRun
> if (NS_SUCCEEDED(rv) && urlToRun)
> {
> nsCOMPtr<nsISmtpUrl> smtpUrl = do_QueryInterface(urlToRun, &rv);
> if (NS_SUCCEEDED(rv))
> smtpUrl->SetSmtpServer(smtpServer);
Now you're passing the smtpServer to NS_MsgBuildSmtpUrl, it should set it directly on the created smtpUrl so that the callers don't have to.
>- if (aRecipientsList)
>- *aRecipientsList = ToNewCString(m_toPart);
>- return NS_OK;
>+ if (aRecipientsList)
>+ *aRecipientsList = ToNewCString(m_toPart);
>+ return NS_OK;
You forgot to diff -w ;-)
>+ else if (!PL_strcasecmp(m_urlidSubString, "verifyLogon"))
Nit: you appended it as "verifylogon"
>+ nsCString escapedUsername;
>+ *((char**)getter_Copies(escapedUsername)) = nsEscape(popUser.get(), url_XAlphas);
Aren't we supposed to use the extenal escape API? Anyway, you mean .Adopt
>+ char * urlSpec = PR_smprintf("pop3://%s@%s:%d/?verifyLogon",
>+ escapedUsername.get(), popHost.get(), popPort);
>+ if (!urlSpec)
>+ return NS_ERROR_OUT_OF_MEMORY;
>+ nsCOMPtr<nsIURI> url;
>+ rv = BuildPop3Url(urlSpec, nsnull, popServer, aUrlListener,
>+ getter_AddRefs(url), nsnull);
>+ PR_Free(urlSpec);
Nit: PR_smprintf_free (or whatever it's called)
I've filed Bug 453979 to remove isSecureServer, which BenB noted as dead code in the idl, and I verified earlier that it is indeed not used.
>All the implementations of verifyLogon simply set the password immediately.
>IMHO it makes more sense for the caller to set the password separately.
I was trying to maintain a bit of flexibility about how the password gets set but if we need that, I can always put it back the way it is.
>>- // clear out all identity information if no other account uses it.
>>- if (!identityStillUsed)
>>- identity->ClearAllValues();
>>+ identity->ClearAllValues(); // clear out all identity information.
>I think there are people who tweak their prefs to share identities...
This is a bad diff on my part. I should have diffed against a completely clean tree...the code that looks like its getting removed is actually getting added, so that people who tweak their prefs to share identities won't have them cleaned out :-)
I'll attach a new, I hope, clean, patch in a bit...
Created attachment 337493 [details] [diff] [review]
logon verification backend changes addressing Neil's comments
This attempts to address Neil's comments. I also made nsMsgAccountManager::SetLastServerFound void, since it never returned an error, and that let me cleanup a little bit of code.
Comment on attachment 337493 [details] [diff] [review]
logon verification backend changes addressing Neil's comments
>+NS_IMETHODIMP
>+nsMsgAccountManager::RemoveIncomingServer(nsIMsgIncomingServer *aServer,
>+ PRBool aCleanupFiles)
>+{
>+ nsCString serverKey;
>+ nsresult rv = aServer->GetKey(serverKey);
>+ NS_ENSURE_SUCCESS(rv,rv);
nit: space missing (there are several of these throughout the patch).
>+ m_incomingServers.Remove(serverKey);
>+
>+ nsCOMPtr<nsIMsgFolder> rootFolder;
>+ aServer->GetRootFolder(getter_AddRefs(rootFolder));
>+ nsCOMPtr<nsISupportsArray> allDescendents;
>+ NS_NewISupportsArray(getter_AddRefs(allDescendents));
>+ rootFolder->ListDescendents(allDescendents);
Should we be checking these for failure / null pointers?
>+ PRUint32 cnt =0;
nit: space missing
>+ rv = allDescendents->Count(&cnt);
>+ NS_ENSURE_SUCCESS(rv, rv);
>+ for (PRUint32 i = 0; i < cnt;i++)
nit: space missing.
>+ {
>+ nsCOMPtr<nsIMsgFolder> folder = do_QueryElementAt(allDescendents, i, &rv);
>+ folder->ForceDBClosed();
You've got the value of rv, but you're not checking it...
> NS_IMETHODIMP
>diff -uwr ./base/util/nsMsgMailNewsUrl.cpp /autoclone/mailnews/base/util/nsMsgMailNewsUrl.cpp
>--- ./base/util/nsMsgMailNewsUrl.cpp Fri Aug 29 08:26:35 2008
>+++ /autoclone/mailnews/base/util/nsMsgMailNewsUrl.cpp Thu Aug 28 12:50:27 2008
>@@ -202,11 +202,9 @@
> NS_ENSURE_ARG_POINTER(aMsgWindow);
> *aMsgWindow = nsnull;
>
>- // note: it is okay to return a null msg window and not return an error
>- // it's possible the url really doesn't have msg window
> nsCOMPtr<nsIMsgWindow> msgWindow(do_QueryReferent(m_msgWindowWeak));
> msgWindow.swap(*aMsgWindow);
>- return NS_OK;
>+ return *aMsgWindow ? NS_OK : NS_ERROR_FAILURE;
NS_ERROR_NULL_POINTER would seem slightly more appropriate.
>@@ -72,7 +73,7 @@
> * It can be specified/saved here to avoid prompting the user constantly for
> * the sending password.
> */
>- attribute string password;
>+ attribute ACString password;
For the record, I was going to suggest changing this (and the others) to AUTF8String to help with using non-ASCII characters in passwords. However I looked into things a bit more, and came across items like base 64 encoding, and the specs for SMTP and decided we need to resolve this elsewhere with more thought.
> nsIURI GetNewMail(in nsIMsgWindow aMsgWindow, in nsIUrlListener aUrlListener,
>- in nsIMsgFolder aInbox,
>- in nsIPop3IncomingServer popServer);
>+ in nsIMsgFolder aInbox, in nsIPop3IncomingServer popServer);
Its a bit hard to tell with -w but this looks the wrong indentation.
> nsIURI CheckForNewMail(in nsIMsgWindow aMsgWindow, in nsIUrlListener aUrlListener,
>- in nsIMsgFolder inbox,
>- in nsIPop3IncomingServer popServer);
>+ in nsIMsgFolder inbox, in nsIPop3IncomingServer popServer);
ditto wrt the indentation
- nsCString escapedUsername;
- *((char **)getter_Copies(escapedUsername)) =
- nsEscape(username.get(), url_XAlphas);
+ nsCString escapedUsername.Adopt(nsEscape(username.get(), url_XAlphas);
This doesn't compile (nsSmtpServer), and please could you use MsgEscapeString version so we're ready for frozen API.
nsPop3Service.cpp seems to be missing an #include "nsINetUtil.h"
(In reply to comment #45)
>).
I think checking this would be a good idea before submitting it. We don't want our forget password cases to get even worse.
r=me with the comments addressed, bustages fixed and the not forgetting passwords on biff checked.
Also, I think we could really do with some unit tests for this. Certainly we have fake servers for both pop and smtp and I think writing some tests around those would be a good idea. However, don't wait on writing them to get this code in, as it is probably going to conflict with some of the password manager stuff I am working on.
Created attachment 337672 [details] [diff] [review]
patch addressing Standard8's comments - checked in
carrying forward standard8's r+, requesting sr from Neil.
I've made it so we only forget imap passwords if there's a msg window (we were already doing this for pop3). I fixed the spaces in NS_ENSURE_SUCCESS(rv, rv) if they were lines I added, but in the interest of keeping this patch from being even bigger, I left the other ones alone. I addressed all the other comments, I believe.
3.0b1 flag is going away in favour of 3.0 flag and milestone combination.
Comment on attachment 337672 [details] [diff] [review]
patch addressing Standard8's comments - checked in
>+ else if (!PL_strcasecmp(m_urlidSubString, "verifyLogon"))
Bah, that wasn't my idea when I made the comment... it looked inconsistent with all the other imap url flags although I admit that I hadn't seen the POP3 code's consistent use of verifyLogon by then.
This isn't ready for beta 1, so we're moving it out to beta 2.
In recent comments to Bug 112356, Bug 231541 and Bug 312431 Bryan Clark claims that this patch will alter the default "leave on server" behaviour (which is rather contentious). I can't see any discussion above regarding a change to the default "leave on server" behaviour and Bryan's comments in the other bugs (particularly Bug 231451 comment #91) are somewhat vague.
Could someone please explain just exactly what is the intention in this patch with regard to the default leave on server behaviour?
bug 231541 comment 91 is where I was describing an alternate method for managing mails on a POP server post account creation. I also created bug 455681 to track the inclusion of this new way of warning and managing server space for POP3 users.
Today I created an email account with Apples Mail (out of curiosity). This was easy, because Apple Mail sets the encryption to SSL per default (this is good for the normal, inexperienced user). You can alter this after the account creation is complete (but I don't find a TLS option).
In my first experiences with e-mail clients, the hardest thing in configuration was to find the configuration informations (name of the POP3/IMAP and SMTP server, Ports, best encryption). So I think a sophisticated method and helpful for inexperienced users would be a list in the Account Wizard that lists the popularest webmail providers. So you can choose your provider and the best settings will be done automatically. After that you can edit it (for the experts) or use this default settings. This would make the account creation extremely easy for everyone. But I don't know if this idea is feasible.
One thing I think is very important is not to get rid of terms like "SSL" or "TLS" for simplification reasons. Because every webmail provider uses this terms on there websites. And this terms are established. And one thing I like on Thunderbird is the potential to have the full control of your account settings.
(In reply to comment #56)
> [...] So I think a sophisticated method and helpful
> for inexperienced users would be a list in the Account Wizard that lists the
> popularest webmail providers. So you can choose your provider and the best
> settings will be done automatically. [...]
Most popular where? In my country, the most popular email providers are @belgacom.net and @skynet.be, but there are other national servers, and some international servers like @hotmail.com and @gmail.com, and some servers in neighbouring countries like @chello.fr or @yahoo.fr, are also popular. (My own accounts are with @belgacom.net, @skynet.be, @yahoo.co.uk and @gmail.com.) I'll concede that most of my country's citizens will prefer French or Dutch interfaces for their browsers and mailers, but I'll also bet that there are people all over the world (even in non-English-speaking countries) who, like me, prefer en-US menus and messages. I think that if you want to list all servers with a non-negligible number of users you'll get such a long list that it won't be practical, especially for an inexperienced user.
I believe it would be better to have the user type the desired server name (as mentioned on whatever document he got from his server when signing up for an account), perhaps as part of the desired email address. This would also allow maintaining a single list of servers with their respective settings, as opposed with a different list of "popular servers" for each localized version of Thunderbird.
> I think a sophisticated method and helpful for inexperienced users would
> be a list in the Account Wizard that lists the popularest webmail
> providers.
That's already implemented on the autoconfig branch.
See .
(More precisely, it fetches the config, depending on the email address domain.)
(In reply to comment #57)
I think that if you want to list all
> servers with a non-negligible number of users you'll get such a long list that
> it won't be practical, especially for an inexperienced user.
Yes, I'm aware that this is an complex to realize idea. But Thunderbird would be the first program with this feature. :D
Hm, maybe you can handle this, that you only type your email adress in and than an automated mechanism will compare the part after the "@" with an internal list of all providers to find the settings.
(In reply to comment #58)
> That's already implemented on the autoconfig branch.
> See .
OH, wow, I didn't know about that bevor. Nice to know. I think this is that what I'm talking about, but I have to read it exactly first. :)
In order to stop loading from BenB's web server, I've made the url we fetch http config info configurable by setting "mailnews.auto_config_url". If we get this set up, we'd set this pref in mailnews.js (or all-thunderbird.js, if it's TB-only)
moving to b2
*** Bug 310269 has been marked as a duplicate of this bug. ***
I've made a pass through the code in the autoconfig repo to make the strings localizable, updated it to use the newer log4moz in gloda, and moved the duplicate account detection to before we verify the password, since there's no sense verifying the password for a duplicate account. I've updated the TODO list somewhat as well.
I'll come up with a plan of attack for the remaining work to get the code into some sort of reviewable shape so we can get it into the tree sooner rather than later, and the localizers can start translating all the strings, and people can start banging on it, and I hope help out with some of the issues.
David, great changes, thanks. Also thanks for doing the localization pass.
I can help with getting this finished. Let's talk about it. Please ping me when you start, if I haven't contacted you before.
Created attachment 356467 [details] [diff] [review]
wip
this is a cumulative wip patch - I've made a pass cleaning up the js formatting, got rid of the dump statements, etc, and got things working in a comm-central tree, among other things. I'm going to try to start getting reviews on parts of this, while I continue to work on some remaining issues.
Created attachment 356661 [details] [diff] [review]
a lot more code cleanup, remove unused files
Created attachment 356817 [details] [diff] [review]
more wip
Phil, do you might taking a jaundiced look at this? I realize it's an insanely large patch but I'm trying to get it into the tree so that we can get it in the hands of users.
Right now, it adds a new file menu, File | New | Mail Account (Quick Setup), which brings up the autoconfig wizard that davida and benb worked on. The wizard seems to be working relatively well. I haven't hooked up any pre-canned xml files yet; Ideally they'd be on our momo server somewhere. Right now some are on BenB's server, but we don't want to check in with that in the code :-)
The windows theme is pretty far behind the mac theme since Davida works on the mac. I haven't dove into that yet. Picking the smtp server isn't fully implemented yet either.
> The wizard seems to be working relatively well
It doesn't for me. It breaks easily in lots of cases for me.
That's why I'd want to work on it still, but I don't want to hold anybody up.
Comment on attachment 356817 [details] [diff] [review]
more wip
Perhaps Magnus has some time to review some or all of this...
My after-work reviewing didn't get past wondering whether you were going to attach another patch that didn't have the "blah blah blah, XXX" strings in /locales/, or you were going to attach another patch that put the strings in content until you got l10n-ready strings.
There are a few strings that the code passes around that afaik are not actually displayed to the user. The ones that are I put in a/mail/locales/en-US/chrome/messenger/accountCreation.properties though I may have missed some...
Lest I forget, or don't get the whole thing done:
+ const CC = Components.classes;
+ const CI = Components.interfaces;
r-, CC should only be Components.Constructor (CI doesn't have that confusion problem, but *will* needlessly lead to someone trying to use Ci, currently at 270 uses in the tree, instead of CI, currently at 9).
+ try {
+ let prefs = CC["@mozilla.org/preferences-service;1"]
+ .getService(CI.nsIPrefBranch);
+ prefs.setBoolPref(leaveOnServerPref,
+ config.incoming.leaveMessagesOnServer);
+ prefs.setBoolPref(deleteFromServerPref,
+ config.incoming.deleteOnServerWhenLocalDelete);
+ } catch (ex) {dump(ex);}
What error are we expecting, why aren't we catching it and re-throwing anything else, and why do we think we can continue creating an account when we can't save prefs?
Comment on attachment 356817 [details] [diff] [review]
more wip
String nitting:
>+++ b/mail/locales/en-US/chrome/messenger/accountCreation.dtd
>+<!ENTITY none.label "None">
>+
>+<!ENTITY gotoadvanced.label "Go to advanced settings">
One extra space starting here
>+<!ENTITY accountcreation.title "Account Setup">
Except here it's a bit more than one
>+<!ENTITY insecureCleartext.description
>+'Warning! This is an insecure server. Email is sent in
>+clear-text, so your email could be read by attackers, etc. Thunderbird
>+will let you get to your mail, but you should really get your email
>+provider to configure the server with a secure connection.
>+More details are available on this ,
>+blah blah blah'>
Single quotes look odd; if I've seen multiline entities wrapped in column zero like that I don't remember it (and if I really haven't, then l10n tool authors maybe haven't, and may break); blah blah blah
>+<!ENTITY incoming_settings.label "Incoming settings:">
>+<!ENTITY outgoing_settings.label "Outgoing settings:">
>+<!ENTITY incoming_is_checked.label "I've double-checked the incoming settings.">
Are those aligned -2 from 0, or -2 from the ones that were +1?
>+<!ENTITY understood.label "I know what I'm doing.">
>+<!ENTITY getmeout.label "This is scary, let me out.">
>+
>+<!ENTITY getcertinfo.label "Get information on securing email servers.">
Then the alignment wheels fell clear off. Personally, I don't actually care much between align and just one space after the entity name, but the variety of alignments is distracting.
>+<!ENTITY certinfo.url "">
I very strongly doubt that you want that URL in a localized entity rather than in a pref, but if you do (you don't), you don't want it XXXed
>+<!ENTITY insecureSelfsigned.description
>+"Warning! This is an insecure server. The server uses
>+a certificate that we can't trust, so we can't be sure that someone
>+isn't intercepting the traffic between Thunderbird and your server.
>+Thunderbird will let you get to your mail, but you should really get your
>+More details are available on this URL...,
>+blah blah blah">
>+
>+<!ENTITY secureServer.description
>+"Congratulations! This is a secure server, blah blah blah">
Double quotes, but again the wrapping looks surprising, and blah blah blah.
>diff --git a/mail/locales/en-US/chrome/messenger/accountCreation.properties b/mail/locales/en-US/chrome/messenger/accountCreation.properties
>new file mode 100644
>--- /dev/null
>+++ b/mail/locales/en-US/chrome/messenger/accountCreation.properties
>@@ -0,0 +1,39 @@
>+# accountCreation.properties
>+
>+cleartext_incoming=This is an insecure incoming server. Data is sent in clear-text, so your password and email you receive could be read by third parties.
For all of these, don't need two spaces between sentences, don't need the trailing space that's after several of them.
>+selfsigned_incoming=This is an mis-configured incoming server. The certificate used by the server can't be trusted, so while the connection is encrypted, we can't be sure that the server is controlled by who it claims to be.
Either "misconfigured" (go go gadget spellchecker, saying that's wrong but misconfiguration is right), or perhaps better "incorrectly configured" or "incorrectly set up" - all of which still fail to adequately get across "You didn't do anything wrong, but your mail server was set up by someone who didn't know what they were doing."
>+cleartexturl=
And you certainly don't want to have that URL in both a localized entity without any guidance about how to localize it and also in this localized string, slightly different (help does look better than XXX) but still unlocalized and unnoted. You're much more likely to want to have it, once, in a pref like mailnews.start_page.welcome_url, including the probably-want of having the version as well as the locale in the URL, depending on what content's going to be there.
>+check_preconfig=Checking for preconfiguration...
>+checking_config=Checking for configuration of your account...
>+checking_mozilla_config=Checking for configuration provided by Mozilla community...
>+probing_config=Probing configuration...
>+checking_password=Checking password...
Real ellipses, rather than three dots, please…
>+incoming_server_exists=Incoming server already exists!
>+outgoing_server_exists=Outgoing server already exists!
Exciting, but not exciting enough for an exclamation point.
I didn't (yet) check for which strings are actually unused.
+function RememberPassword(server, password)
+{
+ CC["@mozilla.org/passwordmanager;1"]
+ .getService(Components.interfaces.nsIPasswordManager)
+ .addUser(server.serverURI, "", password);
+}
Should be rememberPassword, CC is undefined (as it should be, for a single-use at two spaces indent where we don't really need the space-savings), and I doubt we want to save the password in wallet anymore :)
+function sslLabel(val)
+{
+ switch(val)
+ {
+ case 1:
+ return gStringsBundle.getString("no_encryption");
+ case 2:
+ return "SSL"; // SSL and TLS shouldn't need to be translated
+ case 3:
+ return "TLS";
+ default:
+ gEmailWizardLogger.error("Asked to create an sslLabel for: " + val + '\n');
+ return "Unknown";
+ }
+}
It puts the START before the TLS, or it gets the hose again. But if they don't need to be translated, then we shouldn't already have them in multiple localized files, none of which have l10n notes saying not to localize them, some of which are nothing but "SSL" or "TLS" or "STARTTLS", and some of which *are* localized (ССЛ in sr, எஸ்எஸ்எல் in ta). Localize 'em.
philor wrote:
> >+<!ENTITY certinfo.url "">
> I very strongly doubt that you want that URL in a localized entity rather than
> in a pref
This is just a "more info" URL. It contains text that would have been too much to put in the dialog, but otherwise is just a long explanation of the dialog text. As such, it's inherently part of the localization (or help).
It's not a pref in that it would ever be changed by a user, does not affect how the system works etc..
I agree that it should appear only in one place, though.
No, it should be a pref, because that's how partner builds and corporate deployments decide to have things like updates, or addons, or crash reports, or explanations of just how badly their certs suck, go to their server rather than ours..
philor, I once was a redistributor. I wouldn't want to change such a URL.
If so, I'd want it to be part of help or online help and use the same base URL.
(In reply to comment #79)
> [...]
>]
(In reply to comment #80)
> philor, I once was a redistributor. I wouldn't want to change such a URL.
That's fine, as long as you don't confuse your own desires with those of other people. Corporate deployments don't _have_ to run their own AUS, but they can. Partner builds don't _have_ to provide their own help site, but they can.
> If so, I'd want it to be part of help or online help and use the same base URL.
Fine by me, if you can figure out a non-horrid system for making it clear that anyone who uses a different pref for app.support.baseURL is then required to support URLs x (y and z as time goes on), and can work out the website details with the way the MoMo support.baseURL currently sends everything off to mozilla.org. Not sure whether that would be twice as hard as just putting it in its own pref, or ten times, though.
(In reply to comment #75)
> I didn't (yet) check for which strings are actually unused.
Only unused ones are
+thisurl=on this web page.
+cleartexturl=
+var emailRE = /^(("[;
If we're going to go with the current very frustrating UI of just silently sitting there with no feedback or guidance when we don't like an email address, we need The Ultimate Email Regex. This one failed on the second address I tried, philringnalda+foo@gmail.com.
>
> If we're going to go with the current very frustrating UI of just silently
> sitting there with no feedback or guidance when we don't like an email address,
we should give some sort of feedback when we don't like the e-mail address
>.
(In reply to comment #85)
> >
davida, clarkbw: how committed are we to keeping this "guess when the user is done typing their email address instead of having a [Set me up] button" UI? Even assuming someone rewrites Alex's regex to not need look-behind assertions, we're still absolutely certain to get false positives on the user being done, and go out and hit the network for something other than what they intend.
Having that actually do evil _probably_ requires a pretty contrived thing, like you're setting up your foo@evil.com.com CNet account, get as far as entering your password, remember it's now evil.cnet.com, backspace through the last .com and then an alert in another program blurs us, and we wind up sending your password to evil.com while you're dealing with that, but having it surprise the user by going off to do something they didn't ask for or want is nearly certain.
In case somebody doesn't know: I implemented this together with davida and bienvenu.
Given that you seem to be progressing to review, and I still considered this unfinished, I am looking into it a bit. The state is still scary, code quality is still "experimental". There are dozens of bugs still, on all levels, starting from design and logic bugs. Whatever I try falls on its nose. About half of these are logged in TODO, but there's much more. I don't think this is ready for review.
There are also UI changes that I discussed with Bryan in Barcelona.
I'd like to fix this, but it'll probably take me a week of concentrated work.
BenB, thx for your offer of help. I don't think this feature has a chance of making it into the product unless we we get it reviewed and landed in the next week or two, so that the strings can be localized, and we can get feedback from users. The current patch makes it trivial to "remove" this feature from the UI since there's only a single menu item point of access.
I would like to fix the worst of the bugs without reworking the whole thing and putting it back into an unreviewable state. I'd also like to get a directory setup on the mozilla message site with .xml files for the most popular e-mail accounts so that we don't have to do the guessing at all for most users.
>]
Gozer, I assume this also goes for the xml config files that we will be fetching for the common isp's like gmail, at&t, yahoo, etc??
(In reply to comment #90)
> > [...]
> >
> >
> >
> >
> >
> > Each get passed in a bunch of url arguments, i.e.
> > ?locale=[xx]&version=[xx]&platform=[xx]
>
> Gozer, I assume this also goes for the xml config files that we will be
> fetching for the common isp's like gmail, at&t, yahoo, etc?
Yes, I'd treat them the same.
>
>
The idea is to have the client configured to talk to that url, even if under the
hood, that ends up redirecting somewhere else. So in this case, for simplicity,
we might setup for where the files actually live, but
keep the clients talking to and blindly redirect for the time being.
> -?
Yup, it's better to keep the smarts server-side, instead of in the client. The client passes in as much information as it can, and it lets the server decide how to deal with it.
> I would like to fix the worst of the bugs
I fully understand why you'd prefer to changes to be kept small. Unfortunately, the bugs I see here are so fundamental and so severe and so many that I can't keep the changes confined, they'll need to be substantial.
That's also why I don't see any point right now to get any testing from users for this, as I just have to poke it a tiny bit for it to fall over badly, I find more and more bugs all the time, more than I can document. In fact, it's so bad that I didn't know where to start and got quite frustrated and consequently couldn't continue.
Philor, thx very much for the review comments. I've addressed about half of them in the autoconfig repo, and will work on the other half asap. One thing - perhaps I'm doing something wrong, but on windows, TB isn't very happy with ellipses in .properties files - it complains on load that they're not utf8 characters.
(In reply to comment #93)
> perhaps I'm doing something wrong, but on windows, TB isn't very happy with
> ellipses in .properties files - it complains on load that they're not utf8
> characters.
Your editor is probably not set up to edit in UTF-8... in Windows-1252, an ellipsis is 0x85 but what you want is a U+2026 which is 0xE2 0x80 0xA6 in UTF-8 or ò€¦ in Windows-1252 (ironically, no saving in bytes!)
Note that some UTF-8 editors insert a UTF-8 BOM which we don't want.
Thx, Neil - yes, it definitely seems to be an insert time/edit issue, not a save issue per se. I'm using dev studio, but I think I'll just use xcode for this for now.
If you haven't already done rememberPassword, my working-so-it-stops-annoying-me-testing version is
function rememberPassword(server, password)
{
if (server instanceof Components.interfaces.nsIMsgIncomingServer)
var passwordURI = server.type + "://" + server.hostName;
else if (server instanceof Components.interfaces.nsISmtpServer)
var passwordURI = "smtp://" + server.hostname;
if (passwordURI)
{
let lm = Components.classes["@mozilla.org/login-manager;1"]
.getService(Components.interfaces.nsILoginManager);
let login = Components.classes["@mozilla.org/login-manager/loginInfo;1"]
.createInstance(Components.interfaces.nsILoginInfo);
login.init(passwordURI, null, passwordURI, server.username, password, "",
"");
lm.addLogin(login);
}
}
(smtp's untested, since we don't verifyLogon for outgoing servers, so unless it's coming from XML we won't ever think we need auth, which is a bit of problem)
thx, Phil, I'll put that it into the autoconfig repo, and then into the next patch I generate.
Whether things work with xml or probing seems to depend on who touched the code last :-(
>
JS doesn't seem to like this regexp, and my regexp foo is woefully inadequate.
> >.
Yes, I fixed that last night. Problem was merely a missing error msg in the string bundle.
*cough* *cough*
let sslType = sslLabel(config.incoming.socketType);
switch (sslType) {
case 'SSL':
case 'TLS': ...
case 'No encryption':
sslLabel() is the *translated*, user-visible text. The whole point of config.incoming.socketType being an int was that it's a reliably processable enum. I'll fix that.
philor wrote:
> If you haven't already done rememberPassword, my
> working-so-it-stops-annoying-me-testing version is
> function rememberPassword(server, password)
> let lm = Components.classes["@mozilla.org/login-manager;1"]
Error: Cc['@mozilla.org/login-manager;1'] is undefined
(In reply to comment #102)
> (In reply to comment #96)
> > If you haven't already done rememberPassword, my
> > working-so-it-stops-annoying-me-testing version is
> > function rememberPassword(server, password)
> > let lm = Components.classes["@mozilla.org/login-manager;1"]
> Error: Cc['@mozilla.org/login-manager;1'] is undefined
Upgrade your wallet build to a login manager build?
I may need to re-merge with the trunk for that to work - I'll do that now.
+ try {
lm.addLogin(login);
+ } catch (e if e.message.indexOf("This login already exists") != -1) {
+ // TODO modify
}
Oops, I just wanted to see _something_ work. lm.findLogins({}, passwordURI, null, passwordURI), iterate through them looking for one with server.username == login.username and modifyLogin to change the password if it's different, else save, I think is right (and should be fairly copyable from nsLoginManagerPrompter.js).
(In reply to comment #99)
>
> JS doesn't seem to like this regexp, and my regexp foo is woefully inadequate.
The O'Reilly regexp book is pretty good; I can lend you my copy if you want to try and use it along with MDC to debug that...
- Fixed SMTP server selection (full day of work)
- Fixed manual hostname editing a bit, but still broken
- Implemented custom input fields and "enable URLs" from config XML files.
- Stopped verifyConfig() from guessing and downgrading login auth and
username form when config comes from config files.
- Localized JS logic files (error messages).
(The frontend - the vast majority - has been done by bienvenu earlier.)
Localization is complete now, if I haven't overlooked anything.
Outstanding, high priority:
- State changes / transitions (user edits various fields at various points) buggy to completely broken.
Phil, do you have stuff you want to land? I'd like to make an other pass at your review comments but I don't want to duplicate stuff you've already done.
You won't - I've been doing stuff I hadn't yet mentioned, mostly whitespace and style. The only mentioned part I've got is changing the regex to
^[-_a-z0-9\'+*$^&%=~!?{}]+(?:\.[-_a-z0-9\'+*$^&%=~!?{}]+)*@(?:[-a-z0-9.]+\.[a-z]{2,6}|\d{1,3}(?:\.\d{1,3}){3})(?::\d+)?$
(which is the "will allow @-foo-.com but who cares?" version) which I've been pretending I'll test more, but probably won't.
we're not going to hold b2 for this, but I'd really like to push to get it into b2
> I've been doing stuff I hadn't yet mentioned, mostly whitespace and style
You're working off the autoconfig branch, though, are you? Because I see no checkins apart from mine in the last days, and I made a lot of changes, too.
Yeah, that's because I haven't pushed anything. What I *meant* to tell bienvenu was that I would just push nits like trailing whitespace and style, rather than do enormous review comments citing 60 lines with this, and 50 lines with that, and 45 lines with the other, but I still haven't quite figured out how to do that to a moving target, other than maybe make a list and just keep grepping, or do nit after-the-fact reviews on every push that touches anything I've already done.
Well, either you state here what you dislike, e.g. "no trailing whitespace" or "replace ' with " ", or you do it yourself, all at once within 2 hours, and commit it immediately. If you do, please do not mix style and whitespace changes with real code changes.
we seem to have lost the progress widgets, at least on windows - I don't see any progress happening - didn't that used to work on Windows? I'll try the mac again...
I see in David Ascher blog (that is commented in Thunderbird Beta1 Preview Release) a new feature (autoconfig), but I test it with no success.
So, I submit a bug:
But Banner says that this feature is not available yet, and *maybe* spreadsheet available in is not used by developers to develop autoconfig.
I think that this spreadsheet have a lot of good information about mail servers.
Best regards,
Renato
Comment on attachment 356817 [details] [diff] [review]
more wip
marking obsolete - we've moved on a bit.
putting in m3 - Bryan, please push back if you don't think we're going to make that.
Created attachment 370869 [details] [diff] [review]
patch for review
Phil, do you think you could have a look at this? Bryan and I have changed the way this works a bit - now, if you need to edit settings because autodetect won't work for your account, you need to stop the autodiscovery process, make your changes, and then press go.
I've set up all my accounts on my new machine with autoconfig, so most things have worked at one point or an other, though I may have messed up generating a diff between the autoconfig repo and the trunk. I'm using your e-mail address regexp, I believe...
Pushed trailing whitespace removal and __end removal to the autoconfig repo.
Looks like chrome://messenger/skin/identity.png as (not) seen in the tooltip for the green button for a happy secure server didn't manage to actually land.
do you mean in the autoconfig repo or in my patch? If the latter, I'll go make sure it gets added to my trunk repo so it'll be in the diffs...
The autoconfig repo: looks like the intention was to copy (and the other two themes) and then use just the middle third of it, so it should really be just that chunk, and drop the -moz-image-region.
Pushed three identity.png icons, and the changes to jar.mn and accountCreation.css to go with them, to the autoconfig repo.
But, hmm, poor Gnomestripe doesn't seem to have gotten any of the other icons at all, have to do something about that once I remove the spinner.gif one, since we have perfectly usable throbbers already.
Got rid of spinner.gif, and copied over the Qute icons to Gnomestripe so it'll build. Hope you've got a fairly easy way to go from the autoconfig repo to a patch :)
While removing unused strings, I tripped over the customfields and enableURLs stuff. I know BenB's going to hit the roof, but I don't see any sign that that's ready to land. Our rudimentary collection of config files only includes one with one enableURL which isn't commented out, and since there appears to be no way to get past the t-online.de file to get to the t-online.de imap ssl file which uses only one of those two features, we're not only just guessing that it works, we're also expecting localizers to translate some... rather vague strings without any way to see them (and for that matter, expecting ui-r on something that Bryan's not going to even see).
We removed the UI for the enableURLs stuff because it was ui-r, but I didn't remove the strings and code because at some point we would like to have some sort of UI for this.
I'm not sure about the t-online.de stuff...
enableURL is required for gmail
enableURL is required for gmail.
I'll also use it to notify people that Hotmail can't work (without extra software).
customfields are needed for many, many ISPs.
Can we get that in, please? The UI wasn't any more broken than the rest of the UI ;-).
Created attachment 371248 [details] [diff] [review]
patch against trunk with philor's recent changes
Comment on attachment 371248 [details] [diff] [review]
patch against trunk with philor's recent changes
>--- a/mail/locales/en-US/chrome/messenger/messenger.dtd
>+++ b/mail/locales/en-US/chrome/messenger/messenger.dtd
>+<!ENTITY openMessageMenu.label "Open">
That unused entity is just *desperate* to make its way back into the tree, isn't it?
ah, sorry, I'll fix that.
(In reply to comment #129)
> enableURL is required for gmail.
For Gmail *IMAP*. For which might be a better URL.
> I'll also use it to notify people that Hotmail can't work (without extra
> software).
You might have, before March 14th. Now, that's no longer the case.
> customfields are needed for many, many ISPs.
Then we need a config file which uses them, *before* we land strings, so localizers have fighting chance of seeing what they are doing.
Though the 'spec' on the wiki doesn't exactly make it sound like we need a complicated extensible system allowing for every possible type of data and up to five different things with a vaguely worded localized generalized description and then non-localized labels so much as we need to optionally allow for either one or two "username" fields, which could then have localized labels.
Some things I don't currently know how to fix, offhand:
* The bad cert listener is still rather fragile (or maybe just broken): for email:goats@harborside.com password:goats (they deserve the suspicious-looking traffic, for exposing such broken crap even unintentionally), we seem to think we've discovered a secure POP server, at pop.harborside.com:993, but then we throw up an exception dialog with "imaps://pop.harborside.com" as the location, throw "Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIURI.port]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://pippki/content/exceptionDialog.js :: getURI :: line 220" data: no]" in the console, spin pretending we're thinking about it until you get bored and hit the Cancel button, do the same thing twice more, and then say it's an insecure server. Then, for real fun, hit the "Back" button under the address/password, then without changing anything hit "Next" and we'll say it's a lovely green secure server.
* Failure to log in breaks the dialog. With the goats@/goats, hit "Create account" and the failure to log in puts up a "FAIL" dialog, but also shoves the right side of the main window over a little with an "Username or password invalid" (which I bet is then a huge shove with a language where that has to be longer), and shoves the "Edit" and "Create Account" buttons halfway out of sight, because the "Configuration could not be verified -- is the username or password wrong?" string is too long and not wrapping, which probably means that things are broken for more than just that one string in more verbose locales than English.
* Since "Go to advanced settings" is actually "Create this account right now, or die trying" it really shouldn't be there acting like it will work and trying to work from the very second the window comes up, when it actually won't work more often than not.
* Not sure what we need to do to make the tooltips with insecureCleartext.description or insecureSelfsigned.description wrap, but they're currently a single very long line (and while someone's in the neighborhood, MDC and I don't think "bottom" is a valid value for the align attribute).
Reason to want to drop the unused enableURL strings number n: s/Thunderbird/brandShortName/ for entities was simple, but there are two Thunderbird instances in .properties. One is in findoutmore, which as the TODO comment in the code says should move to an entity, the other is in an enableURL string, so we'll have to include a branding <stringbundle> to brand an unused string.
So, if enableURL failed ui-r, what makes us think it will at some point pass ui-r, what will the changes look like, and why do we think we'll make them later rather than now?
* If you don't already have an SMTP server configured, the menulist doesn't show anything at all (probably not a huge concern unless/until we decide to use autoconfig for the first-run first-account wizard, since my way of getting there by creating an RSS account to get past first-run isn't wildly common).
Ultimately, autoconfig will be used for the first run account wizard, so we'll have to figure out the smtp server list for that case. It should be a text box at that point, and I believe it works as one now.
Re the cert error, there are a couple ways we encounter cert errors - one is during port probing, if we're able to connect via the SSL port, the other is if we can't connect via the SSL port but end up doing STARTTLS during verifyLogon. It sounds like you encountered the first one...the test case I had access to only did TLS so I've never exercised that code (I think davida wrote that...).
I don't know what the plan for using enableURL might be - I know Bryan did not like the UI but I'm not sure what the plan for getting a better UI is.
Note to self: don't forget that .larger-button looks like pure evil except for pinstripe which doesn't style it, and that the style on #back_button to make it look disabled when it isn't disabled is... not entirely in line with typical UI guidelines. - moved one of the two .properties strings with a hardcoded "Thunderbird" out to the .dtd, but I had trouble coming up with a more accurate name than the previous inaccurate findoutmore, so it probably still needs a rename.
Several notes-to-self:
* a fair share of the CSS doesn't actually apply to anything
* functions with no callers are evil; global functions with no callers are doubly-evil
* functions only called by uncalled functions aren't less evil
* semicolons at the end of lines may be optional to the interpreter, they aren't optional to the reviewer
* wrapping is good, random indents and random start-of-wrapped-line chars aren't
* let kDebug = true;
* catch (e) { alert(e.message); throw e; }
* TODO
* var gEnableURLsDialog
FWIW, I had discussed and agreed the general flow for enableURL and customfields (and the other dialog screens) with Bryan in Barcelona. The current UI looks horrible, because it depended on the main dialog flow / logic to be fixed first. I'll take a look at the new code, and try to fix the review comments, in the next days (probably starting Friday).
I recreated the harborside problem - I think at that point in the process we're supposed to be trying to do a temporary override of the cert without bringing up the UI, which is what we do for the smtp server. The reason the accept cert dialog is broken is that it got put up synchronously, which doesn't give the nss code a chance at the event loop to fetch the cert. The verifyLogon code which intentionally puts up the cert dialog has to do it on a timeout from the actual notification of the cert error.
Why the pop/imap confusion, I'm not sure. It may be that we discovered the imap port working after the pop3 port, and if we hadn't got the cert exception, we would have updated the UI to indicate the imap server. But since we prefer IMAP over POP, and secure over non-secure, I'm not sure why that would be.
(In reply to comment #134)
> * Since "Go to advanced settings" is actually "Create this account right now,
> or die trying" it really shouldn't be there acting like it will work and trying
> to work from the very second the window comes up, when it actually won't work
> more often than not.
I've talked with Bryan about the need to fix that, but we haven't reached any UI conclusions. One thought is to change the label to something like Create and edit. We may want to only enable it if the auto probing has succeeded, or the user has stopped auto probing.
For the dunno pile: the hostname fields and the email address field should have the class uri-element, to force them to be LTR even in an RTL locale, but the emptytext for the email address field shouldn't.
The cert override stuff is weird - if I set breakpoints in venkman, I don't get the cert exception dialogs so I have a feeling this is some sort of timing issue...
In my experience, Venkman breakpoints aren't terribly reliable; it may be worth adding dump statements double-check..)
my issue is that the breakpoints *were* getting hit, and that changed the timing/event loop stuff in such a way that the error did not happen...
Phil, I landed some semicolon fixes, and Bryan's going to have a look at the css and remove stuff that's not used. And I'll try to figure out why Billy Goat can't read e-mail.
(In reply to comment #148)
>.)
I'm going into options and deleting the cert exceptions. We're supposed to be adding temporary cert exceptions in our port probing but the exceptions seem to survive a restart, which is odd.
> The way that using the Back button and then trying again doesn't give the
> dialogs again, while not proof of a race, would at least be nicely explained by
> one.
I think (cert stuff is not my code) that behaviour is intentional - once you confirmed the scary dialogs, you don't want to see them again - at least not for the same hostname (they should show again for a different hostname, but don't IIRC).
Except that I've *never* confirmed them, because we've never fetched anything we would let me confirm: we throw up a dialog, with a missing port according to the console error, never enable the "confirm exception" button, and all I do is hit the "cancel" button three times.
Phil's right - and it's not your code, Ben, I don't think. I believe it's DavidA's or mine, and I see the bug(s) now - we've hardcoded the url to imaps, among other problems. NSS gave us a perfectly good targetsite, but we forgot it along the way, so I just need to pass that along.
Actually, I'm not sure why the cert exception is permanent, but I'll deal with that after I fix the other issues.
> I'm not sure why the cert exception is permanent
You mean the "Yes, I know the cert is insecure" red dialog of the account wizard adding a permanent cert exception? That is intentional, though, for all I know: We want to remember that the user manually confirmed that this cert is fine, and not warn him about this one anymore (e.g. when checking mail).
Not actually having read the patch, I was wondering whether the code was sufficiently modular to provide for a "Test manual settings" button in a) the account wizard b) the account manager.
I think it's permanent because we never remove the override - we return before we hit the code that removes the override.
I have the cert exception dialog code working better in my tree - it puts in the right site url, and allows the user to confirm the exception. It pops up twice for the goats account, which is a small issue :-) But the larger issue is, do we want the cert exception dialog at all, or do we want to use the UI BenB was referring to, which is way downstream, i.e., the scary dialogs, which at this point are a bit redundant.
Re Neil's question, it seems like the nsIMsgIncomingServer's verifyLogon method could give you most of what you want for Test manual settings.
OK, I've fixed up the cert exception dialog so that it has the right url. I'm still working on figuring out why we get two of them, and fixing that.
Phil, I still can't logon to that account with that user name and password - should I be able to? If so, what should my settings have been? (You can e-mail me privately if you want...)
Heh, no, you shouldn't: they're actually my first-ever ISP, not something I control to create working world-accessible accounts with. Real login in the mail, go ahead and delete any spam you happen to find there ;)
> the larger issue is, do we want the cert exception dialog at all,
> or do we want to use the UI BenB was referring to, which is way downstream,
> i.e., the scary dialogs, which at this point are a bit redundant.
I think our red dialog is supposed to replace the standard PSM invalid cert dialog. But Bryan and DavidA will know better :).
* msgNewMailAccount() needs to either not openDialog with a window name, or use whatsit, toOpenWindowByType or some such, depending on whether we want a second click of the menuitem to open a second autoconfig window or just find the existing one - right now, a second click of the menuitem does nothing.
(In reply to comment #142)
> FWIW, I had discussed and agreed the general flow for enableURL and
> customfields (and the other dialog screens) with Bryan in Barcelona.
To be clear on this.
We agreed that the enableURL could be helpful and that we need to figure out a way to work in custom fields. However the enableURL as it was implemented was a "force the user to click on the URL before they can proceed" interaction which we didn't agree was correct. That kind of system is not only annoying to us as people trying to test and develop but will be to other people who aren't stupid. That system of interaction will not go into the final product.
What we can do with the enableURL is offer it as a helpful option when our effort to login to the IMAP server fails. I understand there is no easy way of knowing why the login failed, essentially we have to try to help the person 'debug' what went wrong: password, username, IMAP enabled. We haven't put much effort toward designing this part yet so it definitely fails to be helpful right now.
For the custom fields I didn't want to insert them into the current dialog, but add them as an extra dialog to the config dialog. Nothing about the custom fields requires guessing usernames or ID codes, those are all provided by the ISP and therefore don't require space in the interactive configuration area. We can add a button to open the dialog along with a green light / red light for indicating that the values are correct or incorrect. Likely the dialog can open on it's own when custom configuration values are detected to be necessary.
Bryan, what you describe was your stance *before* we discussed it constructively and came to an agreement that we both liked.
Part of the problem was that we cannot even reliably detect a failure. In my testing, I had many cases (for different reasons) were we'd just be stalling for 2 minutes and eventually time out, because a) DNS doesn't resolve, b) the POP server simply doesn't answer (it doesn't like the user account / our IP address) etc.. So, while I agree this "show help on error" sounds reasonable in theory, it simply does not work in practice, in my real world experience. I tried many different ISPs and accounts in my testing. It was a horrible experience (despite me knowing the correct settings), and I want to save our users from that.
We had discussed that and several problems in the logic flow (and resulting bugs) of the dialog. The agreement, as I remember it, was that we'll have a dialog with several modes/parts/pages (the left side with name, email, password stays the same, and the right part changes). enableURL and customfields were just two of those changing right parts. The other right parts are: nothing (empty), hostname guessing, manual hostname editing, final configuration/hostname display, and (possibly) cert warning. The parts are sequential and the transition happens with explicit Next buttons.
Can anyone persuade me that there's a reason to keep validatePassword? Right now, if you tab into and then out of the password field, we put up a lying error message, saying "Login did not succeed...", turn the emptytext into eight password bullet characters, and leave a blinking caret there, even though it doesn't have focus. While I don't doubt that's all fixable, I don't see blur as being the right time to be complaining about a zero-length password: as the error string says, when the Login did not succeed is plenty soon enough.
Phil, this and other cases - we have far worse situations - are why we should have explicit Next buttons (see my last comment) instead of relying on blur or the user knowing what he has to do next.
You haven't built autoconfig for a while, have you? We have an explicit Next button. We also have emptytext instead of labels, so actually I can't just get rid of it, at the very least I have to have validatePassword turn it back into text so the emptytext shows up again when you go in-n-out.
phil: yeah that should be changed, I think the blur event was carried over from before.
Apparently I've gotten so license-block blind that I didn't even notice that emailWizard.xul is missing one, and needs to have it.
Created attachment 371973 [details] [diff] [review]
patch to enable autoconfig
I've landed most of the autoconfig stuff on the trunk, as NPOTB - this patch is what you need to apply to turn on the autoconfig UI on the trunk.
Technically, I probably shouldn't have added the jar file changes, or messenger.dtd, but nightly users won't see the changes.
Ack, or the strings, since that now means that any change of string text requires a change of entity name/key.
(In reply to comment #170)
> Ack, or the strings, since that now means that any change of string text
> requires a change of entity name/key.
I did not add the string files to the mail jar files (I only landed the theme jar file changes). I would hope the localizers would ignore property files that weren't part of the product though that's probably too much to hope for :-(
'Fraid so: even as we type, the quickest locales are looking at pages like and localizing away.
Created attachment 372014 [details] [diff] [review]
some better patch to enable autoconfig
We still need a UI decision on whether a second click on the menuitem should open a second autoconfig window or should find the existing one, but at least this version doesn't break SeaMonkey's accountcentral link, and points us at the HTTPS MoMo config server..
clarkbw: do you have a very rough feel for how much string churn we're likely to see here before we're mostly done churning?
s/strings weren't changed/strings weren't being changed much/
Not counting things where Bryan doesn't like the wording, there's certinfo.url, depending on how it goes 10 to 16 customfields/enableURLs strings, one of the pair of cleartext strings where in one we say "email" and the other we say "email and password", the two where we have double-hyphens for an em dash, and perhaps ten or fifteen removals where we're localizing what I think are developer-targetted console error messages like "enum value not supported" that I'm inclined to say we shouldn't be making our localizers try to translate.
i haven't done a real cleanup of the strings in there at all. many of them are left overs of the first attempt. I would plan for a good amount of churn I guess. Even for the strings in there that we plan to keep they don't likely have the final wording as that takes a while and really needs everything else together before it can happen.
There used to be a way to put translation notes in there as message to the translator, IIRC in form of comments, e.g. "DO NOT TRANSLATE" (for "Firefox" etc.). You might just put a note "Do not translate before May" or somesuch at the top of each file.
If someone's in a position to read a l10n note in the en-US file, then they haven't started translating and thus are in a position to be saved by a quick move to content. If not, they won't have any reason to be looking back at the en-US file. And from what I've heard about the lack of support for "ENTIRE FILE" l10n notes, it might not even ever be seen.
It's also cruel to say "leave your tinderbox red for four weeks, and every time you check how you're doing, dig through the details and ignore these 100+ issues" - it's exactly equivalent to landing a patch that turns the code tinderbox red, and saying "eh, leave it for four weeks, and just read the build log to see if there are any new errors."
Created attachment 372256 [details] [diff] [review]
Unrotted patch to enable
A wee bit unfortunate to be dropping an ifdef right back into mailnews/jar.mn minutes after the previous ifdef went away, but this way it's where it belongs when SM's ready to jar it.
* When we give up on guessing (@hotmail.com is handy for that, since it's pop3.live.com), you can edit the hostname like we tell you to, but we have an Edit button rather than a Go button. It should either still be disabled, or the button should change to Go (or disappear, if what we really mean is "we're bored with this, fix it however you want and then Create account").
* When you change the port and security (@hotmail.com is handy for that, since you want 993 and SSL/TLS, but we leave you at 110 and none), we then ignore that and start over at 110 and STARTTLS.
(In reply to comment #174)
> much.
>
>.
That would be the best solution. Localizers who live on the bleeding edge know
what they are doing, so this would be acceptable for them. Nevertheless it
would be polite to inform of them of this decision via a posting in mozilla.dev.l10n
Oh, and once you move the strings back from content/ into locales/ please make sure to remove all obsolete leftovers. Because we've tried hard in the last few months to eliminate all obsolete strings.
(In reply to comment #182)
> That would be the best solution..
Let me just add that Robert is 100% right here in a general sense, that being that things should not be landed in the general nightly builds until they are ready. If they aren't, you should use a try-server build instead.
In this particular situation however, where this was already landed (in error), the proposal from dmose' comment 174 is the best course of action.
Strings moved in
Created attachment 372311 [details] [diff] [review]
Patch to enable with content strings
Created attachment 372354 [details] [diff] [review]
Review nits, round 1 - checked in
I tried to keep to mostly whitespace and wrapping and stray commented-out stuff this round, though some other things slipped in.
Created attachment 372355 [details] [diff] [review]
Make email address and hostnames ltr in rtl locales - checked in
Turns out I was wrong in comment 145, and emptytext is smarter than me. Even if you set class="uri-element" and thus direction: ltr;, the emptytext still takes the document direction, so you have [ כתובת דוא״ל] but when you start typing you get [me@foo ].
(In reply to comment #168)
> Apparently I've gotten so license-block blind that I didn't even notice that
Fixed.
(In reply to comment #183)
>
>.
(In reply to comment #184)
> Let me just add that Robert is 100% right here in a general sense, that being
> that things should not be landed in the general nightly builds until they are
> ready. If they aren't, you should use a try-server build instead.
There's plenty of history at Mozilla of landing features at various stages of maturity for a variety of reasons, and it's generally a judgment call: there's no one-size-fits-all policy to be had here. As I mentioned in comment 174, the lead localizer for Firefox (Axel) encouraged all front-end feature developers to land strings in content before they were ready to be localized; I see no evidence at all that if we had actually done that in this case that it would have somehow been "wrong".
The error here, which I take responsibility for, is not thinking through the l10n consequences of the early landing before suggesting going forward.
* emailWizard.xul has a non-localized |<label class="heading">Account Information</label>| (wonder how many times I've looked at that without seeing it)
Comment on attachment 372354 [details] [diff] [review]
Review nits, round 1 - checked in
- errorStr = getStringBundle("chrome://messenger/content/accountCreationUtil.properties")
- .GetStringFromName("cannot_contact_server.error");
+ var stringBundle = getStringBundle("chrome://messenger/content/accountCreationUtil.properties")
+ errorStr = stringBundle.GetStringFromName("cannot_contact_server.error");
Is this change for formatting/readability reasons? We don't need the temp var stringBundle...but if it's for readability, maybe use let instead of var?
while you're here, can you add some parens around the == clause just to be clear?
+ if (!oX.@type == "smtp")
Everything else looks fine, thanks!
It was for wrapability, and to match the usage a dozen lines up, but I can let them both, sure.
- assert( ! this.result, "Call already returned");
+ assert(!this.result, "Call already returned");
Can you leave this, please? I put spaces around the ! quite intentionally, because it's very eas to overlook otherwise.
(same thing dozens of times)
+ if (!oX.@type == "smtp")
Good catch, bienvenu. That looks like a bug ("!" takes precedence and the expression then makes no sense and is never true), and it should of course just be != . Looks like bad refactoring in a hurry.
Yeah, I realized that you put the spaces there intentionally, but as you know you don't entirely get to pick your coding style while writing Mozilla code. accountcreation has 13 |( ! [a-zA-Z]|, the whole tree has 28 in \.js$, the rest in js engine tests, accountcreation has one |(! [a-zA-Z]| and the whole tree has 53, accountcreation has 37 |(![a-zA-Z]| and the whole tree has mxr's bignumber, "over 1000". If we decide tree-wide to change, or even to change only for new code, fine, but we're not going to make that another "first author of a file gets to choose" thing, much less an "author of a particular line of code gets to choose" thing.
moving to m5 - Phil is making good progress on the reviews. Bryan has a few things he needs to cleanup.
Re the spaces, I agree with Phil - reviews and sr's always say for those to be removed.
Comment on attachment 372355 [details] [diff] [review]
Make email address and hostnames ltr in rtl locales - checked in
Comment on attachment 372354 [details] [diff] [review]
Review nits, round 1 - checked in
Oh, no wonder it looks like we ignore your changes of port and protocol: onGo calls _startProbingIncoming, which still thinks it's responding to a blur on hostname and merrily sets protocol/port/socketType to undefined.
ui-wanted: if I change the hostname, I might have also changed one of the other bits, or I might not have because I didn't know anything other than the right hostname, or I might not have changed them because they happened to be perfect at the time I stopped probing.
I can see how to make it work with buttons that say essentially [Start probing from scratch] and [Try this and nothing else], or with the horrid UI (but perfect behavior) of blanking the port and selecting a blank item at the top of the protocol and socketType menus while entering edit mode, but I don't see any way of divining whether something unchanged was unknown, or already right. Maybe in this case the horrid way is the right way, and "left blank means you figure it out" will make sense to people?
If the user explicitly changes the port and/or protocol, can't we lock those down and make _startProbingIncoming not set them to undefined? Then the issue becomes, what if the user got either of them wrong? I suppose if we ultimately fail, we could clear the fact that the user set the port and/or protocol and start guessing again, if something else (e.g., username/hostname) changed.
I had started on changes that I thought could fix this, but it took longer than I expected to put them together. I was making a menu list widget that contained all the valid probed information, with an additional list item for "Custom...". This menu list sat above the existing form entry which was just visibility:hidden so it would take up the right amount of space.
[ IMAP mail.example.com - 143 TLS | v ]
| POP mail.example.com - 67 TLS |
| POP mail.example.com - 43 None |
| Custom... |
'----------------------------------'
When you selected the "Custom..." it showed our current entry form with our "best guess" (top value) pre-filled in. From there everything was manual entry without trying to stick certain values and keep others.
With the richlist box I styled the different pieces so I don't think it looked too bad. (|| == graytext)
*PROTOCOL* HOST - |PORT| |SECURITY|
But I don't think my dev-foo is quite up to making this happen, or at least I failed at getting it to work correctly.
Onchange may be the best we can do, despite not working for two of my use cases:
Smartypants doesn't like us poking around in the wrong places, can't believe we got rid of the wizard, stops probing as quickly as possible, but happens to stop us with his chosen set being probed. He has to either change everything, and then change it back, or know that "Go to advanced settings" means "Create it now.".
Sadly, my
[ ] v
| POP |
| IMAP |
'------'
idea, with leaving it on the blank choice to mean "restart probing this" didn't survive getting home and actually looking at an autoconfig build, since I'd forgotten that there aren't any labels for those menus, so unless an a11y review winds up requiring a label, that's out - I'd do that for "Protocol: [ ] v" but not for "[ ]v".
I was also very confused about the mixing of probing and manual editing (besides the fact that it doesn't work right atm). When I edit manually, I don't want any probing. I can see that a user may know the hostname, but not the port and protocol, and/or not SSL and auth capability. So, I think we should have a "manual edit" mode/page, where the hostname is empty by default, and the other values are defaulting to "auto". If the user enters a setting, we use that (and if it fails, we go back to that screen - I do *not* want other values to be used in that case). If the user leaves the default of "auto", we probe that particular setting.
.
sorry for the sidetracking.
(In reply to comment #204)
> ?
I feel like we want to get across the idea that you are actually going to create the account but we're dropping you into the advanced settings dialog to stop any auto settings we might have tried. Something like "Create in Advanced Editor" or "Continue with Advanced Settings"? I guess I'm not too concerned about the creation of the account as it's easily removed, but I think it makes sense to get that idea across. I'd like to have an idea of "advanced" in there as we already allowed some reasonable settings to be editing and we're about to drop you into radio and checkbox heaven.
> >.
Agreed. I should have done more from the beginning to get our list of use cases that we were going to support written out. I think we're handling a decent set right now but I keep changing between the cases we are not going to be good at and what we are going to be good at.
I went back and looked at mail.app to see how they deal with some of those issues, and I realized that their config stuff is a lot less ambitious than ours. If we can make it a lot easier than it was for 95+% of users, and not make it harder than it was for the remaining 5%, it'll be a big win.
Created attachment 373409 [details] [diff] [review]
fix enabling of next and advanced settings - checked in.
This patch makes it so "Next" is only enabled with a remotely valid e-mail address (e.g., a@b), and only shows the "advanced settings" link when we have enough information to actually to go to account settings.
Still to do - make "next" and "back" localizable(!)
We also need to make the "advanced settings" link report errors creating the account (most likely, the account already exists). And of course, decide on a better label for the link.
Hmm, are we unable to remember a password of ""? The comment for the soon to be rewritten validatePassword seems to think such a situation might arise, but if we refuse to remember that your password is "" (in general, not just in this patch), I sort of doubt anyone would actually use us with a blank-password account.
Ah, perhaps I could just read nsLoginManager, where it throws on a .length == 0 password, couldn't I?
(In reply to comment #209)
> Ah, perhaps I could just read nsLoginManager, where it throws on a .length == 0
> password, couldn't I?
Or perhaps I could have explained why I added that code :-)
Comment on attachment 373409 [details] [diff] [review]
fix enabling of next and advanced settings - checked in.
Seems like a step in the right direction (except for the trailing whitespace on the first and last lines of the onEmailInput hunk, that's not so right direction)..
Created attachment 373541 [details] [diff] [review]
Don't set isSecureServer
Warning: inServer.isSecureServer is read-only
Source File: chrome://messenger/content/accountcreation/createInBackend.js
Line: 66
Created attachment 373542 [details] [diff] [review]
Don't beg for bitrot - checked in
Now that you mention it, yes, a sane person *would* patch on top of the one he just reviewed.
Who is supposed to be checking whether an account already exists? Whoever it is, they're not terribly good at it. At one point, I did manage to get a dialog complaining that my outgoing server already existed, but most ways I've tried either just go ahead and create a duplicate account or fail by looking hung when nsIMsgAccountManager.createIncomingServer returns an uncaught NS_ERROR_FAILURE.
Comment on attachment 373542 [details] [diff] [review]
Don't beg for bitrot - checked in
thx, I keep forgetting to remove that.
(In reply to comment #211)
>.
I don't think we really need one internally but I don't mind strongly encouraging that there be one. Perhaps I'll look into seeing why we blowup w/o one, and fix that, and we can decide about enforcing one separately.
Comment on attachment 373542 [details] [diff] [review]
Don't beg for bitrot - checked in
clarkbw, do you think you're going to have a chance to fix the error message box problem that philor pointed out? And make the Next/Back button text localizable? Those are two blocking issues, I think.
Philor, what do you think are the top things preventing this from landing so it can get more testing? I'd like to get it in and get people working on a small set of targeted config files for various isp's (the baby bells, for a start) and e-mail providers (hotmail, fastmail, etc).
Eventhough Renato already wrote this in comment #116 I just wanted to point out, that most of the big servers are listed in a spreadsheet created by Gerv. - to avoid double work.
Created attachment 373732 [details] [diff] [review]
move next & back to dtd file - checked in.
Comment on attachment 373732 [details] [diff] [review]
move next & back to dtd file - checked in.
>+<!ENTITY back.label "Back «">
Are you sure? ;)
sure about what? Is there some confusion because this dtd file isn't where localizers can see it? If so, I really can't win for losing :-)
You can't, and neither can I, having thought "I'll just review this without applying it or really looking at it, what can go wrong? Other than TEARS AND DEATH that is."
The fake arrow is supposed to be before the word in the Back button.
duh, ok, I'll fix that.
Created attachment 373744 [details] [diff] [review]
Fix password emptytext as bullets - checked in
The error we were displaying onblur with an empty password was a lie ("login failed"), and we don't need to complain about it until we actually try to use it, plus by setting the type to "password" and leaving it we were displaying eight bullets as emptytext if you tab through without entering your password or delete what you entered and then change focus.
Created attachment 373768 [details] [diff] [review]
require a real name before showing next
this makes us require a real name before allowing next. I also made us hide "next" if the requirements go from met to not met, and I added a little check to the e-mail validity check, for a '.' after the '@'.
Created attachment 373770 [details] [diff] [review]
philor points out we don't want to require '.'.
Comment on attachment 373744 [details] [diff] [review]
Fix password emptytext as bullets - checked in once I got rid of the call in validateAndFinish, since failure to log in does just fine at blowing up if it fails to log in because of a blank password.
(In reply to comment #229)
>.
The penalty for getting it wrong at this step is the user can never create the account. The penalty for getting it wrong in the full check is that we give an invalid warning but the user can still create the account.
Comment on attachment 373770 [details] [diff] [review]
philor points out we don't want to require '.'
r=me, and pushed with light denitting in
Created attachment 373786 [details] [diff] [review]
missing string - checked in
Dunno how I missed seeing the title "undefined" when we can't find either host for so long, since now that I've noticed it, I can't *not* see it. I suspect this wasn't exactly the string you had in mind, but you can always tell me what you really wanted as a review nit ;)
(Localizing the non-localized Account Information is just a ridealong, because I keep seeing it and forgetting to fix it.)
Comment on attachment 373768 [details] [diff] [review]
require a real name before showing next
>+ _show("next_button");
>+ else
>+ _hide("next_button");
On a real wizard I would have expected the button to be disabled...
> <button id="next_button"
> hidden="true"
... but then maybe you're not using a real wizard...
Neil, you're of course right. It should be disabled, not hidden. If disabled state had any purpose, then here.
Um, why? Wizards have disabled Next buttons because that's how you know that you are on pane n of m but haven't yet leveled up enough to go to n+1, that you aren't at the end yet. Here, you are in a single window, with three inputs and a Next button once you fill in two of them. What does a disabled Next button tell you that no Next button does not?
I wouldn't *object* to it being disabled, though, since it would force addressing a review comment about how back is styled disabled when it isn't, up there a hundred comments or so.
Created attachment 373848 [details] [diff] [review]
don't check if existing server exists.
if the user has picked an smtp server, don't error out if it actually exists.
The issue with duplicate incoming server detection is that it happens before user name probing happens - if the user name happens to be the kind w/o the @host, then duplicate detection works; otherwise it doesn't. My thinking is that we should just try both flavors of the user name for duplicate detection. That would cause an issue if you had two accounts on a server, one with username "fred" and one with "fred@foo.com". I don't think that's particularly likely.
My list of blockers for shipping in nightlies with en-US strings from content/:
* Straighten out the buttons when we give up on probing: right now, we replace the Stop button with an Edit button even though we've already enabled editing, so you edit, click Edit, it changes to Go, you click Go.
* Don't expose UI to edit things we'll ignore. Ideally, that would be "expose it all, don't ignore any of it" but at the moment we ignore everything except username and hostname, and we could probably survive if we only paid attention to username, hostname and port. That would require reworking the UI so there's a separate UI for editing to probe again and for showing the results of probing and either creating or manually editing everything and manually creating, but it still might be easier than figuring out how we'll tell what people meant to specify from what we just prefilled for them.
* Make it possible to use an existing SMTP server.
*".
* Remove the fetchConfigFromISP step, since nobody has done anything about a security review for it.
Created attachment 373865 [details] [diff] [review]
check both forms of the username when looking for incoming dup detection - checked in.
this also contains the previous patch for outgoing server detection.
Basically, if the username doesn't have a '@', we also check the e-mail address for duplicate accounts. This may not be the right thing to do 100% of the time, but not doing it is wrong.
> a separate UI for editing to probe again and for showing the results
> of probing and either creating or manually editing everything
> and manually creating
Yes, agreed. That's exactly what Bryan and I discussed and agreed on in
Barcelona.
I want to still implement that, if nobody else has done so.
> Remove the fetchConfigFromISP step
I did post a formal security review request, as you requested.
Nobody had any problems with it.
We show the configuration to the user before we create the account.
Please also see
(In reply to comment #239)
> My list of blockers for shipping in nightlies with en-US strings from content/:
thx for doing this list, Phil.
>
> * Don't expose UI to edit things we'll ignore.
There are two flavors of ignore, right? One when you say Create Account, and one when you do "Go". It's the latter that could require UI changes. The former is really the same as go to account settings. I would not want to lose the ability for the user to override things and go to create account because probing breaks them.
> * Make it possible to use an existing SMTP server.
I think my patch should fix this.
>
> *.
I can look into".
I'll fix this.
> <!ENTITY ssltls.label "SSL / TLS">
This is without middle spaces elsewhere.
Arrgh, "Well, that didn't go terribly well" wasn't terrible enough to force picking something reasonable? Next time I'm using lorem ipsum :)
(In reply to comment #241)
> I did post a formal security review request, as you requested.
Since I think he's done what I actually mean, dmose should be able to explain the difference, and how to go about it.
Comment on attachment 373786 [details] [diff] [review]
missing string - checked in
Comment on attachment 373865 [details] [diff] [review]
check both forms of the username when looking for incoming dup detection - checked in.
Nice! One of these days, we ought to make the caller of checkOutgoingAccountIsNew a little smarter, since finding it exists really calls for using the existing one, not alert()ing, but that's not nearly as much a blocker.
>+ if (isNew && incoming.username.indexOf('@') < 0) {
Micro nit: double quotes unless you actually *have* to use single.
Comment on attachment 371248 [details] [diff] [review]
patch against trunk with philor's recent changes
No real point in a review on this anymore, I've done it piecemeal and the real r? will be the "enable" patch.
Created attachment 374023 [details] [diff] [review]
Remove bogus more-info link - checked in
Over the three months plus four days since I said this URL needed to be removed from the dtd, nobody's removed it, nobody's added the pref it should be, and nobody's written the content, which rather makes me think it's not going to happen. If someone decides to make it happen, they'll have an easy enough time adding it back in (the right way).
I have a fix for clicking on the outgoing server hostname widget hiding the port and connection type.
The reason picking the connection type doesn't work is that setSecurity is not defined:
gEmailConfigWizard.setSecurity
which I should be able to fix this morning.
Comment on attachment 374023 [details] [diff] [review]
Remove bogus more-info link - checked in
Created attachment 374124 [details] [diff] [review]
make probing respect user choices
this patch makes probing respect various user settings, and should make "advanced settings" respect the user choices as well.
It doesn't quite work w.r.t the socketType, though it works quite a bit better than without this patch, at least for a live.com account. live.com will never quite work with my ISP since it does smtp on port 25, but I was able to enter a live.com e-mail address, do next, press stop once guessing had started, and fill in all the correct information, and press go, and wait for smtp to fail, pick an existing smtp server, and then press finish.
I'm thinking what I should do in guessConfig.js is start off with an array of all the possibilities, and remove the ones that don't match the user-specified protocol and/or port and/or socketType.
philor, if you get a chance, let me know if this patch works better for you. object. This would make port 587 much more prominent since end users using Thunderbird will use this port by default. This will raise visiblity among ISPs and they will obviously at some point also block port 587.
was imitating a naive and/or impatient user by"stopping" and following the instructions on MS's site. We don't try 587 for smtp at all - we try 573 and 465. Should we also be trying 587, or 587 instead of 573? One piece of doc I found says 25 and 587 should be used for insecure or STARTTLS, and 465 for SSL. And 587 does work for live.com, over an insecure connection.
I don't think what Thunderbird does is really going to cause ISP's to block port 587.
I see Ben added port 573 for SMTP - Ben, can you say why? Is it common in Europe, or is it a case of a single ISP that would probably be better handled with a config file?
Where is 573 coming from? /etc/services says it's registered for banyan-vip.
The registered "submission" port is 587 (e.g., Gmail uses it for SMTP).
Despite the way I always say "foolishly don't block," really blocking 25 but not 587 is absolutely correct ISP behavior: ISPs block 25 because their zombie customers are contacting example.com:25 to deliver spam for @example.com users, acting as an MTA, not because they are contacting example.com:25 as an MUA, to submit spam for delivery to users at other hosts. There's no need for an ISP to block 587, and it was created explicitly to be the port that ISPs don't need to block, because the server gets to refuse any connection it doesn't like, unlike 25. (And I'm guessing that 573 is a typo for 587, since as rsx11m says that's just not any sort of an SMTP port.)
(In reply to comment #251)
>.
That's a good point we could increase their size or change position
If I added port 573 and SMTP is 587, then that's surely a typo.
Note that ISPs are blocking outgoing port 25 to counter spam originating from botnet zombie PCs on their network, not to force the use of their own mail servers. (At least I'd hope so.) That's also exactly the reason why 587 was introduced, IIRC: to differentiate between server-server SMTP (25) and client-server SMTP (25 originally, now 587).
See comment #35 on 587, also citing that it /should/ be used if available.
Created attachment 374172 [details] [diff] [review]
a bunch of fixes for stopping and restarting
This patch does a few things:
replaces smtp 573 with 587
remember if the user picks any of the settings, and make probing respect those choices
don't reprobe incoming or outgoing on "Go" if we've successfully probed
The elimination of things to probe is a bit ad hoc, and I really should do the table subtraction approach I mentioned earlier, but this works for the case where you stop probing and fill in the values yourself, which I think will be relatively common for folks unlucky enough not to get a pre-canned config. Philor, I'm wondering if you can try this out and let me know what you think.
Two bugs, one that's probably this, maybe in that tangle about protocol and type, one that's probably something else:
1. autoconfig your dreamhost account, either stop us while we're probing IMAP or wait until we discover the IMAP server and then edit
2. change to POP, click Go
3. curse the rediscovery of the IMAP server
and.
Created attachment 374217 [details] [diff] [review]
Patch to enable with just one autoconfig window at a time
I finally got tired of having the menuitem clobber an existing autoconfig window, but not focus it, when you forgot that you had one open already, so I answered my comment 161 question of which way we want to go with "find and focus an existing window."
(In reply to comment #262)
> 1. autoconfig your dreamhost account, either stop us while we're probing IMAP
> or wait until we discover the IMAP server and then edit
> 2. change to POP, click Go
> 3. curse the rediscovery of the IMAP server
Thx, Phil. I think this one is because I don't restart probing on discovered accounts - I need to clear that state if the user changes any of the settings on a discovered account, so that we'll reprobe.
>
>.
Hmm, I thought we would have erred in the other direction...I'll look into it.
Created attachment 374339 [details] [diff] [review]
fix philor's latest issues - checked in.
this fixes our detection of live.com's STARTTLS support (POP3/IMAP/SMTP commands are supposed to end with CRLF, not simply LF)
It also fixes our smtp auth handling - we now assume that a user name and password are required, which was the opposite of before, but this is a much more reasonable default.
It also fixes the incoming protocol/type issue, and reprobing after you changed something in a successful probe.
Sometime, I think pretty recently, remembering passwords for POP account broke: remember checked does remember for IMAP, but not for either POP account I tried creating.
Oh, because pop3 passwords are apparently supposed to be saved for "mailbox://foo.example.com" rather than "pop3://foo.example.com" so maybe it didn't ever work.
Comment on attachment 374339 [details] [diff] [review]
fix philor's latest issues - checked in.
Mmm, it's getting pretty nicely behaved!
> clickOnOutgoingServer: function()
> {
>- _hide('outgoing_protocol');
>- _hide('outgoing_port');
>- _hide('outgoing_security');
> },
Got a future plan in mind for that shell of a function?
>+ dump ("setting outgoing auth to 1\n");
Probably don't need to dump that, but if you do a ddump we can shut off would probably be better.
Comment on attachment 374339 [details] [diff] [review]
fix philor's latest issues - checked in.
checked in with comments addressed.
I think I've addressed all of Philor's blockers in #c239 except the first and last (the buttons when we give up probing, and disabling the fetchConfigFromISP pending a review). Once those and any new blocking issues are addressed, we can turn on this feature with strings still in content. I'll try to fix those today. Bryan, given that the string freeze is this coming Tuesday, do you think you'll have a chance to do a review of the strings before then? I assume we need that review before we can turn this feature on with strings from locales. We really should fix the issue with the error messages messing up the column width as well. Were there any other issues that would prevent turning this on with strings in locales, so the translators can get going, Philor?
Created attachment 374482 [details] [diff] [review]
Philor's fix for stop | edit | go
I've been trying this out - it works much better than what we had before. I think the one place it falls down is when the user does a "back" and a "next". I'll look into that.
Created attachment 374484 [details] [diff] [review]
philor's patch, plus fix for handling back+next - checked in.
I'll land this...
Created attachment 374486 [details] [diff] [review]
disable fetch from isp pending security review
this removes the call to the code that tries to fetch the config from the isp, but leaves the fetching code in - dmose, do you think you could help Ben with what we mean in terms of a security review so that we can get on track to put this code back?
I object to this being disabled. I initiated the review as requested by Phil, publicly on the cited newsgroup and on the sec-group list. Nobody came up with significant issues. In the same thread, I also gave several reasons why this is not pose a considerable problem. We had specifically designed this to be secure, and it's much more secure than status quo.
Another point: If the "fetch config from isp" were a security problem, then the probing is as well, for the same reasons.
See, which Dan pointed to in that very same thread in the newsgroup.
(In reply to comment #275)
> Another point: If the "fetch config from isp" were a security problem, then the
> probing is as well, for the same reasons.
Should I take that to mean that you'll say anything to land fetch from ISP, so I should discount your claims about it, or should I take that to mean that you don't see any difference between "Get access to a well-known subdomain which has long been used for mail servers, and run a mail server, or a script which adequately imitates one, on ports other than 80" and "Get access to an unknown subdomain which means nothing special to any host prior to Tb 3, and serve an XML file over HTTP on port 80," so I should discount your claims about it?
I'm sorry that you didn't understand either what I was asking for, or what dmose meant when he said that your posting was "a fine start" rather than saying it was "all that is required," but that's not a get out of jail free card. I'll never like following the robots.txt anti-pattern, but I can live with it, if and only if we have security-minded people actually commit to having an actual meeting where they will actually look at the code and say one way or the other whether they feel that the risk is adequately minimized.
> not a get out of jail free card
That's precisely what I want to say: That I'm put in jail here, for no good reason. Same with the other code from me that was just removed without even communicating with me.
> if and only if we have security-minded people
You know what? I'm one of them.
For the record, the problem I have is that I am not seeing this "meeting" happening anytime soon, given all the "Unscheduled" on the page, and I don't want this to block indefinitely. I feel I have done all *I* can do for this, including public discussion, 2-3 times. Anyways, I'll add this to the mentioned page.
Created attachment 374527 [details] [diff] [review]
this time w/o syntax errors
Comment on attachment 374527 [details] [diff] [review]
this time w/o syntax errors
That one works. I'd say if we start saving POP passwords with mailbox:// instead of pop3://, we'll be ready to go.
Posted the security review form.
Created attachment 374537 [details] [diff] [review]
fix remembering pop3 server password
this should fix it for pop3.
Comment on attachment 374217 [details] [diff] [review]
Patch to enable with just one autoconfig window at a time
Most of this is yours, r=me, but there are a few bits that are mine, r? you.
Comment on attachment 374217 [details] [diff] [review]
Patch to enable with just one autoconfig window at a time
you caught me in the middle of a full rebuild (I got tired of js_aborting) so it'll be 30 minutes or so before I can try this patch out...
Comment on attachment 374217 [details] [diff] [review]
Patch to enable with just one autoconfig window at a time
looks good, thx! and we're done here.
New bugs for broken and not-so-good bits, please, and don't forget to mark them as blocking this bug, and nominate them for blocking Tb3 if they deserve it.
Mini test plan
File | New | Mail Account (Quick Setup)
First, try creating accounts that we have config files on our server for, e.g., gmail. Verify that good username and password work, and bad username and/or password gives an appropriate error.
Then, try creating accounts that we don't have config files for (e.g., your own personal domain, if you have one). Verify that we prefer IMAP over POP3, and TLS, then SSL, then non-encrypted connections.
Then, try invalid domains and or servers that we won't be able to guess from the e-mail address. Verify that we fail to find the server, and give an appropriate error. Then, try correcting the domain and verifying that discover works.
Verify that stopping a probing session and picking one or more of protocol, port, and connection type works.
Verify that picking an existing smtp server from the list works, and creates the account correctly.
In all cases, you should check that the account created works, so that you can receive incoming mail and send outgoing mail. Verify that remembering/not remembering the password works as expected.
Try connecting to a server with a self-signed cert and verify that we give you the chance to add an exception for the cert.
There are many comments in this bug that contain steps to reproduce problems that we have fixed - repeating those steps and verifying that the problems are fixed would also be very helpful.
Testing:
Must fail: The guessing is known to fail for bucksch.org. If it finds an SMTP server, it's probably a false positive (which would be misleading and bad). There's no IMAP or POP server either.
fetch config: You can see the list of supported ISPs for which we know and can fetch the config - no guessing - at . (All files with a space in the name are disabled.)
Everybody: If you know the configuration for a big ISP or email provider, and it's not in the list yet, please add it to <>.
@Ben Bucksch: I get nightly build (April/28) and try config a new e-mail account (Mandic Mail), but none config is loaded automatically. Thunberbird request to me all configs, as account type, server address, etc.
Mandic Mail is listed in MailServerList (comment #290) more than 4 months.
Yes, we have no process yet to automatically or semi-automatically put the settings at MailServerList live to , so that TB3 will actually use them. I am doing that manually right now for the big ones.
If your ISP is not yet at , you help by putting it in the MailServerList, or/and testing the settings which are there. I (or the other devs) can't test most settings, because we have no accounts, so we have to rely on your testing.
Also, it would be good to check whether there are better settings possible than those listed, specifically whether SSL and secure auth are possible.
For real ISPs (offering Internet connection), sometimes the possible settings differ based on whether you are connected to their network for Internet, or whether you are on other networks ("on the road", in the company). It would be good to test the settings in both situations, and if there are any discrepancies (some settings work only in one of the cases, note them in the "Additional Notes" field.
*** Bug 367499 has been marked as a duplicate of this bug. ***
*** Bug 492187 has been marked as a duplicate of this bug. ***
@Ben,
I send you a xml file such as available in
Can you add it on this autoconfig directory to me test it?
And I see some repeatable files, as:
yahoo.co.uk
yahoo.com
yahoo.com.br
yahoo.de
yahoo.fr
yahoo.it
All this domains is showed in <domain> xml file, so I think that is necessary only one (yahoo.com), right?
If, in the future, gmail (e.g.) change all server address, is possible config mail account manually?
(In reply to comment #296)
> If, in the future, gmail (e.g.) change all server address, is possible config
> mail account manually?
Yes you still can configure your emails manually.
Re ISP fetch "security review", I wrote in comment 279:
> the problem I have is that I am not seeing this "meeting" happening
> anytime soon, given all the "Unscheduled" on the page, and I don't
> want this to block indefinitely.
It is still Unscheduled
Ben, that page says: The "who" is responsible for scheduling the review, and email certain people about the date. That would be you...
duh. Didn't see that (probably because it's in bold ;-P ). Thanks, sent the mail to dveditz and co now.
I'm not sure if this is the right place for this question, but I couldn't find a better place. Is there any guidline how I will get new ISPs in the Autoconfig list: ??
A few month ago I added lycos.de, but now I don't find it anymore (don't know why). I know a few persons with a lycos address. I also miss alice-dsl.de, firemail.de, freenet.de and versatel.de at the moment.
I read somewhere you now must open a bug if you want a new ISP in the list. Is this right?
I already input all data about a brazilian e-mail service and send a XML file to Ben Bucksch, but autoconfig don't work yet to it.
Maybe it work only with Google.
(In reply to comment #301)
> I read somewhere you now must open a bug if you want a new ISP in the list. Is
> this right?
We changed this and are working on making an web-application available to the public - we gave it the name ispdb - it's being tested at the moment (as can be read on the weekly status meetings of Thunderbird). This will be announced on the status meeting notes, mozilla newgroups and a few weblogs when we are ready to accept user input. For now you can ask david access to have a look at the website and provide feedback.
*** Bug 510264 has been marked as a duplicate of this bug. ***
*** Bug 514864 has been marked as a duplicate of this bug. ***
*** Bug 523248 has been marked as a duplicate of this bug. ***
Does the local xml file still work as advertised ?
From what I have read the autoconfig process is supposed to start with
1. Config files on hard disk, in <installdir>/isp/*.xml
I have been testing with current release:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0
And have found that steps 3 and 4 work, but have not been able to get the local xml file step to work.
I thought I must be doing something wrong in the xml, so I downloaded this file (have also tested with many others):
and added a domain to the relevant section, eg;
<domain>mydomain.com</domain>
The wizard goes almost immediately into stage 4 heuristic testing.
I haven't seen many comments on this stage of process, so if anyone has got local isp/whatever.xml file working, please post a link to correct syntax.
> 1. Config files on hard disk, in <installdir>/isp/*.xml
Yes, that's implemented.
Simply adding <domain>foo.com</domain> is not enough, the file needs to have the domain name as filename, i.e. .../isp/foo.com.xml .
---
ATTENTION for all further comments:
Please post all further "This doesn't work for me" or "How do I set up my mail server to support this?" on the newsgroup (e.g. mozilla.dev.apps.thunderbird), not here. This bug is already way too long.
Specs:
(see also subpages at top, and Related Information at bottom)
(In reply to comment #308)
> ATTENTION for all further comments:
> Please post all further "This doesn't work for me" or "How do I set up my mail
> server to support this?" on the newsgroup (e.g. mozilla.dev.apps.thunderbird),
> not here. This bug is already way too long.
Actually the discussion happens on the ispdb google group.
*** Bug 3744 has been marked as a duplicate of this bug. ***
*** Bug 422950 has been marked as a duplicate of this bug. *** | https://bugzilla.mozilla.org/show_bug.cgi?id=422814 | CC-MAIN-2016-30 | refinedweb | 21,448 | 61.16 |
Computer users often have a problem with file search as they tend to forget the location or path of a file even though Windows provides a file search utility. Sometimes we copy the files from a pen drive or save the file from the Internet after saving the files we forget the location even we don’t remember the name of the file. It can be very difficult to find out the file which has been saved 2 days ago without knowing the name. In this article, I am going to discuss the program which will help you to find the file.
Let us first understand the program’s logic. Figure 1 explains this. Let us first do indexing or, in Python language terms, let’s construct a dictionary in which the file with the path will be the key of the dictionary and the value will be the tuple which contains creation date and modification and methods. Let’s see what each function and method do. The program name is fdate.py
The block of code below imports the essential modules:
import os
from threading import Thread
import cPickle
import argparse
from collections import OrderedDict
from datetime import datetime, timedelta
import time
import shutil
from colorama import init,Fore, Back, Style
import urllib
import re
import subprocess
import webbrowser
init(autoreset=True)
- Create a class file_backup which hold the all the methods.
class file_backup(): dict1 = {} def __init__(self): pass
- The below method is responsible for version update. It will check the current version of the program on my website. If your version is old then it would give you the message.
def version_get(self,version1): url2 = '' try: http_r = urllib.urlopen(url2) for each in http_r: if 'Current Version' in each: cur_version = float(each.split('=')[1].strip("\n")) if cur_version>version1: print( Back.RED +'Please download latest code') except : pass
- The below method would return the list of drives in your Windows.
def get_drives(self): response = os.popen("wmic logicaldisk get caption") list1 = [] for line in response.readlines(): line = line.strip("\n") line = line.strip("\r") line = line.strip(" ") if (line == "Caption" or line == ""): continue list1.append(line) return list1
- The below method opens the index database file and load the dictionary into memory.
def file_open(self): pickle_file = open("fdate.raj", "r") file_dict = cPickle.load(pickle_file) pickle_file.close() return file_dict
- The below method stores the created dictionary into disk.
def strore_files(self): pickle_file = open("fdate.raj", "w") cPickle.dump(file_backup.dict1, pickle_file) pickle_file.close()
- The below method is responsible to create the dictionary. The dictionary which contains key as a file name with its path and value as a tuple which contains creation and modification date of the file.
def search1(self, drive): file_t= open("Error_fdate.txt",'w') for root, dir, files in os.walk(drive, topdown=True): for file in files: file = file.lower() file_path = root+'\\'+file #print file_path try: creation_time = os.path.getctime(file_path) modification_time = os.path.getmtime(file_path) tuple1 = (creation_time,modification_time) file_backup.dict1[file_path] = tuple1 except Exception as e : str1 = str(e)+'\n' file_t.write(str1) file_t.close()
- The below method performs the copy or move operations per user’s need.
def copy_files(self, path_to_copy, files,m_or_c=0 ): try: for file in files: if m_or_c==0: shutil.copy(file,path_to_copy) print file," Copied" else : shutil.move(file, path_to_copy) print file, " Moved" except Exception as e : print e
- The below method filters the output according to matching string provided with -m option by the user.
@staticmethod def matching_string(match1, all_file): maching_files = {} for k,v in all_file.iteritems(): if re.search(match1,k): maching_files[k]=v return maching_files
- The below method removes the entries from the output according to matching string provided with -e option by the user.
@staticmethod def filter_list(e_list,all_files): for each in all_files.keys(): each1= each.lower() for e in e_list: e = e.lower() if each1.startswith(e): del all_files[each] return all_files
- The below method runs the selected file given by user.
@staticmethod def file_run(path1): path = path1[2:] file_list = path.split("\\") os.chdir(path1[0:2] + '//') file_to_open = file_list[-1] file_list= file_list[:-1] if file_list[0]: for each in file_list: os.chdir(each) file_name = '"' + file_to_open + '"' os.startfile(file_name)
- The below method opens the folder of the selected file.
@staticmethod def folder_open(path): print "path*****", path path = path.rsplit("\\", 1)[0] path_list = path.split("\\") # print path_list os.chdir(path_list[0][0:2]) if path_list[0][2:]: os.chdir(path_list[0][2:]) if len(path_list) > 1: for i in xrange(1, len(path_list) - 1): os.chdir(path_list[i]) os.chdir(path_list[-1].split(":")[0]) subprocess.Popen(r'explorer /select,"." ')
- The below method is responsible to display the files according to the creation or modification date provided by the user.
def file_get(self,time_stamp,latest=None,m=0, order= False, number_of_files=0,e_list=None,match=None): a = (Fore.RED + '------------------------------------------------------') b = (Fore.BLUE + '|') t1 = datetime.now() i = 0 d1 = {} all_file = self.file_open() if not latest: latest = time.time() if e_list: #Exception list all_file=self.filter_list(e_list,all_file) if match: all_file= self.matching_string(match,all_file) for key,values in all_file.iteritems(): c_date = values[m] if c_date>= time_stamp and c_date<= latest: d1[key]= c_date d2 = OrderedDict(sorted(d1.items(), key=lambda (k, v): v, reverse=order)) for k,v in d2.iteritems(): i = i + 1 print i, ": ", k, b ,time.strftime("%a, %d %b %Y %H:%M:%S ", time.localtime(v)) print a if i== number_of_files: break print "Total files are ", i t2 = datetime.now() total_time = t2 - t1 print "Time taken ", total_time try: if i:
- The following code asks the options whether to open, move or copy the files.
ch = raw_input("Press D to open folder or F to open file or M to move files or C to copy files\t") ch = ch.lower() if ch == 'c' or ch=='m': n = raw_input('Enter the number of the files for multiple files give number with space or type "ALL" for all files \t') d = raw_input('Enter the path \t ') if n =='ALL': files = d2.keys() else : numbers = n.split() print numbers files = [d2.keys()[int(num)-1] for num in numbers] if ch == 'c': self.copy_files(d,files) elif ch== 'm': self.copy_files(d,files,m_or_c=1) elif ch=='d' or ch=='f': num = int(raw_input("Enter the number \t")) path=d2.keys()[num-1] if ch=='d': self.folder_open(path) elif ch=='f': self.file_run(path) except Exception as e : print e
- The following function creates the index databases (dictionary) by using threads.
def create(): t1 = datetime.now() list2 = [] # empty list is created obj1 = file_backup() list1 = obj1.get_drives() print "Creating Index..." for each in list1: process1 = Thread(target=obj1.search1, args=(each,)) process1.start() list2.append(process1) for t in list2: t.join() # Terminate the threads obj1.strore_files() t2 = datetime.now() Total_time = t2-t1 print "Time taken ", Total_time print "Open Error_fdate.txt to check the exceptions "
- The following function converts the hours, minutes and second into epoch time stamp.
def time1(t,num): num = eval(num) if t=='s': delta = timedelta(seconds=num) elif t=='m': delta = timedelta(minutes=num) elif t=='h': delta = timedelta(hours=num) elif t=='d': delta = timedelta(days=num) times= datetime.now() - delta t1 = times.strftime('%Y-%m-%d %H:%M:%S') time_stamp = int(time.mktime(time.strptime(t1, '%Y-%m-%d %H:%M:%S'))) return time_stamp
- The time2 function will be used by the lower limit of exact date.
def time2(t): date1 = dateutil.parser.parse(t) t1 = date1.strftime('%Y-%m-%d %H:%M:%S') time_stamp = int(time.mktime(time.strptime(t1, '%Y-%m-%d %H:%M:%S'))) return time_stamp
- The following function returns the flag values, whether the flags are True or false
def all_flags(R,n,e,m,M): reverse_flag = False files = 0 list1 = [] mod_flag = 0 str_match = None if R: reverse_flag = True if n: files = n if e: list1 = e if m: str_match = m if M: mod_flag = 1 return (reverse_flag,files,list1,str_match,mod_flag)
- The following function is the main function which handles all the operations given by users.
def main(): version1=2.1 parser = argparse.ArgumentParser(version=str(version1)) parser.add_argument('-a', action='store_true', help='Know more about Author Mohit') parser.add_argument('-cs', nargs='?', help='for seconds according to creation date, Main option ') parser.add_argument('-cm', nargs='?', help='for minute according to creation date, Main option ' ) parser.add_argument('-ch', nargs='?', help='for hours according to creation date, Main option' ) parser.add_argument('-cd', nargs='?', help='for days according to creation date, Main option', ) parser.add_argument('-et', nargs='?', help='Exact date like 2015-10-28 16:09:59 , Main option', ) parser.add_argument('-M', action='store_true', help='Search according to modification date, use with main option') parser.add_argument('-R', action='store_true',help='To display the file in reverse oorder, use this option with Main options') parser.add_argument('-l', nargs='?',help='To set the range, use this option with Main options to provide lower timestamp ' ) parser.add_argument('-n', nargs='?',help='To display limited files, use this option with Main options',type=int,default=0) parser.add_argument('-e', nargs='+', help='To display the files except for mentioned files with the option, use this option with Main options',default=None) parser.add_argument('-m', nargs='?', help='Get the files with matching string, use this option with Main options') args = parser.parse_args() obj2 = file_backup() try: time_stamp = False time_2 = False if args.cs: time_stamp = time1('s', args.cs) if args.l: if eval(args.l) < eval(args.cs): time_2 = time1('s', args.l) else: print "Second range must be small" reverse_flag, files, list1, str_match, mod_flag = all_flags(args.R,args.n,args.e,args.m,args.M) elif args.cm: time_stamp = time1('m', args.cm) if args.l: if eval(args.l) < eval(args.cm): time_2 = time1('m', args.l) else: print "Second range must be small" reverse_flag, files, list1, str_match, mod_flag = all_flags(args.R, args.n, args.e, args.m, args.M) elif args.ch: time_stamp = time1('h', args.ch) if args.l: if eval(args.l) < eval(args.ch): time_2 = time1('h', args.l) else: print "Second range must be small" reverse_flag, files, list1, str_match, mod_flag = all_flags(args.R, args.n, args.e, args.m, args.M) elif args.cd: time_stamp = time1('d', args.cd) if args.l: if eval(args.l) < eval(args.cd): time_2 = time1('d', args.l) else: print "Second range must be small" reverse_flag, files, list1, str_match, mod_flag = all_flags(args.R, args.n, args.e, args.m, args.M) elif args.et: time_stamp = time2( args.et) time_2 = time2(args.l) reverse_flag, files, list1, str_match, mod_flag = all_flags(args.R, args.n, args.e, args.m, args.M) elif args.a: url = '' webbrowser.open(url) if time_stamp: obj2.file_get(time_stamp, latest=time_2, m=mod_flag, order=reverse_flag, number_of_files=files, e_list=list1,match=str_match) elif args.a: pass else : create() obj2.version_get(version1) str1 = (Back.MAGENTA + 'L4wisdom.com') print "\nThanks for using "+str1 print(Back.CYAN + 'Email id mohitraj.cs@gmail.com') print "For updated version or help, browse our page" except Exception as e: print e print "Please use proper format to search a file use following instructions" print "see file-name" print "Use <see -h > For help" if __name__== '__main__': main()
Let us save the complete code as fdate.py and make it a Windows executable (exe) file using the Pyinstaller module. You can also download a readymade exe file from. Run the command as shown below.
Python pyinstaller.py –onefile fdate.py
After running it successfully, you can find the fdate.exe in folder C:\PyInstaller-2.1\fdate\dist, You can put the fdate.exe file in the Windows folder, but if you place this in a different folder, you will have to set the path to that folder. Let us run the program with the following command:
fdate -h
This helps to show all options , as seen in Figure 2.
Fdate -v
This helps to show current version.
Fdate -a
This helps to show about author.
Fdate
Fdate without option creates a new index file. As shown in figure 3.
Fdate -ch 1
The above command displays the files which were created 1 hour ago. In figure 4 you can see the output. There are lots of files have been created by a user or system. But I want to get rid of system created files. I can use option -e show in figure 5.
By using -e option you supply a list of exception path which you don’t want to display.
Example
Fdate -ch 1 -e c:app c:pycham
It means we don’t to see the files whose path start from c:app or c:pycham.
Fdate -ch 1 -R
With the -R command you can display the file in reverse order. As shown in figure 6.
Fdate -ch 1 -M
With the help of -M option, you can display the file according to modification date as shown in figure 7.
Consider you want to search a pdf file which you have downloaded 70 days ago. But you don’t remember the name. if you search files which were created 70*24 ago, it will be the huge number.
So, in order to tackle this problem, you can provide a lower limit of time means you can provide a time range with help of -l option.
I am going to display the file which were created 70 to 65 days ago. See the figure 8.
Still, there are lot of files, if you know the file is pdf then with the -m option you can provide the match. As shown in figure 9.
With help of -n you can display a limited number of files.
After displaying file, you can open the folder, open the file, move files or copy the files. As shown in figure 10. I selected 1,2,3 then I provided the e: drive which is my pen drive.
Consider You want to provide the exact date then you can use standard date format. With the help of -et option, you can provide the exact date as shown in the figure in 11. You can check the date format by using fdate -h
You can see within a fraction of second I searched the files and copied the files.
I hope you like the program, regarding more help you can email me or post a comment.
Get the lastest code from | https://opensourceforu.com/2018/07/search-file-and-create-backup-according-to-creation-or-modification-date/ | CC-MAIN-2019-04 | refinedweb | 2,377 | 69.89 |
I Wanted to be a Lumberjack (logging)
October 22, 2012 8 Comments
I Wanted to be a Lumberjack (logging)
Barber: All right … I confess I haven’t cut your hair … I didn’t want to be a barber anyway. I wanted to be a lumberjack. Leaping from tree to tree as they float down the mighty rivers of British Columbia . . . (he is gradually straightening up with a visionary gleam in his eyes). The giant redwood, the larch, the fir, the mighty Scots pine. (he tears off his barber’s jacket, to reveal tartan shirt and lumberjack trousers underneath; as he speaks the lights dim behind him and a choir of Mounties is heard, faintly in the distance)
When something goes wrong with a program, it is natural to try to diagnose the problem by using the print statement to check the value of variables. As your program grows in size however, this begins to get unwieldy, if only because the output of print ends up in the console and you lose it to the autoscrolling. Python offers another way to record these messages – the logging module. In its most most basic form:
import logging fn ="test.log" # Warning! Will delete any file called test.log! logging.basicConfig(filename= fn, filemode='w', level = logging.DEBUG) if __name__=="__main__": logging.debug("This is a test entry")
If you save this to a file (p4kLogging.py) and run it, it should:
- create a file called “test.log” (we could have called it something else if we wished (this is filename =fn)
- if such a file already exists, that file is deleted and a new, empty one created on top of it (this is the filemode = “w” part)
Let’s read the file now from the Python console:
>>>>> f = open(fn,'r') >>> print f.read() DEBUG:root:This is a test entry >>> f.close()
This gives us the message (“This is a test entry”), as well as what logging status it has been given (DEBUG) and what function made the log (root – or the main part of the program)
Let’s try the same program again, but this time we’ll set the logging level to WARNING:
import logging fn ="test.log" # Warning! Will delete any file called test.log! logging.basicConfig(filename= fn, filemode='w', level = logging.WARNING) if __name__=="__main__": logging.debug("This is a test entry")
This time, when we print the contents of the file:
>>> f = open(fn,'r') >>> print f.read() >>> f.close()
It’s empty! This is because we configured the logging to only show messages which were of WARNING or higher priority. Since DEBUG is of lower priority it was filtered out. Most excellent! Imagine if these were print statements instead. Once the program was finished/or the problem debugged, you need to go back and either remove or comment out all of the print statements (leaving important ones alone – so you can’t necessarily just use search and replace). Now, instead, we simply turn all of them off by a simple change of the logger configuration. However, it gets better.
The output we initially saw was a little pedestrian. We can configure the logger to provide heaps more information. Here’s a slightly longer program with a more involved logging parameter:
import logging fn ="test.log" # Warning! Will delete any file called test.log! logging.basicConfig(filename= fn, filemode='w', level = logging.DEBUG, format= "%(levelname)s %(asctime)s %(funcName)s @%(lineno)d %(message)s") def functionA(): logging.debug("We're in function A") def functionB(): logging.debug("We're in function B") if __name__=="__main__": logging.debug("This is a test entry") functionA() functionB()
Look at what we get now when we run the program:
>>> f = open(fn,'r') >>> print f.read() DEBUG 2012-10-22 16:26:15,789 <module> @13 This is a test entry DEBUG 2012-10-22 16:26:15,789 functionA @7 We're in function A DEBUG 2012-10-22 16:26:15,789 functionB @10 We're in function B >>> f.close()
Now, we get a bunch more info, including the time and date of the logging message (down to milliseconds). Not only that, we get the name of the function from which the function call was made and the line number in the program where the function call was made.
Advanced stuff
Knowing the line number in particular is pretty useful. For example, you can filter the log file for references to that specific line number eg (this only works on systems with grep installed of course):
>grep \@7 test.log DEBUG 2012-10-22 16:26:15,789 functionA @7 We're in function A
You can even use it to open up your file at the exact line number:
>vi p4kLogging121022C.py +7
This, of course, is only if you’re using the vi editor, but other editors should have “go to line” functions which can also be used. This is much easier than hunting through your text file trying to find where the logging call was made.
Final comments
Different levels you will typically use are logging.debug, logging.warning and logging.error. The logging function you use will log whatever string is passed as an argument:
logging.debug("It's this bit which will print")
You can use string formatting here as well to log variable values:
logging.warning("The value of x is %s"%(x))
It is good practice to use a logger for your debugging messages. If you have a short program it may be easier to just use print statements. However, as your programs grow, you will definitely need to do logging instead.
More info: Logging how to, logging docs
Pingback: I Wanted to be a Lumberjack (logging) | Python-es | Scoop.it
Why does the line number seem to be off by one in the log?
@bgirardot –
short answer: WordPress’s line numbers are wrong.
My original has an extra line of white space which WordPress’s tag has automatically collapsed.
I have changed them manually to reflect the code as displayed by WordPress.
+1 for being attentive
Cheers
Brendan
Perfect, it makes a lot more sense now. Thank you very much.
Pingback: Links 24/10/2012: First GNOME 3.6 Update | Techrights
Pingback: Python4Kids New Tutorial: I Wanted to be a Lumberjack (logging) | Tutorial WPAP
Hello, I frequently read this blog and really enjoy it. I do have a question about this post. When I try and print line numbers, as in your second example, it is reporting the line number from the logging module, not my code. So, they aren’t very useful to me. Is there some way to stop that? My code is exactly the same as yours and I’m using python 2.7.3.
Thanks,
Jay
My mistake on this one. I was using Python 2.6, not 2.7. When I switched to 2.7, it worked great. Thanks! | https://python4kids.wordpress.com/2012/10/22/i-wanted-to-be-a-lumberjack-logging/?like=1&source=post_flair&_wpnonce=318d04e5da | CC-MAIN-2015-18 | refinedweb | 1,155 | 73.47 |
From: Beman Dawes (beman_at_[hidden])
Date: 2000-02-03 16:32:45
At 08:00 PM 1/27/00 +0000, jorg.schaible_at_[hidden] wrote:
>Hi there,
>
>attached to this mail there is a ported version (from Java to C++)
of the core
>system of the JUnit 3.1 test suite of Kent Beck and Erich Gamma. The
classes
>allow you to setup easy module tests for your classes and integrate
this test
>applciations in an automated test procedure. The JUnit suite
normally has also a
>GUI version, but since C++ has no standard it is not part of the
port. To
>integrate future versions of JUnit I try to stay very close the the
original
>Java source although I changed the concept of the TestRunner
slightly to
>seperate data and test output and to gain make support from the exit
code of a
>test application. Also I dropped some Java only features.
>
>I am aware that from Michael Feathers exists another port of JUnit,
but
>- the version I previously had did not fulfill the Boost standards
(e.g. using
>namespace std in the headers)
>- I had to have a portable version
>- I wanted to have a JUnit port added to Boost to have some kind of
standard
>- wanted to build automated tests and was not interested in a GUI
>- I needed it now (most common reason <g>)
>
>Additionally I know also DejaGNU, but I found it very nasty to
provide Windows
>development seats with the necessary environment and train the
people with that
>complete package.
>
>Concerning the proposal to Boost I am interested in following
answers:
>- The original source seperates the classes into different files.
Currently most
>boost libraries use just one single header in the boost directory.
Shoud I keep
>this single header (yes, the inlines are too big) or separate this
classes also?
>- Should I move the classes in an additional namespace boost::test?
>
>Awaiting your comments ....
Jörg,
In addition to the files you included I also skim read portions of to get an idea of what
JUnit is all about. Here are some comments:
The idea is interesting, but...
Because the code is based on someone else's Java code, you should
probably get their permission (even though there are no copyright
messages in their code.) My understanding is that a program
rewritten from one programming language to another is still
considered a derived work, at least in the US legal system..
Although it may be an issue of naming rather than functionality, it
seems to be a bit shortsighted to focus on solely on unit testing.
Where does that leave system level and other forms of testing?
Documentation, including samples and tutorial material would seem to
be as important as the actual testing code. Many programmers have no
experience with testing packages, so there is much more of an
education component than with most of the boost libraries.
There really is a need for some kind of small, easy-to-use testing
framework, so the idea is worth discussion.
What do others think?
--Beman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk | https://lists.boost.org/Archives/boost/2000/02/2052.php | CC-MAIN-2019-35 | refinedweb | 530 | 61.56 |
Ruby Array Exercises: Create a new array with the first element of two arrays
Ruby Array: Exercise-28 with Solution
Write a Ruby program to create a new array with the first element of two arrays. If lenght of any array is 0, ignore that array.
Ruby Code:
def check_array(a, b) front = [] if(a.length > 0 && b.length > 0) front[0] = a[0] front[1] = b[0] elsif (a.length > 0) front[0] = a[0] elsif (b.length > 0) front[0] = b[0] end return front end print check_array([3, 4, 5, 6], [7, 3, 4]),"\n" print check_array([3, 4, 5], [6, 7, 3, 4, 7]),"\n" print check_array([3, 4], [])
Output:
[3, 7] [3, 6] [3]
Flowchart:
Ruby Code Editor:
Contribute your code and comments through Disqus.
Previous: Write a Ruby program to create a new array using first three elements of an given array of integers. If the length of the given array is less than three return the original array.
Next: Write a Ruby program to get the number of even integers | https://www.w3resource.com/ruby-exercises/array/ruby-array-exercise-28.php | CC-MAIN-2021-21 | refinedweb | 177 | 64 |
Not too long ago, I did a blog post on using the ArcGIS JavaScript API with ReactJS for widgets. I've been talking to a few people about React lately, so I thought I might revisit the subject here. The biggest question you might ask, is why use React? Personally, I think React has a really elegant API. When you start using it and begin to find how easy it is to compose your components that make up the user interface, I think that's when React really shines. A neat feature of React is the use of a virtual DOM. Basically, if you update the state of your application at the root, it will rerender the entire applications DOM. It sounds like it would be slow, but it's really not. It can be, if you do something silly like try to create a very large JSON editor **ahem**. You can read more about how the updates occur here.
It's all just DOM
If you are familiar with working with Dijits and the Dijit lifecycle, React components have a similar lifecycle. In both cases it's beneficial to get to know them. React uses an optional syntax called JSX. It's important to remember that JSX is totally optional. Some folks get all up in arms about mixing DOM with JavaScript, but that's not the case. JSX is simply used to help you define your DOM structure. It still has to be compiled to pure JavaScript in order to in the browser and there are tools for that.
Widgets for the masses
The source code for the sample application is available here. I won't go over the entire application in detail, but I do want to highlight the widgets.
First off there is a widget called Locator that simply displays the map coordinates of the cursor.
/** @jsx React.DOM */ define([ 'react', 'dojo/topic', 'helpers/NumFormatter' ], function( React, topic, format ) { var fixed = format(3); var LocatorWidget = React.createClass({ getInitialState: function() { return { x: 0, y: 0 }; }, componentDidMount: function() { this.handler = this.props.map.on('mouse-move', function(e) { this.update(e.mapPoint); }.bind(this)); }, componentWillUnMount: function() { this.handler.remove(); }, update: function(data) { this.setState(data); topic.publish('map-mouse-move', data); }, render: function() { return ( <div className='well'> <label>x: {fixed(this.state.x)}</label> <br/> <label>y: {fixed(this.state.y)}</label> </div> ); } }); return LocatorWidget; });
So this component is pretty simple. It will just display coordinates and uses dojo/topic to publish those coordinates to the application. I've talked about dojo/topic before. The next component is a little more interesting. It has a button that will activate a draw tool and a label that will display the distance being drawn.
/** @jsx React.DOM */ define([ 'react', 'esri/toolbars/draw', 'esri/geometry/geometryEngine', 'dojo/topic', 'dojo/on', 'helpers/NumFormatter' ], function( React, Draw, geomEngine, topic, on, format ) { var fixed = format(3); var DrawToolWidget = React.createClass({ getInitialState: function() { return { startPoint: null, btnText: 'Draw Line', distance: 0, x: 0, y: 0 }; }, componentDidMount: function() { this.draw = new Draw(this.props.map); this.handler = this.draw.on('draw-end', this.onDrawEnd); this.subscriber = topic.subscribe( 'map-mouse-move', this.mapCoordsUpdate ); }, componentWillUnMount: function() { this.handler.remove(); this.subscriber.remove(); }, onDrawEnd: function(e) { this.draw.deactivate(); this.setState({ startPoint: null, btnText: 'Draw Line' }); }, mapCoordsUpdate: function(data) { this.setState(data); // not sure I like this conditional check if (this.state.startPoint) { this.updateDistance(data); } }, updateDistance: function(endPoint) { var distance = geomEngine.distance(this.state.startPoint, endPoint); this.setState({ distance: distance }); }, drawLine: function() { this.setState({ btnText: 'Drawing...' }); this.draw.activate(Draw.POLYLINE); on.once(this.props.map, 'click', function(e) { this.setState({ startPoint: e.mapPoint }); // soo hacky, but Draw.LINE interaction is odd to use on.once(this.props.map, 'click', function() { this.onDrawEnd(); }.bind(this)); }.bind(this)) }, render: function() { return ( <div className='well'> <button className='btn btn-primary' onClick={this.drawLine}> {this.state.btnText} </button> <hr /> <p> <label>Distance: {fixed(this.state.distance)}</label> </p> </div> ); } }); return DrawToolWidget; });
This component is a little more involved, but it will use the geometryEngine to calculate the distance between the start point and the end point in a straight line. I do some ugly hacky-ness to stop the drawing interaction after a single line segment, because single drawing with the Draw tool is a little odd behavior (in my opinion). If you wanted to track the total distance of the polyline segments while being drawn, it's a little more involved and you would need to update the start point with the last end point and accumulate the distances as you go along. Sounds like a nice reduce function. I'll leave that exercise up to you. If I spent more time on this, I might separate some of the logic happening here into helper methods and maybe clean up some listeners, but as it stands, it works pretty well.
The last thing you need to do is actually render these components on the page.
/** @jsx React.DOM */ define([ 'react', 'dojo/query', 'dojo/dom', 'dojo/dom-construct', './components/Locator', './components/DrawTools' ], function( React, query, dom, domConstruct, Locator, DrawTools ) { var createContainer = function() { var c = query('.widget-container'); if (c.length) { return c.shift(); } var container = domConstruct.create('div', { className: 'widget-container' }, dom.byId('map_root'), 'first'); return container; }; var addContainer = function(map) { React.render( <div> <Locator map={map} /> <DrawTools map={map} /> </div>, createContainer()); }; return { addContainer: addContainer }; });
This is where React will render the components to the defined DOM element on the page and I can pass the map to my widgets as properties. I didn't really discuss props or propTypes, but you can read more how they work here. Also here is a nice write-up on Properties vs State.
Get hacking
You can see a demo of this application in action here. In case you missed it the source code is here.
As you can see, this is just another example of being able to integrate any library or framework of your choice in your ArcGIS API for JavaScript applications. There are certain parts of Dojo that you need to use (and some are very handy, such as dojo/topic), but beyond that it's not too hard to mix-n-match your JavaScript libraries. React is not a total framework, and the FB devs will be the first to tell you that, but it does do the V in MVC very well. So hack away folks and most of all enjoy it!
For more geodev tips and tricks, check out my blog. | https://community.esri.com/people/odoe/blog/2015/04/01/esrijs-with-reactjs-updated | CC-MAIN-2018-17 | refinedweb | 1,084 | 50.43 |
SAM zip-city
This library aims to do city lookups in a fast (client-side), generic way.
The script will dynamically load the appropriate file with zipcodes and city names for a given country.
This allows for smaller bundle size and means that the file(s) are only downloaded when needed.
But all the zipcode files are inside the repo?
Yes, but they are in .npmignore and are fetched with jsdelivr.com directly from Github.
How to install
npm install @omnicar/sam-zip-city or
yarn add @omnicar/sam-zip-city
How to use
import { getCityFromZip } from '@omnicar/sam-zip-city' const myFunc = async () => { const city = await getCityFromZip({ zipcode: 2300, country: 'DK' }) console.log(city) }
Or to initialise a country before requesting a city:
import { initZipCityCountry } from '@omnicar/sam-zip-city' const myOtherFunc = async () => { await initZipCityCountry({ country: 'DK' }) console.log('Danish zipcodes and cities should be ready!') } | https://www.npmtrends.com/@omnicar/sam-zip-city | CC-MAIN-2021-39 | refinedweb | 147 | 50.12 |
As you know till now in c# everything was static and known at design time. But with the C# 4.0 language Microsoft have enabled new dynamic data type which is belongs to Dynamic Language Runtime on top of CLR(Common language Runtime). As you know that dynamic object will know their behaviour at run time. Here Microsoft has given one new class called ExpandoObject class. ExpandoObject class is a member of System.Dynamic namespace and is defined in the System.Core assembly. This class object members can be dynamically added and removed at runtime. This is class is a sealed class and implements number of interfaces like below.
That’s it. You can add valid type of member to ExpandoOjbect class. Isn’t interesting.. Hope you liked it.. Stay tuned for more..
public sealed class ExpandoObject : IDynamicMetaObjectProvider, IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable, INotifyPropertyChanged;Now let’s take a simple example of console application. Where we will create a object of expandoobject class and manipulate that class at run time. Let’s create a simple code like below.
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ExpandoObject { class Program { static void Main(string[] args) { dynamic users = new System.Dynamic.ExpandoObject(); users.UserName = "Jalpesh"; users.Password = "Password"; Console.WriteLine(string.Format("{0}:{1}","UserName:",users.UserName)); Console.WriteLine(string.Format("{0}:{1}","Password:",users.Password)); Console.ReadKey(); } } }Here in the above code I have added a new memeber called UserName and Password for the new dynamic user type and then print their value. Now let’s run the application and see its output as below
That’s it. You can add valid type of member to ExpandoOjbect class. Isn’t interesting.. Hope you liked it.. Stay tuned for more..
Your feedback is very important to me. Please provide your feedback via putting comments. | https://www.dotnetjalps.com/2011/04/expandoobject-class-in-c-40.html | CC-MAIN-2019-18 | refinedweb | 314 | 53.17 |
Date of Submission:
28th October 2010
iii.
iv
University of Southern Queensland
Faculty of Engineering and Surveying
Limitations of Use
The council of the University of Southern Queensland, its Faculty of Engineering and
Surveying, and the staff of the University of Southern Queensland, do not accept any
Persons using all or any part of this material do so at their own risk, and not at the risk
Dean
v,
Saud Alenazi
0050077753
Signature:
vi
Acknowledgments
The author would like to acknowledge the efforts and assistance have been provided
by the supervisor, Dr Alexander Kist. Dr Kist deserves thanks for continuous help
and support throughout this project. Technical and Academic information have been
provided by him, have guided the author to the right and proper way during the
project.
The author would like to thank his wife as she deserves thanks for her patience and
support. His little son must be mentioned here, as the author has not spent an
adequate time caring after him during this academic year.
vii
Table of Contents
Abstract ......................................................................................................................... iv
Limitation of Use...........................................................................................................v
Certification..................................................................................................................vi
Acknowledgement.......................................................................................................vii
Table of Contents.......................................................................................................viii
Table of Figures.........................................................................................................xiii
Table of Codes...........................................................................................................xvi
List of Tables............................................................................................................xvii
Chapter 1 : Introduction.............................................................................................. 1
viii
2.1.1 Traffic Classes ......................................................................................... 6
3.1 Introduction.................................................................................................. 23
3.2 Network Simulator 2 (NS2) and LTE/SAE virtual network model ............ 23
ix
3.6 Project Timelines ......................................................................................... 41
4.1 Introduction.................................................................................................. 42
x
4.3.8 q1, Scenario 4 Results............................................................................ 59
4.5 Background (Best Effort) Traffic Test Scenarios and Results .................... 68
xi
5.1 Introduction.................................................................................................. 79
References .................................................................................................................... 85
Appendixes .................................................................................................................. 90
xii
Table of Figures
Figure 1: Digital Communication Standards System (this figure made using MS office
power point) ................................................................................................................... 2
Figure 2: Simplified LTE/SAE Network (this figure made using DIA software office
power point) ................................................................................................................... 3
Figure 5 : Typical packet protocols for real and non-real time services...................... 12
Figure 11 : the structure of RT and NRT Traffic packet scheduler in eNB (Jungsup
Song et all, 2010) ......................................................................................................... 19
xiii
Figure 17 : LTE/SAE Network Model (this figure made using DIA software office
power point) ................................................................................................................. 25
Figure 21: Queue classes (this figure made using MS office word and MS painter) .. 29
Figure 27 : Project Tasks Timelines (this figure made using MS office Excel).......... 41
xiv
Figure 41 : q1 Delay While q2 UEs Increasing ........................................................... 58
Figure 58: Task Progress and Deviation Identification Chart (this figure made using
DIA software and MS office painter) .......................................................................... 80
xv
Table of Codes
Code 4 : Real-time Traffic Simulation with aid of rtp protocol in tcl Code ................ 30
Code 12 : Delay Calculation Statements in AWK file for Classes 0, 1 and 3 Traffic . 38
xvi
List of Tables
Table 5: QoS Classes (Traffic Classes) and Simulation Protocol Used ...................... 30
xvii
Chapter 1 : Introduction
In this project, a simple Long Term Evolution/System Architecture Evolution
(LTE/SAE) model will be implemented and simulated in accordance with practical
Quality of Service (QoS) parameters set by the operator and simplified for this
project. Specifically, the total throughput, packet delay of this system will be tested
when QoS parameters are enabled as well as when they are disabled. Long Term
Evolution (LTE) is introduced to deal with the increase in the number of users and the
need for high speed communications. It represents the fourth generation and most
recent digital technology created since digital communication was invented. The
Quality of Service (QoS) mechanism is essential to provide reasonable identification
of the Long Term Evolution/System Architecture Evolution (LTE/SAE) System
performance. Network Simulator 2 (NS2) tool is the nominated tool for building and
testing the system. The expected results should show an improvement in the three
tested criteria.
1.1 Background
In the early of 1980s, mobile communication has been first introduced. Figure 1
below shows the major communication standards evolution. The first standard was an
analogue system and so-called the Advanced Mobile Phone System (AMPS). In the
early 1990s Global System for Mobile Communication (GSM) has been released as
the first standard system for the digital mobile communication network and it
represents the 2nd Generation of communication standards. General Packet Radio
Service (GPRS) has been released in the mid 1990s, representing the 2.5 Generation.
GPRS has enhanced the data bit rate to reach up to 114 Kbps. Enhanced Data rate
for GSM evolution (EDGE) was the key for starting the 3rd Generation towards the
end of the 1990s. The Enhanced 3rd Generation has been presented in 2002 and was
represented by the Universal Mobile Telecommunication System (UMTS) standard.
The first step to transfer the technology towards the 4th generation has been achieved
once High Speed Packet Access (HSPA) was identified in the middle period of the
1
first decade of the 21st century. HSPA has improved the data bit rate to reach up to
14Mbps and it is known as 3.75 Generation. However, Long Term Evolution (LTE)
is the major key that leads the communication technology to start the 4th Generation
level.
Figure 1: Digital Communication Standards System (this figure made using MS office power point)
Long Term Evolution (LTE) is the current technology that is standardized to transfer
the communication from the previous standard HSPA in the 3rd Generation to 4th
Generation. The reasons that motivate this transfer are the rapid increase in the
number of users of technology, the need of high speed data and uplink/downlink
speed. LTE philosophy is based on the 3rd Generation Partnership Project (3GPP)
specifications release 8. LTE decreases the latency with a factor of 1/6 than HSPA
does and it enhances the call setup delay to be 50-100ms. Therefore, LTE has an
ultra low latency.
2
1.1.3 Long Term Evolution/System Architecture Evolution (LTE/SAE)
When these two terminologies, (LTE/SAE), come together, this results in LTE
network architecture improvement. As a result, architecture complexity is eliminated
due to reducing the number of nodes in the core network. Furthermore, the network
becomes Flatter Network which means that the communication between stations in
the network is performed without mediators such as routers. Therefore, the time
taken for packets to travel is minimised which means latency is improved. Some of
the nodes are redistributed in the network and/or merged to some other nodes since
LTE/SAE elements have the ability to take place and substitute the user and/or control
nodes. An example of this is the Radio Network Controller (RNC) that is split
between the Access Gate Way (AGW) and Base Transceiver Station (BTS) or what is
called (eNodeB). Core Network elements such as SGSN (Serving GPRS Support
Node) and GGSN (Gateway GPRS Support Node) or PDSN (Packet Data Serving
Node) are combine with the AGW. Figure 2 below shows simplified LTE/SAE
network and it shows that the network includes two major parts, E-UTRAN (Evolved
Universal Terrestrial Radio Access Network ) and EPC (Evolved Packet Core). UE is
connected to the eNodeB via Air interface. The interface that connects the eNodeBs
or BTSs together is the Air interface or x2 interface. Network nodes are connected to
each other via S1 interface.
Figure 2: Simplified LTE/SAE Network (this figure made using DIA software office power point)
3
1.1.4 LTE Network QoS
When the service is shifted from single user to multi user service, the number of users
is increased and higher traffic communication is needed. Therefore, it is important to
define Quality of Service (QoS). QoS defines Policies rather than improving
service’s features. QoS standardizations are in 3GPP release 8. A general example of
QoS is when a supermarket has a policy which states that the customer should not
wait for more than 1 minute at the checkout. The QoS in the LTE/SAE network is for
both the access and service network.
The main aim of this project paper is to develop methods and techniques as well as
providing measurements and test results analysis of the Long Term Evolution/System
Architecture Evolution network environment in accordance to the Quality of Service
concept. One more aim of this project is to provide an analysis of the categorisation of
the available Quality of Service mechanism. In particular, the paper investigates the
concept of bearer, evaluates the performance of the network as well as a number of
applications and last but not least, aimed at being simulated in either real-time
applications or mathematical model.
Number of objectives has been set in order to achieve the main goals of the projects.
The following dot points summarize the objectives:
4
1.4 Dissertation Outline Overview
This dissertation includes six chapters. Chapters’ titles and brief description of them
are as following:
5
Chapter 2 : Literature Review
This project covers a number of topic areas. Description of relevant subjects is
introduced in this chapter. Literature includes Quality of Service and 3GPP traffic
classes, packet scheduling techniques and investigation of throughput and delay
calculation.
It is the QoS class level that is defined by the operator and they should be considered
as traffic limitations. In this model the most popular four QoS and traffic classes are
significant. The first class is the high sensitive delay class or so-called Conversational
Class. The second class is the Streaming Class, which is lower sensitive delay class
than the first one. Both of the first two classes are used for real-time traffic flow. The
third class is the Interactive Class, while the fourth one is the lowest sensitive delay
class the Background class. These traffic classes are specified in 3GPP TS 23.107
6
V8.0.0.Specifications. Table 1 below shows the four QoS classes and their popular
application.
( Traffic Classes)
Once the network is not loaded, the Quality of Service differentiation is not required.
But once the network gets loaded, the QoS differentiation is highly recommended.
The definition of QoS differentiation is depicted in Figure 3 below.
7
The real-time classes are the ones get benefits from the QoS differentiation, while the
best effort classes are not much affected by the technique as they are low-delay
service traffic. Ones the eNodeB node has the ability to identify different types of
traffics; it can prioritise the traffic in relation to time sensitivity (Holma & Toskala
2007).
8
Evolved Packet System (EPS) bearer is the stream of packets in between the user
equipment (UE) and Packet Data Network Gateway (PDN-GW). Between each
specific mobile equipment and service, there is a stream of data called Service Data
Flows (SDFs). Evolved Packet System bearer/E-UTRAN Radio Access Bearer
(EPS/E-RAB) is the indicator of bearer’s granularity in the radio access network.
This means that a specific QoS treatment will be applied to all packets in same EPS
bearer. An example of such treatment is a prioritisation scheduling. The Quality of
Service Class Identifier (QCI) is to give an identity value to a specific bearer to
identify the type of class included in this bearer. The QCI specifications are preset by
network’s operator. Once the bearer has been firstly created, the GBR value would
specify the type of resources that this bearer need. Services assigned to default
bearers will experience Non Guaranteed Bit Rate (Non-GBR). It is standardized that
the number of QCI values are unified due to roaming between networks. Table 2
below show this standardisation (Alcatel & Lucent 2009).
Packet Delay
Resource
QCI Priority Service Example
Type
(ms)
8 8
300 Background
9 9
Table 2: QCI Standardisation (Modified from LTE World Summit paper, Berlin, 2009)
9
Once the call is firstly admitted to the network, it uses a parameter called Allocation
and Retention Priority (ARP) to test if the nominated bearer is suitable to its type of
traffic. Therefore, the main advantage of ARP parameter is to avoid any prospected
risk results from the wrong assigned bearer. In layer two of the transport layers
shown in Figure 4, the radio bearer is the stream of data used to transfer data in
between the user equipment (UE) and eNodeB and it can be named as X1 bearer. S1
bearer is the stream of data in between eNodeB and Core Network (CN) which is used
to transfer data between the Access Network (E-UTRAN) and Core Network (CN).
In addition, S5 and S8 bearers are the bearers used in between Core Network elements
(Alcatel & Lucent 2009).
QoS Handling
QoS Transport Scheduling QoS Parameters in the Control
Unit Types
Plane
• QoS Transport Unit: the transport unit used in WiMax as specified in IEEE
802.16 is the Service flow which is the packets flow connecting the mobile
station to base station while LTE uses bearer between the mobile phone and
gateway.
• Scheduling Type: WiMax uses different type of schedulers, they are
Unsolicited grant service (UGS) for fixed size real-time traffic, Real-time
polling service (rtPS) for changeable real-time traffic, Non-real-time polling
10
service (nrtPS) for delay-tolerant traffic which need some rate to be reserved
and Best effort (BE) service for usual services where LTE uses Guaranteed Bit
Rate and non-Guaranteed Bit Rate bearers.
• Quality of Service parameters: WiMAx lets the operator to predefine traffic
prioritisation and Maximum Sustained Traffic Rate (MSTR) and Minimum
Reserved Traffic Rate with different values while LTE state that the operator
must set Guaranteed Bit Rate and Maximum Bit Rate at same values.
• Control Plane: in WiMax the network initiated control or the user initiated
control and network initiated control are both available while in LTE only
network initiated control is available.
This Section will discuss number of subsections. These subsections include packet
data protocols, transport channels, and packet scheduling techniques have been
investigated by number of researchers.
According to Holma & Toskala (2007), each transport protocol has different
characteristics. The traffic to be transported must be suite its transport protocol.
Therefore, real-time traffic such as conversational traffic uses Real-Time Protocol
(RTP) via User Datagram Protocol (UDP) transport protocol. In addition, Best effort
traffics are transported via Transmission Control Protocol (TCP). Figure 5 below
shows the real and non-real time protocol.
11
Figure 5 : Typical packet protocols for real and non-real time services.
The real-time traffics such that conversational and streaming traffic needs guaranteed
bit rates where the non-real time traffics doesn’t need guaranteed bit rate.
Conversational real-time traffic doesn’t need scheduling and it is transmitted over
Dedicated Channel (DCH). Figure 6 below shows the mapping of traffic classes to
scheduling and to transport channels.
Regarding to 3GPP TSG RAN, TS 36.413 V8.5.0, user plane is mainly provided by
eNodeB entity. The user plane includes protocols to execute number of functions.
This protocol stack is depicted in Figure 7 below.
12
Figure 7 : User Plane Protocol Stack
Packet Data Convergence Protocol (PDCP), Radio Link Control (RLC) and Medium
Access Control (MAC) layers are terminated in eNodeB. The main functions behind
the user plane are scheduling, ciphering, header compression, ARQ and HARQ.
The control plane that controls the user plane is as shown in Figure 8 below.
13
The new layers introduced in Figure 8 are the Radio Resources Control (RRC) that
terminated in eNodeB from the network side, and the Non-Access Stratum (NAS) that
terminates at the MME from the network side. RRC main functions are radio
resource management, scheduling, compression and decompression and many others.
The packet scheduler in LTE network is located in eNodeB. The air interface
measurements is measured by the eNodeB itself and they are forwarded to the packet
scheduler. In addition, the information of size of the upstream traffic is provided by
user equipment (UE). This section includes the user packet scheduler description
. There are number of transport channels used in LTE network in regards to packet
transfer. These transport channels and their relation to scheduling is discussed in the
following subsection.
Common Channels in LTE network are the Random Access Channel (RACH) as an
uplink channel, where the downlink common transport channel is Forward Access
Channel (FACH). These two channels are used as user data transport channels. The
common channels can cause more interference than other channel types due to that
they can use soft handover (Holma & Toskala 2009, pp. 271-2).
DCH channel is an efficient channel, and it has both directions uplink and downlink.
In comparison to the common channels, dedicated channels has feedback channel
which make it more powerful than common channels. DCH doesn’t cause any
significant interference in the presence of soft handover. The only disadvantage of
this channel is that the delay is more than it is in the common channel due to that the
accessing time of DCH is more than the common channels. According to 3GPP, the
bit rate of this channel reaches to 2Mbps (Holma & Toskala 2009, pp. 272-3).
14
2.2.2.1.3 Downlink Shared Channel (DSCH)
This type of channels used for bursty packets transport. It is used with DCH in
parallel, if DCH is a lower bit rate channel. It is not suitable in the case of soft
handover. It is suitable for the slow start TCP. This channel can be assigned to
another UE before the time located for DCH is up, due to this it is called shared
channel (Holma & Toskala 2009, pp. 274-5).
UL/DL Both DL DL UL
Suited for Medium and Medium and Small data Small data
large data size large data size
Table 4 : Transport Channels Overview (Modified from Holma & Toskala 2009, p. 274)
According to Holma & Toskala (2009), the capacity of the non-real time is equally
divided between the users in the cell. This is divided with the aid of packet scheduler.
A periodic division has been executed by the cell packet scheduler within a range
from 100ms to 1 second. Once it is overloaded, the packet scheduler helps user
equipments to not losing the service by decreasing the bearer’s bit rate. The idea
behind the scheduling is to use the available non-real time traffic to assist the user
equipments with service improvement.
15
The cell packet scheduler needs number of inputs to do scheduling efficiently, and
these inputs are as follow:
Figure 1 below shows the main principle of the input information and calculations
needed by the cell packet scheduler.
schedule
2.2.2.2.1 Priorities
The Quality of Service parameters are set by operator and it is provided to the
EUTRAN network from core network (CN). The quality of service parameters
includes number of important information such that allocation retention priority and
the network traffic
ic classes. This information is provided to let eNodeB distribute the
radio resources between users efficiently. From these parameters, the packet scheduler
16
gets clear picture of how the capacity to be distributed. The bearers that they are
specified for high priority traffic will use the available capacity while the bearers with
low priority will hold until the previous bearer is executed. Different allocation
priority number is assigned to different traffic types. In one of the relevant studies
(Falconio
io & Dini 2004)
2004 Examples of prioritisation algorithm are as follow:
In regards to the provided parameters, cell packet scheduler chooses the suitable
bearer to every single type of incoming traffic. As an example of this,
this Figure 10
below shows the DCH bit rate allocation.
17
The capacity of cell is assumed as 900 kbps. The first user capacity will be 348 kbps;
the second one will get the same value once we have only two UE. Once we have 3
users, it is not possible to have 348kbps, then the first one will maintain having
348kbps but the remaining two get 256kbps each and so forth. The downgrading
operation represents the bearer bandwidth downgrade. The upgrade operation is
permitted in the case that one of the bearers is free of use. This algorithm shows the
distribution of resources once there is only one type of traffic classes’ available
(Holma and Toskala 2009, p. 282).
The scheduler receives information about the bit rate offered in the cell. This
available bit rate will be distributed equally between the users. This algorithm can be
used for real-time traffic as it can offer a guaranteed bit rate to the users.
In this scheduling scheme, all user equipments are assigned at same power. The
throughput is distributed in regards to the channel condition. The user equipments
enabled to use higher throughput are the user equipments with high channel quality.
At full buffer state(holding the packets for later use between two different telecom
nodes with the maximum availability, which means the maximum availability of the
buffer is used), the edge UE will have very low throughput available.
18
Schedulers such as the latest three types, use Time Domain Packet Scheduler (TDPS)
followed by Frequency Domain Packet Scheduler (FDPS) phases.
Figure 11 : the structure of RT and NRT Traffic packet scheduler in eNB ( Song et al, 2010)
Once we have more than one traffic class in a system, the classifier is important for
the packet scheduling. Different queues with different priorities are set by the
classifier for different traffic types. It can be seen from Figure 11 above that the
classifier at layer 2 buffer assigning the each stream of one type of traffic with its
class (Song et al, 2010). There are different Quality of Service requirements for each
class.
19
By looking at Figure 12, it shows the cooperation between the Packet Scheduler (PS),
HARQ management and Link Adaptation (LA). These are existed in the eNodeB.
Packet Scheduler is the controlling item. Physical Resource Block (PRB) is showing
the resolution of the scheduling. In the frequency domain the bandwidth of PRB is
375 kHz minimum for one block and it is 24 PRBs in the 10MHz BW.
The Packet Scheduler will get a help from LA to know the data rate of different users
having different PRBs. The Link Adaptation is highly dependent on the Channel
Quality Indication (CQI). CQI helps LA as it obtain the users’ feedback. HARQ
manager has information about the buffer (Pokhariyal et al 2007).
Time Domain (TD) scheduler will identify the number of users N in the highest
priority to go to Frequency Domain (FD) Scheduler. TD considers the new data users
and keeps in touch with the users with retransmission requests which are not
prioritized by TD. FD scheduler’s function is to give M available number of the
PRBs to N users. Figure 13 shows the HARQ management steps (Pokhariyal et all,
2007).
Figure 13 : Mechanism used by the FD scheduler to allocate PRB resources to 1st transmission and retransmission
users(Pokhariyal et all, 2007)
20
2.3 Throughput and Delay Calculation
K: Number
mber of packets per window
The general equations to find the sent packets’ delay is shown in equation 1 below
∑ Equation 1
21
To find a specific link throughput is as follow:
( )
Equation 2
To sum up, this chapter has investigated number of relevant topics. The Quality of
Service of Long Term Evolution network has been discussed. The techniques and
algorithms of packet scheduling have been described. The chapter concluded with
basic methods of calculating network’s throughput and delay.
22
Chapter 3 : Project Methodology and
Simulation Model
3.1 Introduction
The major goal of this project is to evaluate QoS features of the LTE/SAE network,
and to build a model simulating this network. The network performance will be
evaluated by analysing the throughput and delay while QoS parameters are enabled as
well as when they are disabled. A comparison between the two situations triggered
and non-triggered QoS features will be investigated. One more criterion to be
examined is the packet flow of information being transmitted edge to edge from the
eNodeB to the GateWay.
An initial step to complete this project is to be familiarized with the tools required for
building a LTE/SAE virtual network. Background knowledge of the LTE/SAE
system itself is a supportive factor to build a model. Network Simulator 2 (NS2) is
the nominated software simulator to model the system and to obtain accurate results.
It is industry approved software that is widely used by communication engineers for
networking research. The LTE/SAE model will include the Network Model and
Traffic Model. The Network Model includes the following interfaces Air interface
and S1 interface. Separating these two models would increase the reusability and
flexibility of the LTE/SAE model.
23
Figure 15 : Basic Architecture of Network Simulator (Issariyakul & Hossain, 2009 )
As it is illustrated in the above figure, the NS2 mainly consists of two main
languages, C++ and Object-oriented Tool Command Language (OTcl). C++ in NS2 is
mainly existed for simulation objects’ mechanism definition. The OTcl is used for
simulation scheduling discrete events’ setting. The main simulation script as shown
in the above figure is the very far left item. It is used to set up network topology,
links, setting the type of traffic between nodes and much more input arguments. It is
run via an executable command ns followed by the name of the script. The name of
this project main simulation script is lte.tcl and it is provided in the appendixes. The
first right hand item is the output information file, which can be used to obtain and
graph the results.
This project simulates one cell of LTE/SAE network. Therefore the part of network
needed for simulation is as illustrated in between blue borders of LTE/SAE network
in Figure 16 below.
24
Figure 16 : The parts of LTE/SAE network to be simulated
Figure 17 : LTE/SAE Network Model (this figure made using DIA software office power point)
The model has five elements. They are: number (quantity) of User Equipment, at
least 1; eNodeB, or the base station of the model, which provides the network with the
needed flow control data; an Access Gateway to help the network with the flow
control and caching Hypertext Transfer Protocol (HTTP) and; one main server
providing signalling services, File Transfer Protocol (FTP) and HTTP.
25
The following figures of codes show how the network model’s elements built in tcl
file
set numberClass0 5
set numberClass1 2
set numberClass2 1
set numberClass3 1
set number [expr {$numberClass0 + $numberClass1 +
$numberClass2 + $numberClass3}]
Code 1 : Setting Different Classes' User Equipments Number
The first four lines of the Code 1 above are to set the number of user equipments for
each class, where the last line is the total number of user equipments in the network.
The steps of defining network’s elements in the script file are demonstrated in Code 2
below
Node 0 in the simulation stands for eNB, node1 refers to Access Gate Way, the Main
Server’s number is 2 and any number greater than 2 refers to user equipments.
To connect the nodes to each other, instproc unidirectional and bi-directional links are
used. These steps are illustrated in the Code 3 below.
26
for { set i 0} {$i<$number} {incr i} {
$ns simplex-link $UE($i) $eNB 10Mb 2ms
LTEQueue/ULAirQueue
$ns simplex-link $eNB $UE($i) 10Mb 2ms
LTEQueue/DLAirQueue
}
In Node Connection Script, Code 3 above, the upper part of the script is to set the
number of air interface with reference to the total number of active user equipments in
the network. The first instproc uni-directional link is to connect the user equipment to
eNodeB as an uplink link with bandwidth equal to 10 Mbps, and it is assigned to
ULAirQueue flow controller. The next line is for the downlink connection between
same nodes and the flow controller is DLAirQueue. Delay of all links is 2msec. The
middle part of the script is to set the connection between eNodeB and access Gate
Way which is the bottleneck link, and it is assigned to the flow controllers DL and UL
S1 queue. The bandwidth of this link will be downgraded from 100Mbps to 2Mbps
due to the limitation of computer’s memory used in this project. The general
behaviour is same with both values of the bottleneck bandwidth as it is tested
previously. The bottom part of the script is to create a connection between the main
server and the access gateway and it is assigned to the normal Drop tail.
27
3.3.1 Flow Control
To avoid any packet loss due to downlink limitation, Flow Control is required. The
flow control has been represented in the model with Air interface downlink Queue
and S1 interface downlink Queue Script files. Air interface downlink Queue Script
file provides the flow with the required information such as average data rate while S1
interface downlink Queue Script File decides whether or not to send the packet to the
Air Interface down link queue in accordance to available information. The scripts of
the flow control are written in C++ language and they are included in the appendixes.
S1 and Air interfaces are to be simulated by setting and implementing queue classes
in the network model. These Queue Classes are LTE main Queue, Air interface down
link queue, S1 interface Uplink Queue, and S1 interface downlink Queue. In the main
class, the condition of whether or not to use these optimization features are defined.
Other classes define the interface implementation.
The packets enter the main queue with identification of the class and sub queue where
they come from. When the Quality of Service features are triggered, the q0 packets
travel first to Drop Tail queue, then q1 and q2 respectively. The q3 packets will travel
to the Red queue. But when QoS features are disabled all the packets travel to Drop
Tail queue and the first packet in the first packet out. The order of packet
transmission when QoS features are enabled, is q0 then q1 then q2 and finally q3 as it
is the least priority packet, will remain in hold state until all the high priority packets
have been sent. This queuing technique is depicted in Figure 18 below
28
Figure 18: Queue classes (this figure made using MS office word and MS painter)
In this model the most popular four QoS and traffic classes are simulated. The first
class is the high sensitive delay class or so-called Conversational real time class, is
usually simulated with Real Time Protocols. The second class is the Streaming Class,
and it is usually simulated by using Constant Bit Rate protocol. The third class is the
Interactive Class and it is simulated by using Transport Control Protocol Agent, while
the fourth one which is the Background class and it is simulated by setting Forward
Transport Protocol over TCP agent. Table 1 below shows the four QoS classes and
the protocols and agents used to drive the traffic while the next subsections are to
describe the traffic simulation in more details.
29
QoS Classes Popular QoS Class Simulation Protocol
Application Used
( Traffic Classes)
-Session/RTPAgent
-Session/RTCPAgent
- HTTP/Client
- HTTP/Cache
- HTTP/Server
30
After simulating real-time traffic, unpredicted results for the throughput are
obtained where the sent traffic is much lower than the received packets without
any packet drop. After observing the traffic by running NAM network animator
in NS2, it shows that this traffic is a broadcasting traffic. The following figures
will show the traffic animation has been observed.
Figure 19 above shows the RTP traffic once it is initially travelling from UEs towards
the eNB. Nodes number 3,4 and 5 are the user equipments. Node0 is the eNB. Node
1 is the Access Gate way. And the node number 2 is the main server.
31
Figure 21 : All RTP Traffics enter the eNB
Figure 21 above shows the moment that all RTP traffic packets have entered the eNB
node.
Figure 22 above shows the problem clearly where packets are broadcasting traffic,
where they are broadcasted to all nodes at the same time, going to all user equipments
as well as access gateway. This is not suitable for telephony service.
To solve this problem, CBR traffic to be used in both directions sends and receives
direction with the aid of UDP agent.
32
Code 5 below shows the part of script codes to create conversational traffic
The conversational traffic codes in Code 5 above shows that the traffic are set in both
direction where the cbr over udp agent are set at the user equipment side which
terminated at the server side, and for the other direction the cbr over udp agent is set
at the side of server to simulate the conversational traffic travels from server and
terminated at the side of user equipments.
33
While the streaming traffic comes from the server to the user equipments, the traffic
agent and protocol to be set in the side of server and terminated at the side of user
equipments where the null agent to be set. To avoid any misdistributions of the traffic
over networks the number of user equipment must not set as numbers, but it must use
a range distribution to avoid distributing more than one traffic type to the same user
equipment. This is clearly shown in the first line of the Code 6 above where the first
user equipment using class1 is equal to the last one who is using the class0 traffic plus
1. The number assigned to last user equipment to use class1 traffic is equal to number
assigned to last user equipment using class0 plus the number of user equipment will
use the class1 traffic.
Over TCP Agent, class2 simulation is done by setting HTTP/Server at the side of
main server, HTTP/cache at the side of access gateway and HTTP/client at the side of
user equipment. The average page size each user can see is 10K. The script of
creating this traffic type is attached in the appendixes.
Over TCP agent, FTP protocol in the side of main server is set to simulate class3.
This traffic sink at the side of user equipment. Code 7 below shows the script codes
of creating class3 simulation.
{$i<($numberClass0+$numberClass1+$numberClass2+$numberCla
ss3)} {incr i} {
set sink($i) [new Agent/TCPSink]
$ns attach-agent $UE($i) $sink($i)
set tcp($i) [new Agent/TCP]
$ns attach-agent $server $tcp($i)
$ns connect $sink($i) $tcp($i)
$tcp($i) set class_ 3
set ftp($i) [new Application/FTP]
$ftp($i) attach-agent $tcp($i)
$ns at 0.4 "$ftp($i) start"
}
Code 7 : Class3 codes
34
3.4 Obtaining Results
This section discusses the script files used to calculate the required results. This
section includes number of subsections as follow, trace file, AWK script files, and
Random Number Generator Set.
In the tcl script file, predefining the trace file is important, due to that; all information
of NS2 based simulation is included in the trace file. This file’s information sample is
shown in the Figure 23 below which is a snapshot of one of trace files obtained in this
project tests. The format of the trace file lines is shown in Table 6 below.
The first symbols in the left hand side in each means as following:
(+): enqueue
()ــ: dequeue
35
Source Dest. Pkt Pkt Flow Src Dest Seq Pkt
event time Flags
Node Node Type Size ID Addr Addr Num ID
In the main tcl file, the trace file must be predefined and it is predefined in this project
main tcl file as it appears in Code 8 below.
From this trace file, the simulation results are obtained by reading the file. The way it
is followed in this project to obtain the results is by writing a script in an AWK file.
Two awk script files are used in this project’s simulation to extract the results out
from trace file and doing calculation on trace file’s information. The first awk script
is to calculate the throughput received, sent and dropped of the first mobile equipment
use specific class traffic. The second awk script is used to calculate the time delay of
this mobile phone’s traffic.
In the beginning of this script, number of initializations are to be set such that Code 9
BEGIN{
flag=0;
UEclass0=-1;
UEclass1=-1;
UEclass2=-1;
UEclass3=-1;
}
Code 9 : AWK file Initialization 1
36
In this part of initialization, BEGIN is the start of an awk file and the lines in between
curly brackets are for main initialization that if satisfied, actions will be executed or
more initialization to be set as shown in Code 10 below.
event = $1;
time = $2;
node_s = $3;
node_d = $4;
trace_type = $5;
pkt_size = $6;
classid = $8;
src_ = $9;
Code 10 : AWK Script File Initialization2
The flag=0 is satisfied in initialization 1, then in this code, Code 10, number of
actions to be executed which is here giving the columns in trace file realistic names.
The dollar sign with numbers refers to the number of column in the trace file’s lines’
format.
}
}
if(event == "d") {
#ue_d_byte[classid]=ue_d_byte[classid]+pkt_size;
Code 11 : Throughput Calculation in AWK file
Code 11 above shows that once the event is “-” which means dequeue, we can only
calculate the received throughput by user equipments.
37
In the following statement once the node destination is equal to 2 where the sender is
the user equipments is used to give a statement to calculate the sent throughput.
The last statement is to give a limit where the event is”d” which means the dropped
packets calculation.
The resultant throughput is in byte which means that it must be divided by million to
get the numbers in MByte.
In this script file, the initialization steps are exactly similar to the previous
initialization in the throughput awk file. The statements to limit the calculation are
the only difference than the throughput statements.
In this part of the delay script, the statement as it is illustrated in Code 12 above. This
statement is only applicable for the traffic travelling from the server which is node
number 2 to the user equipment. To find the round trip time of the class0 for
example, two statements to be set once the mobile phones is the sender and the node 2
is the receiver plus the time when the sender is the node 2 and the receiver in the
return trip is the same mobile phone. The last line is only a counter. The above
38
statements are only applicable for classes 0, 1 and 3 only where the delay of class 3
traffic is illustrated in Code 13 below.
packet[pkt_id]=time;
}
if (event == "r" && (node_d==1) )
{
if(packet[pkt_id]!=0){
delay2[2,0] = delay2[2,0] + time -
packet[pkt_id];
delay2[2,1] = delay2[2,1] + 1;
}
}
Code 13 : Delay Calculation Scripts for Class2 Traffic
In Code 13 above, the delay calculation is limited by a statement state that once only
the sender is the mobile equipment and the receiver is the node 1 which is the aGW
where HTTP/Cache is located and the class of traffic is 2. This is only applicable for
Class2 traffic which is the interactive traffic.
To run these AWK files in NS2 terminal, the two commands in Code 14 are to be
used directly in the terminal under the right directory where this project files located.
Where throughput.awk and delay1.awk are the awk files used to obtain throughput
and delay respectively, and out.tr is the trace file named out.
39
3.4.3 Random Number Generator
The Random Number Generator (RNG) is used to provide randomness in the software
simulation. These random numbers are generated by selectively choosing a stream of
numbers from pseudo random numbers. To provide kind of confidence to any
software simulation results, testing the results at different RNG number is required.
An example of this is that, a study is to be made on number of supermarket’s
customers on Thursday, the long shopping day. Instead of doing the study of one
Thursday of single week, the more the number of weeks the more accurate the results
will be. This means that the simulation is performed at different situations. RNG can
be changed from 1 until 7.6x1022. In this project’s simulation, the results will be
obtained at 10 different RNG number representing ten different situations. The
confidence interval taking into account is 95% of the mean percent of the results at
these ten RNGs.
The code in the main scripts used to set the RNG number is as demonstrated in Code
15 below.
global defaultRNG
$defaultRNG seed 10
Code 15 : Setting Random Number Generator Script
As the main aim of this project is to compare and analyse the system
performance, three main criteria are important and need to be analysed. First, the
throughput received and/or sent by the UE will be tested. Second, the average delay
or time consumed by the travelling bits from the terminal to the gateway in the
network will be evaluated. LTE/SAE model will be implemented with aid of NS2
simulator. This model will test the preceding three criteria with both QoS parameters
enabled and disabled. A comparison will be made of the results from both test
situations. These two criteria are expected to achieve better values when the QoS
features are triggered in comparison to the values when the QoS features are not
40
available. It is assumed that the best results will come from the high priority traffic
classes.
The major tasks and timelines for the project are shown in Figure 24 below
2011-01-07
2010-11-18
2010-09-29
2010-08-10
2010-06-21
2010-05-02
2010-03-13
2010-01-22
2009-12-03
Remaining
2009-10-14
Completed
Figure 24 : Project Tasks Timelines (this figure made using MS office Excel)
3.7 Conclusion
In summary, this project aims to investigate the effect of QoS parameters on the Total
Throughput and time Delay of the travelling data in the LTE/SAE system. The
required improvements in the system criteria are necessary to cope with the higher
communication speed, durability and efficiency of the LTE/SAE system. The
Network Simulator 2 (NS2) is used to model the system. All results to be analysed to
identify the advantages of the QoS features to the system’s services. As a result, LTE
philosophy is the key to the present and future of communication technology.
41
Chapter 4 : Test Scenarios and Simulation
Results
4.1 Introduction
The Quality of Service scheduling mechanism used in this project is similar to the
mechanism used in real Long Term Evolution Network. This mechanism has a
prioritisation method and gives the highest priority to real-time conversational traffic.
The main objective of this scheduling mechanism is to meet the quality of service
requirements in LTE network. Lower delay of real-time packets is one of these
objectives. The throughput is not ignored in the objectives and should be kept away
from losing packets as possible. This project objective is to verify how good is the
scheduling method in relation to the quality of service requirements has been
mentioned above.
Before starting the tests, examining the bottleneck link (between eNB and aGW) is
important. To find the maximum number of each class UEs to be served before any
packet loss happening and this is can be mathematically calculated depending on the
amount of traffic rate per UE and see how many UEs’ traffic can be served by the
link. An example of this is the amount of water can be delivered by main pipe once it
is fed by multiple sub pipes. By knowing these threshold values, it is easy to test how
much effect of other classes’ traffic on the main class traffic that it almost uses the
link capacity.
In this project’s scenarios it would be assumed that the threshold value of traffic can
be reached by using more than 5 user equipments for the class 0, class1 and class2
where it is more than 1 user equipments for the class3. Therefore, the default number
of the user equipments of the class to be tested is 5 user equipments for the first three
classes and one user equipment for the last one.
42
4.2 Conversational Class Test Scenarios and Results
This section includes scenarios and results of the conversational traffic test. The
conversational traffic is high sensitive to delay and it is given the conversational real-time traffic as well as to study the
effect of other traffic’s classes on class0 traffic.
43
vii. Graph the results in comparison with the state of QoS
parameters OFF(it is expected that no difference with the
previous Test)
It is expected that the results will be same in both cases as we only have one type of
traffic.
The full results’ tables are available in the Appendixes, and the graphed results only
are shown here.
0.500000
0.480000
0.460000
Throughput(MByte)
0.440000
0.420000
0.400000
0.380000
0.360000
0.340000
0.320000
0.300000
0 5 10 15 20
Number of q0 UEs
10.000000
1.000000
0 5 10 15 20
Delay (Sec)
0.100000
0.010000
0.001000
Number of q0 UEs
44
It can be seen from the throughput’s graph in Figure 25 that the results are reasonable.
The received throughput is approximately constant. This means that the entire sent
throughput is received with no drop or with low drop value. Once the link is
overloaded, the dropped packets have increased gradually, which means that the
received throughput has decreased once the User Equipments number has exceed
certain value. The highest number of user equipments that the test shows without
significant dropped packets value is 15 user equipments which is the maximum
number of user equipments the link can tolerate. Once the number of user equipments
exceeds the maximum number 15, the test shows decreasing in throughput of the first
mobile that has used the real time traffic service. On the other hand, the delay is more
important than the throughput value for the real-time traffic. It is shown in Figure 26
above, that the delay is increased after certain number of user equipments of q0 real
time traffic. After this certain value of user equipments, as the number of user
equipments entering the service increase, as the delay of the first user equipment is
increased until it lose the service. It is standardised that the threshold value of delay
that beyond this value the traffic is considered as unaccepted is 100ms as round trip
time (3GPP TS 23.107 Release 8, V8.0.0 (2008-12). Therefore, the service is
considered as unaccepted after the number of user equipments exceeds 15. The
results in both situations once QoS scheduling mechanism is triggered and once it is
not triggered are similar in this scenario.
45
4.2.3 q0, Scenario 2
The objective of this scenario is to test the performance of the conversational traffic
(class 0) over load with class1
46
4.2.4 q0, Scenario 2 Results
0.600000
0.400000
0.300000 QoS ON
0.100000
0.000000
0 5 10 15 20
q1 UE
10.000000
1.000000
0 5 10 15 20
q0 Delay (Sec)
0.100000 QoS ON
QoS OFF
0.010000
0.001000
q1 UE
The results have been shown in this scenario’s figures, Figure 27 and Figure 28 are
reasonable. Once the QoS mechanism is triggered, the received throughput of the q0
user equipment is remain constant, while it decreases after certain number of user
equipments using streaming traffic “11 user equipments” in the case of QoS
mechanism is off. The delay of q0 user equipment has increased slowly for the QoS
47
mechanism ON. On the other side, the delay has increased rapidly once q1 user
equipments reach 11 and up.
The data range of 10 different samples in this test is still not high as shown in figures,
which means that the results are more likely to be considered as accurate. The real-
time traffic is considered as lost after the number of q1 user equipments is 11 and up.
48
4.2.6 q0, Scenario 3 Results
0.476000
0.474000
q0 Throughput 0.472000
0.470000
0.468000
0.466000 QoS ON
0.464000 QoS OFF
0.462000
0.460000
0 10 20 30 40 50 60
Number of q2 UE
1.000000
0 10 20 30 40 50 60
0.100000
q0 Delay
QoS ON
QoS OFF
0.010000
0.001000
Number of q2 UE
For the throughput results as it is shown in Figure 29, it can be said that the results are
good, but the range of data is not low. By looking at the general behaviour of the
results it can be said that the behaviour is reasonable. Below 25 user equipments of
q1 traffic, the throughput is identical for both states once QoS mechanisms is
triggered and not triggered. Above 25 user equipments, different behaviour of the
two situations’ trends is noticed. While QoS mechanism is available, the throughput
is generally constant. On the other hand, while QoS mechanism is disabled, the
throughput has decreased once the number of q1 user equipments is reached. The
49
throughput has continued decreasing with greater values after 25 user equipments of
q1 traffic.
Once we have only 1 user equipment using q1 traffic, the delay values in both
situations are identical. After that, as the number of q1 user equipment increases, the
delay increases. In the case of QoS ON, the delay increases with very small values.
In the case of QoS OFF, the delay increases with considerable values as shown in
Figure 30 above. For delay figure the data range is not large, which leads to conclude
that the delay results can be assumed as accurate.
50
4.2.8 q0, Scenario 4 Results
0.480000
q0 Throughput 0.475000
0.470000
0.465000
QoS ON
0.460000
QoS OFF
0.455000
0.450000
0 2 4 6 8 10 12
Number of q3 User Equipments
1.000000
0 2 4 6 8 10 12
0.100000
q0 Delay
QoS ON
QoS OFF
0.010000
0.001000
Number of q3 User Equipments
In regards to results have been shown in Figure 31, If only one q3’s user equipment is
existed, the throughput in both situations is approximately identical. If q3 user
equipments increases, the q0 received throughput is much better in the case of QoS
mechanism is available than it is not available. It can be seen that the data range is
not low due to different number of RNG use.
51
For the delay test as it is shown in Figure 32, it is clear from the result, that the effect
of the first q3 user equipment on delay in the QoS OFF case is much higher than the
QoS ON. The delay becomes greater as the number of the q3 user equipments
increases.
This section includes scenarios and results of the streaming traffic test. The streaming
traffic is high sensitive to delay and it is given the second streaming real-time traffic as well as to study the effect
of other traffic’s classes on class1 traffic.
52
• Once QoS parameters are ON (Scheduling prioritisation are applied):
o Sending streaming traffic only, class1 available and Classes 0,2
and 3 are not available
o Increasing the number of UEs between 1 and 20UEs
o Testing the delay (the most important performance parameter in
regards to the class1), then Throughput.
o Graph the results in comparison with the state of QoS
parameters OFF(it is expected that no difference with the
previous Test)
It is expected that the results will be same in both cases as we only have one type of
traffic.
1.600000
1.400000
q1 Throughput (MByte)
1.200000
1.000000
0.800000
0.600000 q0 Throughput
0.400000
0.200000
0.000000
0 5 10 15 20 25
Number of q1 User Equipments
53
10.000000
1.000000
q1 Delay (Sec) 0 5 10 15 20 25
0.100000
q1 only, q1 Delay
0.010000
0.001000
Number of q1 User Equipments
The received throughput of the first user equipment using streaming traffic remains
constant until the number of user equipments reaches 15 UEs. Once the number of
user equipments is 15, the dropped packet increases. As the number of user
equipments exceeds 15, more traffic packets drops down. It is clearly shown in the
throughput’s figure, Figure 33 above that the q1 throughput decreases as the number
of user equipments increases beyond 15 UEs.
It can be explained from Figure 34, the packets’ delay of the first user of q1 traffic,
increases gradually with low amount of time until the number of user equipments
reaches 16, and then the delay is rapidly increases. Beyond 16 user equipments, the
delay continues increasing to exceed 1 second. The range of data in both figures’
results is small.
54
4.3.3 q1, Scenario 2
This scenario’s objective is to test the performance of the streaming traffic (class 1)
over loaded with class0
1.600000
1.400000
q1 Throughput (MByte)
1.200000
1.000000
0.800000
QoS ON
0.600000
QoS OFF
0.400000
0.200000
0.000000
0 5 10 15 20
Number of q0 User Equipments
55
100.000000
10.000000
q1 Delay (Sec)
1.000000
0 5 10 15 20 QoS ON
0.100000 QoS OFF
0.010000
0.001000
Number of q0 User Equipments
As it is shown in the q1 throughput figure, Figure 35 above, the throughput results are
identical for both situations while QoS is enabled and disabled from the q0 user
equipments increases from 1 until 10 UEs. At the time q0 user equipments number
exceeds 10, the throughput decreases in both situations. More convergence between
the two situations’ results is clearly shown by the graph that the throughput of q1 user
equipment decreases in the case of QoS ON much more than it decreases in the case
of QoS OFF. This is what was expected before the test, that the higher priority traffic
will always has the advantage in the case that the scheduling mechanism is available.
The q1 delay results’ graph in Figure 36 shows that the results are identical for both
cases if the number of the q0 user equipments is below 10. Once it is 10 q0 user
equipments both results increase in both cases but in the case of QoS ON results
shows more q1 delay than the QoS OFF results. At 11 q0 user equipments, there is a
rapid increase in both cases’ results and the QoS ON results still showing more delay
of q1 UE. As the number of q0 user equipments continues increasing, the delay
increases more and more and the results still showing better results for q1 user
equipment while the QoS mechanism is disabled.
56
4.3.5 q1, Scenario 3
This scenario objective is to test the performance of the streaming traffic (class 1)
over load with class2 (interactive traffic)
1.440000
1.420000
q1 Throughput (MByte)
1.400000
1.380000
1.360000
1.340000 QoS ON
1.320000
QoS OFF
1.300000
1.280000
1.260000
0 20 40 60 80 100 120
Number of q2 User Equipments
57
10.000000
1.000000
q1 Delay (Sec) 0 20 40 60 80 100 120
0.100000 QoS ON
QoS OFF
0.010000
0.001000
Number of q2 User Equipments
In reference to Figure 37, the throughput of the user equipment that is first uses the
streaming traffic is depicted in the q1 throughput while q2 UEs increasing figure
above. While the number of q2 user equipments is between 1 and 20 UEs, the
received throughput in both situations is identical. Beyond 20 user equipments of q2
traffic, the difference in throughput becomes clearer. The QoS ON case results shows
more received throughput by the q1 user equipment. The difference between the two
throughput values increases as the number of q2 user equipments increases. The last
test sample is presented here in this test to demonstrate how large is the difference
between the two values of throughput in the two cases at high number of q2 user
equipments. It is clearly shown that the QoS ON mechanism is much better for the q1
user equipment in regards to throughput.
The delay results in Figure 38 show that the delay of the q1 user equipment in the
case of QoS OFF is higher than it is in QoS ON. As the number of the q2 user
equipment increases the q1 user equipment traffic delay in QoS OFF state becomes
greater. In comparison with the state of QoS ON the delay slightly increases.
58
4.3.7 q1, Scenario 4
This scenario objective is to test the performance of the streaming traffic (class 1) in
the existence of class3 traffic (background traffic)
1.440000
1.430000
q1 Throughput (MByte)
1.420000
1.410000
1.400000
1.390000 QoS ON
1.380000
QoS OFF
1.370000
1.360000
1.350000
0 2 4 6 8 10 12
Number of q3 UEs
59
1.000000
0 2 4 6 8 10 12
QoS ON
QoS OFF
0.010000
0.001000
Number of q3 UEs
It is clearly shown in Figure 39, q1 throughput while q3 UEs Increases figure, that the
results of the received throughput in QoS ON mechanism are within the range of
1.41ــ1.43Mbyte. While it decreases from 1.41MByte at 1 user equipment of class3
traffic until it reaches an average value of 1.36MByte in the presence of 10 user
equipments of class3 traffic. The minor fluctuation of the q1 received throughput is
possibly due to Random Number Generated in the software.
It can be seen from Figure 40 delay results shows that in the case of the QoS
mechanism available, the q1 user equipment traffic time delay increases from 7ms in
the presence of 1 user equipment of q3 traffic until it reaches around 9ms at 10 q3’s
user equipment. In the case of the QoS mechanism disabled, the delay increases
from around 100ms in the presence of 1 UEs of class3 traffic until it reaches 1 second
for 10 UEs of q3’s traffic.
60
4.4 Interactive Traffic Test Scenarios and Results
This section includes scenarios and results of the Interactive Best Effort traffic test.
The interactive traffic is high sensitive to throughput and it is given the third highest
priority in this project traffic scheduling scheme. The main two performance features
is tested and analyzed for this traffic class are the throughput and delay, where the
throughput results is the interactive traffic as well as to study the effect
of other traffic’s classes on class2 traffic.
61
o Graph the results in comparison with the state of QoS
parameters OFF(it is expected that no difference with the
previous Test)
It is expected that the results will be same in both cases as we only have one type of
traffic
It can be seen from Figure 41 below, the q2 throughput with only class2 traffic
available figure that the received throughput by the first user equipment has the
service hasn’t changed much once the number of mobile phones in the service
between 1 and 20 user equipments. Once the number of user equipments increases to
be more than 20, there are more dropped packets introduced and the throughput
decreases gradually until reaching very low value if there is 90 user equipments in
service.
1.200000
1.000000
q2 Throughput (MByte)
0.800000
0.600000
0.400000 q2 Throughput
0.200000
0.000000
0 20 40 60 80 100
Number of q2 User Equipments
62
4.4.3 q2, Scenario 2
This scenario objective is to test the performance of the interactive traffic (class 2)
under and over load in the presence of the q0 real-time traffic.
1.000000
q2 Throughput (MByte)
0.800000
0.600000
0.400000 QoS ON
0.000000
0 5 10 15 20
Number of q0 User Equipments
63
0.007000
0.006500
0.006000
q2 Delay (Sec)
0.005500
0.005000 QoS ON
0.004000
0.003500
0 5 10 15 20
Number of q0 User Equipments
In Figure 42, the values of the received throughput of the first user equipment has a
service with interactive class traffic are identical when the number of mobile phone
equipments having a q0 real-time service is less than 5 UEs. When the number of q 43 shows that the q2 user equipment’s traffic delay values
are identical in the presence of 10 user equipments of q0 traffic or less. Once the q0
UEs number is higher than 10 UEs, the delay of q2 user equipment traffic is higher
with QoS mechanism is triggered than it is with QoS mechanism is off. And these
results are as expected due to the packet scheduling priorities.
64
4.4.5 q2, Scenario 3
This scenario objective is to test the performance of the interactive traffic (class 2)
under and over load in the presence of the q1 traffic.
1.200000
q2 Throughput (MByte)
1.000000
0.800000
0.600000
QoS ON
0.400000
0.200000 QoS OFF
0.000000
0 5 10 15 20
Number of q1 User Equipment
65
0.007000
0.006500
0.006000
q2 Delay (Sec)
0.005500
0.005000 QoS ON
0.004000
0.003500
0 5 10 15 20
Number of q1 User Equipments
As the previous test once q0 increasing, similar results are obtained in this test. The
values of the received throughput of the first user equipment has a service with
interactive class traffic are identical when the number of mobile phone equipments
having a q1 real-time service is less than 5 UEs. It can be seen in Figure 44, when the
number of q 45 shows that the q2 user equipment’s traffic delay values
are identical in the presence of 10 user equipments of q1 traffic or less. Once the q1
UEs number is higher than 10 UEs, the delay of q2 user equipment traffic is higher
with QoS mechanism is triggered than it is with QoS mechanism is off. And these
results are as expected due to the packet scheduling priorities.
66
4.4.7 q2, Scenario 4
This scenario objective is to test the performance of the interactive traffic (class 2)
under and over load in the presence of the q3 traffic.
67
4.4.8 q2, Scenario 4 Results
1.200000
q2 Throughput (MByte)
1.000000
0.800000
0.600000
0.400000 QoS ON
0.200000 QoS OFF
0.000000
0 2 4 6 8 10 12
Number of q3 User Equipments
It is clearly shown in Figure 46 that if only one q3’s user equipment is existed, the
throughput in of q2 user equipment in the presence of QoS mechanism is higher than
the throughput in the absence of the mechanism. If q3 user equipments increases, the
q1 received throughput is much better in the case of QoS mechanism is available than
it is not available. The data range in the QoS ON state is not low due using different
RNG’s number.
This section includes scenarios and results of the background best effort traffic test.
The background traffic is high sensitive to throughput and it is given the least priority
in this project traffic scheduling scheme. The main two performance features is tested
and analyzed for this traffic class are the throughput and delay, where the throughput
results is background traffic as well as to study the effect of other
traffic’s classes on class3 traffic.
68
4.5.1 q3, Scenario 1
This scenario objective is to test the performance of the background (best
effort) traffic (class 3) under and over load
• Once QoS parameters are OFF(no prioritisation are applied):
o Sending background traffic only, class3 available and Classes
0,1 and 2 are not available
o Increasing the number of UEs having services with class 3
traffic between 1 and 19 UEs
o Testing the class 3 throughput (the most important performance
parameter in regards to the best effort traffic) and delay.
It is expected that the results will be same in both cases as we only have one type of
traffic
69
4.5.2 q3, Scenario 1 Results
25.000000
15.000000
10.000000
q3 Throughput
5.000000
0.000000
0 5 10 15 20
q3 User Equipment Number
1.400000
1.200000
1.000000
q3 Delay (Sec)
0.800000
0.600000
q3 Delay
0.400000
0.200000
0.000000
0 5 10 15 20
The received throughput by the first mobile phone equipments once only one q3 user
equipment available is the full throughput available as best effort traffic which is
approximately 22MByte. Once the number of q3 user equipment increases, the
throughput is divided equally between the mobile phones stations available. The q3
received throughput, only q3 traffic only available figure, Figure 47 shows an
exponential decay trend, which means that the results are reasonable and as expected.
70
As the number of q3 user equipments increases, the throughput is distributed with a
factor of [1/(number of user equipments using q3 traffic)].
On the other hand, the delay of the first user equipment having the service increases
as the number of user equipments sharing the throughput with it, increases.
As this type of traffic is not highly affected by the delay as soon as the service is still
available, therefore the delay won’t considered as big problem to certain extent.
The delay values started with approximately 7msec in a case of only one user
equipment is available until it reaches 1.1sec with 19 user equipments sharing the
throughput with the first mobile phone.
The results in both cases, QoS ON and QoS OFF, are identical due to that the QoS
mechanism is helpful once more than one traffic type is sent via bottleneck link. This
depicted in Figure 48.
71
o Testing the class 3 throughput (the most important performance
parameter in regards to the best effort traffic) and delay.
o Graph the results in comparison with the state of QoS
parameters OFF
25.000000
q3 Throughput (MByte)
20.000000
15.000000
10.000000 QoS ON
0.000000
0 5 10 15 20
Number of q0 User Equipment
2.500000
2.000000
q3 Delay (Sec)
1.500000
1.000000 QoS ON
QoS OFF
0.500000
0.000000
0 5 10 15 20
It can be seen from Figure 49, the resultant values of throughput that is received by
the first mobile equipment having a q3 traffic service decrease and are all identical in
both QoS situations, when the number of q0 user equipment is less or equal to 10 user
equipments. Once the number of q0 user equipment increases beyond 10 user
72
equipments, the throughput in both situations continues decreasing, but it decreases
more in the case of QoS ON. The divergence between the values of throughput in
both cases becomes obvious with the existence of 15 user equipments using real-time
traffic.
Figure 50 shows that the delay increases as the number of q0 UEs increases with
identical values up to 10 q0’s UEs. Beyond this, as the number of q0’s UEs increases,
the delay increases more in the case of QoS ON rather than in the QoS OFF. The
delay becomes double in the existence of 15 user equipments using real-time traffic
once QoS mechanism is applied. The results demonstrate the expectations, where the
method used in this project gives higher priority to real-time traffic.
73
4.5.6 q3, Scenario 3 Results
25.000000
q3 Throughput(MByte) 20.000000
15.000000
10.000000 QoS ON
QoS OFF
5.000000
0.000000
0 5 10 15 20
Number of q1 User Equipments
2.500000
2.000000
q3 Delay (Sec)
1.500000
1.000000 QoS ON
QoS OFF
0.500000
0.000000
0 5 10 15 20
Figure 51 shows that the resultant values of throughput that is received by the first
mobile equipment having a q3 traffic service decrease and are all identical in both
QoS situations, when the number of q1 user equipment is less or equal to 10 user
equipments. Once the number of q1 user equipment increases beyond 10 user
equipments, the throughput in both situations continues decreasing, but it decreases
more in the case of QoS ON. The divergence between the values of throughput in
both cases becomes obvious with the existence of 15 user equipments using streaming
traffic.
74
Figure 52 shows that the delay increases as the number of q1 UEs increases with
identical values up to 10 q1’s UEs. Beyond this, as the number of q1’s UEs increases,
the delay increases more in the case of QoS ON rather than in the QoS OFF. The
delay becomes double in the existence of 15 user equipments using streaming traffic
once QoS mechanism is applied. The results demonstrate the expectations, where the
method used in this project gives higher priority for q1traffic than q3 traffic.
75
4.5.8 q3, Scenario 4 Results
25.000000
15.000000
10.000000 QoS ON
QoS OFF
5.000000
0.000000
0 5 10 15 20
Number of q2 User Equipment
0.250000
0.200000
q3 Delay (Sec)
0.150000
0.100000 QoS ON
QoS OFF
0.050000
0.000000
0 5 10 15 20
Referring to Figure 53, the difference between the results of the two cases, once QoS
ON and QoS OFF is clear. The value of the q3 user equipment throughput in the
existence of QoS mechanism is lower than the throughput value in the absence of QoS
mechanism. As the number of q2 traffic user equipments increases, both situation
throughput values decreases where the advantaged values are the ones in the case of
QoS mechanism not triggered.
As the number of interactive user equipments increases, the delay increases in both
situation, where the results in the case of QoS ON is much worse than the delay
76
results in the QoS OFF state. This is clearly true in regards to the method of
prioritisation used, as the q2 traffic is prioritized in higher state than the q3 traffic.
The delay results are graphed in Figure 54.
77
4.6 Chapter Summary
From above results, the QoS scheduling mechanism has mainly achieved its primary
objectives. The scheduling mechanism has assisted conversational traffic packets to
travel faster from mouth to ear, while the downstream throughput is constant or even
higher. The prioritisation mechanism provides advantages to real-time streaming
traffic in the existence of best effort traffic as lower delay and higher throughput. Due
to flexibility of the lower priority traffic classes (best effort classes) with time, there is
no significant effect of the mechanism on them. The only concern is that the
throughput of class2 and class3 traffic decreases in the existence of real-time traffic in
loaded link. Even though, the throughput decreases with acceptable value that the
traffic can still be executed.
78
Chapter 5 : Consequential Effects and Project
Resources
5.1 Introduction
This chapter is included to discuss the consequential effects and project resources. It
is highly recommended before beginning any project, to study and analyze any
prospected consequential effects on everyone and /or everything. In addition the
project resources should be discussed to reference the tools has been used in the
project.
5.2.1 Sustainability
As the LTE/SAE system improvement will decrease the number of nodes in the
network, evidently there will be a decrease in the disposable and recyclable materials
used for the infrastructure. As the LTE philosophy is compatible with previous
generations, users can still use their 3rd Generation mobile equipment while still
benefitting from the 4th Generation; therefore LTE will decrease the number of
disposable and/or recyclable mobile phone equipments.
It is important to obtain accurate results due to that the findings of this paper would
demonstrate the advantages of LTE/SAE system as well as the advantages of applying
the QoS features in the network. Any limitations that would affect the results’
accuracy must be described and recorded. Especially when using the university’s
properties and devices. Also, non-trusted softwares and products must be avoided to
prevent any damage to those devices.
79
5.2.3 Risk Management
In general, projects would involve several numbers of risks. The type of risks
involved in this project is mostly dealing with software hazards. Downloading
different packages used in this project would increase the probability of virus attacks.
Efficient virus detectors must be available in the computer devices used for this
experiment.
One more risk related to this project especially with students who do not have any
background and experience with such work, is the pattern of deviation in the research
work. To fix such deviation the graph in Figure 55 shows the work strategy of
identifying the deviation as early as possible.
Figure 55: Task Progress and Deviation Identification Chart (this figure made using DIA software and MS office painter)
Work on software modelling needs large amount of time, Due to this there are
possible side effects on human being health:
• If the workstation is not well prepared for sitting, back pain and other
pains can be experienced.
• Bad connection of power adapters and wires can cause a fire or electric
shock.
• Bad types of Monitors and screens could harm eyes.
80
• Command window of Linux and Ubuntu usually has a white background
which could affect the eyes with long period.
• The shiny light of screen could cause an eye harm as well as headache;
therefore the light should be adjusted to comfort the eyes.
• Some other side effects can occur if a person uses equipment with
screens for four hours daily without any protection could be: ‘stress,
headaches, irritability, insomnia, eye strain, eyesight decline, abnormal
general fatigue, decrease in productivity and in the natural resistance of
the immune system, decline in libido, disorders in the menstrual cycle,
and hormonal disturbances.’ (EMF Bioshield website, 2010).
In relation to the human being health, there are no proven studies demonstrating
that the waves and signals of the telecommunication equipments have negative
impacts to the human health. The only concern with those propagated waves
and signals is the interference with other electronic devices such as medical and
aeroplane electronic systems.
5.3 Resources
The resources of this project are mostly open sources and available for free, as well as
some software CD’s that are available on-campus and have been provided on request
by project supervisor.
operation system and the one have been used for this project is the version
81
5.3.2 Ubuntu
It is the Operating System used for the virtual environment and it is based on LINUX
distribution. The version used in this project is Ubuntu 9.10 and it has been provided
Queensland.
It is an open source simulator used to serve the user to model the network,
implementing the elements, providing interfaces and simulate the network model. The
version used in this model is ns-2.33 and it is installed on the foregoing Ubuntu
operating system.
To sum up, the prospected effects, risks, and tools used in this project are important to
82
Chapter 6 : Overall Summary and Conclusion
The main aim of this dissertation is to investigate and analyse the Long Term
evolution is to the broadband services since the voice call can be done easily without
problems by using the 2nd Generation network. LTE network has number of
advantages such that it has low number of network elements which leads to low time
delay. LTE network standardisations and requirements are included in 3rd Generation
saying, one aim of this project is to investigate the available QoS mechanism and
The available QoS mechanism has been investigated and software model has been
used to test its advantages. One advantage of this mechanism is to improve the time
that the sent packet takes to arrive to its destination. More specifically, this
mechanism looks after the real time information to be faster than other traffic’s types.
These traffic classes are mainly divided into two main classes, each main type include
two subclasses. These classes are mainly the real-time traffic and best effort traffic.
The real time traffic includes conversational and streaming traffic. The best effort
83
traffic includes the interactive and background classes. The QoS mechanism also
The model used in this project has been built in Network Simulator software. Once
all software’s hurdles have been overcome, number of scenarios to test the network
has been listed. These scenarios’ objectives are to test the performance features
including packet delay and received throughput. These two features are tested for the
first user equipment using a specific type of traffic in existence of the QoS mechanism
and loading traffic. This loading traffic used to load the network in each time is
different and it is from the four classes mentioned above. A comparison between the
results obtained in the existence of the QoS mechanism is made with the results
The results have been obtained in this project show reasonable behaviour. The QoS
mechanism helps real time traffic to be faster than it is in the case where this
mechanism is not used. More specifically the results were as follow: Firstly, delay and
throughput of conversational traffic are improved while using the QoS mechanism.
best effort traffic. Thirdly, the throughput and delay of best effort are limited in the
To sum up, this method of traffic scheduling demonstrates that the LTE’s Quality of
Service features has been satisfied. As a result, the performance features of LTE
network are improved. This is clearly shows that the QoS mechanism used by Long
84
References
Berzin, O 2010, ‘Bandwidth, Delay, Throughput and Some Math’, viewed 17 August
2010, <>.
Castro, JP 2004, All IP in 3G CDMA Networks: the UMTS Infrastructure and Service
Platforms, John Wiley & Sons Ltd, England
Classifying VoIP Signalling and Media with DSCP for QoS 2010, Release 12.2 T,
Cisco IOS Software, Cisco Systems, viewed 12 April 2010,
<>.
85
Face to Face-Embrace Network Technology Development Consulting in All-IP Times
2010, Issue 12, HUAWEI Company, China, viewed 15 April 2010,
<>.
Gronbaek, I 2000,’ IP QoS bearer service elements for the converging fixed and
mobile 3G.IP network ’, Personal, Indoor and Mobile Radio Communications,
PIMRC 2000, The 11th IEEE International Symposium, vol. 1, no. 1, pp. 19-23.
Holma, H & Toskala, A 2002, WCDMA for UMTS – Radio Access for Third Generation
Mobile Communications, 2nd edn, Wiley, England.
Holma, H & Toskala, A 2004, WCDMA for UMTS – Radio Access for Third Generation
rd
Mobile Communications, 3 edn, Wiley, England.
Holma, H & Toskala, A 2007, WCDMA for UMTS – HSPA evolution and LTE, 4th
edn, Wiley, England.
86
Krishnan, S Marchand, L, Cassel, GN 2008,’ An IETF-based Evolved Packet System
beyond the 3GPP Release 8’, Ericsson Research & Development, viewed 29 April
2010,
<
chnologies/Beyond_R8_EPS.pdf>.
Leading Edge –LTE Requirements for Bearer Networks 2009, Issue 50, HUAWEI
Company, China, viewed 15 April 2010,
<>.
Long Term Evolution (LTE) Q&A 2010, GSM World Association, viewed 20 March
2010, <>.
Quality of Service Class Identifier 2009, Long Term Evolution World Summit,
Alcatel & Lucent Company, Berlin
Long Term Evolution (LTE): The vision beyond 3G 2010, Technology Marketing
Corporation, viewed 14 March 2010, <-
wirelessevolution/articles/Nortel%20LTE%20The%20vision%20beyond%203G.pdf>
.
Long Term Evolution (LTE): Long Term Evolution Presentations with Audio 2009,
Event Helix Incorporation, Maryland, US, viewed 10 April 2010,
<>.
87
Ludwig, R Ekstrom, H Willars, P & Lundin, N 2006,’ An Evolved 3GPP QoS
Concept’, Ericsson Research & Development , vol. 1.
Nortel Technology Demo Long Term Evolution Wireless Access 2010, Nortel
Networks, viewed 19 March 2010,
<
mo_sheet.pdf>.
Olsson, M Sultana, S Rommer, S Frid, L & Mulligan, C 2009, SAE and the Evolved
Packet Core Driving the Mobile Broadband Revolution, 1st edn, Academic Press, US,
viewed 20 April 2010, <
stem+Architecture+Evolution+(SAE):+Evolved+Packet+Core+for+LTE,+Fixed+and
+Other+Wireless+Accesses&hl=en&ei=tBH5S7-
TNMSecfiEgOcL&sa=X&oi=book_result&ct=result&resnum=1&ved=0CDEQ6AEw
AA#v=onepage&q&f=false>.
Prashant, P 2009, Introduction to LTE , Issue 50, HUAWEI Company, China, viewed
15 April 2010,
<>.
Qiu, Q Chen, J Ping, L Zhang, Q Pan, X 2009, ‘LTE/SAE Model and its
Implementation in NS 2’, Mobile Ad-hoc and Sensor Networks the 5th International
Conference, pp. 299-303.
88
Rumney, M 2009, LTE and the Evolution to 4G Wireless : Design and Measurements,
Agilent Technologies Publication, US, viewed 12 May 2010, <
hitecture+Evolution+(SAE):+Evolved+Packet+Core+for+LTE,+Fixed+and+Other+
Wireless+Accesses&hl=en&ei=tBH5S7-
TNMSecfiEgOcL&sa=X&oi=book_result&ct=book-
thumbnail&resnum=2&ved=0CDcQ6wEwAQ#v=onepage&q&f=false >.
Vadada, H 2009, QoS over LTE & WiMAX Networks, viewed 1 September 2009, <-
networks/39mvtk6o5rtho/4#>.
89
Appendixes
90
Appendix B: Simulation Scripts
Lte.tcl
# Define the multicast mechanism
set ns [new Simulator -multicast on]
# Predefine tracing
set f [open out.tr w]
$ns trace-all $f
set nf [open out.nam w]
$ns namtrace-all $nf
91
# The bandwidth between aGW and server is not the
bottleneck.
$ns simplex-link $aGW $server 5000Mb 2ms DropTail
$ns simplex-link $server $aGW 5000Mb 2ms
LTEQueue/DLQueue
# -------------------------------------------------
# 0: Conversational: CBR/UdpAgent
# 1: Streaming: CBR/UdpAgent
# 2: Interactive: HTTP/TcpAgent (HTTP/Client,
HTTP/Cache, HTTP/Server)
# 3: Background: FTP/TcpAgent
92
}
93
$c($i) set-interval-generator $ctmp($i)
$c($i) set-page-generator $pgp
$c($i) log $log
}
$cache connect $s
for { set i [expr $numberClass0+$numberClass1]}
{$i<($numberClass0+$numberClass1+$numberClass2)} {incr
i} {
$c($i) connect $cache
$c($i) start-session $cache $s
}
}
# finish tracing
$ns at 30 "finish"
proc finish {} {
global ns f log
$ns flush-trace
flush $log
close $log
close $f
exit 0
}
94
Delay.AWK
# calculate each class delay
BEGIN{
UEclass0=-1;
UEclass1=-1;
UEclass2=-1;
UEclass3=-1;
}
{
event = $1;
time = $2;
node_s = $3;
node_d = $4;
trace_type = $5;
pkt_size = $6;
flag = $7;
classid = $8
pkt_id = $12;
src = $9;
split(src_,tmp,".");
src = tmp[1];
95
if(packet[pkt_id]!=0){
delay[classid,0] = delay[classid,0] + time
- packet[pkt_id];
delay[classid,1] = delay[classid,1] + 1;
}
}
packet[pkt_id]=time;
}
}
END {
for(classid=0;classid<4;classid++) {
av_delay[classid]=delay[classid,0]/delay[classid,1];
av_delayy[classid]=delayy[classid,0]/delayy[classid,
1];
total[0] = total[0] + delay[classid,0] +
delayy[2,0];
total[1] = total[1] + delay[classid,1] +
delayy[2,1];
}
print "0 1 2 3
total";
print av_delay[0]," ",av_delay[1],"
",av_delayy[2]," ",av_delay[3],"
",total[0]/total[1];
}
96
Throughput.AWK
BEGIN{
flag=0;
UEclass0=-1;
UEclass1=-1;
UEclass2=-1;
UEclass3=-1;
}
{
#r 0.241408 1 0 tcp 1040 ------- 1 4.0 0.0 3 6
#$1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11
$12
event = $1;
time = $2;
node_s = $3;
node_d = $4;
trace_type = $5;
pkt_size = $6;
classid = $8;
src_ = $9;
split(src_,tmp,".");
src = tmp[1];
#if
#eNB node id is 0
#aGW node id is 1
#server node id is 2
#UE node id >2
# note that the received throughput are the ones
received by the UEs
97
# and the sent ones are the ones received by the
server
if(event == "-" && (node_d == UEclass0) || (node_d
== UEclass1) || (node_d == UEclass2) || (node_d ==
UEclass3)) {
#if(event == "-" && node_d >2 ) {
if(flag==0) {
start_time=time;
flag=1;
}
end_time=time;
ue_r_byte[classid] = ue_r_byte[classid] + pkt_size;
}
if(event == "-" && node_d ==2 ) {
if(src == UEclass0) {
ue_s_byte[classid]=ue_s_byte[classid]+pkt_size;
}
}
if(event == "d") {
#ue_d_byte[classid]=ue_d_byte[classid]+pkt_size;
}
}
END {
for(i=0;i<4;i++)
{
ue_d_byte[classid]=ue_s_byte[classid]-
ue_r_byte[classid]
ue_r[i]=ue_r_byte[i]/1000000;
ue_s[i]=ue_s_byte[i]/1000000;
ue_d[i]=ue_d_byte[i]/1000000;
total_r=total_r+ue_r[i];
total_s=total_s+ue_s[i];
total_d=total_d+ue_d[i];
}
printf("0\t1\t2\t3\ttotal(Mbyte)\n");
printf("%1.2f\t%1.2f\t%1.2f\t%1.2f\t%1.2f\n",ue_r[0]
,ue_r[1],ue_r[2],ue_r[3],total_r);
printf("%1.2f\t%1.2f\t%1.2f\t%1.2f\t%1.2f\n",ue_s[0]
,ue_s[1],ue_s[2],ue_s[3],total_s);
printf("%1.2f\t%1.2f\t%1.2f\t%1.2f\t%1.2f\n",ue_d[0]
,ue_d[1],ue_d[2],ue_d[3],total_d);
}
98
Downlink S1 Queue Script in C++ language
#include "dls1queue.h"
void DLS1);
}
}
} else {//no qos_, no classification
q0->enqueue(p);
}
}
Packet* DLS1Queue::deque()
{
if(!flow_control_)
{
if(!qos_)
return q0->dequeue();
99
{
return q1->dequeue();
}
if(q2->length()>0)
{
//return q2->deque();
return q2->dequeue();
}
if(q3->length()>0)
{
return q3->dequeue();
}
if(classid==0 || classid==1)
{
p=q0->remove(i);
return p;
}
//flow control only apply to class 2 and class 3
if(size < flow[classid])
{
p=q0->remove(i);
return p;
}
100
//with flow control and QoS
if(qos_)
{
if(q0->length()>0) {
return q0->dequeue();
}
if(q1->length()>0) {
return q1->dequeue();
}
for(int i=0;i < q2->length();i++) {
Packet *p=q2->find(i);
if(p==NULL) {
// no packet to send in q2
break;
}
hdr_ip *iph=HDR_IP(p);
hdr_cmn *cmh=HDR_CMN(p);
int size=cmh->size();
int classid=iph->flowid();
int flowid=iph->daddr();
if(size<flow[classid])
{
p=q2->remove(i);
return p;
}
//else continue to find next packet
}
if(size<flow[classid])
{
p=q3->remove(i);
return p;
}
//else continue to find next packet
}
101
// no packet can be sent in q3
return NULL;
}
}
102
Downlink Air Queue Script File in C++ language
#include "dlairqueue.h"
//int max_buff=51200;
extern int flow[100];
void DLAirTimer::expire(Event*)
{
q_->update();
}
void DLAirQueue::update()
{
if(!qos_) {
flow[0] = q0->limit()*q0->meanPacketSize() - q0->byteLength();
} else {
flow[0] = q0->limit()*q0->meanPacketSize() - q0->byteLength();
flow[1] = q1->limit()*q1->meanPacketSize() - q1->byteLength();
flow[2] = q2->limit()*q2->meanPacketSize() - q2->byteLength();
flow[3] = q3->limit()*q3->meanPacketSize() - q3->byteLength();
}
dlairtimer.resched(1.0);
}
void DLAir);
103
}
}
} else {//no qos_, no classification
q0->enqueue(p);
}
}
Packet* DLAirQueue::deque()
{
if(!qos_)
{
return q0->dequeue();
}
//scheduling: strict priority
if(q0->length()>0)
{
return q0->dequeue();
}
if(q1->length()>0)
{
return q1->dequeue();
}
if(q2->length()>0)
{
//return q2->deque();
return q2->dequeue();
}
if(q3->length()>0)
{
return q3->dequeue();
}
return NULL;
}
104
LTE Queue Script in C++ language
#include "ltequeue.h"
//int max_buff=51200;
int flow[100];
105
Uplink Air Queue Script File in C++ language
#include "ulairqueue.h"
void ULAir* ULAirQueue::deque()
{
if(!qos_)
return q0->dequeue();
if(q0->length()>0)
{
return q0->dequeue();
}
if(q1->length()>0)
{
return q1->dequeue();
}
106
if(q2->length()>0)
{
return q2->dequeue();
}
if(q3->length()>0)
{
return q3->dequeue();
}
return NULL;
}
107
Uplink S1 Queue Script File in C++ language
#include "uls1queue.h"
void ULS1* ULS1Queue::deque()
{
if(!qos_)
return q0->dequeue();
if(q0->length()>0)
{
return q0->dequeue();
}
if(q1->length()>0)
{
return q1->dequeue();
}
108
if(q2->length()>0)
{
return q2->dequeue();
}
if(q3->length()>0)
{
return q3->dequeue();
}
return NULL;
}
109
Appendix C: Tables of Results
110
QoS ON73000 0.004583 0.002840 0.470160 0.475840
Throughput_r
12 q0 0.472000 0.004000 0.002479 0.469521 0.474479
Throughput_r
13 q0 0.472000 0.004000 0.002479 0.469521 0.474479
Throughput_r
14 q0 0.473000 0.004583 0.002840 0.470160 0.475840
Throughput_r
15 q0 0.474000 0.004899 0.003036 0.470964 0.477036.370000 0.007746 0.004801 1.365199 1.374801
Throughput_r
12 q1 1.253000 0.007810 0.004841 1.248159 1.257841
Throughput_r
13 q1 1.161000 0.008307 0.005148 1.155852 1.166148
Throughput_r
14 q1 1.078000 0.004000 0.002479 1.075521 1.080479
Throughput_r
15 q1 1.005000 0.006708 0.004158 1.000842 1.009158
1 Delay q0 0.007174 0.000005 0.000003 0.007170 0.007177
5 Delay q0 0.007313 0.000006 0.000004 0.007309 0.007316
7 Delay q0 0.007393 0.000008 0.000005 0.007388 0.007398
9 Delay q0 0.007470 0.000008 0.000005 0.007465 0.007475
11 Delay q0 0.007558 0.000006 0.000004 0.007554 0.007562
12 Delay q0 0.007556 0.000007 0.000005 0.007551 0.007560
13 Delay q0 0.007557 0.000009 0.000006 0.007551 0.007562
14 Delay q0 0.007558 0.000007 0.000004 0.007554 0.007562
15 Delay q0 0.007560 0.000008 0.000005 0.007555 0.007565
1 Delay q1 0.007244 0.000005 0.000003 0.007240 0.007247
5 Delay q1 0.007610 0.000014 0.000009 0.007601 0.007619
7 Delay q1 0.007947 0.000022 0.000014 0.007933 0.007960
9 Delay q1 0.008592 0.000029 0.000018 0.008574 0.008610
11 Delay q1 0.497596 0.050486 0.031291 0.466305 0.528887
12 Delay q1 1.692630 0.037828 0.023446 1.669184 1.716076
13 Delay q1 2.701125 0.039053 0.024205 2.676920 2.725330
14 Delay q1 3.554847 0.046354 0.028730 3.526117 3.583577
15 Delay q1 4.329807 0.039006 0.024176 4.305631 4.353983
111
QoS OFF63000 0.004583 0.002840 0.460160 0.465840
Throughput_r
12 q0 0.434000 0.004899 0.003036 0.430964 0.437036
Throughput_r
13 q0 0.411000 0.003000 0.001859 0.409141 0.412859
Throughput_r
14 q0 0.390000 0.000000 0.000000 0.390000 0.390000
Throughput_r
15 q0 0.370000 0.000000 0.000000 0.370000 0.370000.386000 0.008000 0.004958 1.381042 1.390958
Throughput_r
12 q1 1.302000 0.006000 0.003719 1.298281 1.305719
Throughput_r
13 q1 1.234000 0.008000 0.004958 1.229042 1.238958
Throughput_r
14 q1 1.167000 0.004583 0.002840 1.164160 1.169840
Throughput_r
15 q1 1.108000 0.006000 0.003719 1.104281 1.111719
1 Delay q0 0.007184 0.000005 0.000003 0.007181 0.007188
5 Delay q0 0.007457 0.000012 0.000007 0.007450 0.007464
7 Delay q0 0.007713 0.000009 0.000006 0.007708 0.007719
9 Delay q0 0.008200 0.000020 0.000013 0.008188 0.008213
11 Delay q0 0.343821 0.034217 0.021208 0.322613 0.365028
12 Delay q0 1.198299 0.026460 0.016400 1.181899 1.214699
13 Delay q0 1.954868 0.028583 0.017716 1.937152 1.972584
14 Delay q0 2.626021 0.029446 0.018250 2.607771 2.644271
15 Delay q0 3.247439 0.025799 0.015990 3.231449 3.263429
1 Delay q1 0.007191 0.000006 0.000004 0.007187 0.007194
5 Delay q1 0.007464 0.000012 0.000008 0.007456 0.007472
7 Delay q1 0.007717 0.000014 0.000009 0.007708 0.007725
9 Delay q1 0.008190 0.000025 0.000015 0.008175 0.008206
11 Delay q1 0.344303 0.034708 0.021512 0.322791 0.365815
12 Delay q1 1.196770 0.025343 0.015708 1.181062 1.212478
13 Delay q1 1.955199 0.027380 0.016970 1.938229 1.972169
14 Delay q1 2.621516 0.035940 0.022275 2.599241 2.643791
15 Delay q1 3.246570 0.026340 0.016325 3.230245 3.262895
112
QoS ON72000 0.004000 0.002479 0.469521 0.474479
Throughput_r
30 q0 0.472000 0.004000 0.002479 0.469521 0.474479
Throughput_r
35 q0 0.472000 0.004000 0.002479 0.469521 0.474479
Throughput_r
40 q0 0.472000 0.004000 0.002479 0.469521 0.474479
Throughput_r
45 q0 0.472000 0.004000 0.002479 0.469521 0.474479
Throughput_r
50 q0 0.472000 0.004000 0.002479 0.469521 0.474479
Throughput_r
1 q2 0.882000 0.148445 0.092006 0.789994 0.974006
Throughput_r
5 q2 0.874000 0.156601 0.097061 0.776939 0.971061
Throughput_r
10 q2 0.954000 0.144444 0.089526 0.864474 1.043526
Throughput_r
15 q2 0.837000 0.150602 0.093342 0.743658 0.930342
Throughput_r
20 q2 0.706000 0.082849 0.051350 0.654650 0.757350
Throughput_r
25 q2 0.661000 0.098534 0.061071 0.599929 0.722071
Throughput_r
30 q2 0.465000 0.060042 0.037214 0.427786 0.502214
Throughput_r
35 q2 0.415000 0.075000 0.046485 0.368515 0.461485
Throughput_r
40 q2 0.370000 0.047117 0.029203 0.340797 0.399203
Throughput_r
45 q2 0.354000 0.022000 0.013635 0.340365 0.367635
Throughput_r
50 q2 0.305000 0.032016 0.019843 0.285157 0.324843
1 Delay q0 0.007203 0.000014 0.000009 0.007195 0.007212
5 Delay q0 0.007468 0.000024 0.000015 0.007453 0.007483
10 Delay q0 0.007773 0.000042 0.000026 0.007747 0.007799
15 Delay q0 0.008048 0.000034 0.000021 0.008026 0.008069
20 Delay q0 0.008210 0.000015 0.000009 0.008201 0.008219
25 Delay q0 0.008273 0.000014 0.000009 0.008264 0.008281
30 Delay q0 0.008281 0.000015 0.000009 0.008271 0.008290
35 Delay q0 0.008286 0.000015 0.000009 0.008276 0.008295
40 Delay q0 0.008274 0.000015 0.000010 0.008264 0.008283
45 Delay q0 0.008279 0.000015 0.000009 0.008270 0.008288
50 Delay q0 0.008281 0.000014 0.000008 0.008272 0.008289
1 Delay q2 0.004293 0.000022 0.000013 0.004280 0.004307
5 Delay q2 0.004290 0.000022 0.000014 0.004276 0.004304
10 Delay q2 0.004306 0.000009 0.000006 0.004300 0.004311
15 Delay q2 0.0042921 0.0000179 0.000011 0.004281 0.004303
20 Delay q2 0.0042913 0.0000137 0.000009 0.004283 0.004300
25 Delay q2 0.0042723 0.0000272 0.000017 0.004255 0.004289
30 Delay q2 0.008281 0.000026 0.000016 0.008265 0.008297
35 Delay q2 0.004216 0.000025 0.000015 0.004201 0.004231
40 Delay q2 0.004201 0.000030 0.000018 0.004182 0.004219
45 Delay q2 0.004195 0.000016 0.000010 0.004184 0.004205
50 Delay q2 0.004159 0.000020 0.000012 0.004147 0.004171
113
QoS OFF71000 0.003000 0.001859 0.469141 0.472859
Throughput_r
30 q0 0.470000 0.000000 0.000000 0.470000 0.470000
Throughput_r
35 q0 0.469000 0.003000 0.001859 0.467141 0.470859
Throughput_r
40 q0 0.468000 0.004000 0.002479 0.465521 0.470479
Throughput_r
45 q0 0.468000 0.004000 0.002479 0.465521 0.470479
Throughput_r
50 q0 0.465000 0.005000 0.003099 0.461901 0.468099
Throughput_r
1 q2 0.898000 0.160860 0.099700 0.798300 0.997700
Throughput_r
5 q2 0.893000 0.159000 0.098547 0.794453 0.991547
Throughput_r
10 q2 0.965000 0.146168 0.090594 0.874406 1.055594
Throughput_r
15 q2 0.839000 0.146932 0.091068 0.747932 0.930068
Throughput_r
20 q2 0.703000 0.073627 0.045634 0.657366 0.748634
Throughput_r
25 q2 0.668000 0.090089 0.055837 0.612163 0.723837
Throughput_r
30 q2 0.492000 0.054553 0.033812 0.458188 0.525812
Throughput_r
35 q2 0.446000 0.054626 0.033857 0.412143 0.479857
Throughput_r
40 q2 0.399000 0.027368 0.016962 0.382038 0.415962
Throughput_r
45 q2 0.374000 0.027368 0.016962 0.357038 0.390962
Throughput_r
50 q2 0.342000 0.039446 0.024449 0.317551 0.366449
1 Delay q0 0.007722 0.000145 0.000090 0.007633 0.007812
5 Delay q0 0.011046 0.000393 0.000244 0.010803 0.011290
10 Delay q0 0.018207 0.001325 0.000821 0.017386 0.019028
15 Delay q0 0.037202 0.002875 0.001782 0.035420 0.038983
20 Delay q0 0.073372 0.004390 0.002721 0.070652 0.076093
25 Delay q0 0.135392 0.007946 0.004925 0.130467 0.140317
30 Delay q0 0.202308 0.008869 0.005497 0.196811 0.207804
35 Delay q0 0.280303 0.010451 0.006477 0.273826 0.286780
40 Delay q0 0.349385 0.019026 0.011792 0.337593 0.361177
45 Delay q0 0.438747 0.021664 0.013427 0.425319 0.452174
50 Delay q0 0.572514 0.031593 0.019581 0.552933 0.592095
1 Delay q2 0.004296 0.000016 0.000010 0.004286 0.004306
5 Delay q2 0.004290 0.000014 0.000009 0.004281 0.004298
10 Delay q2 0.004301 0.000012 0.000007 0.004294 0.004308
15 Delay q2 0.0043006 0.0000177 0.000011 0.004290 0.004312
20 Delay q2 0.0042817 0.0000098 0.000006 0.004276 0.004288
25 Delay q2 0.0042731 0.0000248 0.000015 0.004258 0.004289
30 Delay q2 0.004243 0.000015 0.000009 0.004233 0.004252
35 Delay q2 0.004225 0.000017 0.000010 0.004214 0.004235
40 Delay q2 0.004218 0.000019 0.000012 0.004206 0.004229
45 Delay q2 0.004201 0.000024 0.000015 0.004186 0.004216
50 Delay q2 0.004192 0.000035 0.000022 0.004170 0.004213
114
QoS ON
q3 standard Confidence average-
UE average deviation Interval conf average+conf
Throughput_r
1 q0 0.472000 0.004000 0.002479 0.469521 0.474479
Throughput_r
2 q0 0.473000 0.004583 0.002840 0.470160 0.475840
Throughput_r
3 q0 0.473000 0.004583 0.002840 0.470160 0.475840
Throughput_r
4 q0 0.472000 0.006000 0.003719 0.468281 0.475719
Throughput_r
5 q0 0.472000 0.004000 0.002479 0.469521 0.474479
Throughput_r
6 q0 0.473000 0.004583 0.002840 0.470160 0.475840
Throughput_r
7 q0 0.473000 0.004583 0.002840 0.470160 0.475840
Throughput_r
8 q0 0.472000 0.006000 0.003719 0.468281 0.475719
Throughput_r
10 q0 0.472000 0.004000 0.002479 0.469521 0.474479
Throughput_r
1 q3 15.088000 0.025219 0.015631 15.072369 15.103631
Throughput_r
2 q3 7.570000 0.008944 0.005544 7.564456 7.575544
Throughput_r
3 q3 5.060000 0.035496 0.022001 5.037999 5.082001
Throughput_r
4 q3 3.913000 0.074572 0.046219 3.866781 3.959219
Throughput_r
5 q3 3.145000 0.151872 0.094129 3.050871 3.239129
Throughput_r
6 q3 2.619000 0.075160 0.046584 2.572416 2.665584
Throughput_r
7 q3 2.288000 0.006000 0.003719 2.284281 2.291719
Throughput_r
8 q3 2.040000 0.000000 0.000000 2.040000 2.040000
Throughput_r
10 q3 1.536000 0.016852 0.010445 1.525555 1.546445
1 Delay q0 0.009211 0.000036 0.000022 0.009188 0.009233
2 Delay q0 0.009230 0.000027 0.000017 0.009213 0.009246
3 Delay q0 0.009215 0.000027 0.000017 0.009198 0.009232
4 Delay q0 0.009208 2.537E-05 0.000016 0.009192 0.009224
5 Delay q0 0.009218 0.000021 0.000013 0.009205 0.009231
6 Delay q0 0.009213 0.000016 0.000010 0.009203 0.009223
7 Delay q0 0.009224 0.000033 0.000021 0.009203 0.009244
8 Delay q0 0.009225 0.000023 0.000014 0.009211 0.009240
10 Delay q0 0.009209 0.000024 0.000015 0.009194 0.009224
1 Delay q3 0.115463 0.000197 0.000122 0.115341 0.115585
2 Delay q3 0.235877 0.000287 0.000178 0.235700 0.236055
3 Delay q3 0.354286 0.002034 0.001261 0.353025 0.355546
4 Delay q3 0.458440 0.009033 0.005599 0.452841 0.464038
5 Delay q3 0.546711 0.006037 0.003742 0.542970 0.550453
6 Delay q3 0.636818 0.004327 0.002682 0.634136 0.639500
7 Delay q3 0.7222948 0.0023242 0.001441 0.720854 0.723735
8 Delay q3 0.7998405 0.0011986 0.000743 0.799098 0.800583
9 Delay q3 0.8918513 0.0076076 0.004715 0.887136 0.896566
10 Delay q3 0.970602 0.001507 0.000934 0.969668 0.971536
115
QoS OFF
q3 standard Confidence average-
UE average deviation Interval conf average+conf
Throughput_r
1 q0 0.472000 0.004000 0.002479 0.469521 0.474479
Throughput_r
2 q0 0.470000 0.000000 0.000000 0.470000 0.470000
Throughput_r
3 q0 0.469000 0.005385 0.003338 0.465662 0.472338
Throughput_r
4 q0 0.464000 0.004899 0.003036 0.460964 0.467036
Throughput_r
5 q0 0.461000 0.003000 0.001859 0.459141 0.462859
Throughput_r
6 q0 0.461000 0.003000 0.001859 0.459141 0.462859
Throughput_r
7 q0 0.460000 0.000000 0.000000 0.460000 0.460000
Throughput_r
8 q0 0.460000 0.000000 0.000000 0.460000 0.460000
Throughput_r
10 q0 0.455000 0.005000 0.003099 0.451901 0.458099
Throughput_r
1 q3 15.107000 0.026096 0.016174 15.090826 15.123174
Throughput_r
2 q3 7.582000 0.006000 0.003719 7.578281 7.585719
Throughput_r
3 q3 5.088000 0.006000 0.003719 5.084281 5.091719
Throughput_r
4 q3 3.896000 0.012000 0.007438 3.888562 3.903438
Throughput_r
5 q3 3.240000 0.120333 0.074582 3.165418 3.314582
Throughput_r
6 q3 2.600000 0.000000 0.000000 2.600000 2.600000
Throughput_r
7 q3 2.290000 0.000000 0.000000 2.290000 2.290000
Throughput_r
8 q3 2.040000 0.000000 0.000000 2.040000 2.040000
Throughput_r
10 q3 1.709000 0.017578 0.010895 1.698105 1.719895
1 Delay q0 0.113211 0.000247 0.000153 0.113057 0.113364
2 Delay q0 0.234470 0.000309 0.000191 0.234278 0.234661
3 Delay q0 0.355032 0.000659 0.000409 0.354624 0.355441
4 Delay q0 0.464624 0.001180 0.000731 0.463893 0.465356
5 Delay q0 0.557356 0.001679 0.001041 0.556315 0.558396
6 Delay q0 0.651735 0.001751 0.001085 0.650650 0.652820
7 Delay q0 0.742124 0.002205 0.001367 0.740757 0.743491
8 Delay q0 0.829047 0.001482 0.000918 0.828128 0.829965
10 Delay q0 0.993184 0.002174 0.001348 0.991837 0.994532
1 Delay q3 0.115345 0.000210 0.000130 0.115214 0.115475
2 Delay q3 0.235217 0.000302 0.000187 0.235030 0.235404
3 Delay q3 0.353455 0.000619 0.000384 0.353072 0.353839
4 Delay q3 0.458659 0.000597 0.000370 0.458289 0.459029
5 Delay q3 0.542189 0.006774 0.004198 0.537991 0.546388
6 Delay q3 0.636935 0.001072 0.000664 0.636271 0.637600
7 Delay q3 0.7200339 0.0014000 0.000868 0.719166 0.720902
8 Delay q3 0.7973371 0.0011753 0.000728 0.796609 0.798066
10 Delay q3 0.937607 0.001077 0.000668 0.936940 0.938275
116
QoS Enabled and Disabled
standard Confidence average-
UE average deviation Interval conf average+conf
1 Throughput_r q1 1.424000 0.008000 0.004958 1.419042 1.428958
5 Throughput_r q1 1.423000 0.007810 0.004841 1.418159 1.427841
10 Throughput_r q1 1.417000 0.007810 0.004841 1.412159 1.421841
15 Throughput_r q1 1.416000 0.008000 0.004958 1.411042 1.420958
16 Throughput_r q1 1.386000 0.004899 0.003036 1.382964 1.389036
17 Throughput_r q1 1.306000 0.009165 0.005681 1.300319 1.311681
18 Throughput_r q1 1.231000 0.007000 0.004339 1.226661 1.235339
19 Throughput_r q1 1.174000 0.009165 0.005681 1.168319 1.179681
20 Throughput_r q1 1.108000 0.006000 0.003719 1.104281 1.111719
1 Delay q1 0.007008 0.000000 0.000000 0.007008 0.007008
5 Delay q1 0.007139 0.000006 0.000004 0.007135 0.007143
10 Delay q1 0.007457 0.000009 0.000006 0.007451 0.007463
15 Delay q1 0.008985 0.000081 0.000050 0.008936 0.009035
16 Delay q1 0.349130 0.034333 0.021279 0.327851 0.370409
17 Delay q1 1.198809 0.030918 0.019163 1.179646 1.217972
18 Delay q1 1.954065 0.033357 0.020675 1.933390 1.974740
19 Delay q1 2.632495 0.028572 0.017709 2.614786 2.650204
20 Delay q1 3.242274 0.025974 0.016099 3.226175 3.258373
117
QoS ON74000 0.004899 0.003036 0.470964 0.477036
Throughput_r
12 q0 0.471000 0.003000 0.001859 0.469141 0.472859
Throughput_r
13 q0 0.474000 0.004899 0.003036 0.470964 0.477036
Throughput_r
14 q0 0.472000 0.004000 0.002479 0.469521 0.474479
Throughput_r
15 q0 0.470000 0.004472 0.002772 0.467228 0.472772.313000 0.013454 0.008338 1.304662 1.321338
Throughput_r
12 q1 1.028000 0.008718 0.005403 1.022597 1.033403
Throughput_r
13 q1 0.745000 0.005000 0.003099 0.741901 0.748099
Throughput_r
14 q1 0.464000 0.008000 0.004958 0.459042 0.468958
Throughput_r
15 q1 0.182000 0.006000 0.003719 0.178281 0.185719
1 Delay q0 0.007145 0.000004 0.000002 0.007142 0.007147
5 Delay q0 0.007313 0.000006 0.000004 0.007309 0.007316
10 Delay q0 0.007798 0.000015 0.000009 0.007789 0.007808
11 Delay q0 0.007985 0.000014 0.000009 0.007977 0.007994
12 Delay q0 0.008126 0.000016 0.000010 0.008117 0.008136
13 Delay q0 0.008309 0.000013 0.000008 0.008301 0.008317
14 Delay q0 0.008621 0.000026 0.000016 0.008605 0.008637
15 Delay q0 0.009389 0.000036 0.000022 0.009367 0.009411
1 Delay q1 0.007189 0.000004 0.000003 0.007186 0.007192
5 Delay q1 0.007610 0.000014 0.000009 0.007601 0.007619
10 Delay q1 0.011295 0.000181 0.000112 0.011183 0.011407
11 Delay q1 1.084599 0.072874 0.045167 1.039432 1.129766
12 Delay q1 4.067464 0.126067 0.078136 3.989328 4.145600
13 Delay q1 7.020248 0.142134 0.088094 6.932154 7.108342
14 Delay q1 9.982780 0.195980 0.121467 9.861313 10.104247
15 Delay q1 12.859250 0.444661 0.275599 12.583651 13.134849
118
QoS OFF64000 0.004899 0.003036 0.460964 0.467036
Throughput_r
12 q0 0.434000 0.004899 0.003036 0.430964 0.437036
Throughput_r
13 q0 0.410000 0.000000 0.000000 0.410000 0.410000
Throughput_r
14 q0 0.390000 0.000000 0.000000 0.390000 0.390000
Throughput_r
15 q0 0.368000 0.004000 0.002479 0.365521 0.370479.383000 0.011874 0.007360 1.375640 1.390360
Throughput_r
12 q1 1.306000 0.006633 0.004111 1.301889 1.310111
Throughput_r
13 q1 1.232000 0.006000 0.003719 1.228281 1.235719
Throughput_r
14 q1 1.167000 0.009000 0.005578 1.161422 1.172578
Throughput_r
15 q1 1.113000 0.007810 0.004841 1.108159 1.117841
1 Delay q0 0.007185 0.000006 0.000004 0.007182 0.007189
5 Delay q0 0.007457 0.000012 0.000007 0.007450 0.007464
10 Delay q0 0.008962 0.000058 0.000036 0.008927 0.008998
11 Delay q0 0.344138 0.021549 0.013356 0.330782 0.357493
12 Delay q0 1.199214 0.031968 0.019814 1.179400 1.219028
13 Delay q0 1.952679 0.019672 0.012193 1.940486 1.964872
14 Delay q0 2.632313 0.034385 0.021312 2.611001 2.653625
15 Delay q0 3.230338 0.036337 0.022522 3.207816 3.252860
1 Delay q1 0.007181 0.000004 0.000003 0.007178 0.007183
5 Delay q1 0.007464 0.000012 0.000008 0.007456 0.007472
10 Delay q1 0.008971 0.000057 0.000035 0.008935 0.009006
11 Delay q1 0.344633 0.021795 0.013508 0.331125 0.358141
12 Delay q1 1.201534 0.031586 0.019577 1.181957 1.221111
13 Delay q1 1.954533 0.026007 0.016119 1.938414 1.970652
14 Delay q1 2.633586 0.029530 0.018303 2.615283 2.651889
15 Delay q1 3.236889 0.027148 0.016826 3.220063 3.253715
119
QoS ON
standard Confidence average-
q3 UE average deviation Interval conf average+conf
1 Throughput_r q1 1.419000 0.007000 0.004339 1.414661 1.423339
2 Throughput_r q1 1.416000 0.008000 0.004958 1.411042 1.420958
3 Throughput_r q1 1.416000 0.008000 0.004958 1.411042 1.420958
4 Throughput_r q1 1.423000 0.006403 0.003969 1.419031 1.426969
5 Throughput_r q1 1.426000 0.009165 0.005681 1.420319 1.431681
6 Throughput_r q1 1.416000 0.012000 0.007438 1.408562 1.423438
7 Throughput_r q1 1.419000 0.005385 0.003338 1.415662 1.422338
8 Throughput_r q1 1.421000 0.009434 0.005847 1.415153 1.426847
9 Throughput_r q1 1.423000 0.007810 0.004841 1.418159 1.427841
10 Throughput_r q1 1.422000 0.007483 0.004638 1.417362 1.426638
1 Throughput_r q3 15.094000 0.018547 0.011495 15.082505 15.105495
2 Throughput_r q3 7.565000 0.015000 0.009297 7.555703 7.574297
3 Throughput_r q3 5.049000 0.021656 0.013423 5.035577 5.062423
4 Throughput_r q3 3.931000 0.037269 0.023099 3.907901 3.954099
5 Throughput_r q3 3.059000 0.077775 0.048205 3.010795 3.107205.728000 0.041183 0.025525 1.702475 1.753525
10 Throughput_r q3 1.528000 0.009798 0.006073 1.521927 1.534073
1 Delay q1 0.009219 0.000019 0.000012 0.009207 0.009230
2 Delay q1 0.009202 0.000018 0.000011 0.009190 0.009213
3 Delay q1 0.009221 0.000029 0.000018 0.009203 0.009239
4 Delay q1 0.009222 0.000024 0.000015 0.009207 0.009237
5 Delay q1 0.009241 0.000026 0.000016 0.009225 0.009256
6 Delay q1 0.009224 0.000028 0.000017 0.009207 0.009242
7 Delay q1 0.009215 0.000033 0.000021 0.009194 0.009235
8 Delay q1 0.009225 0.000029 0.000018 0.009207 0.009243
9 Delay q1 0.009219 0.000021 0.000013 0.009206 0.009231
10 Delay q1 0.009213 0.000028 0.000017 0.009196 0.009231
1 Delay q3 0.115590 0.000154 0.000096 0.115494 0.115686
2 Delay q3 0.236119 0.000384 0.000238 0.235881 0.236357
3 Delay q3 0.3549265 0.001172028 0.000726 0.354200 0.355653
4 Delay q3 0.4563237 0.005617515 0.003482 0.452842 0.459805
5 Delay q3 0.5504047 0.003113363 0.001930 0.548475 0.552334
6 Delay q3 0.6371985 0.00190066 0.001178 0.636020 0.638377
7 Delay q3 0.7215502 0.001246445 0.000773 0.720778 0.722323
8 Delay q3 0.8012263 0.001991955 0.001235 0.799992 0.802461
9 Delay q3 0.8941130 0.006177218 0.003829 0.890284 0.897942
10 Delay q3 0.9699808 0.001166222 0.000723 0.969258 0.970704
120
QoS OFF
standard Confidence average-
q3 UE average deviation Interval conf average+conf
1 Throughput_r q1 1.414000 0.009165 0.005681 1.408319 1.419681
2 Throughput_r q1 1.411000 0.008307 0.005148 1.405852 1.416148
3 Throughput_r q1 1.402000 0.007483 0.004638 1.397362 1.406638
4 Throughput_r q1 1.397000 0.007810 0.004841 1.392159 1.401841
5 Throughput_r q1 1.392000 0.007483 0.004638 1.387362 1.396638
6 Throughput_r q1 1.384000 0.008000 0.004958 1.379042 1.388958
7 Throughput_r q1 1.381000 0.008307 0.005148 1.375852 1.386148
8 Throughput_r q1 1.373000 0.004583 0.002840 1.370160 1.375840
9 Throughput_r q1 1.366000 0.006633 0.004111 1.361889 1.370111
10 Throughput_r q1 1.362000 0.008718 0.005403 1.356597 1.367403
1 Throughput_r q3 15.107000 0.018466 0.011445 15.095555 15.118445
2 Throughput_r q3 7.582000 0.006000 0.003719 7.578281 7.585719
3 Throughput_r q3 5.090000 0.000000 0.000000 5.090000 5.090000
4 Throughput_r q3 3.891000 0.018138 0.011242 3.879758 3.902242
5 Throughput_r q3 3.247000 0.111270 0.068965 3.178035 3.315965.850000 0.000000 0.000000 1.850000 1.850000
10 Throughput_r q3 1.691000 0.025865 0.016031 1.674969 1.707031
1 Delay q1 0.113394 0.000145 0.000090 0.113305 0.113484
2 Delay q1 0.234648 0.000286 0.000177 0.234471 0.234825
3 Delay q1 0.355264 0.000462 0.000286 0.354978 0.355550
4 Delay q1 0.465116 0.001803 0.001117 0.463998 0.466233
5 Delay q1 0.557848 0.001734 0.001075 0.556774 0.558923
6 Delay q1 0.652021 0.001109 0.000688 0.651334 0.652709
7 Delay q1 0.742281 0.001091 0.000676 0.741605 0.742957
8 Delay q1 0.829682 0.001499 0.000929 0.828753 0.830611
9 Delay q1 0.913042 0.002279 0.001412 0.911629 0.914454
10 Delay q1 0.991455 0.002748 0.001703 0.989752 0.993158
1 Delay q3 0.115502 0.000144 0.000089 0.115413 0.115592
2 Delay q3 0.235435 0.000283 0.000175 0.235259 0.235610
3 Delay q3 0.3536651 0.000413611 0.000256 0.353409 0.353921
4 Delay q3 0.4593412 0.001867069 0.001157 0.458184 0.460498
5 Delay q3 0.5418491 0.007774024 0.004818 0.537031 0.546667
6 Delay q3 0.6370766 0.000679172 0.000421 0.636656 0.637498
7 Delay q3 0.7205419 0.000676476 0.000419 0.720123 0.720961
8 Delay q3 0.7977926 0.000753914 0.000467 0.797325 0.798260
9 Delay q3 0.8701875 0.000894186 0.000554 0.869633 0.870742
10 Delay q3 0.9379900 0.000839898 0.000521 0.937469 0.938511
121
QoS ON
standard Confidence average-
q2 UE average deviation Interval conf average+conf
1 Throughput_r q1 1.422000 0.007483 0.004638 1.417362 1.426638
5 Throughput_r q1 1.419000 0.008307 0.005148 1.413852 1.424148
10 Throughput_r q1 1.418000 0.008718 0.005403 1.412597 1.423403
15 Throughput_r q1 1.422000 0.010770 0.006675 1.415325 1.428675
20 Throughput_r q1 1.419000 0.010440 0.006471 1.412529 1.425471
25 Throughput_r q1 1.416000 0.011136 0.006902 1.409098 1.422902
30 Throughput_r q1 1.417000 0.009000 0.005578 1.411422 1.422578
35 Throughput_r q1 1.422000 0.006000 0.003719 1.418281 1.425719
40 Throughput_r q1 1.418000 0.008718 0.005403 1.412597 1.423403
45 Throughput_r q1 1.425000 0.006708 0.004158 1.420842 1.429158
100 Throughput_r q1 1.420000 0.011832 0.007334 1.412666 1.427334
1 Throughput_r q2 0.891000 0.135753 0.084139 0.806861 0.975139
5 Throughput_r q2 0.884000 0.089017 0.055172 0.828828 0.939172
10 Throughput_r q2 0.914000 0.148068 0.091772 0.822228 1.005772
15 Throughput_r q2 0.799000 0.084077 0.052111 0.746889 0.851111
20 Throughput_r q2 0.741000 0.114145 0.070746 0.670254 0.811746
25 Throughput_r q2 0.638000 0.081707 0.050641 0.587359 0.688641
30 Throughput_r q2 0.498000 0.047074 0.029176 0.468824 0.527176
35 Throughput_r q2 0.419000 0.059405 0.036819 0.382181 0.455819
40 Throughput_r q2 0.397000 0.059000 0.036568 0.360432 0.433568
45 Throughput_r q2 0.366000 0.038262 0.023715 0.342285 0.389715
100 Throughput_r q2 0.160000 0.021909 0.013579 0.146421 0.173579
1 Delay q1 0.007206 0.000014 0.000008 0.007197 0.007214
5 Delay q1 0.007463 0.000027 0.000017 0.007446 0.007479
10 Delay q1 0.007768 0.000023 0.000014 0.007754 0.007783
15 Delay q1 0.008038 0.000031 0.000019 0.008019 0.008057
20 Delay q1 0.008207 0.000028 0.000017 0.008190 0.008224
25 Delay q1 0.008265 0.000017 0.000010 0.008255 0.008275
30 Delay q1 0.008279 0.000011 0.000007 0.008272 0.008286
35 Delay q1 0.008275 0.000014 0.000009 0.008266 0.008283
40 Delay q1 0.008277 0.000013 0.000008 0.008269 0.008285
45 Delay q1 0.008274 0.000012 0.000007 0.008267 0.008282
100 Delay q1 0.0082764 1.70746E-05 0.000011 0.008266 0.008287
1 Delay q2 0.0041216 1.10568E-05 0.000007 0.004115 0.004128
5 Delay q2 0.0041233 7.3483E-06 0.000005 0.004119 0.004128
10 Delay q2 0.0041265 1.29051E-05 0.000008 0.004118 0.004134
15 Delay q2 0.0041191 8.0946E-06 0.000005 0.004114 0.004124
20 Delay q2 0.0041133 1.54031E-05 0.000010 0.004104 0.004123
25 Delay q2 0.0041001 1.24133E-05 0.000008 0.004092 0.004108
30 Delay q2 0.0040735 1.11276E-05 0.000007 0.004067 0.004080
35 Delay q2 0.0040521 2.03915E-05 0.000013 0.004040 0.004065
40 Delay q2 0.0040453 2.12054E-05 0.000013 0.004032 0.004058
45 Delay q2 0.0040299 1.94009E-05 0.000012 0.004018 0.004042
100 Delay q2 0.0038433 3.85918E-05 0.000024 0.003819 0.003867
122
QoS OFF
standard Confidence average-
q2 UE average deviation Interval conf average+conf
1 Throughput_r q1 1.422000 0.007483 0.004638 1.417362 1.426638
5 Throughput_r q1 1.418000 0.008718 0.005403 1.412597 1.423403
10 Throughput_r q1 1.417000 0.009000 0.005578 1.411422 1.422578
15 Throughput_r q1 1.424000 0.008000 0.004958 1.419042 1.428958
20 Throughput_r q1 1.415000 0.011180 0.006930 1.408070 1.421930
25 Throughput_r q1 1.412000 0.014000 0.008677 1.403323 1.420677
30 Throughput_r q1 1.406000 0.008000 0.004958 1.401042 1.410958
35 Throughput_r q1 1.409000 0.005385 0.003338 1.405662 1.412338
40 Throughput_r q1 1.404000 0.009165 0.005681 1.398319 1.409681
45 Throughput_r q1 1.403000 0.007810 0.004841 1.398159 1.407841
100 Throughput_r q1 1.294000 0.023324 0.014456 1.279544 1.308456
1 Throughput_r q2 0.901000 0.147949 0.091698 0.809302 0.992698
5 Throughput_r q2 0.893000 0.098392 0.060983 0.832017 0.953983
10 Throughput_r q2 0.926000 0.155962 0.096664 0.829336 1.022664
15 Throughput_r q2 0.812000 0.067941 0.042110 0.769890 0.854110
20 Throughput_r q2 0.715000 0.113864 0.070572 0.644428 0.785572
25 Throughput_r q2 0.632000 0.089978 0.055768 0.576232 0.687768
30 Throughput_r q2 0.545000 0.075928 0.047060 0.497940 0.592060
35 Throughput_r q2 0.445000 0.064692 0.040096 0.404904 0.485096
40 Throughput_r q2 0.424000 0.040299 0.024977 0.399023 0.448977
45 Throughput_r q2 0.372000 0.048744 0.030211 0.341789 0.402211
100 Throughput_r q2 0.150000 0.018974 0.011760 0.138240 0.161760
1 Delay q1 0.007704 0.000126 0.000078 0.007626 0.007782
5 Delay q1 0.010635 0.000378 0.000234 0.010401 0.010869
10 Delay q1 0.018505 0.001148 0.000711 0.017794 0.019216
15 Delay q1 0.035530 0.002374 0.001472 0.034058 0.037001
20 Delay q1 0.073091 0.007059 0.004375 0.068716 0.077466
25 Delay q1 0.131977 0.008101 0.005021 0.126956 0.136998
30 Delay q1 0.201358 0.012355 0.007658 0.193700 0.209015
35 Delay q1 0.276838 0.006098 0.003780 0.273059 0.280618
40 Delay q1 0.355444 0.013758 0.008527 0.346917 0.363971
45 Delay q1 0.450133 0.028156 0.017451 0.432681 0.467584
100 Delay q1 1.9303840 0.150255027 0.093127 1.837257 2.023511
1 Delay q2 0.0041222 1.16021E-05 0.000007 0.004115 0.004129
5 Delay q2 0.0041238 7.95623E-06 0.000005 0.004119 0.004129
10 Delay q2 0.0041270 1.33066E-05 0.000008 0.004119 0.004135
15 Delay q2 0.0041195 6.947E-06 0.000004 0.004115 0.004124
20 Delay q2 0.0041083 1.40316E-05 0.000009 0.004100 0.004117
25 Delay q2 0.0040979 1.31736E-05 0.000008 0.004090 0.004106
30 Delay q2 0.0040810 1.59024E-05 0.000010 0.004071 0.004091
35 Delay q2 0.0040612 2.16027E-05 0.000013 0.004048 0.004075
40 Delay q2 0.0040546 1.24013E-05 0.000008 0.004047 0.004062
45 Delay q2 0.0040292 2.4765E-05 0.000015 0.004014 0.004045
100 Delay q2 0.0038318 3.15205E-05 0.000020 0.003812 0.003851
123
QoS Enabled and Disabled
standard Confidence average- average+con
UE average deviation Interval conf f
Throughput_r
1 q2 0.859000 0.127941 0.079297 0.779703 0.938297
Throughput_r
10 q2 0.959000 0.121610 0.075373 0.883627 1.034373
Throughput_r
20 q2 0.899000 0.149763 0.092822 0.806178 0.991822
Throughput_r
30 q2 0.757000 0.084267 0.052229 0.704771 0.809229
Throughput_r
40 q2 0.517000 0.061164 0.037909 0.479091 0.554909
Throughput_r
50 q2 0.471000 0.097821 0.060629 0.410371 0.531629
Throughput_r
60 q2 0.424000 0.056071 0.034753 0.389247 0.458753
Throughput_r
70 q2 0.357000 0.048795 0.030243 0.326757 0.387243
Throughput_r
80 q2 0.304000 0.081633 0.050596 0.253404 0.354596
Throughput_r
90 q2 0.273000 0.025710 0.015935 0.257065 0.288935
1 Delay q2 0.004118 0.000013 0.000008 0.004110 0.004127
10 Delay q2 0.004131 0.000008 0.000005 0.004126 0.004136
20 Delay q2 0.004129 0.000015 0.000009 0.004120 0.004138
30 Delay q2 0.004118 0.000009 0.000006 0.004113 0.004124
40 Delay q2 0.004079 0.000016 0.000010 0.004070 0.004089
50 Delay q2 0.004069 0.000026 0.000016 0.004052 0.004085
60 Delay q2 0.004064 0.000022 0.000014 0.004050 0.004078
70 Delay q2 0.004033 0.000024 0.000015 0.004018 0.004048
0.003995
80 Delay q2 6 4.08433E-05 0.000025 0.003970 0.004021
0.003982
90 Delay q2 8 2.38251E-05 0.000015 0.003968 0.003998
124
QoS ON
standard Confidence average-
q0 UE average deviation Interval conf average+conf
1 Throughput_r q0 0.471000 0.003000 0.001859 0.469141 0.472859
5 Throughput_r q0 0.474000 0.004899 0.003036 0.470964 0.477036
9 Throughput_r q0 0.473000 0.004583 0.002840 0.470160 0.475840
10 Throughput_r q0 0.474000 0.004899 0.003036 0.470964 0.477036
11 Throughput_r q0 0.471000 0.003000 0.001859 0.469141 0.472859
12 Throughput_r q0 0.473000 0.004583 0.002840 0.470160 0.475840
13 Throughput_r q0 0.471000 0.003000 0.001859 0.469141 0.472859
14 Throughput_r q0 0.476000 0.004899 0.003036 0.472964 0.479036
15 Throughput_r q0 0.471000 0.003000 0.001859 0.469141 0.472859
1 Throughput_r q2 0.847000 0.118832 0.073651 0.773349 0.920651
5 Throughput_r q2 0.874000 0.156601 0.097061 0.776939 0.971061
9 Throughput_r q2 0.889000 0.081664 0.050615 0.838385 0.939615
10 Throughput_r q2 0.795000 0.103755 0.064307 0.730693 0.859307
11 Throughput_r q2 0.785000 0.097596 0.060490 0.724510 0.845490
12 Throughput_r q2 0.772000 0.097242 0.060270 0.711730 0.832270
13 Throughput_r q2 0.656000 0.129089 0.080009 0.575991 0.736009
14 Throughput_r q2 0.469000 0.062040 0.038452 0.430548 0.507452
15 Throughput_r q2 0.192000 0.025219 0.015631 0.176369 0.207631
1 Delay q0 0.007241 0.000013 0.000008 0.007233 0.007249
5 Delay q0 0.007468 0.000024 0.000015 0.007453 0.007483
9 Delay q0 0.007863 0.000029 0.000018 0.007845 0.007881
10 Delay q0 0.008021 0.000032 0.000020 0.008001 0.008041
11 Delay q0 0.008237 0.000041 0.000025 0.008212 0.008262
12 Delay q0 0.008501 0.000043 0.000027 0.008474 0.008527
13 Delay q0 0.008844 0.000042 0.000026 0.008818 0.008870
14 Delay q0 0.009280 0.000053 0.000033 0.009247 0.009313
15 Delay q0 0.010094 0.000036 0.000022 0.010071 0.010116
1 Delay q2 0.004144 0.000008 0.000005 0.004139 0.004149
5 Delay q2 0.004290 0.000022 0.000014 0.004276 0.004304
9 Delay q2 0.004569 0.000025 0.000015 0.004538 0.004568
10 Delay q2 0.004671 0.000028 0.000017 0.004635 0.004669
11 Delay q2 0.004823 0.000039 0.000024 0.004759 0.004807
12 Delay q2 0.0050085 3.4768E-05 0.000022 0.004926 0.004969
13 Delay q2 0.0052595 4.30687E-05 0.000027 0.005117 0.005170
14 Delay q2 0.0055461 6.9521E-05 0.000043 0.005378 0.005464
15 Delay q2 0.0066331 0.000168725 0.000105 0.005841 0.006050
125
QoS OFF
standard Confidence average-
q0 UE average deviation Interval conf average+conf
1 Throughput_r q0 0.471000 0.003000 0.001859 0.472859 0.472859
5 Throughput_r q0 0.474000 0.004899 0.003036 0.477036 0.477036
9 Throughput_r q0 0.473000 0.004583 0.002840 0.475840 0.475840
10 Throughput_r q0 0.472000 0.004000 0.002479 0.474479 0.474479
11 Throughput_r q0 0.473000 0.004583 0.002840 0.475840 0.475840
12 Throughput_r q0 0.473000 0.004583 0.002840 0.475840 0.475840
13 Throughput_r q0 0.471000 0.003000 0.001859 0.472859 0.472859
14 Throughput_r q0 0.470000 0.000000 0.000000 0.470000 0.470000
15 Throughput_r q0 0.458000 0.004000 0.002479 0.460479 0.460479
1 Throughput_r q2 0.847000 0.118832 0.073651 0.920651 0.920651
5 Throughput_r q2 0.893000 0.159000 0.098547 0.991547 0.991547
9 Throughput_r q2 0.859000 0.110132 0.068259 0.927259 0.927259
10 Throughput_r q2 0.867000 0.123454 0.076516 0.943516 0.943516
11 Throughput_r q2 0.845000 0.123875 0.076777 0.921777 0.921777
12 Throughput_r q2 0.854000 0.099418 0.061619 0.915619 0.915619
13 Throughput_r q2 0.704000 0.110200 0.068301 0.772301 0.772301
14 Throughput_r q2 0.534000 0.061677 0.038227 0.572227 0.572227
15 Throughput_r q2 0.325000 0.050050 0.031021 0.356021 0.356021
1 Delay q0 0.008984 0.000184 0.000114 0.009097 0.009097
5 Delay q0 0.011046 0.000393 0.000244 0.011290 0.011290
9 Delay q0 0.016039 0.000840 0.000521 0.016560 0.016560
10 Delay q0 0.020127 0.001641 0.001017 0.021144 0.021144
11 Delay q0 0.026171 0.001822 0.001130 0.027301 0.027301
12 Delay q0 0.041991 0.007116 0.004410 0.046402 0.046402
13 Delay q0 0.076397 0.015649 0.009699 0.086096 0.086096
14 Delay q0 0.205321 0.026348 0.016330 0.221651 0.221651
15 Delay q0 0.602664 0.077986 0.048335 0.651000 0.651000
1 Delay q2 0.004144 0.000009 0.000006 0.004150 0.004150
5 Delay q2 0.004290 0.000014 0.000009 0.004298 0.004298
9 Delay q2 0.004553 0.000019 0.000012 0.004581 0.004581
10 Delay q2 0.004652 0.000031 0.000020 0.004690 0.004690
11 Delay q2 0.004783 0.000041 0.000026 0.004848 0.004848
12 Delay q2 0.0049477 2.9685E-05 0.000018 0.005027 0.005027
13 Delay q2 0.0051438 6.60267E-05 0.000041 0.005300 0.005300
14 Delay q2 0.0054209 6.38521E-05 0.000040 0.005586 0.005586
15 Delay q2 0.0059456 0.000279049 0.000173 0.006806 0.006806
126
QoS ON
average-
q1 UE average standard deviation Confidence Interval conf average+conf
1 Throughput_r q1 1.426000 0.006633 0.004111 1.421889 1.430111
5 Throughput_r q1 1.419000 0.008307 0.005148 1.413852 1.424148
10 Throughput_r q1 1.417000 0.011874 0.007360 1.409640 1.424360
11 Throughput_r q1 1.425000 0.008062 0.004997 1.420003 1.429997
12 Throughput_r q1 1.418000 0.013266 0.008223 1.409777 1.426223
13 Throughput_r q1 1.417000 0.007810 0.004841 1.412159 1.421841
14 Throughput_r q1 1.423000 0.009000 0.005578 1.417422 1.428578
15 Throughput_r q1 1.418000 0.007483 0.004638 1.413362 1.422638
1 Throughput_r q2 0.956000 0.139442 0.086425 0.869575 1.042425
5 Throughput_r q2 0.884000 0.089017 0.055172 0.828828 0.939172
10 Throughput_r q2 0.790000 0.144637 0.089646 0.700354 0.879646
11 Throughput_r q2 0.798000 0.127421 0.078975 0.719025 0.876975
12 Throughput_r q2 0.771000 0.084906 0.052624 0.718376 0.823624
13 Throughput_r q2 0.625000 0.078390 0.048586 0.576414 0.673586
14 Throughput_r q2 0.449000 0.060902 0.037746 0.411254 0.486746
15 Throughput_r q2 0.196000 0.045869 0.028430 0.167570 0.224430
1 Delay q1 0.007258 0.000009 0.000006 0.007252 0.007263
5 Delay q1 0.007463 0.000027 0.000017 0.007446 0.007479
10 Delay q1 0.008020 0.000041 0.000025 0.007995 0.008045
11 Delay q1 0.008246 0.000043 0.000027 0.008219 0.008273
12 Delay q1 0.008516 0.000045 0.000028 0.008488 0.008544
13 Delay q1 0.008810 0.000036 0.000022 0.008787 0.008832
14 Delay q1 0.009274 0.000030 0.000019 0.009255 0.009292
15 Delay q1 0.010094 0.000106 0.000066 0.010029 0.010160
1 Delay q2 0.004128 0.000011 0.000007 0.004121 0.004135
5 Delay q2 0.004124 0.000007 0.000005 0.004119 0.004128
10 Delay q2 0.004117 0.000018 0.000011 0.004101 0.004122
11 Delay q2 0.004120 0.000013 0.000008 0.004106 0.004122
12 Delay q2 0.004121 0.000010 0.000006 0.004106 0.004118
13 Delay q2 0.004109 0.000014 0.000008 0.004084 0.004101
14 Delay q2 0.004068 0.000017 0.000011 0.004044 0.004065
15 Delay q2 0.004019 0.000059 0.000037 0.003861 0.003934
127
QoS OFF
average-
q1 UE average standard deviation Confidence Interval conf average+conf
1 Throughput_r q1 1.426000 0.006633 0.004111 1.421889 1.430111
5 Throughput_r q1 1.418000 0.008718 0.005403 1.412597 1.423403
10 Throughput_r q1 1.420000 0.014142 0.008765 1.411235 1.428765
11 Throughput_r q1 1.425000 0.008062 0.004997 1.420003 1.429997
12 Throughput_r q1 1.415000 0.011180 0.006930 1.408070 1.421930
13 Throughput_r q1 1.413000 0.007810 0.004841 1.408159 1.417841
14 Throughput_r q1 1.407000 0.007810 0.004841 1.402159 1.411841
15 Throughput_r q1 1.376000 0.015620 0.009682 1.366318 1.385682
1 Throughput_r q2 0.956000 0.139442 0.086425 0.869575 1.042425
5 Throughput_r q2 0.893000 0.098392 0.060983 0.832017 0.953983
10 Throughput_r q2 0.847000 0.143739 0.089089 0.757911 0.936089
11 Throughput_r q2 0.865000 0.146850 0.091017 0.773983 0.956017
12 Throughput_r q2 0.873000 0.122560 0.075962 0.797038 0.948962
13 Throughput_r q2 0.750000 0.054955 0.034061 0.715939 0.784061
14 Throughput_r q2 0.517000 0.080380 0.049819 0.467181 0.566819
15 Throughput_r q2 0.341000 0.054672 0.033885 0.307115 0.374885
1 Delay q1 0.009197 0.000234 0.000145 0.009052 0.009342
5 Delay q1 0.010635 0.000378 0.000234 0.010401 0.010869
10 Delay q1 0.018964 0.001448 0.000898 0.018067 0.019862
11 Delay q1 0.026327 0.002894 0.001794 0.024533 0.028120
12 Delay q1 0.039832 0.004995 0.003096 0.036736 0.042928
13 Delay q1 0.073491 0.010482 0.006497 0.066994 0.079988
14 Delay q1 0.216792 0.025871 0.016035 0.200757 0.232827
15 Delay q1 0.616694 0.061115 0.037879 0.578815 0.654573
1 Delay q2 0.004128 0.000011 0.000007 0.004121 0.004135
5 Delay q2 0.004123 0.000008 0.000005 0.004119 0.004129
10 Delay q2 0.004112 0.000017 0.000010 0.004107 0.004128
11 Delay q2 0.004114 0.000014 0.000009 0.004111 0.004128
12 Delay q2 0.004112 0.000011 0.000007 0.004114 0.004128
13 Delay q2 0.004093 0.000007 0.000004 0.004105 0.004113
14 Delay q2 0.004055 0.000021 0.000013 0.004055 0.004081
15 Delay q2 0.003897 0.000029 0.000018 0.004001 0.004037
128
QoS ON
standard Confidence average-
q3 UE average deviation Interval conf average+conf
1 Throughput_r q2 0.911000 0.124133 0.076937 0.834063 0.987937
2 Throughput_r q2 0.985000 0.146918 0.091059 0.893941 1.076059
3 Throughput_r q2 0.918000 0.164912 0.102212 0.815788 1.020212
4 Throughput_r q2 0.976000 0.193298 0.119805 0.856195 1.095805
5 Throughput_r q2 0.927000 0.093172 0.057747 0.869253 0.984747
6 Throughput_r q2 0.938000 0.153610 0.095207 0.842793 1.033207
7 Throughput_r q2 0.885000 0.212474 0.131690 0.753310 1.016690
8 Throughput_r q2 0.911000 0.087115 0.053993 0.857007 0.964993
9 Throughput_r q2 0.935000 0.143335 0.088838 0.846162 1.023838
10 Throughput_r q2 0.959000 0.139818 0.086658 0.872342 1.045658
1 Throughput_r q3 17.685000 0.320289 0.198513 17.486487 17.883513
2 Throughput_r q3 8.758000 0.111427 0.069062 8.688938 8.827062
3 Throughput_r q3 5.932000 0.081093 0.050261 5.881739 5.982261
4 Throughput_r q3 4.416000 0.121589 0.075361 4.340639 4.491361
5 Throughput_r q3 3.618000 0.157911 0.097873 3.520127 3.715873
6 Throughput_r q3 3.073000 0.089448 0.055440 3.017560 3.128440
7 Throughput_r q3 2.602000 0.095163 0.058982 2.543018 2.660982
8 Throughput_r q3 2.316000 0.099820 0.061868 2.254132 2.377868
9 Throughput_r q3 2.085000 0.064226 0.039807 2.045193 2.124807
10 Throughput_r q3 1.900000 0.084617 0.052445 1.847555 1.952445
1 Delay q2 0.004125 0.000012 0.000007 0.004118 0.004133
2 Delay q2 0.004131 0.000011 0.000007 0.004124 0.004138
3 Delay q2 0.004124 0.000017 0.000010 0.004114 0.004135
4 Delay q2 0.004129 0.000013 0.000008 0.004121 0.004137
5 Delay q2 0.004127 0.000008 0.000005 0.004122 0.004132
6 Delay q2 0.004127 0.000012 0.000007 0.004119 0.004134
7 Delay q2 0.004119 0.000024 0.000015 0.004104 0.004134
8 Delay q2 0.004127 0.000007 0.000004 0.004122 0.004131
9 Delay q2 0.004127 0.000010 0.000006 0.004120 0.004133
10 Delay q2 0.004129 0.000011 0.000007 0.004122 0.004135
1 Delay q3 0.097889 0.001873 0.001161 0.096728 0.099050
2 Delay q3 0.203560 0.002649 0.001642 0.201918 0.205201
3 Delay q3 0.3021982 0.004369779 0.002708 0.299490 0.304907
4 Delay q3 0.3976134 0.007422935 0.004601 0.393013 0.402214
5 Delay q3 0.4802466 0.01528191 0.009472 0.470775 0.489718
6 Delay q3 0.5592001 0.014412261 0.008933 0.550267 0.568133
7 Delay q3 0.6372158 0.013825968 0.008569 0.628647 0.645785
8 Delay q3 0.7199800 0.013481999 0.008356 0.711624 0.728336
9 Delay q3 0.7829744 0.009167498 0.005682 0.777292 0.788656
10 Delay q3 0.8486948 0.012133127 0.007520 0.841175 0.856215
129
QoS OFF
standard Confidence average-
q3 UE average deviation Interval conf average+conf
1 Throughput_r q2 0.644000 0.073648 0.045647 0.598353 0.689647
2 Throughput_r q2 0.489000 0.093856 0.058172 0.430828 0.547172
3 Throughput_r q2 0.418000 0.041665 0.025824 0.392176 0.443824
4 Throughput_r q2 0.369000 0.033601 0.020825 0.348175 0.389825
5 Throughput_r q2 0.306000 0.037470 0.023224 0.282776 0.329224
6 Throughput_r q2 0.298000 0.038158 0.023650 0.274350 0.321650
7 Throughput_r q2 0.281000 0.029816 0.018480 0.262520 0.299480
8 Throughput_r q2 0.274000 0.046519 0.028832 0.245168 0.302832
9 Throughput_r q2 0.234000 0.035833 0.022209 0.211791 0.256209
10 Throughput_r q2 0.242000 0.056356 0.034929 0.207071 0.276929
1 Throughput_r q3 18.989000 0.158142 0.098016 18.890984 19.087016
2 Throughput_r q3 9.889000 0.058898 0.036505 9.852495 9.925505
3 Throughput_r q3 6.715000 0.050050 0.031021 6.683979 6.746021
4 Throughput_r q3 5.170000 0.025298 0.015680 5.154320 5.185680
5 Throughput_r q3 4.229000 0.041097 0.025472 4.203528 4.254472
6 Throughput_r q3 3.685000 0.034424 0.021336 3.663664 3.706336
7 Throughput_r q3 2.983000 0.020518 0.012717 2.970283 2.995717
8 Throughput_r q3 2.673000 0.021932 0.013593 2.659407 2.686593
9 Throughput_r q3 2.420000 0.014832 0.009193 2.410807 2.429193
10 Throughput_r q3 2.223000 0.004583 0.002840 2.220160 2.225840
1 Delay q2 0.004095 0.000013 0.000008 0.004086 0.004103
2 Delay q2 0.004061 0.000024 0.000015 0.004046 0.004076
3 Delay q2 0.004043 0.000017 0.000010 0.004033 0.004053
4 Delay q2 0.004021 0.000016 0.000010 0.004011 0.004031
5 Delay q2 0.003988 0.000018 0.000011 0.003977 0.003999
6 Delay q2 0.003983 0.000024 0.000015 0.003969 0.003998
7 Delay q2 0.003972 0.000023 0.000014 0.003958 0.003986
8 Delay q2 0.003963 0.000037 0.000023 0.003940 0.003986
9 Delay q2 0.003931 0.000039 0.000024 0.003906 0.003955
10 Delay q2 0.003930 0.000050 0.000031 0.003899 0.003961
1 Delay q3 0.090712 0.000796 0.000494 0.090218 0.091206
2 Delay q3 0.179484 0.001149 0.000712 0.178772 0.180196
3 Delay q3 0.2665191 0.001939166 0.001202 0.265317 0.267721
4 Delay q3 0.3467387 0.001154522 0.000716 0.346023 0.347454
5 Delay q3 0.4224410 0.001389428 0.000861 0.421580 0.423302
6 Delay q3 0.4847042 0.002404075 0.001490 0.483214 0.486194
7 Delay q3 0.5593268 0.002686054 0.001665 0.557662 0.560992
8 Delay q3 0.6191223 0.002625175 0.001627 0.617495 0.620749
9 Delay q3 0.6784909 0.001906169 0.001181 0.677309 0.679672
10 Delay q3 0.7365034 0.002694779 0.001670 0.734833 0.738174
130
QoS Enabled and Disabled
average-
UE average standard deviation Confidence Interval conf average+conf
1 Throughput_r q3 22.180000 0.000000 0.000000 22.180000 22.180000
3 Throughput_r q3 7.400000 0.000000 0.000000 7.400000 7.400000
5 Throughput_r q3 4.557000 0.050408 0.031243 4.525757 4.588243
7 Throughput_r q3 3.173000 0.021000 0.013016 3.159984 3.186016
9 Throughput_r q3 2.582000 0.021354 0.013235 2.568765 2.595235
11 Throughput_r q3 2.170000 0.000000 0.000000 2.170000 2.170000
13 Throughput_r q3 1.740000 0.000000 0.000000 1.740000 1.740000
15 Throughput_r q3 1.520000 0.000000 0.000000 1.520000 1.520000
17 Throughput_r q3 1.350000 0.000000 0.000000 1.350000 1.350000
19 Throughput_r q3 1.222000 0.009798 0.006073 1.215927 1.228073
1 Delay q3 0.076796 0.000000 0.000000 0.076796 0.076796
3 Delay q3 0.240889 0.000000 0.000000 0.240889 0.240889
5 Delay q3 0.393152 0.000907 0.000562 0.392590 0.393714
7 Delay q3 0.527902 0.001745 0.001082 0.526820 0.528984
9 Delay q3 0.647911 0.000668 0.000414 0.647497 0.648325
11 Delay q3 0.759037 0.000211 0.000131 0.758906 0.759168
13 Delay q3 0.884257 0.000000 0.000000 0.884257 0.884257
15 Delay q3 0.985794 0.000068 0.000042 0.985752 0.985836
17 Delay q3 1.0778390 5.95735E-05 0.000037 1.077802 1.077876
19 Delay q3 1.1619780 0.002221953 0.001377 1.160601 1.163355
131
QoS ON
standard Confidence average-
q0 UE average deviation Interval conf average+conf
1 Throughput_r q0 0.474000 0.004899 0.003036 0.470964 0.477036
5 Throughput_r q0 0.472000 0.004000 0.002479 0.469521 0.474479
9 Throughput_r q0 0.473000 0.004583 0.002840 0.470160 0.475840
10 Throughput_r q0 0.472000 0.004000 0.002479 0.469521 0.474479
11 Throughput_r q0 0.473000 0.004583 0.002840 0.470160 0.475840
12 Throughput_r q0 0.472000 0.004000 0.002479 0.469521 0.474479
13 Throughput_r q0 0.472000 0.004000 0.002479 0.469521 0.474479
14 Throughput_r q0 0.474000 0.004899 0.003036 0.470964 0.477036
15 Throughput_r q0 0.473000 0.004583 0.002840 0.470160 0.475840
1 Throughput_r q3 20.757000 0.009000 0.005578 20.751422 20.762578
5 Throughput_r q3 15.088000 0.025219 0.015631 15.072369 15.103631
9 Throughput_r q3 9.422000 0.020881 0.012942 9.409058 9.434942
10 Throughput_r q3 7.992000 0.027857 0.017265 7.974735 8.009265
11 Throughput_r q3 6.585000 0.026173 0.016222 6.568778 6.601222
12 Throughput_r q3 5.154000 0.032924 0.020406 5.133594 5.174406
13 Throughput_r q3 3.742000 0.022271 0.013803 3.728197 3.755803
14 Throughput_r q3 2.315000 0.021095 0.013075 2.301925 2.328075
15 Throughput_r q3 0.896000 0.024576 0.015232 0.880768 0.911232
1 Delay q0 0.009083 0.000018 0.000011 0.009072 0.009094
5 Delay q0 0.009211 0.000036 0.000022 0.009188 0.009233
9 Delay q0 0.009447 0.000032 0.000020 0.009428 0.009467
10 Delay q0 0.009524 0.000029 0.000018 0.009505 0.009542
11 Delay q0 0.009657 0.000031 0.000019 0.009638 0.009676
12 Delay q0 0.009793 0.000024 0.000015 0.009778 0.009808
13 Delay q0 0.009975 0.000038 0.000024 0.009951 0.009999
14 Delay q0 0.010284 0.000029 0.000018 0.010265 0.010302
15 Delay q0 0.010992 0.000046 0.000028 0.010964 0.011020
1 Delay q3 0.082436 0.000036 0.000023 0.082413 0.082458
5 Delay q3 0.115463 0.000197 0.000122 0.115341 0.115585
9 Delay q3 0.188012 0.000415 0.000257 0.187755 0.188269
10 Delay q3 0.222386 0.000737 0.000457 0.221929 0.222843
11 Delay q3 0.270777 0.001115 0.000691 0.270085 0.271468
12 Delay q3 0.3466271 0.002153333 0.001335 0.345292 0.347962
13 Delay q3 0.4775734 0.003114909 0.001931 0.475643 0.479504
14 Delay q3 0.7674512 0.007218219 0.004474 0.762977 0.771925
15 Delay q3 1.8974570 0.050781523 0.031474 1.865983 1.928931
132
QoS OFF
standard Confidence average-
q0 UE average deviation Interval conf average+conf
1 Throughput_r q0 0.471000 0.003000 0.001859 0.469141 0.472859
5 Throughput_r q0 0.472000 0.004000 0.002479 0.469521 0.474479
9 Throughput_r q0 0.469000 0.003000 0.001859 0.467141 0.470859
10 Throughput_r q0 0.469000 0.003000 0.001859 0.467141 0.470859
11 Throughput_r q0 0.469000 0.003000 0.001859 0.467141 0.470859
12 Throughput_r q0 0.470000 0.000000 0.000000 0.470000 0.470000
13 Throughput_r q0 0.466000 0.004899 0.003036 0.462964 0.469036
14 Throughput_r q0 0.460000 0.000000 0.000000 0.460000 0.460000
15 Throughput_r q0 0.450000 0.000000 0.000000 0.450000 0.450000
1 Throughput_r q3 20.762000 0.006000 0.003719 20.758281 20.765719
5 Throughput_r q3 15.107000 0.026096 0.016174 15.090826 15.123174
9 Throughput_r q3 9.490000 0.020000 0.012396 9.477604 9.502396
10 Throughput_r q3 8.103000 0.031639 0.019609 8.083391 8.122609
11 Throughput_r q3 6.717000 0.017349 0.010753 6.706247 6.727753
12 Throughput_r q3 5.357000 0.034366 0.021300 5.335700 5.378300
13 Throughput_r q3 4.040000 0.024083 0.014927 4.025073 4.054927
14 Throughput_r q3 2.835000 0.025788 0.015983 2.819017 2.850983
15 Throughput_r q3 1.963000 0.014866 0.009214 1.953786 1.972214
1 Delay q0 0.080152 0.000046 0.000029 0.080123 0.080180
5 Delay q0 0.113211 0.000247 0.000153 0.113057 0.113364
9 Delay q0 0.185543 0.000501 0.000310 0.185233 0.185854
10 Delay q0 0.219174 0.000925 0.000573 0.218601 0.219747
11 Delay q0 0.267094 0.000858 0.000532 0.266562 0.267626
12 Delay q0 0.339554 0.002413 0.001496 0.338058 0.341049
13 Delay q0 0.460745 0.003045 0.001888 0.458857 0.462632
14 Delay q0 0.688918 0.007061 0.004377 0.684542 0.693295
15 Delay q0 1.098431 0.010615 0.006579 1.091852 1.105010
1 Delay q3 0.082420 0.000022 0.000013 0.082407 0.082433
5 Delay q3 0.115345 0.000210 0.000130 0.115214 0.115475
9 Delay q3 0.186724 0.000418 0.000259 0.186465 0.186983
10 Delay q3 0.219571 0.000843 0.000523 0.219048 0.220093
11 Delay q3 0.265866 0.000737 0.000457 0.265409 0.266322
12 Delay q3 0.3343803 0.002132184 0.001322 0.333059 0.335702
13 Delay q3 0.4442679 0.002708721 0.001679 0.442589 0.445947
14 Delay q3 0.6320600 0.007061319 0.004377 0.627683 0.636437
15 Delay q3 0.9026128 0.006338668 0.003929 0.898684 0.906541
133
QoS ON
q1 standard Confidence average-
UE average deviation Interval conf average+conf
Throughput_r
1 q1 1.419000 0.008307 0.005148 1.413852 1.424148
Throughput_r
5 q1 1.419000 0.007000 0.004339 1.414661 1.423339
Throughput_r
9 q1 1.424000 0.008000 0.004958 1.419042 1.428958
Throughput_r
10 q1 1.417000 0.009000 0.005578 1.411422 1.422578
Throughput_r
11 q1 1.416000 0.009165 0.005681 1.410319 1.421681
Throughput_r
12 q1 1.417000 0.006403 0.003969 1.413031 1.420969
Throughput_r
13 q1 1.421000 0.008307 0.005148 1.415852 1.426148
Throughput_r
14 q1 1.415000 0.005000 0.003099 1.411901 1.418099
Throughput_r
15 q1 1.420000 0.007746 0.004801 1.415199 1.424801
Throughput_r
1 q3 20.761000 0.008307 0.005148 20.755852 20.766148
Throughput_r
5 q3 15.094000 0.018547 0.011495 15.082505 15.105495
Throughput_r
9 q3 9.419000 0.034191 0.021191 9.397809 9.440191
Throughput_r
10 q3 8.005000 0.042249 0.026186 7.978814 8.031186
Throughput_r
11 q3 6.588000 0.041425 0.025675 6.562325 6.613675
Throughput_r
12 q3 5.163000 0.002955 0.001831 5.161169 5.164831
Throughput_r
13 q3 3.736000 0.045431 0.028158 3.707842 3.764158
Throughput_r
14 q3 2.316000 0.046087 0.028564 2.287436 2.344564
Throughput_r
15 q3 0.897000 0.052163 0.032330 0.864670 0.929330
1 Delay q1 0.009074 0.000022 0.000014 0.009060 0.009087
5 Delay q1 0.009219 0.000019 0.000012 0.009207 0.009230
9 Delay q1 0.009451 0.000024 0.000015 0.009436 0.009466
10 Delay q1 0.009529 0.000023 0.000014 0.009514 0.009543
11 Delay q1 0.009650 0.000021 0.000013 0.009637 0.009663
12 Delay q1 0.009777 0.000021 0.000013 0.009764 0.009790
13 Delay q1 0.009985 0.000021 0.000013 0.009972 0.009998
14 Delay q1 0.010272 0.000035 0.000022 0.010250 0.010294
15 Delay q1 0.011066 0.000077 0.000048 0.011019 0.011114
1 Delay q3 0.082444 0.000035 0.000022 0.082422 0.082466
5 Delay q3 0.115590 0.000154 0.000096 0.115494 0.115686
9 Delay q3 0.188498 0.000732 0.000454 0.188045 0.188952
10 Delay q3 0.222623 0.001180 0.000731 0.221891 0.223354
11 Delay q3 0.271398 0.001762 0.001092 0.270306 0.272490
12 Delay q3 0.3470021 0.002954582 0.001831 0.345171 0.348833
13 Delay q3 0.4791866 0.005768947 0.003576 0.475611 0.482762
14 Delay q3 0.7685904 0.015065807 0.009338 0.759253 0.777928
15 Delay q3 1.9079420 0.095875649 0.059423 1.848519 1.967365
134
QoS OFF
q1 standard Confidence average-
UE average deviation Interval conf average+conf
Throughput_r
1 q1 1.421000 0.007000 0.004339 1.416661 1.425339
Throughput_r
5 q1 1.414000 0.009165 0.005681 1.408319 1.419681
Throughput_r
9 q1 1.410000 0.007746 0.004801 1.405199 1.414801
Throughput_r
10 q1 1.412000 0.009798 0.006073 1.405927 1.418073
Throughput_r
11 q1 1.411000 0.011358 0.007040 1.403960 1.418040
Throughput_r
12 q1 1.403000 0.006403 0.003969 1.399031 1.406969
Throughput_r
13 q1 1.400000 0.007746 0.004801 1.395199 1.404801
Throughput_r
14 q1 1.384000 0.009165 0.005681 1.378319 1.389681
Throughput_r
15 q1 1.347000 0.009000 0.005578 1.341422 1.352578
Throughput_r
1 q3 20.760000 0.004472 0.002772 20.757228 20.762772
Throughput_r
5 q3 15.107000 0.018466 0.011445 15.095555 15.118445
Throughput_r
9 q3 9.492000 0.030265 0.018758 9.473242 9.510758
Throughput_r
10 q3 8.102000 0.036551 0.022654 8.079346 8.124654
Throughput_r
11 q3 6.725000 0.042249 0.026186 6.698814 6.751186
Throughput_r
12 q3 5.363000 0.044508 0.027586 5.335414 5.390586
Throughput_r
13 q3 4.042000 0.044227 0.027411 4.014589 4.069411
Throughput_r
14 q3 2.840000 0.038987 0.024164 2.815836 2.864164
Throughput_r
15 q3 1.964000 0.024576 0.015232 1.948768 1.979232
1 Delay q1 0.080187 0.000038 0.000023 0.080163 0.080210
5 Delay q1 0.113394 0.000145 0.000090 0.113305 0.113484
9 Delay q1 0.186032 0.000692 0.000429 0.185602 0.186461
10 Delay q1 0.219774 0.000692 0.000429 0.219344 0.220203
11 Delay q1 0.267590 0.001808 0.001121 0.266470 0.268711
12 Delay q1 0.340153 0.003069 0.001902 0.338251 0.342055
13 Delay q1 0.461425 0.005794 0.003591 0.457834 0.465016
14 Delay q1 0.688788 0.011974 0.007421 0.681367 0.696209
15 Delay q1 1.099317 0.020245 0.012548 1.086769 1.111865
1 Delay q3 0.082451 0.000029 0.000018 0.082434 0.082469
5 Delay q3 0.115502 0.000144 0.000089 0.115413 0.115592
9 Delay q3 0.187185 0.000655 0.000406 0.186780 0.187591
10 Delay q3 0.220174 0.001028 0.000637 0.219537 0.220811
11 Delay q3 0.266266 0.001748 0.001083 0.265182 0.267349
12 Delay q3 0.3349293 0.002860561 0.001773 0.333156 0.336702
13 Delay q3 0.4450838 0.004832674 0.002995 0.442089 0.448079
14 Delay q3 0.6320311 0.008408795 0.005212 0.626819 0.637243
15 Delay q3 0.9050840 0.010521545 0.006521 0.898563 0.911605
135
QoS ON
standard Confidence average-
q2 UE average deviation Interval conf average+conf
1 Throughput_r q2 1.001000 0.196288 0.121658 0.879342 1.122658
5 Throughput_r q2 0.911000 0.124133 0.076937 0.834063 0.987937
9 Throughput_r q2 0.919000 0.143140 0.088717 0.830283 1.007717
10 Throughput_r q2 0.941000 0.112379 0.069652 0.871348 1.010652
11 Throughput_r q2 0.910000 0.192094 0.119059 0.790941 1.029059
12 Throughput_r q2 0.914000 0.115603 0.071650 0.842350 0.985650
13 Throughput_r q2 0.863000 0.142341 0.088222 0.774778 0.951222
14 Throughput_r q2 0.871000 0.071477 0.044301 0.826699 0.915301
15 Throughput_r q2 0.844000 0.119264 0.073919 0.770081 0.917919
1 Throughput_r q3 21.178000 0.195745 0.121322 21.056678 21.299322
5 Throughput_r q3 17.685000 0.320289 0.198513 17.486487 17.883513
9 Throughput_r q3 14.146000 0.498321 0.308857 13.837143 14.454857
10 Throughput_r q3 12.986000 0.365026 0.226241 12.759759 13.212241
11 Throughput_r q3 12.407000 0.308385 0.191135 12.215865 12.598135
12 Throughput_r q3 11.738000 0.357514 0.221585 11.516415 11.959585
13 Throughput_r q3 10.730000 0.802857 0.497607 10.232393 11.227607
14 Throughput_r q3 9.665000 0.388336 0.240689 9.424311 9.905689
15 Throughput_r q3 9.225000 0.575104 0.356447 8.868553 9.581447
1 Delay q2 0.004129 0.000015 0.000009 0.004120 0.004138
5 Delay q2 0.004125 0.000012 0.000007 0.004118 0.004133
9 Delay q2 0.004126 0.000012 0.000007 0.004119 0.004134
10 Delay q2 0.004129 0.000010 0.000006 0.004123 0.004136
11 Delay q2 0.004124 0.000017 0.000011 0.004114 0.004135
12 Delay q2 0.004127 0.000010 0.000006 0.004121 0.004133
13 Delay q2 0.004122 0.000016 0.000010 0.004112 0.004131
14 Delay q2 0.004125 0.000007 0.000004 0.004121 0.004130
15 Delay q2 0.004121 0.000011 0.000007 0.004114 0.004129
1 Delay q3 0.080723 0.000805 0.000499 0.080224 0.081222
5 Delay q3 0.097889 0.001873 0.001161 0.096728 0.099050
9 Delay q3 0.123798 0.004572 0.002834 0.120965 0.126632
10 Delay q3 0.135053 0.004109 0.002547 0.132506 0.137600
11 Delay q3 0.141512 0.003761 0.002331 0.139181 0.143843
12 Delay q3 0.1499157 0.004500719 0.002790 0.147126 0.152705
13 Delay q3 0.1650363 0.012807694 0.007938 0.157098 0.172974
14 Delay q3 0.1821917 0.007401519 0.004587 0.177604 0.186779
15 Delay q3 0.1910522 0.012179085 0.007549 0.183504 0.198601
136
QoS OFF
standard Confidence average-
q2 UE average deviation Interval conf average+conf
1 Throughput_r q2 0.640000 0.081854 0.050732 0.589268 0.690732
5 Throughput_r q2 0.644000 0.073648 0.045647 0.598353 0.689647
9 Throughput_r q2 0.616000 0.059867 0.037105 0.578895 0.653105
10 Throughput_r q2 0.650000 0.058992 0.036563 0.613437 0.686563
11 Throughput_r q2 0.646000 0.084404 0.052313 0.593687 0.698313
12 Throughput_r q2 0.643000 0.163832 0.101542 0.541458 0.744542
13 Throughput_r q2 0.673000 0.090227 0.055923 0.617077 0.728923
14 Throughput_r q2 0.605000 0.088572 0.054896 0.550104 0.659896
15 Throughput_r q2 0.657000 0.092201 0.057146 0.599854 0.714146
1 Throughput_r q3 21.539000 0.080926 0.050157 21.488843 21.589157
5 Throughput_r q3 18.989000 0.158142 0.098016 18.890984 19.087016
9 Throughput_r q3 16.567000 0.211237 0.130924 16.436076 16.697924
10 Throughput_r q3 15.956000 0.199860 0.123872 15.832128 16.079872
11 Throughput_r q3 15.399000 0.202210 0.125329 15.273671 15.524329
12 Throughput_r q3 14.843000 0.281995 0.174779 14.668221 15.017779
13 Throughput_r q3 14.238000 0.337366 0.209098 14.028902 14.447098
14 Throughput_r q3 13.743000 0.311000 0.192756 13.550244 13.935756
15 Throughput_r q3 13.231000 0.285253 0.176798 13.054202 13.407798
1 Delay q2 0.004093 0.000012 0.000008 0.004085 0.004100
5 Delay q2 0.004095 0.000013 0.000008 0.004086 0.004103
9 Delay q2 0.004092 0.000010 0.000006 0.004085 0.004098
10 Delay q2 0.004098 0.000009 0.000006 0.004092 0.004104
11 Delay q2 0.004097 0.000012 0.000008 0.004089 0.004104
12 Delay q2 0.004092 0.000026 0.000016 0.004076 0.004108
13 Delay q2 0.004101 0.000013 0.000008 0.004093 0.004109
14 Delay q2 0.004090 0.000014 0.000009 0.004081 0.004099
15 Delay q2 0.004099 0.000013 0.000008 0.004091 0.004107
1 Delay q3 0.079258 0.000320 0.000199 0.079060 0.079457
5 Delay q3 0.090712 0.000796 0.000494 0.090218 0.091206
9 Delay q3 0.104850 0.001445 0.000896 0.103954 0.105746
10 Delay q3 0.109088 0.001461 0.000905 0.108183 0.109994
11 Delay q3 0.113281 0.001556 0.000964 0.112317 0.114245
12 Delay q3 0.1177541 0.002354587 0.001459 0.116295 0.119213
13 Delay q3 0.1230369 0.003054883 0.001893 0.121143 0.124930
14 Delay q3 0.1276550 0.003083191 0.001911 0.125744 0.129566
15 Delay q3 0.1328038 0.003039239 0.001884 0.130920 0.134688
137 | https://www.scribd.com/document/56049762/Alenazi-2010 | CC-MAIN-2019-30 | refinedweb | 26,644 | 75 |
Computer Science Archive: Questions from February 08, 2011
- Anonymous askedI need a few good points as to why the creation of comprehensive network of sensors and intelligent... Show more
I need a few good points as to why the creation of comprehensive network of sensors and intelligent devices as outlined it Watson, Boudreau and Chen's "Information Systems and Environmentally Sustainable Development" can be a good or a bad thing, why it may have adverse effects, and if it would be feasible at all.• Show less0 answers
- Anonymous askedwith Vt= 10 Vpk, R1 = 1 kohms, R2 = 5 Kohms, Batt = 4V, What are the maximum positive and negative v... More »1 answer
- Anonymous askedsuppose a computer sends a frame to another computer on a bus topology lan.the physical destination ... More »0 answers
- Anonymous askedCustomers... Show moreA0 answers
- Anonymous askedWrite a program in C to convert the temperature from 38.5 degrees in Celsius to degrees in Fahrenhei... Show more
Write a program in C to convert the temperature from 38.5 degrees in Celsius to degrees in Fahrenheit. The relationship is as follows:• Show less
. Where c is the temperature in Celsius and f is the temperature in Fahrenheit.1 answer
- Anonymous asked*******I actually have a lot of code to this which can be located at the bottom of the question. I h... Show more
*******I actually have a lot of code to this which can be located at the bottom of the question. I have gotten most of it. I need help getting the hands which represent the sec min and hrs. This is supposed to be an intro to Java.• Show less
* The applet should display the circular dial of a analog clock, with a second hand, minute hand, and an hour hand in the correct position. The hour and minute hands should be shown in proportion to the actual time. For example, if the time is 3:30:45, the hour hand should be about halfway between 3pm and 4pm. Similarly for the minute hand.
* The dial should be centered on the panel and should scale in size with the panel. The hour, minute and second hands should also scale with the size of the dial.
* The dial should have markers for hours at 3, 6 , 9 and 12.
You will need to find the angles of the hours, minutes and seconds hand. The seconds and minutes hand travels 360 degrees in 60 minutes. The hours hand travels 360 degrees in 12 hours. Once you have the angles (in the appropriate trigonometric units), then you will have to calculate the coordinates of the endpoints of the seconds, minutes and hours hands. Knowing the endpoints and the center of the dial allows you to draw the hands as lines.
Useful methods:
* Math class: Math.sin(..), Math.cos(..), Math.toRadians(...), Math.round(...).
* Graphics class: drawLine, drawOval, fillOval, setColor
Note that applet is animated. So after you set the time, it will start ticking once per second. The code to animate the applet is also being provided to you in the template.
The following image shows an example clock face. The hours hand is in red, the minutes hand is in blue and the seconds hand is in pink.
// MY CODE
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JOptionPane;
import javax.swing.Timer;
import javax.swing.JApplet;
/**
An animated analog clock.
@author
*/
public class Clock extends JApplet
{
private int hour;
private int minute;
private int second;
private final int delay = 1000; //milliseconds
/**
Ask for time input via a dialog box and parse the time input.
@param none
@return void
*/
public void init()
{
hour = 0;
minute = 0;
second = 0;
getTimeFromUser();
startAnimation();
}
/**
Draw the face of the analog clock for current hour and minute.
@param g Graphics context
@return none
*/
public void paint(Graphics g)
{
int width = getWidth();
int height = getHeight();
int midx = width/2;
int midy = height/2;
int midx2 = width/3;
int midy2 = width/3;
// set the radius to be 1/4th of the smaller of width and height.
int radius = Math.min(width, height)/4;
g.setColor(Color.black);
g.drawOval(midx - radius, midy - radius, 2*radius + 1, 2*radius + 1);
g.drawOval(midx - radius, midy - radius, 2*radius + 2, 2*radius + 2);
g.drawOval(midx - radius, midy - radius, 2*radius + 3, 2*radius + 3);
g.drawOval((midx - radius) -1, (midy - radius) -1, 2*radius + 4, 2*radius + 4);
g.drawOval((midx - radius) - 2, (midy - radius) -2 , 2*radius + 5, 2*radius + 5);
g.drawOval((midx - radius) - 2, (midy - radius) -2, 2*radius + 6, 2*radius + 6);
g.drawOval((midx - radius) -3, (midy - radius) -3, 2*radius + 6, 2*radius + 6);
g.drawString(hour + ":" + minute + ":" + second, midx, midy);
String twelve = "12";
int fontWidth = g.getFontMetrics().stringWidth(twelve);
// center the label on the top
g.drawString(twelve, (width - fontWidth)/2, midy - radius + 15);
String six = "6";
int fontWidthSix = g.getFontMetrics().stringWidth(six);
// center the label on the top
g.drawString(six, (width - fontWidthSix)/2, midy + radius - 5);
String three = "3";
// center the label on the top
g.drawString(three, midx - radius + 5, midy);
String nine = "9";
// center the label on the top
g.drawString(nine, midx + radius - 10, midy);
//doing this to make the numbers thicker
//just slightly moving the position of the number
String twelve2 = "12";
int fontWidth2 = g.getFontMetrics().stringWidth(twelve);
// center the label on the top
g.drawString(twelve2, (width - fontWidth2)/2, midy - radius + 14);
String six2 = "6";
int fontWidthSix2 = g.getFontMetrics().stringWidth(six);
// center the label on the top
g.drawString(six2, (width - fontWidthSix2)/2, midy + radius - 4);
String three2 = "3";
// center the label on the top
g.drawString(three2, midx - radius + 4, midy);
String nine2 = "9";
// center the label on the top
g.drawString(nine2, midx + radius - 9, midy);
}
/**
* Create an animation thread that runs once per second
*/
private void startAnimation()
{
ActionListener taskPerformer = new ActionListener() {
public void actionPerformed(ActionEvent evt) {
ticktock();
repaint();
}
};
new Timer(delay, taskPerformer).start();
}
/**
* Increment time by one second and adjust time accordingly.
*/
private void ticktock()
{
second = second + 1;
if (second == 60) {
second = 0;
minute = minute + 1;
if (minute == 60) {
minute = 0;
hour = hour + 1;
if (hour == 12)
hour = 0;
}
}
}
/**
* Ask user to input time to set the clock by a pop-up dialog box.
* Assume that hours are in the range 0..11, minutes in the range 0..59
* and seconds in the range 0..59.
*/
private void getTimeFromUser()
{
String input;
input = JOptionPane.showInputDialog("time (hh:mm:ss):");
if (input == null)
System.out.println("No input");
else
{
try
{
int index1 = input.indexOf(":");
hour = Integer.parseInt(input.substring(0,index1));
int index2 = input.indexOf(":",index1+1);
minute = Integer.parseInt(input.substring(index1+1,index2));
second = Integer.parseInt(input.substring(index2+1,input.length()));
}
catch (NumberFormatException e)
{
System.out.println(e);
}
}
}
}1 answer
- Anonymous askedCustomers... Show more
A2 answers
- Anonymous asked0 answers
- Anonymous askedConsider the following example of the LRU page replacement algorithm. Calculate number of page fault... More »0 answers
- Anonymous askedUsing loop methods "while", "do/while" or "for"
Generate a table of conversion from yen to South Afri... Show moreUsing loop methods "while", "do/while" or "for"
Generate a table of conversion from yen to South African rand. Start the yen column at 100 Y and print 25 lines, with the final line containing the value 10,000 Y. • Show less1 answer
- Anonymous asked1 answer
- Anonymous asked1.Assemble a program that moves immedi... Show moreI need solution to the following assembly language questions:
1.Assemble a program that moves immediate values to each of the 16 and 32 bit registers. Test all the data, segment, index, pointer, and flag registers. Find out which registers cannot be modified and suggest reasons why they cannot be changed directly?
2.Using mov,add and sub instructions, plus appropriate calls to any Irvine library routines necessary to print, assemble a short program that sets carry flag, Perform this once using unsigned addition and once using unsigned subtraction. When using DumpRegs, setting the carry flag is indicated as CF=1.
• Show less0 answers
- Anonymous asked... Show moreDefine a lisp function getgrade that returns the grade of a students specified as argument
Example:
(setf listgrades '( (90006734 70 70) (90006734 71 87) (90006738 65)...... (90006934 95) (90008934 85))
Example: > (getgrade listgrades '90008934)
> 85
• Show less0 answers
- Anonymous askedproba... Show more
Consider Figure 1. Suppose that each link between the server and the client has a packet loss
probability p and the packet loss probabilities for these links are independent.
a) What is the probability that a packet (sent by the server) is successfully received by the
receiver?
b) If a packet is lost in the path from the server to the client, then the server will re-transmit
the packet. On average, how many times will the server re-transit the packet in order for the
client to successfully receive the packet?
c) If a packet is lost, how many links do you expect the packet to traverse before being lost • Show less0 answers
- Anonymous asked1 answer
- Anonymous asked1 answer
- Anonymous asked0 answers
- wordplays asked(g(n)). For the statement below, decide wh... Show more
Assume you are given functions f and g such that f(n) is Ω(g(n)). For the statement below, decide whether you think it is true or false. Give a proof or counterexample.
• Show less1 answer
- OutlanderFeelingStupid askedThe program executes the first two statements then stops. Where am I going wrong?
#include <iostream>... Show moreThe program executes the first two statements then stops. Where am I going wrong?
#include <iostream>
using namespace std;
int main()
{
int numNumber, num, count = 0, pos = 0, neg = 0, z = 0;
// ask user for a number of numbers
cout << "How many numbers will you enter?\n";
cin >> numNumber;
for (count; count <= numNumber; count++)
{
cout << "Enter 1st number.\n";
cin >> num;
count++;
if(count++ == 1)
{
cout << "Enter 2nd number.\n";
cin >> num;
count++;
}
else if (count++ == 2)
{
cout << "Enter 3rd number.\n";
cin >> num;
count++;
}
else if (count++ == 3)
{
cout << "Enter 4th number.\n";
cin >> num;
count++;
}
else if (count++ == 4)
{
cout << "Enter 5th number.\n";
cin >> num;
count++;
}
}
system ("PAUSE");
return 0;
}
• Show less1 answer
- Anonymous askedImplement a class named... Show moreDesign a recursive program that generates all the permutations of a string.
Implement a class named SumPuzzle that includes a null constructor (a constructor definition that takes no arguments). The SumPuzzle class should also contain an instance method named permute(String str, LinkedList lst). The permute method pulls characters from lst in order to grow permutation strings inside str and it uses both iteration and recursion. Your base case should test for an empty lst argument, in which case you can store the str argument in a SumPuzzle attribute that collects all the permutations for you. You don’t need to know how many permutations you’ll be collecting if you use a linked list to collect them all.
The permute method doesn’t have to be a public method. In fact, it should probably be private. The permute method just a workhorse to be used by a public method named allPermutations(string). A call to allPermutations(string) should return a LinkedList containing all possible permutations of the argument string.
Be careful when you test your code – do not try it on strings that are very long. The number of permutations for a string of length n is factorial(n).
If it helps---
PascalSpecs.java
PuzzleSpecs.java • Show less1 answer
- Anonymous asked1 answer
- Anonymous asked1 answer
- Anonymous asked2 answers
- Anonymous asked0 answers
- MachoRabbit5390 askedwirte a program usuing IDEA/ALTER framework, that has four different boxes, all going in four differ... More »0 answers
- Anonymous askedWrite a program to manage a list of students waiting to register for a courses. Operations should in... More »1 answer
- Anonymous asked1 answer
- Anonymous askedWrite and test the code for mysteryFunction that consumes a vector, v, and produces a new vector, w,... Show moreWrite and test the code for mysteryFunction that consumes a vector, v, and produces a new vector, w, of the same length where each element of w is the sum of the corresponding element in v and the previous element in v. For v(1), use 0 as the previous element.
mysteryFunction( [1 4 9 16 25 36]) should return
w = [1 5 13 25 41 61] % 1+0, 4+1, 9+4, 16+9, 25+16, 36+25
what would be the matlab code for this? • Show less1 answer
- Anonymous askedrows forming... Show moreWrite a program that prints isosceles triangles using the character '*'. The number of
rows forming the triangle is determined by the user. For instance, an isosceles triangle with
five rows looks like:
*
***
*****
*******
*********
My failed code so far is this:
#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int main()
{
int n; // Number of rows declared by the user
int i; // Counting variable for number of rows
char star('*'); // Character for triangle
char blank(' '); // Spaces for uniformity
cout << "Enter number of rows: "; // Prompt for entering rows
cin >> n;
// User must enter at least 2
while (n<2)
{
cout << "Number of rows must be at least 2 " << endl;
cout << "Enter number of rows: ";
cin >> n;
}
for (i=2; i<=n; i=i+1)
{
cout << setfill(blank) << setw(n) << blank;
cout << setfill(star) << setw(i*2-1) << star;
cout << blank << endl;
}
return(0);
}
• Show less2 answers
- Anonymous askedA simple medium access control protocol would be to use a fixed assignment timed division multiplexi... Show moreA simple medium access control protocol would be to use a fixed assignment timed division multiplexing (TDM) scheme. Each station is assigned one time slot per cycle for transmission. For the bus, the length of each slot is the time to transmit 100 bits plus the end-to-end propagation delay. For the, ring assume a dealy of 1 bit time per station, and asuume that a round-robin assignment is used. Stations monitor all time slots for reception. Assume a propagation time of 2 x 10^8 m/s. For N stations, what are the limitation and throughput per station for a 1-km, 10-Mbps baseband bus?
• Show less1 answer
- Anonymous askedAssuming there is an algorithm called SELECT that determines the ith smallest of an input array of n... Show moreAssuming there is an algorithm called SELECT that determines the ith smallest of an input array of n>1 distinct elements by dividing the n elements of the input array into n/5 groups of 5 elements each and at most on group made up of the remaining n mod 5 elements. Find the median of each of the n/5 groups by first insertion sorting the elements of each group and then picking the median from the sorted list of group elements. We would use SELECT recursively to find the median x of the n/5 medians found in step 2. Partitions the input array around the median-of-medians x using partition. Let k be one more than the number of elements on the low side of the partition, so that x is the kth smallest element and there are n-k elements on the high side of the partition. If i=l then return x. Otherwise use SELECT recursively to find the ith smallest element on the low side of i<k or the (i-k)th smallest element on the high side if i>k.
What is the upper bound if the number of groups of 3 • Show less1 answer
- Anonymous askedWrite a program that will read any valid data set (of the 3 data types). After reading the data (whi... Show moreWrite a program. Any help would be appreciated even psuedocode.
For our example data, we can have (and in the order listed) sea surface temperature, salinity, and sea surface height. If we use a 1 to mean the data set is present and a 0 to mean it is not and follow that with the data set sizes:
1 1 0 40
• Show less0 answers
- Anonymous askedYou are given an array A of n distinct integers, and an integer k such that 1<=k<=n. The squar... More »1 answer
- Anonymous askedGiven: two unordered multisets A and B... Show moreI have a two part homework question I am trying to figure out.
Given: two unordered multisets A and B of n integers each (sets where repeated elements are allowed). Two multisets are said to be identical if each integer occurs the same number of times in both sets.
Goal: Design an algorithm that decides if the multisets are identical.
Assume all integers in the multisets are in the range [0..M) for some positive integer M
a) Make the algorithm run in O(nlogn) time
***Am I correct in assuming that simply using mergesort I can sort each multiset and then do n comparisons to test along each element if they are the same integer, and if they are different then the elements are incorrect?
b) Use universal hashing to design a randomized algorithm that takes worst case O(n) time does this: If A and B are identical then the algorithm always outputs YES and if they are not it outputs NO with probability at least 99/100. Assume that performing addition, multiplication and mod operations on integers in the range 0 through O((n_M)^2) takes unit time. • Show less1 answer
- Anonymous asked(x +... Show moreFind a cube root of x3 where x =2
Set x3 = 3
add x3 to both sides
2 x3 = x3 + 3
divide by 2 x2
x = ½(x + 3/x2)
Iterate 20 times.
Once you have that working place it in another loop based on the method shown in Display 2.14 in the Savitch book. This means you will have one loop (cube root) inside of another loop.
show, (flow chart), code and execution .
• Show less0 answers
- Anonymous askedIf 23 persons are chosen at random, then the chanc... Show more
The birthday paradox can be described as follows:• Show less
If 23 persons are chosen at random, then the chances are more than 50% that at least two will have the same birthday!
When they first hear this stated, most persons have trouble believing it and are unconvinced by mathematical proofs1. The program that you write for this assignment will allow you to test the birthday paradox to see if it is really true. This will be done by simulating birthdays with random numbers between 1 and 365.
Your main program should display a menu that reads as follows:
1) Explain birthday paradox
2) Check birthday paradox by generating 1000 sets of birthdays
3) Display one set of 23 birthdays
E) Exit
If option 2) is selected, the output would be something like this:
Generating 1000 sets of 23 birthdays and checking for matches...
Results : 511 out of 1000 (51.1%) of the sets contained matching birthdays
=============================================================================
If option 3) is selected, the program will display the results in chronological order with matches indicated. The output should needs to look like this:
Here are the results of generating a set of 23 birthdays
============================================================
January 2 January 5 January 12
January 25 February 3 February 6
February 12 February 17 March 8
April 4 April 12 June 3
June 12 July 3 August 4
September 3 September 9 September 25
(2) October 12 October 16 October 22
December 22
Hints and Suggestions:
* A "birthday" can be viewed as a random integer between 1 and 365. Recall that there is function named "rand()" in stdlib that can be used to generate such random numbers. The expression "1 + (rand() % 365)" yields a random number that is between 1 and 365 inclusive. You should use the srand() function, but be sure to not to call it more than once!
* As a bottom-up exercise, I recommend that you write the following function.
void ConvertDayOfYear (int DayOfYear, // "Converts" a day of the year, such as 32
int &MonthNumber, // to a MonthNumber, 2 and a DayOfMonth, 1
int &DayOfMonth)
* We'll do a top-down design in class that will make your work go more smoothly. The Selection Sort code can be found on website. (also inline function swap is there)
* Write one function at a time!1 answer
- Anonymous askedbyte_pointer valp = (byte_poin... Show moreconsider the following three calls to show_bytes:
int val = 0x87654321
byte_pointer valp = (byte_pointer) &val;
show_bytes(valp, 1); /*A*/
show_bytes(valp, 2); /*B*/
show_bytes(valp, 3); /*C*/
Indicate which of the following values will be printed by each call on a little endian machine and on a big endian machine. • Show less1 answer
- Anonymous askedIn a system using paged memory management , the size of logical address space os 32MB.The page table... Show more
In a system using paged memory management , the size of logical address space os 32MB.The page table entries are 32 bits.the page offset assuming an optimal page size being used is having• Show less
a) 12 bits b)10 bits c)14 bits d)20 bits0 answers
- Anonymous askedDesign and implement a program that counts tyhe number of punctuation marks in a text input file. P... More »1 answer
- Anonymous askedI am having difficulty with declaring functions. I want to end a function, but with the result of th... More »1 answer
- Anonymous askeds on a 4-variable Karnaug... Show more
Given a logic expression f(a,b,c,d) = m(0,1,3,5,6,7,11,12,14)• Show less
1. Plot the 1’s on a 4-variable Karnaugh map.
2. List all the prime implicants.
3. Make sure you understand the instructions in the notes.
4. Use the following table to follow those instructions to find all the essential prime implicants and fill out the table.
Choose a minterm What are the adjacent minterm(s)? Does there exist a prime implicant that covers this minterm and all of its neighbors? If yes, what is it?
1 A’B’C’D’
2 A’B’CD
3 A’BC’D
4 A’BCD’
5 ABC’D’
6 AB’CD
5. Can those essential prime implicants cover all the 1’s? If not, please choose a minimum number of other prime implicant(s) to cover the rest of the 1’s.1 answer
- Anonymous asked1. Prompts a user to e... Show moreUsing If/else and switch statements, write a program that does the following:
1. Prompts a user to enter two double-digit numbers,
2. Determines the largest of the two numbers entered,
3. Then prints the largest in word format.
Hint: Look at each digit separately and use a switch statement to print each part of your double digit number (ie twenty, thirty, forty and so on for the first digit, -one, -two, -three and so on for the second digit). Remember that 11-19 must be treated differently!
• Show less2 answers
- Anonymous askedwe studied a version of the merge operation that runs in constant time if the last element in the fi... Show morewe studied a version of the merge operation that runs in constant time if the last element in the first subarray is less than or equal to the first element in the second subarray. Prove that a recursive implementation of mergesort that uses this version of merge will run in linear time on an already-sorted array.
• Show less0 answers
- Anonymous askedIntroduction: For this machine problem, you will be writing a simple C program to... Show moreProblem Statement
Introduction: For this machine problem, you will be writing a simple C program to approximate the function sin(x). The user of your program should be prompted to enter a number x, and your program should approximate and print out the value of sin(x).
Algorithm: We will use the Taylor series approximation for the value of sin(x):
sin(x) = x - x^3/3! + x^5/5! - x^7/7! + … x^n/n!
where n is the degree of the Taylor polynomial and x is an angle in radians. The higher the degree, the closer the approximation is to the actual value of sin(x). Note that the error of the approximation is no larger than
|x|^(n+2)/(n + 2)!
This fact is important for Checkpoint 2.
Checkpoint 2
For the second checkpoint, you will modify and extend your code for checkpoint 1. You will need to modify the code to read in a second number, r, from the user. This should be read immediately after x is read. This second number represents the desired maximum error. You then should modify your code to use a loop to calculate the approximation. You will need to add enough terms so that the error of your approximation is no larger than r. Finally, you will also need to print out
the value of n used to compute the approximation.
I cannot construct a loop for the formula sin_(x) and the approximation.
this should not use math.h. so should be done with loop.
please tell me the code in C lang. • Show less1 answer
- Anonymous askedI want to know the Importance of Principles of programming languages along with its Objective and Ou... More »1 answer
- Anonymous asked0 answers
- yassermohammed askedFile names and extensions. Write a program that prompts the user for the drive letter (c), the path ... More »1 answer
- VietSubject askedI need help drawing a flowchart to find all positive prime integers up to 2000 and output the intege... Show moreI need help drawing a flowchart to find all positive prime integers up to 2000 and output the integers as they are found. assume 1 and 2 are prime already.
start
declarations
input
output
stop • Show less1 answer | http://www.chegg.com/homework-help/questions-and-answers/computer-science-archive-2011-february-08 | CC-MAIN-2014-23 | refinedweb | 4,276 | 64 |
Suppose you have a Javascript variable containing multiple lines of text that you want to render in your React component. More or less you would have the following code:
const text = `This is a long string of text and it
includes new line characters. We want this text
to display properly using React.
`;
function App() {
return (
<p>{text}</p>
);
}
If you try to run this example you will easily notice that, despite the text being on multiple lines, the output is displayed on one single line:
This is a long string of text and it includes…
Se siete diretti in Canada per trascorrere la vostra vacanza avete bisogno di alcuni documenti che vi consentiranno di passare i controlli doganali e quindi di entrare in Canada. Ovviamente uno di questi è il passaporto, il quale deve essere valido per la durata del soggiorno e scadere almeno 6 mesi dopo il vostro arrivo sul territorio canadese.
Oltre a questo avrete bisogno di un permesso, che varia a seconda della motivazione della vostra visita. Esistono principalmente due tipologie di permesso, il classico visto temporaneo, o Temporary Resident Visa, e l’Electronic Travel Authorization, detta anche eTA.
I due permessi non…
A little truth that not everybody knows is that you’re unlikely to know what happens in your application until you actually look at your application while it is running. It doesn’t matter if you are the developer that wrote most of the application code, todays applications might be so complex that what happens behind the scene is hard to picture.
A story that supports this statements happened a week ago, when I started looking into the code that performs the server side rendering of an application. “It’s straightforward and it works fine” I thought, “after all it’s less than one…
As developers we only have one way to be certain that our code works, we test it. Since it’s very likely that we will make mistakes, testing comes in our help to ensure that we do not end up pushing a broken application in the hand of our users.
Thousands of blog posts has been written around unit testing React components, Redux reducers, action creators or sagas. But when I started documenting myself around automated end-to-end testing I couldn’t find a solution used by most of the people in the React community. …
I was initially skeptic about the CSS-in-JS solutions that were recently gaining popularity. Probably I was overestimating the benefits of working with a toolset that I already knew, SASS, compared to the many benefits JSS brings to a React project. Anyway, after some internal team discussions, we decided to give JSS and its React integration (react-jss) a chance.
At the beginning not everything was straightforward: here is how we managed to solve some of the problems we discovered.
I decided to leave Medium and move my articles to my personal blog.
You can read the rest of this article here.
I decided to leave Medium and move my articles to my personal blog.
You can read the rest of this article here..
I decided to leave Medium and move my articles to my personal blog.
You can read the rest of this article here.
If you come from object-oriented programming, one of the weird things about Elixir and other functional programming languages is for sure immutability.
In many of those, we are allowed to assign a value to a variable and then change it during the execution of a program.
I decided to leave Medium and move my articles to my personal blog.
You can read the rest of this article here. | https://medium.com/@darioghilardi?source=rss-46f08dda19fe------2 | CC-MAIN-2021-39 | refinedweb | 613 | 58.21 |
easy to handle this type of program but i want to combine student detail forms how???????????
ur solution is having some mistake the checkbox class should not have a public class.........
your web is good and i have goten more from your website
Post your Comment
How to create CheckBox On frame
How to create CheckBox On frame
...
will learn how to create CheckBox on the frame. In the Java AWT, top-level
windows... can
learn in very efficient manner.
In this section, you will see how to create
Frame
Frame Michael wants to create a Java application with the following requirements:
1.Two labels representing name and age.
2.Two textboxes accepting name and age. The textbox accepting age should accept maximum 2 values.
3.A
Creating a Frame
, calender, combobox checkbox and many more
for creating GUI in Java based...;
Setting the Icon for a Frame
Showing a Dialog Box
... an Icon to a JButton Component
Making a Frame
Non-Resizable
how to create frame in swings
how to create frame in swings how to create frame in swings
JSP CheckBox
JSP CheckBox
JSP CheckBox is used to create a CheckBox in JSP... checkbox and also print the
userdefined message that specify the languages option
UIButton checkbox
UIButton checkbox iPhone UIButton checkbox example required.. can any one please explain me.. how to create a checkbox button using UIButton in XIB
JSP Checkbox
JSP Checkbox
In this tutorial you will learn how to create a checkbox using...
selection always go for checkbox. Using the example we will try to understand
how
Create a Frame in Java
Create a Frame in Java
Introduction
This program shows you how to create a frame in java AWT package. The frame in java works like the main window where your
add button to the frame - Swing AWT
(Exception e) {
e.printStackTrace();
}
// Create table with database data
JFrame frame = new JFrame("View Patients...("The checkbox state changed to " + myCheckBox.isSelected());
else
Dojo Checkbox
Dojo Checkbox
In this section, you will learn how to create a
checkbox in dojo. For creating checkbox you require "dijit.form.CheckBox".
The checkbox button do
How to Create Button on Frame
How to Create Button on Frame
In this section, you will learn how to create Button
on frame the topic of Java AWT
package. In the section, from the generated output
checkbox
checkbox how to insert multiple values in database by using checkbox in jsp
To Create a Frame with Preferences
To Create a Frame with Preferences
In this section you will learn how to
use the preferences in frame... with frame window. the required package to use
the preferences with frame window
Adding checkbox to List as item
Adding checkbox to List as item can we add checkox to List
Hi Friend,
Try the following code:
import java.awt.*;
import javax.swing.... main(String args[]) {
JFrame frame = new JFrame
Creating a Frame
Creating a Frame : Swing Tutorials
This program shows you how to create a frame in Java Swing...;javax.swing.*;
public class Swing_Create_Frame{
public
jQuery Multiple Checkbox Select / Deselect
");
}
});
});
jQuery Multiple Checkbox Select / Deselect
In this section, you will learn how to create multiple checkbox group which
select/deselect the group...);
});
// if all checkbox are selected, check the selectall checkbox
java swing-action on checkbox selection
java swing-action on checkbox selection I am working in netbeans... main(String args[]) {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JCheckBox checkBox = new JCheckBox(des
will be able to know what is JSP checkbox and also how it works in creating a checkbox... CheckBox'. To understand and grasp the example we create a CheckBox.jsp that include the html tag <input type="checkbox"> to create the checkboxes
call frame - Java Beginners
call frame dear java,
I want to ask something about call frame to another frame and back to first frame.
I have FrameA and FrameB. In frameA..._DECORATIONS = "ws_dec";
protected final static String CREATE_WINDOW = "new
Checkbox Problem--Please Check this - JSP-Servlet
Checkbox Problem I am facing a problem while creating a check box in JavaScript. Can any one share the part of code to create a checkbox in JavaScript
delete multiple row using checkbox
checkbox
We are providing you the code where we have specified only three fields bookid,author and title in the database.
1) Create book.jsp
<%@page... i=0; while(rs.next()){ %>
<tr><td><input type="checkbox" name
Radio Button in Java
by the user.
The AWT Widget used to create a radio button is Checkbox. The Checkbox
class is used by the AWT to create both Radio Button and Checkbox... a RadioButton,we need to
create a Checkbox first, followed by adding Radio Button
FRAME
FRAME WHILE I'M RUNNINGFILE OF A GUI PROGRAMME(JDBC CONNECTION) INSTEAD OF OUTPUT FRAME ONLY TWO BLANK FRAMES ARE GETTING DISPLAYD... CAN ANYONE HELP ME TO SOLVE DS PROBLEM
insert data in the database using checkbox
the database using servlet on the jsp page and there is checkbox corresponding each row but the problem is that i am not fetching data in any textboxes so how... and title in the database. Follow these steps to update these fields:
1) Create
Dropdown Checkbox list
Dropdown Checkbox list
This tutorial explains how to create jquery Dropdown Checkbox list in JSP.
This example is created in eclipse IDE and run... jquery Dropdown Checkbox list. The application directory structure should look like
frame
frame how to creat a frame in java
Hi Friend,
Try the following code:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
class RetrieveDataFromTextFields{
public static void main(String[] args
java programming lanuagedeepak kumar sana March 19, 2013 at 3:00 PM
easy to handle this type of program but i want to combine student detail forms how???????????
checkbox framearbind sahu January 5, 2012 at 1:38 PM
ur solution is having some mistake the checkbox class should not have a public class.........
java2Bilawal August 22, 2013 at 12:02 AM
your web is good and i have goten more from your website
Post your Comment | http://www.roseindia.net/discussion/18435-How-to-create-CheckBox-On-frame.html | CC-MAIN-2015-06 | refinedweb | 1,011 | 60.75 |
![if gte IE 9]><![endif]>
Hi all
I'm trying to consume a web service running on port 8080. When loading the WSDL directly from HTTP it works great:
hServer:CONNECT("-WSDL").
But when we save this exact same WSDL definition to a file and use the file instead, e.g:
hServer:CONNECT("-WSDL /tmp/mywsdl")
The WSDL loads, but whenever we try to run something on it (i.e. consume a service) it fails.
I've done some network traces and found that it's making the call on port 8080 when using the http address directly, but when using the file it's going back to port 80 - and fails.
The port number is defined in the WSDL file itself:
<wsdl:service<wsdl:port<soap:address location="mip-vpm.mip.co.za:8080/.../wsdl:service>
Any idea how to fix this? Is this a bug?
OE11.3.3 CentOS7 64-bit and Windows 32-bit.
Regards
Johan
I am using 11.6.3
The documentation states the following about additional parameters -Service and -Port (documentation.progress.com/.../index.html
-Service service-name
The local name of the service element within the WSDL document that the application will use. This field is optional. Many WSDL documents only support one service and this parameter is optional if there is only one (or zero) service elements defined. Used in conjunction with -Port.
-Port port-name
The local name of the port element contained within the service element. Used in conjunction with -Service. This parameter is optional if -Service contains only one port.
And also:
Connection parameter combinations
The CONNECT( ) method is used to connect an ABL SERVER object to a specific application service. This service can be either an AppServer or a Web service. Independent of the type of application service to which the client is connecting, the client needs to provide the location of the service and transport information. There are two mechanisms for providing this information when connecting to a Web service:
1. The CONNECT( ) method can identify a specific service element name and port element name from the WSDL document. The combination of these two element names identify the location of a set of operations that are available on the Web service. It also identifies the transport data. The service element name is specified with the -Service connection parameter and the port element name is specified with the -Port connection parameter.
If the WSDL document contains several service elements, the CONNECT method must identify which service element the client wants to connect to, via -Service. If the WSDL document only identifies one service element, the CONNECT method does not need to contain the service element name. Similarly if the WSDL document (or if the identified service element) only identifies one port element, the CONNECT method does not need to contain the port element name.
If the application needs to provide account name and password information, it can accomplish this by providing the account name and password information in the -SoapEndpointUserid and -SoapEndpointPassword parameters.
If the WSDL document identifies multiple service elements with the same local name, the CONNECT ( ) method must also contain the -ServiceNamespace connection parameter.
2. If the WSDL document contains several binding elements, the CONNECT method must identify which binding element the client wants to use, via the -Binding parameter. If the WSDL document only identifies one binding element, the CONNECT method does not need to contain the binding element name.
If the WSDL document identifies multiple binding elements with the same local name, the CONNECT( ) method must also contain the -BindingNamespace connection parameter.
So the question is, does your WSDL file contain more than one service/binding?
If so, you should address these parameters accordingly.
No there is only one service/binding.
My question is why does it work when you use the URI directly, but it doesn't work if you use a file with exactly the same contents of the URI?
hmm I did get this to work, the response that I get back is a SOAP response (being an invalid username/password):
def var hServer as handle no-undo.
def var hAuth as handle no-undo.
def var username as character.
def var password as character.
def var blaat as character.
create server hServer.
hServer:CONNECT("-WSDL c:\temp\Auth.xml").
IF NOT hServer:CONNECTED() THEN DO:
MESSAGE "is not connected"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
RETURN.
END.
/* use the Port type name here to create proxy and set a handle to it */
RUN Auth SET hAuth ON hServer.
RUN login IN hAuth(input username, input password, output blaat).
IF NOT VALID-HANDLE(hAuth) THEN DO:
MESSAGE "PortType: " VALID-HANDLE(hAuth) " is not valid"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
RETURN.
END.
Interesting. What version of OE are you using? It's not working in OE13.3.
*11.3.3
Thanks. So somewhere between 11.3.3 and 11.6.3 this was fixed. | https://community.progress.com/community_groups/openedge_development/f/19/t/29292 | CC-MAIN-2017-34 | refinedweb | 825 | 57.47 |
Ok people: it's time to make our React app legit, by loading and saving data to the server via AJAX. Our Symfony app already has a functional set of API endpoints to load, delete and save rep logs. We're not going to spend a lot of time talking about the API side of things: we'll save that for a future tutorial. That's when we'll also talk about other great tools - like ApiPlatform - that you won't see used here.
Anyways, I want to at least take you through the basics of my simple, but very functional, setup.
Open
src/Controller/RepLogController.php. As you can see, we already have API endpoints for returning all of the rep logs for a user, a single rep log, deleting a rep log and adding a new rep log. Go back to the browser to check this out:
/reps. Boom! A JSON list of the rep logs.
This endpoint is powered by
getRepLogsAction(). The
findAllUsersRepLogModels() method lives in the parent class -
BaseController, which lives in this same directory. Hold Command or Ctrl and click to jump into it.
The really important part is this: I have two rep log classes. First, the
RepLog entity stores all the data in the database. Second, in the
Api directory, I have another class called
RepLogApiModel. This is the class that's transformed into JSON and used for the API: you can see that it has the same fields as the JSON response.
The
findAllUsersRepLogModels method first queries for the
RepLog entity objects. Then, it loops over each and transforms it into a
RepLogApiModel object by calling another method, which lives right above this. The code is super boring and not fancy at all: it simply takes the
RepLog entity object and, piece by piece, converts it into a
RepLogApiModel.
Finally, back in
getRepLogsAction(), we return
$this->createApiResponse() and pass it that array of
RepLogApiModel objects. This method also lives inside
BaseController and it's dead-simple: it uses Symfony's serializer to turn the objects to JSON, then puts that into a
Response.
That's it! The most interesting part is that I'm using two classes: the entity and a separate class for the serializer. Having 2 classes means that you need to do some extra work. However... it makes it really easy to make your API look exactly how you want! But, in a lot of cases, serializing your entity object directly works great.
So here's our first goal: make an API request to
/reps and use that to populate our initial
repLogs state so that they render in the table.
In the
assets/js directory, create a new folder called
api and then a new file called
rep_log_api.js. This new file will contain all of the logic we need for making requests related to the rep log API endpoints. As our app grows, we might create other files to talk to other resources, like "users" or "products".
You probably also noticed that the filename is lowercase. That's a minor detail. This is because, instead of exporting a class, this module will export some functions... so that's just a naming convention. Inside, export function
getRepLogs().
The question now is... how do we make AJAX calls? There are several great libraries that can help with this. But... actually... we don't need them! All modern browsers have a built-in function that makes AJAX calls super easy. It's called
fetch()!
Try this: return
fetch('/reps').
fetch() returns a
Promise object, which is a super important, but kinda-confusing object we talked a lot about in our ES6 tutorial. To decode the JSON from our API into a JavaScript object, we can add a success handler:
.then(), passing it an arrow function with a
response argument. Inside, return
response.json().
With this code, our
getRepLogs() function will still return a
Promise. But the "data" for that should now be the decoded JSON. Don't worry, we'll show this in action.
By the way, I mentioned that
fetch is available in all modern browsers. So yes, we do need to worry about what happens in older browsers. We'll do that later.
Go back to
RepLogApp. Ok, as soon as the page loads, we want to make an AJAX call to
/reps and use that to populate the state. The constructor seems like a good place for that code. Oh, but first, bring it in:
import { getRepLogs } from
../api/rep_log_api. For the first time, we're not exporting a
default value: we're exporting a named function. We'll export more named functions later, for inserting and deleting rep logs.
Oh, and, did you see how PhpStorm auto-completed that for me? That was awesome! And it wasn't video magic: PhpStorm was cool enough to guess that correct import path.
Down below, add
getRepLogs() and chain
.then(). Because we decoded the JSON already, this should receive that decoded
data. Just log it for now.
Ok... let's try it! Move over and, refresh! Oof! An error:
Unexpected token in JSON at position zero
Hmm. It seems like our AJAX call might be working... but it's having a problem decoding the JSON. It turns out, the problem is authentication. Let's learn how to debug this and how to authenticate our React API requests next. | https://symfonycasts.com/screencast/reactjs/fetch | CC-MAIN-2020-05 | refinedweb | 899 | 75.71 |
The for-loop in R, can be very slow in its raw un-optimised form, especially when dealing with larger data sets. There are a number of ways you can make your logics run fast, but you will be really surprised how fast you can actually go.
This posts shows a number of approaches including simple tweaks to logic design, parallel processing and
Rcpp, increasing the speed by orders of several magnitudes, so you can comfortably process data as large as 100 Million rows and more.
Lets try to improve the speed of a logic that involves a for-loop and a condition checking statement (if-else) to create a column that gets appended to the input data frame (df). The code below creates that initial input data frame.
# Create the data frame col1 <- runif (12^5, 0, 2) col2 <- rnorm (12^5, 0, 2) col3 <- rpois (12^5, 3) col4 <- rchisq (12^5, 2) df <- data.frame (col1, col2, col3, col4)
The logic we are about to optimise:
For every row on this data frame (df), check if the sum of all values is greater than 4. If it is, a new 5th variable gets the value “greater_than_4”, else, it gets “lesser_than_4”.
# Original R code: Before vectorization and pre-allocation system.time({ for (i in 1:nrow(df)) { # for every row if ((df[i, 'col1'] + df[i, 'col2'] + df[i, 'col3'] + df[i, 'col4']) > 4) { # check if > 4 df[i, 5] <- "greater_than_4" # assign 5th column } else { df[i, 5] <- "lesser_than_4" # assign 5th column } } })
All the computations below, for processing times, were done on a MAC OS X with 2.6 Ghz processor and 8GB RAM.
Vectorise and pre-allocate data structures.
# after vectorization and pre-allocation output <- character (nrow(df)) # initialize output vector system.time({ for (i in 1:nrow(df)) { if ((df[i, 'col1'] + df[i, 'col2'] + df[i, 'col3'] + df[i, 'col4']) > 4) { output[i] <- "greater_than_4" } else { output[i] <- "lesser_than_4" } } df$output})
Raw Code Vs With vectorisation:
Take statements that check for conditions (if statements) outside the loop
Taking the condition checking outside the loop the speed is compared against the previous version that had vectorisation alone. The tests were done on dataset size range from 100,000 to 1,000,000 rows. The gain in speed is again dramatic.
# after vectorization and pre-allocation, taking the condition checking outside the loop. output <- character (nrow(df)) condition <- (df$col1 + df$col2 + df$col3 + df$col4) > 4 # condition check outside the loop system.time({ for (i in 1:nrow(df)) { if (condition[i]) { output[i] <- "greater_than_4" } else { output[i] <- "lesser_than_4" } } df$output <- output })
Condition Checking outside loops:
Run the loop only for True conditions
Another optimisation we can do here is to run the loop only for condition cases that are ‘True’, by initialising (pre-allocating) the default value of output vector to that of ‘False’ state. The speed improvement here largely depends on the proportion of ‘True’ cases in your data.
The tests compared the performance of this against the previous case (2) on data size ranging from 1,000,000 to 10,000,000 rows. Note that we have increase a ‘0’ here. As expected there is a consistent and considerable improvement.
output <- character(nrow(df)) condition <- (df$col1 + df$col2 + df$col3 + df$col4) > 4 system.time({ for (i in (1:nrow(df))[condition]) { # run loop only for true conditions if (condition[i]) { output[i] <- "greater_than_4" } else { output[i] <- "lesser_than_4" } } df$output })
Running Loop Only On True Conditions:
Use ifelse() whenever possible
You can make this logic much simpler and faster by using the
ifelse() statement. The syntax is similar to the
if function in MS Excel, but the speed increase is phenomenal, especially considering that there is no vector pre-allocation here and the condition is checked in every case. Looks like this is going to be a highly preferred option to speed up simple loops.
system.time({ output <- ifelse ((df$col1 + df$col2 + df$col3 + df$col4) > 4, "greater_than_4", "lesser_than_4") df$output <- output })
True conditions only vs ifelse:
Using which()
By using
which() command to select the rows, we are able to achieve one-third the speed of
Rcpp.
# Thanks to Gabe Becker system.time({ want = which(rowSums(df) > 4) output = rep("less than 4", times = nrow(df)) output[want] = "greater than 4" }) # nrow = 3 Million rows (approx) user system elapsed 0.396 0.074 0.481
Use apply family of functions instead of for-loops
Using apply() function to compute the same logic and comparing it against the vectorised for-loop. The results again is faster in order of magnitudes but slower than
ifelse() and the version where condition checking was done outside the loop. This can be very useful, but you will need to be a bit crafty when handling complex logic.
# apply family system.time({ myfunc <- function(x) { if ((x['col1'] + x['col2'] + x['col3'] + x['col4']) > 4) { "greater_than_4" } else { "lesser_than_4" } } output <- apply(df[, c(1:4)], 1, FUN=myfunc) # apply 'myfunc' on every row df$output <- output })
apply function Vs For loop in R:
Use byte code compilation for functions cmpfun() from compiler package, rather than the actual function itself
This may not be the best example to illustrate the effectiveness of byte code compilation, as the time taken is marginally higher than the regular form. However, for more complex functions, byte-code compilation is known to perform faster. So you should definitely give it a shot.
# byte code compilation library(compiler) myFuncCmp <- cmpfun(myfunc) system.time({ output <- apply(df[, c (1:4)], 1, FUN=myFuncCmp) })
apply vs for-loop vs byte code compiled functions:
Use Rcpp
Lets turn this up a notch. So far we have gained speed and capacity by various strategies and found the most optimal one using the
ifelse() statement. What if we add one more zero? Below we execute the same logic but with
Rcpp, and with a data size is increased to 100 Million rows. We will compare the speed of
Rcpp to the
ifelse() method.
library(Rcpp) sourceCpp("MyFunc.cpp") system.time (output <- myFunc(df)) # see Rcpp function below
Below is the same logic executed in C++ code using Rcpp package. Save the code below as “MyFunc.cpp” in your R session’s working directory (else you just have to sourceCpp from the full filepath). Note: the
// [[Rcpp::export]] comment is mandatory and has to be placed just before the function that you want to execute from R.
// Source for MyFunc.cpp #include
using namespace Rcpp; // [[Rcpp::export]] CharacterVector myFunc(DataFrame x) { NumericVector col1 = as (x["col1"]); NumericVector col2 = as (x["col2"]); NumericVector col3 = as (x["col3"]); NumericVector col4 = as (x["col4"]); int n = col1.size(); CharacterVector out(n); for (int i=0; i 4){ out[i] = "greater_than_4"; } else { out[i] = "lesser_than_4"; } } return out; }
Rcpp speed performance against
ifelse:
Use parallel processing if you have a multicore machine
Parallel processing:
# parallel processing library(foreach) library(doSNOW) cl <- makeCluster(4, type="SOCK") # for 4 cores machine registerDoSNOW (cl) condition <- (df$col1 + df$col2 + df$col3 + df$col4) > 4 # parallelization with vectorization system.time({ output <- foreach(i = 1:nrow(df), .combine=c) %dopar% { if (condition[i]) { return("greater_than_4") } else { return("lesser_than_4") } } }) df$output <- output
Remove variables and flush memory as early as possible
Remove objects
rm() that are no longer needed, as early as possible in code, especially before going in to lengthy loop operations. Sometimes, flushing
gc() at the end of each iteration with in the loops can help.
Use data structures that consume lesser memory
Data.table() is an excellent example, as it reduces the memory overload which helps to speed up operations like merging data.
dt <- data.table(df) # create the data.table system.time({ for (i in 1:nrow (dt)) { if ((dt[i, col1] + dt[i, col2] + dt[i, col3] + dt[i, col4]) > 4) { dt[i, col5:="greater_than_4"] # assign the output as 5th column } else { dt[i, col5:="lesser_than_4"] # assign the output as 5th column } } })
Speed Summary
Method: Speed, nrow(df)/time_taken = n rows per second
Raw: 1X, 120000/140.15 = 856.2255 rows per second (normalised to 1)
Vectorised: 738X, 120000/0.19 = 631578.9 rows per second
True Conditions only: 1002X, 120000/0.14 = 857142.9 rows per second
ifelse: 1752X, 1200000/0.78 = 1500000 rows per second
which: 8806X, 2985984/0.396 = 7540364 rows per second
Rcpp: 13476X, 1200000/0.09 = 11538462 rows per second
The numbers above are approximate and are based in arbitrary runs. The results are not calculated for
data.table(), byte code compilation and parallelisation methods as they will vary on a case to case basis, depending upon how you apply... | https://www.r-bloggers.com/strategies-to-speedup-r-code/ | CC-MAIN-2016-36 | refinedweb | 1,438 | 60.24 |
I would like to raise a flag here.
Stated the Groovy documentation a Gstring can be resolved both in a eager
and lazy manner:
def number = 1 def eagerGString = "value == ${number}"def lazyGString
= "value == ${ -> number }"
assert eagerGString == "value == 1" assert lazyGString == "value == 1"
number = 2 assert eagerGString == "value == 1"assert lazyGString ==
"value == 2"
The example you are reporting should *already* be reasolved eagerly and I
can agree that it can be confusing.
However the ability to resolve a GString lazily it's a very important
Groovy feature for DSL builders. Wipe it out would have a serious impact
(read destroy) on existing frameworks that rely on that feature.
Cheers,
Paolo | http://mail-archives.apache.org/mod_mbox/groovy-dev/201809.mbox/%3CCADgKzdwd_kjAxrcNYvU=qHtf_fnL0R0c8x-Ri81koDvpuit_1g@mail.gmail.com%3E | CC-MAIN-2019-51 | refinedweb | 110 | 52.73 |
jhaml
Joe's HTML Abstraction Markup Language, a DSL/template engine to reduce the tedium of copious, partially redundant HTML templates
jhaml.js
Jhaml.js is a JavaScript implementation of Joe's HTML abstraction markup language, a domain specific language for HTML templating by Joe Langeway.
You can use it. The license is the MIT license.
Jhaml was developed with input from Jamal Williams and Clint Zehner to reduce the tedium of writing copious HTML templates.
What Jhaml is
Jhaml is a notation for defining named templates which can call to each other like functions, passing named arguments with dynamic scope. Compiling some jhaml notation results in template functions becoming available on a templates object. Other template functions on that object can be called by jhaml templates as though they were also notated in jhaml. A particular application may run many independent instances of jhaml/jhaml-templates-objects.
What Jhaml.js is
Jhaml.js is a JavaScript implementation of the jhaml notation. It is structured as a require.js module which exports one constructor. To make a jhaml.js object simply "new" that constructor. The resulting jhaml.js object will have a templates object as a property and a compile method. Feed jhaml notation to the compile method, and template functions show up on the templates object. See jhaml_tests.html and jhaml_demo.html for example usage.
What Jhaml is and is not for
Jhaml is intended to solve the problem of quickly generating and maintaining HTML structure. It purposefully does not make it easy to put policy in templates. It is intended to sit on top of a view model of some sort which will contain any such logic.
It defines functions which return strings. It does not interact with the DOM. It does not update in place.
There are lots of JavaScript frameworks. This isn't one of them. It's a DSL for making HTML and it's an opinionated template engine.
How to get it
npm install jhaml
You can then require jhaml as a node.js module or in the browser as a requirejs module. It currently requires underscore, requirejs, and amdefine. NPM will get all those for you.
Brief tutorial
See jhaml_tests.js and jhaml_demo.js for the big picture. Here is a quick introduction to the notation.
Template functions are defined by "def" statements. So this:
def fDiv { div }
is equivalent to this:
jhaml.templates.fDiv = function(args) { return '<div></div>'; };
HTML tags are defined by tag names optionally followed by id's, classes, or attributes just as they would be given in a css query. So this:
li#listItem1.style1.style2[data-item="1"]
would result in HTML like this:
<li id="listItem1" class="style1 style2" data-</li>
Tags are given contents with curly braces. So this:
div { span }
would result in HTML like this:
<div><span></span></div>
Literal HTML can be included between tildes like this:
div.wrap { span.text { ~Text content~ } }
Consecutive tags or literals are siblings. So this:
div.wrap { p { ~paragraph 1~ } p { ~paragraph 2~ ~more~ } }
would result in HTML like this:
<div class="wrap"><p>paragraph 1</p><p>paragraph 2more</p></div>
Arguments can be referenced with an @ sign. So this:
def fDiv { div { @content.html } }
is equivalent to this:
jhaml.templates.fDiv = function(args) { return '<div>' + args.content.html + '</div>'; };
Arguments can be references and HTML escaped by including a tilde between the @ and the first argument name. So this:
def fText { p.text { @~text } }
is equivalent to this:
jhaml.templates.fText = function(args) { return '<p class="text">' + htmlEscape(args.text) + '</p>'; };
where htmlEscape() does what you'd think it does.
References can be used for id's and classes and attribute values like so:
div#@id.@class1.@class2[data-foo=@foo]
Parenthesis can be used when references and multiple class names would be ambiguous like so:
def.style1.@(classes.class1).style3
You can call into other templates by giving their name followed by a list of named arguments in parenthesis like this:
def caller { div { callee() } } def caller { div { callee(text: ~a literal for an argument~) } } def caller { div { callee(content: { span { ~a block for an argument~ } } ) } } def caller { div { callee(arg: @a.reference, arg2: "a second argument in a quote") } }
You can "splat" multiple arguments by specifying a reference to an object without a name before the named arguments. So this:
def callee { img[src=@avatar] span { @~username } } def caller { div { callee(@user) } }
when called like this
jhaml.templates.caller( {user: {avatar: "imageurl", username: "myusername"}})
would produce this
<div><img src="imageurl"></img><span>myusername</span></div>
White space is totally meaningless and may be omitted or abused except inside literals and quotes where it is exactly preserved.
Comments may appear anywhere a tag may or before argument names in a call or after argument values in a call. They begin with "/" and end with "/" and may nest. They are not respected inside quotes or literals. Like so:
def caller { dev { callee( /* no arguments /* really none */ */ ) /*end call to callee */ } }
Arrays and objects can be enumerated with a for..in construct so that this:
def call1 { for txt in @txts { span { @txt } } }
when called with this:
{txts: ['a', 'b', 'c'] }
will produce this:
<span>a</span><span>b</span><span>c</span>
Objects properties are enumerated by the order of their names according to Array.sort. Property names or array indexes are available by simply giving a second iteration variable name. So that this:
def call1 { for txt, name in @txts { span { @name ~-~ @txt } } }
when called with this:
{txts: {b:'3', a:'2', c:'1'} }
will produce this:
<span>a-2</span><span>b-3</span><span>c-1</span>
Command Line Tool
To create HTML assets statically there is a command line tool that NPM will install for you. It is used thusly:
$ jhamlc --help This is the command line tool for converting jhaml source to HTML. Pass it files containing jhaml source and it outputs HTML. Each file is implicately wrapped in a template definition and the template called after each file. Files are processed in the order the appear. A single - in place of a filename indicates standard input and will cause jhamlc to read stdin to the end and process it as a single file in sequence. To specify a bag of arguments to pass, include a JSON literal object as a command line argument. If no files are given, then standard input is implied as though a single - were given. $ echo "div { @foo } " | jhamlc '{"foo":"bar"}' - <div>bar</div> | https://www.npmjs.com/package/jhaml | CC-MAIN-2015-11 | refinedweb | 1,091 | 66.74 |
Let me preface this by saying that this IS a homework assignment but I'm not looking for someone to code this for me. I am just having a really difficult time sorting through all of this and I've been everywhere on the internet and I have 4 C++ books sitting in front of me and the lecture notes have not been particularly helpful. This program is supposed to use class Queue to manipulate data and class QueueItem to store the data. It is incomplete because the assignment is more complicated than this particluar problem, but I'm not concerned with all of that until I can get the basic structure down. The code below compiles, although it prints what appear so to be an octal memory address, rather than the char string "test". I'm trying to step through the code bit by bit so many fuctions are not included. My question is this: How do I pass "test" to function Queue::addItem(char *pData, ++mNodeCounter). I'm struggling because pData and the char mData[30] array belong to different classes and char mData[30] is private. Again, I'm not looking for someone to code the entire program for me, I just need a clarification on how to pass "test" to a function and store it and/or a little explanation of what is going on in the Queue implementation as far as storing data. I'm trying to learn how to do this correctly for future assignments, but again I've been through countless resources and I have found little in the way of instruction involving using this many pointers and classes to write a FIFO queue. Thank you in advance for your help.
Code:#include <iostream> #include <cstring> using namespace std;; }; QueueItem::QueueItem(char *pData, int id) { id = mNodeID; } class Queue { public: Queue(); // ctor inits a new Queue ~Queue(); // dtor erases any remaining QueueItems void addItem(char *pData); void removeItem(); void print(); void erase(); private: QueueItem *mpHead; // always points to first QueueItem in the list QueueItem *mpTail; // always points to the last QueueItem in the list int mNodeCounter; // always increasing for a unique id to assign to each new QueueItem }; Queue::Queue() { mpHead = NULL; mpTail = NULL; } void Queue::addItem(char *pData) { // dynamically create and init a new QueueItem QueueItem *pQI = new QueueItem(pData, ++mNodeCounter); if (0 == mpHead) // chk for empty queue mpHead = mpTail = pQI; else { // link new item onto tail of list using mpTail pointer mpTail = pQI; } } void Queue::removeItem() { delete mpHead; } void Queue::print() { cout << mpHead << endl; cout << mNodeCounter << endl; } Queue::~Queue() {} int main() { Queue myQueue; myQueue.addItem("test"); myQueue.print(); getchar(); } | https://cboard.cprogramming.com/cplusplus-programming/100416-need-help-fifo-queue-using-singly-linked-lists.html | CC-MAIN-2017-26 | refinedweb | 438 | 53.58 |
Apollo Magnetic Card Reader
Apollo Magnetic Card reader with an RS232 Serial Interface
The low cost Apollo Magnetic Card reader will read up to three tracks of data from just about any magnetic card or credit card. It is available in the serial output option from Sparkfun It outputs the data at 9600 baud on an RS232 serial port. Swiping a card will send out the card's data on the serial output.
It draws its internal power off of the serial port's handshake lines (i.e., RTS(DB9 pin7) or DTR(DB9 pin4) ). So these lines need around 5V to power the reader. When it is powered up, the reader's LED is green. On a PC serial port, the handshake lines supply the power needed for the reader. On a microprocessor serial port that does not support handshaking, getting power to the device it the most difficult part of using it. The easiest way to hook it up to mbed is to use an RS232 breakout board that supports the handshake lines such as the one below from Pololu. It drives the handshake lines that power the reader.
The Pololu Serial Adapter Supports Handshake Lines
Recently, Sparkfun introduced a new version of the magnetic card reader that is shown below. It replaced the older one shown above. This one costs a bit more, but it now has a PS/2 connector that is used to provide power instead of taking it from the RS232 handshake lines. The PS/2 cable is only used for 5V power and gnd (do not connect other PS/2 pins), so a PS/2 breakout board will make it a bit easier to connect on a breadboard. If you order the breakout board, don't forget to get the PS/2 socket to solder on the breakout board.
New version of Sparkfun's magnetic card reader with PS/2 power cable.
A PS/2 Breakout board makes it easier to hookup the new version.
Wiring
And to power the new PS/2 version only:
You could also use a RS-232 adapter without handshaking support such as the module below from Sparkfun. If you need to add wires for the handshake connections needed to power the older magnetic card reader, soldering would likely be required since these connections do not come out on header pins on the Sparkfun module. An RS232 voltage conversion circuit could also be built on a breadboard (this circuit is already in the two RS232 adapter breakouts along with the DB9 connector).
The Sparkfun Serial Adapter has LEDs, but no handshake lines
Wiring
In addition, a null modem and a M/M gender changer adapter (or cables) are also needed. The mini DB9 null modem and gender changer adapters as seen below are a handy way to hook it up so that everything just plugs together. A single M/M DB9 null modem mini adapter could be used to minimize all of the connector clutter, if you can find one.
mini DB9 null modem adapter
Breadboard setup for magnetic card reader
Software
To try it out, just run the standard serial bridge code on mbed, run a terminal application on the PC attached to mbed's virtual com port running at 9600 baud (just like for printf). You should see the card data stream out whenever a card is swiped in the reader. A red LED means a bad read. A green flash on the LED means it read the card and sent out the data.
Serial_Bridge_for_Card_Reader
#include "mbed.h" Serial pc(USBTX, USBRX); // tx, rx Serial device(p13, p14); // tx, rx int main() { while(1) { if(pc.readable()) { device.putc(pc.getc()); } if(device.readable()) { pc.putc(device.getc()); } } }
Swiping a magnetic card to display the data. The data shown here has fake numbers.
The output format for credit cards is % "ASCII string on track 1" ?; "ACSII string on track 2" ?; "ASCII string on track 3" ? . Some ID cards only have 1 or 2 tracks. Wikipedia has some basic information on card number formats under Bank Card Number
Sparkfun PC-based demo of magnetic card reader
Please log in to post comments. | https://developer.mbed.org/users/4180_1/notebook/pollo-magnetic-card-reader/ | CC-MAIN-2017-26 | refinedweb | 695 | 70.33 |
How would I deal 13 cards to 4 players? I have my program below, but I'm stuck.
This is my work so far. I'm new to this programming but I'm trying! I know there are a lot of things wrong with this, but bear with me I'm learning.
public class Project_BridgeDeal { static String[] suits = {"Spades", "Hearts", "Diamonds", "Clubs"}; static String[] ranks = {"2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ace"}; public static void main(String[] args) { } public static void unwrap(int[] pack) { int[] deck = new int[52]; unwrap(deck); for (int i = 0; i < deck.length; i++) deck[i] = i; } public static void shuffle(int[] pack) { shuffle(deck); for (int i = 0; i < deck.length; i++) { int index = (int)(Math.random() * deck.length); int temp = deck[i]; deck[i] = deck[index]; deck[index] = temp; } } public static int[] deal(int[] pack, int n, int offset) { final int CARDS_PER_HAND = 13; int[] north = deal(deck, CARDS_PER_HAND, CARDS_PER_HAND * 0); showHand(north, "North was dealt: "); int[] east = deal(deck, CARDS_PER_HAND, CARDS_PER_HAND * 1); showHand(east, "East was dealt:"); int[] south = deal(deck, CARDS_PER_HAND, CARDS_PER_HAND * 2); showHand(south, "South was dealt:"); int[] west = deal(deck, CARDS_PER_HAND, CARDS_PER_HAND * 3); showHand(west, "West was dealt: "); }
I did a program like this before, but without dealing them out.
Here is a sample run of the program:Here is a sample run of the program:public class ProgramDeck { public static void main(String[] args) { String[] suit = { "Clubs", "Diamonds", "Hearts", "Spades" }; String[] rank = { "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ace" }; int SUITS = suit.length; int RANKS = rank.length; int N = SUITS * RANKS; // build the deck String[] deck = new String[N]; for (int i = 0; i < RANKS; i++) for (int j = 0; j < SUITS; j++) deck[SUITS*i + j] = rank[i] + " of " + suit[j]; // shuffle the deck for (int i = 0; i < N; i++) { int r = i + (int) (Math.random() * (N-i)); String t = deck[r]; deck[r] = deck[i]; deck[i] = t; } // print the shuffled deck for (int i = 0; i < N; i++) System.out.println(deck[i]); } }
North was dealt:
2 of Spades
6 of Spades
8 of Spades
2 of Hearts
3 of Hearts
8 of Hearts
10 of Hearts
6 of Diamonds
8 of Diamonds
Queen of Diamonds
King of Diamonds
4 of Clubs
5 of Clubs
East was dealt:
5 of Spades
King of Spades
6 of Hearts
9 of Hearts
Jack of Hearts
Queen of Hearts
Ace of Hearts
2 of Diamonds
4 of Diamonds
10 of Diamonds
Ace of Diamonds
9 of Clubs
Jack of Clubs
South was dealt:
3 of Spades
4 of Spades
9 of Spades
Jack of Spades
Ace of Spades
7 of Hearts
3 of Diamonds
5 of Diamonds
7 of Diamonds
Jack of Diamonds
3 of Clubs
7 of Clubs
King of Clubs
West was dealt:
7 of Spades
10 of Spades
Queen of Spades
4 of Hearts
5 of Hearts
King of Hearts
9 of Diamonds
2 of Clubs
6 of Clubs
8 of Clubs
10 of Clubs
Queen of Clubs
Ace of Clubs | http://www.javaprogrammingforums.com/whats-wrong-my-code/34594-dealing-13-cards-4-players.html | CC-MAIN-2014-35 | refinedweb | 518 | 62.85 |
An ether being in cyberspace calling itself - Julia Anne Case - uttered:
|
| Subject: Duplicate Mail...
| Date: Fri, 14 Apr 1995 07:44:07 -0400 (EDT)
|
| I
Some of it is due to people replying (or group replying) without
touching up the header portion. Julia will note that she will receive
this message twice. Once from me. The other remailed by the list.
When people do this style of replying more people get added to the To:
line and this cycle expands to more people. My mailer allows me to
edit the header portion of my email before sending it out. I try to
do this (esp when responding to a list) whenever I remember to. This
time Julia I do it on purpose to show my point.
-Paul
--
#include <stddisclamer>
__________________________________________________________________________
[ Paul-Joseph de Werk, B.S. \ RX Net, Inc. ]
[ Systems Analyst II \ MIS Dept. ]
[ \ vrx: paul@av2.vrx.vhi.com ]
[ \ inet: paul%av2.vrx.vhi.com@vhipub.vhi.com ]
[_______________________________\__________________________________________] | http://www.greatcircle.com/lists/majordomo-users/mhonarc/majordomo-users.199504/msg00124.html | CC-MAIN-2017-30 | refinedweb | 161 | 77.03 |
Exercises 1
(Sample solutions are online)
- pascal has a function called odd, that given an integer returns 1 if the number is odd, 0 otherwise. Write an odd function for C and write a main routine to test it. (hint - You can use the fact that in C, if i is an integer then (i/2)*2 equals i only if i is even).
- Write a routine called binary that when supplied with a decimal number, prints out that number in binary, so binary(10) would print out 1010
void binary(unsigned int number){ /* print decimal `number' in binary */ ... }Then write a main routine to test it. Don't worry about leading zeroes too much at the moment. Note that binary returns a void, i.e. nothing.
- Write a routine called base that when supplied with a decimal number and a base, prints out that number to the required base, so base(10,3) would print out 101
void base(unsigned int number, unsigned int base){ /* print decimal `number' to the given `base' */ ... }Then write a main routine to test it.
- Print a table of all the primes less than 1000. Use any method you want. The sieve method is described here:- aim to create an array `number' such that if numbers[i] == PRIME then i is a prime number. First mark them all as being prime. Then repeatedly pick the smallest prime you haven't dealt with and mark all its multiples as being non prime. Print out the primes at the end. Here's a skeleton:-
#include <stdio.h> #include <stdlib.h> #define PRIME 1 /* Create aliases for 0 and 1 */ #define NONPRIME 0 int numbers[1000]; void mark_multiples(int num){ /* TODO: Set all elements which represent multiples of num to NONPRIME. */ } int get_next_prime(int num){ /* find the next prime number after `num' */ int answer; answer = num+1; while (numbers[answer] == NONPRIME){ answer= answer +1; if (answer == 1000) break; } return answer; } int main(){ int i; int next_prime; /* TODO: Set all the elements to PRIME. Remember, the 1st element is numbers[0] and the last is numbers[999] */ /* TODO: 0 and 1 aren't prime, so set numbers[0] and numbers[1] to NONPRIME */ next_prime = 2; do{ mark_multiples(next_prime); next_prime = get_next_prime(next_prime); } while(next_prime < 1000); /* TODO: Print out the indices of elements which are still set to PRIME */ exit(0); }
The `TODO' lines describe what code you need to add in.
You can speed up this program considerably by replacing 1000 where appropriate by something smaller. See online for details. | http://www-h.eng.cam.ac.uk/help/tpl/languages/C/teaching_C/node10.html | CC-MAIN-2018-09 | refinedweb | 421 | 70.23 |
C++ <ctime> - time() Function
The C++ <ctime> time() function returns the current calendar time as a value of type time_t and if the argument is not a null pointer, it also sets this value to the object pointed by timer.
The function returns an integral value representing the number of seconds generally holding the number of seconds elapsed since 00:00, Jan 1 1970 UTC (i.e., a unix timestamp). Although libraries may use a different representation of time.
Syntax
time_t time (time_t* timer);
Parameters
Return Value
On success, returns current calendar time as a value of type time_t. On failure, returns a value of -1. If the argument is not a null pointer, the return value is the same value as stored in the location pointed to by timer.
Example:
The example below shows the usage of time() function.
#include <iostream> #include <ctime> using namespace std; int main (){ time_t t = time(NULL); cout<<"Time elapsed since the epoch began: " <<t<<" seconds\n"; //displaying the date & time cout<<asctime(localtime(&t)); return 0; }
The possible output of the above code could be:
Time elapsed since the epoch began: 1618580793 seconds Fri Apr 16 13:46:33 2021
❮ C++ <ctime> Library | https://www.alphacodingskills.com/cpp/notes/cpp-ctime-time.php | CC-MAIN-2021-43 | refinedweb | 200 | 58.52 |
suppose I take a string input from the user , and if will then group all the words in that sentence with respect to first character of the word and later we have to display the o/p as dictionary , No repetition of words is allowed .
For example consider i/p string
a="A cat ran after the dog and died due to injury"
{'A': ['A'], 'a': ['after', 'and'], 'c': ['cat'], 'd': ['died', 'dog', 'due'], 'i': ['injury'], 'r': ['ran'], 't': ['the', 'to']}
a="A cat ran after the dog and died due to injury"
b=[]
c={}
b=list(sorted(set(a.split())))
for x in b:
e=x[0]
c.setdefault(e,[])
c[e].append(x)
print (c)
You could simplify your code a little but apart from that it's ok
from collections import defaultdict a="A cat ran after the dog and died due to injury" c=defaultdict(list) for x in set(a.split()): # no need to sort unless you create an OrderedDict which you didn't c[x[0]].append(x) print (c)
You can replace the loop by
any(map(lambda x : c[x[0]].append(x),set(a.split()))) | https://codedump.io/share/vFolHGv325u5/1/from-a-sentence-group-all-words-that-start-with-same-alphabet-and-and-sort-it-according-to-first-character-of-the-word | CC-MAIN-2017-39 | refinedweb | 194 | 61.7 |
Oracle WebLogic Server Support: Using WebLogic Scripting Tool (WLST)
This document describes the following:
OEPE provides tooling for WLST that enable editing, executing, debugging, WebLogic MBean access and navigation, as well as a built-in help for WLST commands.
1. Configuring Projects for WLST
To configure your project for WLST, follow this procedure:
Figure 1. Project Properties Dialog
Figure 2. Selecting WLST Support in the Project Properties Dialog
Figure 3. Modify Faceted Project - Configure WebLogic Scripting Tools Dialog
Figure 4. WLST in Project View
2. Creating New WLST Files
Figure 5. Creating New WLST File
Figure 6. Creating New WLST File Dialog
Figure 7. Selecting Template
Upon completion, a new WLST script file is created in the specified location, as Figure 7 shows.
Figure 7. WLST File in Project Explorer
3. Editing WLST Script
To access the editor, double-click your WLST file.
Figure 9 shows the editor and its Help view that you access by selecting Window > Show View > Other from the main menu, and then selecting WebLogic > WLST Help View in the Show View dialog. To view help topics for a command, you double-click that command in the WLST source editor.
Figure 9. WLST Source Editor and Help View
4. Adding WLST Templates
You add a new WLST template as follows:
Figure 10. Templates View
Figure 11. New Template Dialog
Figure 12. Completed New Template Dialog
Figure 13. New Template Listed
5. Navigating MBean Structures
Figure 14. MBean Hieracrchy in the Servers pane
To add or generate WLST code from MBean Hierarchy:
Note: This menu item is enabled only when the WSLT file is in focus.
6. Using WLST Console
You use WLST console, activate the Console tab, and then select WLST > Oracle WebLogic Server Version from the tab menu, as Figure 15 shows.
Figure 15. Creating New WLST File
To interact with the server, type WLST commands. Figure 16 shows output produced upon entering help().
Figure 16. Interacting with Server Using WLST Console
7. Executing WLST
Figure 17. Executing WLST Script
8. Debugging WLST Script
Figure 18. Debugging WLST Script
The Pydev debugger allows you to do the following:
Note that WLST script is executed with Jython interpreter in debug mode,
as opposed to the weblogic.WLST interpreter.
weblogic.WLST
9. Importing an Existing WLST Script into OEPE )
wlstModule
from wlstModule import *
cmo
import wlstModule as wl
cd()
cmo=cd( MBEAN_PATH )
When importing existing WLST scripts into OEPE, be aware of the fact that Eclipse may flag WLST commands with "undefined variable" error.
To work around this problem, add following conditional import statement in the beginig of the file:
if __name__ == '__main__':
from wlstModule import *
if __name__ == '__main__':
from wlstModule import *
This statement is intended to help the builder to locate the WLST command.
The wlstModule will be imported only when the script is executed with Jython interpereter.
10. Known Issues and Limitations
If you use WebLogic Server 9.2 on Windows Vista or Windows 7 operating system, you should avoid using Jython variable os.environ in your WLST script. Instead, you have to manually change the value of BEA_HOME and WL_HOME variables in the generated WLST script.
os.environ
BEA_HOME
WL_HOME
11. Related Information | http://docs.oracle.com/cd/E15315_09/help/oracle.eclipse.tools.weblogic.doc/html/wlst.html | CC-MAIN-2014-41 | refinedweb | 529 | 57.57 |
Text translated by google (French -> English)
Hello, I appeal to you because I have a problem.
I’m trying to retrieve API information with an API key provided. But that does not work.
When I make the request on “Postman”, it works for me. However, when I make the request in the code of my application ionic blank, I have errors.
My code:
import { Component } from '@angular/core'; import { NavController } from 'ionic-angular'; import * as unirest from "unirest"; @Component({ selector: 'page-home', templateUrl: 'home.html' }) export class HomePage { public test: any; constructor(public navCtrl: NavController) { var req = unirest("GET", " req.headers({ "Postman-Token": "475064f1-5b36-466e-b7f4-61a86d2f194c", "Cache-Control": "no-cache", "TRN-Api-Key": "API-key", "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Methods": "GET, POST, OPTIONS, PUT, PATCH, DELETE", "Access-Control-Allow-Credentials": true, }); req.end(function (res) { this.test = res.body; console.log(res.body); }); } }
My first mistake:
To deal with this, I installed CORS on google. However, it brings me back to a second mistake:
How to do ? Because it works on postman and when I use another API it works even in my code.
Thank you in advance. | https://forum.ionicframework.com/t/http-cors-error-access-control-allow-origin/128006 | CC-MAIN-2022-21 | refinedweb | 193 | 50.63 |
I want to write a method that has a Scanner parameter associated with a stream of input and counts the number of Strings within the input. However, I have a stack overflow exception. Can you tell me the reason? Thank you a lot.
import java.util.Scanner;
public class test {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println(count(input));
}
public static int count(Scanner input) {
if (input.hasNextLine())
return 1 + count(input);
else
return 1;
}
}
You need to call
nextLine() on
input in the line
return 1 + count(input). You are checking for the next line, but nothing actually consumes it. This means the Scanner never runs out of lines to process. | https://codedump.io/share/xkLzwOkPQIUW/1/counting-the-number-of-strings-remaining-to-be-read-in-standard-input-using-recursion | CC-MAIN-2018-05 | refinedweb | 120 | 67.86 |
Asynchronous call from ObserverSlawek Sobotka Oct 10, 2010 9:30 PM
[component -> observer -> asynch method]
Logic works but asynch method is called in the synch way - i know it because it slows down response time
When I get rid of observer:
[component -> asynch method]
than works perfectly in asynchronous way.
DETAILS:
1. Conversation component raises event:
events.raiseTransactionSuccessEvent(EventsDictionary.DOCUMENT_RELEASED, document);
2. Event Listener calls Async. method of other component:
@Observer(EventsDictionary.DOCUMENT_RELEASED)
public void documentReleased(Document document){
...
mailSender.sendMail("documentReleased", params);
}
3. Where mail sender is:
@Name("mailSender")
@AutoCreate
public class MailSender {
@Asynchronous
public void sendMail(String mail, Map<String, Object> params) {
... tricks with mail sending
}
1. Re: Asynchronous call from ObserverLeo van den berg Oct 11, 2010 2:45 AM (in response to Slawek Sobotka)
Hi,
I solve this issue by adding an additional observer layer which is used to watch for the transaction success event, does some pre-processing (if necessary) and raise an Asynchronous event.
One of the advantages is that within the original call (with the transaction) the delay is decereased to a minimum and you're also able to call something with a new Transaction. So basically
Component --> raiseTransactionSuccess --> Component --> RaiseSyncronousEvent --> doSomething.
Hopefully this helps.
Leo
2. Re: Asynchronous call from ObserverSlawek Sobotka Oct 11, 2010 1:03 PM (in response to Slawek Sobotka)
hmm nice trick:)
works like a charm.
thanks a lot Leo!
I'm wondering is it possible to add a facesMessage to some context in the last
element of this chain?
I know that last
phaseis asynchronous and works in different context (I guess) but it would be nice if user could see message in the n-th request in the future.
3. Re: Asynchronous call from ObserverLeo van den berg Oct 11, 2010 1:51 PM (in response to Slawek Sobotka)
Hi,
adding a message to the context is a bit more complex because you're running the task asynchronous and it no notion whatsoever of the context. However you can create messages without a problem. The thing I do is to send these messages to an Application scoped bean which hols the listener for an rich ajax-poll element. The meaaage is received and added to a Map which has the user as Key and a message List to which the message is added. At the moment the user-poll is triggered it reads the list with pending messages and adds them to the context.
Leo
4. Re: Asynchronous call from ObserverSlawek Sobotka Oct 11, 2010 4:04 PM (in response to Slawek Sobotka)
smart, i like that:)
thanks again | https://developer.jboss.org/thread/193015 | CC-MAIN-2018-39 | refinedweb | 432 | 61.87 |
index
Working With File,Java Input,Java Input Output,Java Inputstream,Java io
Tutorial,Java io package,Java io example
to deals with most of the
machine dependent files in a machine-independent manner... files using the File
class. This class is available in the java.lang
package. The java.io.File is the central class that works
with files and directories-io - Java Beginners
java-io Hi Deepak;
down core java io using class in myn...://
Thanks
Java
Java IO
Java FileOutputStream Example
Java FileOutputStream Example
In this section we will discuss about the Java IO FileOutputStream.
FileOutputStream is a class of java.io package which...)
throws IOException
Example :
Here an example is being given
Simple IO Application - Java Beginners
Simple IO Application Hi,
please help me Write a simple Java application that prompts the user for their first name and then their last name. The application should then respond with 'Hello first & last name, what
files
.
Please visit the following link:
files
files write a java program to calculate the time taken to read a given number of files. file names should be given at command line.
Hello Friend,
Try the following code:
import java.io.*;
import java.util.*;
class
Reading files in Java
.
Please provide me the example code for reading big text file in Java. What do you suggest for Reading files in Java?
Thanks...Reading files in Java I have to make a program in my project between Two set of Stream class as mention below-
1)FileInputStream... information.
Thanks
code for serching files and folders
code for serching files and folders i want to create a code in java...://
including index in java regular expression
including index in java regular expression Hi,
I am using java regular expression to merge using underscore consecutive capatalized words e.g., "New York" (after merging "New_York") or words that has accented characters
How to index a given paragraph in alphabetical order
How to index a given paragraph in alphabetical order Write a java program to index a given paragraph. Paragraph should be obtained during runtime. The output should be the list of all the available indices.
For example:
core java ,io operation,calling methods using switch cases
core java ,io operation,calling methods using switch cases How to create a dictionary program,providing user inputs using io operations with switch cases and providing different options for searching,editing,storing meanings
Filter Files in Java
Filter Files in Java
Introduction
The Filter File Java example code provides the following functionalities:
Filtering the files depending StringWriter
Java IO StringWriter
In this section we will discussed about the StringWriter... in the Java program. In this example I have created a Java
class named...[])
{
String str = "Java StringWriter Example";
try
Java IO PipedWriter
Java IO PipedWriter
In this tutorial we will learn about the PipedWriter in Java.
java.io.PipedWriter writes the characters to the piped output stream....
Syntax : public void write(int c) throws IOException
Example
Here
Index Out of Bound Exception
:\saurabh>java Example
Valid indexes are 0, 1,2,3,4,5,6 or 7
End...
Index Out of Bound Exception
Index Out of Bound Exception are the Unchecked Exception
quqtion on jar files
through the following link: on jar files give me realtime examples on .jar class files
A Jar file combines several classes into a single archive file
Spring IO Platform 1.0.0 Released
Spring IO Platform 1.0.0 Released - Check the new features of this release
The Spring IO is platform for developing and building the modern day
applications.... The Spring IO is 100% open source system and it is modular.
The latest version
How to delete files in Java?
, we use the delete() function to delete the file.
Given below example will give you a clear idea :
Example :
import java.io.*;
public class DeleteFile
header files
header files do you have a all header files of java
configuration files - Java Beginners
configuration files i have to use configuration file in my program "listing of number of files and their modified time of directory",but problem is that directory name should be provided through configuratin file not input
Java count files in a directory
Java count files in a directory
In this section, you will learn how to count only files in a directory.
You have learnt various file operations. Here we are going to find out the
number of files from a directory. You can see
listing files - Java Beginners
listing files how to list the files and number of files only...]);
System.exit(0);
default : System.out.println("Multiple files...]);
System.exit(0);
default : System.out.println("Multiple files are not allow
Java IO OutputStream
Java IO OutputStream
In this section we will read about the OutputStream class...)
throws IOException
Example :
An example... to the specified file. In this example I have tried to read the
stream of one file
Java list files
Java list files
In this section, you will learn how to display the list of files from a
particular directory.
Description of code:
In the given example, we... only the files, we have created a condition
that if the array of files contains
Files - Java Beginners
OGNL Index
is a expression language.
It is used for getting and setting the properties of java object... properties of
java object. It has own syntax, which is very simple. It make... - For example, array[0], which returns
first element of current object
Write the Keys and Values of the Properties files in Java
Write the Keys and Values of the Properties files in
Java... will learn how to add the keys and
it's values of the properties files in Java. You know the properties files have
the the keys and values of the properties files
Concatenate two pdf files
Concatenate two pdf files
In this program we are going to concatenate two pdf files
into a pdf file through java program. The all data of files have
Java File Management Example
as text files.
Yes you can use the Java API for reading the text file one line... of file.
Read the example Read file in Java for more information on reading...Java File Management Example Hi,
Is there any ready made API
Java: Searching a string from doc files
Java: Searching a string from doc files I want to search a string from DOC, DOCX files in java. Can anyone please help
Append winword files in java - Java Beginners
Append winword files in java HI,
Im trying to merge 2 winword documents containing text, tables and pictures, resulting doc file should have the same formatting as in original docs. My platform is windows XP and office | http://roseindia.net/tutorialhelp/comment/83458 | CC-MAIN-2014-42 | refinedweb | 1,116 | 53.1 |
Group When
Phil Nash’s recent tweet intrigued me.
Functional people: I often (in F#) need to process a seq into a smaller list or seq – where items from the input are grouped in some way…— Phil Nash (@phil_nash) July 15, 2014
… the need to group may not be known until after the first item in the group. I struggle to find a nicely functional way to do this. Ideas?— Phil Nash (@phil_nash) July 15, 2014
He later clarified what he was after — and had now found — linking to a solution posted a couple of years ago by Tomas Petricek. The function
groupWhen splits a sequence into groups, starting a new group whenever the predicate returns true.
module Seq = /// Iterates over elements of the input sequence and groups adjacent elements. /// A new group is started when the specified predicate holds about the element /// of the sequence (and at the beginning of the iteration). /// /// For example: /// Seq.groupWhen isOdd [3;3;2;4;1;2] = seq [[3]; [3; 2; 4]; [1; 2]] let groupWhen f (input:seq<_>) = seq { use en = input.GetEnumerator() let running = ref true // Generate a group starting with the current element. Stops generating // when it founds element such that 'f en.Current' is 'true' let rec group() = [ yield en.Current if en.MoveNext() then if not (f en.Current) then yield! group() else running := false ] if en.MoveNext() then // While there are still elements, start a new group while running.Value do yield group() |> Seq.ofList }
Here’s a nice Haskell version coded up by @sdarlington.
Maybe takewhile and dropwhile could power a Python solution, but my first choice would be itertools.groupby.
Groupby chops a sequence into subsequences, where the elements of each subsequence have the same key value. A suitable key function, in this case, must change its return value every time the sequence yields an element for which the predicate holds. It could toggle between a pair of values, for example. Or it could just count the number of times the predicate holds.
class count_p: ''' Return a value which increments every time the predicate holds. ''' def __init__(self, pred): self._n = 0 self._pred = pred def __call__(self, v): self._n += self._pred(v) return self._n def group_when(pred, xs): return (gp for _, gp in groupby(xs, count_p(pred)))
Here,
group_when accepts an iterable and returns an iterable sequence of iterable groups. Clients choose how to consume the results.
>>> def odd(v): return v % 2 >>> xs = group_when(odd, [3, 3, 2, 4, 1, 2]) >>> print([list(g) for g in xs]) [[3], [3, 2, 4], [1, 2]]
Note that
count_p does something very like itertools.accumulate. Here’s another version of
group_when which takes advantage of this.
def group_when(pred, xs): xs, ys = tee(xs) accu = accumulate(map(pred, ys)) return (gp for _, gp in groupby(xs, lambda _: next(accu)))
§
After a short break, here’s a third version of
group_when. This is the first time I’ve found a use for
takewhile and
dropwhile. Beware: as the teed streams
xs and
ys diverge, the amount of backing storage required will grow … only for the stored values to then be dropped!
from itertools import * def group_when(p, xs): def notp(x): return not p(x) xs = iter(xs) while True: x = next(xs) xs, ys = tee(xs) yield chain([x], takewhile(notp, xs)) xs = dropwhile(notp, ys) def odd(x): return x % 2 [list(g) for g in group_when(odd, [3, 3, 2, 4, 1, 2])] # [[3], [3, 2, 4], [1, 2]] | http://wordaligned.org/articles/group-when | CC-MAIN-2018-05 | refinedweb | 592 | 73.68 |
I want to know in which order the attributes of the following example class would be serialized:
public class Example implements Serializable { private static final long serialVersionUID = 8845294179690379902L; public int score; public String name; public Date eventDate; }
EDIT:
Why i wanna know this:
I got a serialized string in a file for a class of mine which has no implementation for
readObject() or writeObject(). now that implementation changed ( some properties are gone )
and i want to write a readObject() method that handles the old serialized class.
There i would just read this property but wouldnt save it to the created object.
This is basically just for legacy i use a database now but need to support the old
serialized files.
to write this readObject() i need the order of properties that in the stream.
Based on a brief reading of the spec.
The fields are written in the order of the field descriptors the class descriptor
The field descriptors are in “canonical order” which is defined as follows:
“The descriptors for primitive typed fields are written first sorted by field name followed by descriptors for the object typed fields sorted by field name. The names are sorted using String.compareTo.”
(I suspect that the bit about the canonical order should not matter. The actual order of the fields in the serialization should be recoverable from the actual order of the field descriptors in the class descriptor in the same serialization. I suspect that the reason a canonical order is specified is that it affects the computed serialization id. But I could easily be wrong about this 🙂 )
Reference:
- Java Object Serialization Specification – Section 4.3 and Section 6.4.1 (the comment on the “nowrclass” production)
###
With regards to your original problem, some testing would suggest that if you’ve maintained your serialVersionUID and haven’t removed fields containing values you need, you can probably just deserialize your old objects without error.
Any fields you no longer have will be ignored. Any new fields will be initialised to default values (e.g.
null, or
0 etc.).
Bear in mind, this approach might violate constraints you’ve placed upon your class. For example, it may not be legal (in your eyes) to have
null values in your fields.
Final warning: this is based on some testing of mine and research on the Internet. I haven’t yet encountered any hard proof that this is guaranteed to work in all situations, nor that it is guaranteed to continue to work in the future. Tread carefully.
###
It doesn’t matter. Fields are serialized along with their names. Changing the order doesn’t affect serialization compatibility, as long as the serialVersionUID is the same. There are a lot of other things that don’t mater either. See the Versioning chapter in the Object Serialization Specification. | https://exceptionshub.com/java-standard-serialization-order.html | CC-MAIN-2022-05 | refinedweb | 470 | 53.61 |
#include <cafe/kpr.h> u8 KPRPutChar(KPRQueue *queue, wchar_t inChar);
The number (count) of processed characters available for output.
This function inserts a character into the given processing queue. Characters are processed as they are inserted.
Characters should be entered into the appropriate queue as they are generated by the keyboard. Immediately after entering the character in the queue, the application should try to get the processed characters from the queue. The application should try to remove characters in a loop, since one input may generate multiple outputs. An output of 0 indicates that the queue is empty.
It is an application error to add characters to a queue and not try to remove them immediately afterwards. The queue is not designed to hold more characters than can be processed immediately. Overflowing the queue will result in a fatal error.
To support ALT+keypad keys, the private Unicode values
KBK_Keypad_0 through
KBK_Keypad_9 are placed in a queue whenever the ALT key is pressed while NUM LOCK is active and the 0-9 keys on the keypad
are entered. To generate output when the ALT key is released, the value
KPR_FLUSH_AKP_CHAR should be entered into the queue. This value itself is absorbed by the queue and does not
become available for output.
This function may also be used to flush all the unprocessed characters in the queue (and make them available for output). To do so, the value
KPR_FLUSH_ALL_CHAR should be entered into the
queue. This value itself is absorbed by the queue and does not become available for output.
2013/05/08 Automated cleanup pass.
CONFIDENTIAL | http://anus.trade/wiiu/personalshit/wiiusdkdocs/fuckyoudontguessmylinks/actuallykillyourself/AA3395599559ASDLG/pads/hid/kpr/KPRPutChar.html | CC-MAIN-2018-05 | refinedweb | 266 | 64.51 |
Graphics in the .NET Framework with Visual Basic
The .NET Framework provides the GDI+ application programming interface (API) for manipulating graphics. GDI+ is an advanced implementation of the Windows Graphics Device Interface (GDI). With GDI+ you can create graphics, draw text, and manipulate graphical images as objects.
GDI+ is designed to offer performance, as well as ease of use. You can use GDI+ to render graphical images on Windows Forms and controls. Although you cannot use GDI+ directly on Web Forms, you can display graphical images through the Image Web Server control.
Introduction to GDI+
When you create a Windows Forms control, you can use GDI+ to access and update its image. You can also use GDI+ to create your own images, independent of your application's user interface.
To draw on an image in .NET Framework, you must use the Graphics object associated with the image.
In some cases, you can directly get the image's Graphics object. For example, when you are creating a Windows Forms control, you can override the OnPaint method to access the Graphics object for the control's image.
In other cases, such as when you are creating your own image, you also need to create a graphics object. The shared FromImage method takes an image and returns a Graphics object associated with that image.
The Graphics class has many drawing- and image-manipulation methods. Some of the commonly used methods are listed below:
Methods for drawing lines: DrawArc, DrawBezier, DrawEllipse, DrawImage, DrawLine, DrawPolygon, DrawRectangle, and DrawString.
Methods for filling shapes: FillClosedCurve, FillEllipse, FillPath, FillPolygon, and FillRectangle.
Method for clearing the drawing surface: Clear.
Method for creating a new Graphics object from an image: FromImage.
Several of the methods listed above take as arguments structures or classes defined in the System.Drawing namespace. The following table lists some of the most used GDI+ classes and structures.
Resource Management
Many of the drawing classes implement IDisposable because they encapsulate unmanaged system resources. If you create a new instance of one of these classes, you should call the class's Dispose method when you are through with the object.
Alternatively, you can create the object with the Using statement, which implicitly calls the object's Dispose method. For more information, see Object Lifetime: How Objects Are Created and Destroyed and Using Statement (Visual Basic).
Related Sections
- Graphics for Visual Basic 6.0 Users
Describes changes to the graphics rendering model in Visual Basic 2005.
- Graphics and Drawing in Windows Forms
Roadmap for using graphics in Windows Forms applications.
- Graphics Overview (Windows Forms)
Provides an introduction to the graphics-related managed classes.
- About GDI+ Managed Code
Provides information regarding the managed GDI+ classes.
- Using Managed Graphics Classes
Demonstrates how to complete a variety of tasks using the GDI+ managed classes.
- Custom Control Painting and Rendering
Details how to provide code for painting controls.
- Image Web Server Control Overview
Describes the control that you can use to display images on a Web Forms page and to manage the images with code.
- Image Editor
Provides links to topics on how to use the image editor to create image files for use in your application. | https://msdn.microsoft.com/en-us/library/ms233778(vs.80).aspx | CC-MAIN-2016-30 | refinedweb | 525 | 56.96 |
import "golang.org/x/build/tarutil"
Package tarutil contains utilities for working with tar archives.
FileList is a list of entries in a tar archive which acts as a template to make .tar.gz io.Readers as needed.
The zero value is a valid empty list.
All entries must be added before calling OpenTarGz.
AddHeader adds a non-regular file to the FileList.
AddRegular adds a regular file to the FileList.
func (fl *FileList) TarGz() io.ReadCloser
TarGz returns an io.ReadCloser of a gzip-compressed tar file containing the contents of the FileList. All Add calls must happen before OpenTarGz is called. Callers must call Close on the returned ReadCloser to release resources.
Package tarutil imports 4 packages (graph) and is imported by 1 packages. Updated 2017-08-16. Refresh now. Tools for package owners. | http://godoc.org/golang.org/x/build/tarutil | CC-MAIN-2017-34 | refinedweb | 136 | 70.9 |
14 April 2017 1 comment Javascript, ReactJS
tl;dr; I'm not a TC39 member and I barely understand half of what those heros are working on but there is one feature they're working on that really stands out, in my view, for React coders; Public Class Fields.
Very common pattern in React code is that have a component that has methods that are tied to DOM events (e.g.
onClick) and often these methods need acess to
this. The component's
this. So you can reach things like
this.state or
this.setState().
You might have this in your code:
class App extends Component { state = {counter: 0} constructor() { super() // Like homework or situps; something you have to do :( this.incrementCounter = this.incrementCounter.bind(this) } incrementCounter() { this.setState(ps => { return {counter: ps.counter + 1} }) } render() { return ( <div> <p> <button onClick={this.incrementCounter}>Increment</button> </p> <h1>{this.state.counter}</h1> </div> ) } }
If you don't bind the class method to
this in the constructor,
this will be
undefined inside the class instance field
incrementCounter. Buu!
Suppose you don't like having the word
incrementCounter written in 4 placecs, you might opt for this shorthand notation where you create a new unnamed function inside the render function:
class App extends Component { state = {counter: 0} render() { return ( <div> <p> <button onClick={() => { this.setState(ps => { return {counter: ps.counter + 1} }) }}>Increment</button> </p> <h1>{this.state.counter}</h1> </div> ) } }
Sooo much shorter and kinda nice that the code can be so close in proximity to the actual
onClick event definition.
But this notation has a horrible side-effect. It creates a new function on every render. If instead of a regular DOM jsx object
<button> it might be a sub-component like
<CoolButton/> then that sub-component would be forced to re-render every time (unless you write your own
shouldComponentUpdate.
Also, this notation works when the code is small and light but it might get messy quickly if you need that functionality on other element's
onClick. Or it might become mess with really deep indentation.
That new feature is currently in the "Draft" stage at TC39. Aka. stage 1.
However, I discovered that you can use
stage-2 in Babel to use this particular feature.
Note! I don't understand why you only have to put on your stage-2-brave socks for this feature when it's part of a definition that is stage 1.
Anyway, what it means is that you can define your field (aka method) like this instead:
class App extends Component { state = {counter: 0} incrementCounter = () => { this.setState(ps => { return {counter: ps.counter + 1} }) } render() { return ( <div> <p> <button onClick={this.incrementCounter}>Increment</button> </p> <h1>{this.state.counter}</h1> </div> ) } }
Now it's only mentioned by name
incrementCounter twice. And no need for that manual binding in a constructor.
And since it's automatically bound, the function isn't recreated and those can easily make sub-components be pure.
So, let's always write our React methods this way from now on.
Oh, and in case you wonder. Inheritence works the same with these public class fields as the regular class instance fields.
Follow @peterbe on Twitter
Hi, thanks for the great post.
Aren't "public class fields" actually *instance* fields? When I print an instance to the console, all the public class fields are listed there, as its direct properties. Meaning that every time we instantiate an object, it gets its own fresh copy of the "public class fields". Please correct me if I'm wrong. I'm just looking for a way to write actual *class* fields, which all instances can access via the prototype chain. Do you know of such a proposal that exists? Would love to give it a test run.
Thanks a lot!
Jonathan | https://api.minimalcss.app/plog/public-class-fields | CC-MAIN-2020-16 | refinedweb | 634 | 66.44 |
How To: Serialize Data
The Complete Sample
The code in the topic shows you the technique. You can download a complete code sample for this topic, including full source code and any additional supporting files required by the sample.
Serializing Data
To define save game data
Define a new class or structure.
The size of this class will determine the size of your saved game files, so try to keep the class small. Do not reference other objects from this class unless you want to serialize them as well.
Add the Serializable attribute to the class.
To serialize data to a save game file
Create a StorageContainer to access the specified device.
Use Path.Combine to create a new string specifying the full path to the save game file.
Open a FileStream object on the file using the File.Open method from the System.IO namespace.
Specifying FileMode.Create tells Open to create the save game if it doesn't exist. If it does, the file will be truncated to zero bytes.
Create an XmlSerializer object, passing the type of the structure that defines your save game data.
Call Serialize, and then pass the FileStream and the data to serialize.
The XmlSerializer will turn the data in the structure into XML and use the FileStream to write the data into the file.
Close the FileStream.
Dispose the StorageContainer to commit the changes to the device.
private static void DoSaveGame(StorageDevice device) { // Create the data to save. SaveGameData data = new SaveGameData(); data.PlayerName = "Hiro"; data.AvatarPosition = new Vector2(360, 360); data.Level = 11; data.Score = 4200; // Open a storage container. StorageContainer container = device.OpenContainer("StorageDemo"); // Get the path of the save game. string filename = Path.Combine(container.Path, "savegame.sav"); // Open the file, creating it if necessary. FileStream stream = File.Open(filename, FileMode.Create); // Convert the object to XML data and put it in the stream. XmlSerializer serializer = new XmlSerializer(typeof(SaveGameData)); serializer.Serialize(stream, data); // Close the file. stream.Close(); // Dispose the container, to commit changes. container.Dispose(); }
To read serialized data from a save game file
Create a StorageContainer to access the specified device.
Use Path.Combine to create a new string specifying the full path to the save game file.
Call File.Exists to determine if the save game exists.
Open a FileStream object on the file using the File.Open method from the System.IO namespace.
Create an XmlSerializer object, and then pass the type of the structure that defines your save game data.
Call Deserialize, and then pass the FileStream object.
Deserialize returns a copy of the save game structure populated with the data from the save game file. (You will have to cast the return value from Object to your type.)
Close the FileStream.
Dispose the StorageContainer. | http://msdn.microsoft.com/en-us/library/bb203924(v=xnagamestudio.31).aspx | CC-MAIN-2014-15 | refinedweb | 462 | 61.33 |
Catching up on a few posts…. I’ve been making progress, but failing to post about them, so here goes:
On Day 4, which was roughly 5 days ago, I took Lecture 5 of the Learn Python Django from scratch course. Basically, this lecture was about using the ‘Django app directory’ to store the views that map to the HTML used to display the app content. Take a look at the code:
views.py
from article.models import Article # Create your views here. ''' def hello(request): name = "Jay" html = "<html><body>Hi %s. It worked.</body></html>" % name return HttpResponse(html) def hello_template(request): name = "Jay" t = get_template('hello.html') html = t.render(Context({'name': name})) return HttpResponse(html) ''' def articles(request): return render_to_response('articles.html', {'articles': Article.objects.all() }) def article(request, article_id=1): return render_to_response('articles.html', {'article': Article.objects.get(id=article_id) })
We defined a few new methods to handle a couple different cases. The first method takes care of the case where a request is made to the website for ALL of the articles in the web app. The second method takes a parameter, the article id, and it returns the article requested to the articles view for display purposes.
Where do we define these request cases? In the url.py file:
url.py :
from django.conf.urls import patterns, include, url urlpatterns = patterns('', url(r'^all/$', 'article.views.articles'), url(r'^get/(?P<article_id>\d+)/$', 'article.views.article'), )
You can see the regular expression that represents the /all/ URL, which passes the request on to the articles (plural) method. The other regular expression /get/ some_number /, will pass the number in the URL as the id parameter in the article (singular) method.
Finally, we had to create the views template to handle both requests. Have a look:
articles.html :
<html> <body> <h1>Articles</h1> </body> </html>
Quite simple, here. For all the articles returned in either method call, the for loop in the HTML will display 1 or all of the articles data requested.
That’s it. Onto blogging the next day… | https://jasondotstar.com/Advanced-Views-and-URLs.html | CC-MAIN-2020-29 | refinedweb | 346 | 60.72 |
Investors considering a purchase of Signet Jewelers Ltd (Symbol: SIG) shares, but cautious about paying the going market price of $134.08/share, might benefit from considering selling puts among the alternative strategies at their disposal. One interesting put contract in particular, is the July 2016 put at the $105 strike, which has a bid at the time of this writing of $2.80. Collecting that bid as the premium represents a 2.7% return against the $105 commitment, or a 4.2% annualized rate of return (at Stock Options Channel we call this the YieldBoost ).
Selling a put does not give an investor access to SIG Signet Jewelers Ltd sees its shares decline 21.8% and the contract is exercised (resulting in a cost basis of $102.20 per share before broker commissions, subtracting the $2.80 from $105), the only upside to the put seller is from collecting that premium for the 4.2% annualized rate of return.
Interestingly, that annualized 4.2% figure actually exceeds the 0.7% annualized dividend paid by Signet Jewelers Ltd by 3.5%, based on the current share price of $134.08. And yet, if an investor was to buy the stock at the going market price in order to collect the dividend, there is greater downside because the stock would have to lose 21.8% to reach the $105 strike price.
Always important when discussing dividends is the fact that, in general, dividend amounts are not always predictable and tend to follow the ups and downs of profitability at each company. In the case of Signet Jewelers Ltd, looking at the dividend history chart for SIG below can help in judging whether the most recent dividend is likely to continue, and in turn whether it is a reasonable expectation to expect a 0.7% annualized dividend yield.
The chart above, and the stock's historical volatility, can be a helpful guide in combination with fundamental analysis to judge whether selling the July 2016 put at the $105 strike for the 4.2% annualized rate of return represents good reward for the risks. We calculate the trailing twelve month volatility for Signet Jewelers Ltd (considering the last 252 trading day closing values as well as today's price of $134.08) to be 25%. For other put options contract ideas at the various different available expirations, visit the SIG. | https://www.nasdaq.com/articles/agree-buy-signet-jewelers-105-earn-42-annualized-using-options-2015-11-24 | CC-MAIN-2020-34 | refinedweb | 397 | 64.61 |
First time posting here. I am a new user to Python. I am puzzled to why the list 'matrix' is changed between the two print statements (the ones with 'Hi' and 'Hi2') even though I did nothing to change it in the code. Below is the code:
- Code: Select all
#FIRST PROPER SCRIPT
import math
number = int(raw_input("What number do you want to input?\n"))
from random import randint
#Declaring variables
matrix = []
hold1 = [0 for x in xrange(4)]
count = 0
while (1 != 0):
count = count + 1
a = randint(0,int(math.sqrt(number)))
b = randint(0,int(math.sqrt(number)))
c = randint(0,int(math.sqrt(number)))
d = randint(0,int(math.sqrt(number)))
if ((a**2)+(b**2)+(c**2)+(d**2)) == number:
print('Hi' + str(matrix))
hold1[0] = a
hold1[1] = b
hold1[2] = c
hold1[3] = d
hold1.sort()
print('Hi2' + str(matrix))
if len(matrix) == 0:
#store
matrix.append(hold1)
Below is the output:
- Code: Select all
What number do you want to input?
5462
Hi[]
Hi2[]
Hi[[4, 19, 27, 66]]
Hi2[[7, 7, 42, 60]]
Hi[[7, 7, 42, 60]]
Hi2[[21, 27, 34, 56]]
Hi[[21, 27, 34, 56]]
Hi2[[7, 30, 47, 48]]
I expected each pair of Hi and Hi2 to have the exact same output. What have I done wrong? | http://www.python-forum.org/viewtopic.php?p=12954 | CC-MAIN-2017-22 | refinedweb | 222 | 75.81 |
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #include <errno.h> #include "d3des.h" #include "base64.h" static const char *progname = "vmware-vncpassword"; static const char *keystr = "RemoteDisplay.vnc.key"; void usage(int ret) { printf("Usage: %s [password]\n", progname); exit(ret); } int main(int argc, char *argv[]) { char input[DES_HEXKEY_LEN + 1] = { 0 }; char *output = NULL; size_t outlen = 0; unsigned int key[32]; if (argc != 2 || !strlen(argv[1])) { printf("invalid arguments specified!\n", progname); usage(EINVAL); } strncat(input, argv[1], DES_HEXKEY_LEN); deskey((unsigned char *) input, EN0); cpkey(key); outlen = Base64_EncodedLength((char *) key, sizeof key); output = malloc(outlen); if (!output) { printf("%s: failed to allocate output buffer!", progname); return ENOMEM; } Base64_Encode((char *) key, sizeof key, output, outlen, NULL); printf("%s = \"%s\"\n", keystr, output); return 0; }
Hi rrdharan
I am PC Varma. Recentlry i was assigned a module "Managing VMware servers" with our internal IT Management portal. Our portal has an ability to manage the server with VNC and SSH from a cenralized J2EE based application server, where we use the Java applets to launch the remote consoles from the browser.
Some how we have integrated VMWare management with VI Java API. Now, the challenge is to launch the VMWare built-in VNC server to access guests. I have read the link, thats why i am shooting this to you. But, how can i launch the VNC console for a desired guest OS, even while it is booting? Is this possible? If it is possible, can please explain a little bit like what is the port number and what kind of VNC server version does the ESX, Workstation, Server, and Fusion products support.
Thanks in advance
PC Varma | http://communities.vmware.com/docs/DOC-7535 | crawl-002 | refinedweb | 282 | 67.86 |
Craft Minimal Bug Reports
Following up on a post on supporting users in open source this post lists some suggestions on how to ask a maintainer to help you with a problem.
You don’t have to follow these suggestions. They are optional. They make it more likely that a project maintainer will spend time helping you. It’s important to remember that their willingness to support you for free is optional too.
Crafting minimal bug reports is essential for the life and maintenance of community-driven open source projects. Doing this well is an incredible service to the community.
Minimal Complete Verifiable Examples
I strongly recommend following Stack Overflow’s guidelines on Minimal Complete Verifiable Exmamples. I’ll include brief highlights here:
… code should be …
- Minimal – Use as little code as possible that still produces the same problem
- Complete – Provide all parts needed to reproduce the problem
- Verifiable – Test the code you’re about to provide to make sure it reproduces the problem
Lets be clear, this is hard and takes time..
When answering questions I often point people to StackOverflow’s MCVE document. They sometimes come back with a better-but-not-yet-minimal example. This post clarifies a few common issues.
As an running example I’m going to use Pandas dataframe problems.
Don’t post data
You shouldn’t post the file that you’re working with. Instead, try to see if you can reproduce the problem with just a few lines of data rather than the whole thing.
Having to download a file, unzip it, etc. make it much less likely that someone will actually run your example in their free time.
Don’t
I’ve uploaded my data to Dropbox and you can get it here: my-data.csv.gz
import pandas as pd df = pd.read_csv('my-data.csv.gz')
Do
You should be able to copy-paste the following to get enough of my data to cause], ... })
Actually don’t include your data at.
Don’t
Here is enough of my data to reproduce], ... })
Do
My actual problem is about finding the best ranked employee over a certain time period, but we can reproduce the problem with this simpler dataset. Notice that the dates are out of order in this data (2000-01-02 comes after 2000-01-03). I found that this was critical to reproducing the error.
import pandas as pd df = pd.DataFrame({'account-start': ['2000-01-01', '2000-01-03', '2000-01-02'], 'db-id': [1, 2, 3], 'name': ['Alice', 'Bob', 'Charlie'})
As we shrink down our example problem we often discover a lot about what causes the problem. This discovery is valuable and something that only the question-asker is capable of doing efficiently.
See how small you can make things?
Do
import pandas as pd df = pd.DataFrame({'datetime': ['2000-01-03', '2000-01-02'], 'id': [1, 2]})
Remove unnecessary steps
Is every line in your example absolutely necessary to reproduce the error? If you’re able to delete a line of code then please do. Because you already understand your problem you are much more efficient at doing this than the maintainer is. They probably know more about the tool, but you know more about your code.
Don’t
The groupby step below is raising a warning that I don’t understand
df = pd.DataFrame(...) df = df[df.value > 0] df = df.fillna(0) df.groupby(df.x).y.mean() # <-- this produces the error
Do
The groupby step below is raising a warning that I don’t understand
df = pd.DataFrame(...) df.groupby(df.x).y.mean() # <-- this produces the error
Use Syntax Highlighting
When using Github you can enclose code blocks in triple-backticks (the character on the top-left of your keyboard on US-standard QWERTY keyboards). It looks like this:
```python x = 1 ```
Provide complete tracebacks
You know all of that stuff between your code and the exception that is hard to make sense of? You should include it.
Don’t
I get a ZeroDivisionError from the following code: ```python def div(x, y): return x / y div(1, 0) ```
Do ```
If the traceback is long that’s ok. If you really want to be clean you can put
it in
<details> brackets.>
Ask Questions in Public Places
When raising issues you often have a few possible locations:
- GitHub issue tracker
- Stack Overflow
- Project mailing list
- Project Chat room
Different projects handle this differently, but they usually have a page on their documentation about where to go for help. This is often labeled “Community”, “Support” or “Where to ask for help”. Here are the recommendations from the Pandas community.
Generally it’s good to ask questions where many maintainers can see your question and help, and where other users can find your question and answer if they encounter a similar bug in the future..
My personal preferences
- For user questions like “What is the right way to do X?” I prefer Stack Overflow.
- For bug reports like “I did X, I’m pretty confident that it should work, but I get this error” I prefer Github issues
-.
- I only like personal e-mail if someone is proposing to fund or seriously support the project in some way
But again, different projects do this differently and have different policies. You should check the documentation of the project you’re dealing with to learn how they like to support users.
blog comments powered by Disqus | http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports | CC-MAIN-2021-39 | refinedweb | 911 | 63.7 |
Haskell Quiz/Housie/Solution Dolio
From HaskellWiki
< Haskell Quiz | Housie
This solution uses a two pronged approach to the problem. Naively generating and testing books is too slow. However, if one looks only at whether spaces are empty or filled, the search space is sufficiently small to generate random candidates and search for a valid result among them. This search results in a template for the book, which can then be filled in (with some additional constraint checking) to get the final result.
Since the algorithm involves randomly guessing candidate results, it's possible for it to take a very long time. However, in practice, results usually appear in a matter of seconds.
This code makes use of the random monad.
module Main where import Control.Monad import Data.List import MonadRandom -- Some handy datatypes and aliases type Card a = [[a]] type Book a = [Card a] data Slot = Filled | Vacant deriving (Eq) -- Some general functions combinations :: [a] -> [a] -> [[a]] combinations xs [] = [xs] combinations [] ys = [ys] combinations (x:xs) (y:ys) = map (x:) (combinations xs (y:ys)) ++ map (y:) (combinations (x:xs) ys) splitAtM :: MonadPlus m => Int -> [a] -> m ([a], [a]) splitAtM _ [] = mzero splitAtM n xs = return $ splitAt n xs select :: MonadRandom m => [a] -> m (a, [a]) select xs = do i <- getRandomR (0, length xs - 1) let (f, x:l) = splitAt i xs return (x, f ++ l) stream :: MonadRandom m => [a] -> m [a] stream rs = map (rs !!) `liftM` getRandomRs (0, length rs - 1) slice :: Int -> [a] -> [[a]] slice n x@(_:tx) = take n x : slice n tx -- Some problem-specific functions rowTemplates :: [[Slot]] rowTemplates = combinations (replicate 5 Filled) (replicate 4 Vacant) bounds :: [(Int, Int)] bounds = zip (1: [10, 20 .. 80]) ([9, 19 .. 79] ++ [90]) validateCol :: [Int] -> Bool validateCol c = nc == (nub . sort $ nc) where nc = filter (> 0) c -- For creating an entire book bookTemplates :: MonadRandom m => [[Slot]] -> m [[[Slot]]] bookTemplates rs = (filter validateBookTemplate . slice 18) `liftM` stream rs validateBookTemplate :: [[Slot]] -> Bool validateBookTemplate b = and $ zipWith (==) fls bls where fls = map (length . filter (== Filled)) . transpose $ b bls = map (length . uncurry enumFromTo) bounds fillBook :: MonadRandom m => [[Slot]] -> m (Book Int) fillBook bt = liftM (unfoldr (splitAtM 3) . transpose) . mapM fill . zip bounds . transpose $ bt where fill (b,c) = do c' <- f (uncurry enumFromTo b) c if all validateCol (unfoldr (splitAtM 3) c') then return c' else fill (b, c) f _ [] = return [] f b (Vacant:xs) = liftM (0:) (f b xs) f b (Filled:xs) = do (r, b') <- select b liftM (r:) (f b' xs) -- For output intercalate s = concat . intersperse s showCard = unlines . map (intercalate "|") . map (map showN) where showN n | n == 0 = " " | n < 10 = " " ++ show n | otherwise = show n showBook = intercalate "\n" . map showCard main = bookTemplates rowTemplates >>= fillBook . head >>= putStrLn . showBook | http://www.haskell.org/haskellwiki/Haskell_Quiz/Housie/Solution_Dolio | CC-MAIN-2014-35 | refinedweb | 451 | 58.92 |
Remote logging with Python logging and Django
As part of my work on EveryWatt, our fledgling energy monitoring web site, I needed a way to consolidate log messages from all the data loggers we have running in a single place. If you're not familiar with it, Python's logging module is good stuff and worth checking out. We already used it for logging to files locally, and the module defines an HTTPHandler that can deliver log messages to a remote server via HTTP.
To implement the Django side, I wrote a lightweight pluggable app to receive the log messages and store them in the database. To use the app, just create an HTTPHandler that points to your Django site, and add it to a logger:
import logging import logging.handlers logger = logging.getLogger('mylogger') http_handler = logging.handlers.HTTPHandler( 'django.app.hostname:port', '/remotelog/your_app_slug/log/', method='POST', ) logger.addHandler(http_handler) logger.info('testing remote logging')
On the Django side, navigate to /admin/remotelog/logmessage/ and you should have a nice interface (courtesy of the Django admin) to filter, search, and sort log messages as they come in. The app is called django-remotelog, and it's up on Google code. Check it out, and feel free to comment. | http://www.caktusgroup.com/blog/2009/06/09/remote-logging-with-python-logging-and-django/ | CC-MAIN-2014-10 | refinedweb | 209 | 54.12 |
Post your Comment
Getting Methods Information of a class
Getting Methods Information of a class
... to retrieve information of all methods of a class (that included
in the program... methods list in Method[]
array. Now we can get other information of that methods
creating class and methods - Java Beginners
of the Computers.
This class contains following methods,
- Constructor method...creating class and methods Create a class Computer that stores information about different types of Computers
available with the dealer
methods
methods PrintStream class has two formatting methods,what
programes on methods
function
write a program to concatenate two strings entered by user
design a class called cricket to store information of players. Read information of 50 players and display information w.r.t. batting average
java object class methods
java object class methods What are the methods in Object class? There are lots of methods in object class.
the list of some methods are as-
clone
equals
wait
finalize
getClass
hashCode
notify
notifyAll
Servlet Methods
Servlet Methods
In this section we will read about the various methods... methods that are used to
initialize a Servlet, handles the request received..., the Servlet methods are
called life-cycle methods of Servlet.
Following
to create a java class and methods
to create a java class and methods How to create a java class without using the library class to represent linked lists of integers and also provide it with methods that can be used to reverse a list & append two lists.Also
Access the User's node and Retrieve the Preference Information in Class
will learn how to access the user's node and retrieve the
stored information in the class. Here we are going to make it easier to
understand by the complete example on this topic here we illustrate all the
methods used in this example
what is class methods in objective c
what is class methods in objective c What is class methods in objective c? Explain the class method of objective c with the help of an example
List Information about folder
List Information about folder
This Example shows you how to show folder information.
In this code we have used method of Folder class to retrieve information about
Class AsyncEvent important methods
In this section, you will learn about the important methods of AsyncEvent Class
PHP list class methods
Function get_class_methods gives the all methods names of the given class.
It takes input as class name and returns the array of the methods name
PHP LIst Class Methods Example
<?php
class myclass{
function aa
using class and methods - Java Beginners
using class and methods Sir,Plz help me to write this below pgm. here is the question:
Assume a table for annual examination results for 10... the following code:
import java.util.*;
public class Student{
int rollNo
Abstract class,Abstract methods and classes
to implement the
methods inherited from the abstract class (base class...
Abstract methods and classes
... is used
with methods and classes.
Abstract Method
An abstract method one
information updations
information updations I have created the following interface that allows updations to customer information:
public interface validateInfo
{
public void validate(String empcode, String password);
}
class updateInfo implements
Setting Fields Information of a class using Reflection
Setting Fields Information of a class using Reflection... we have seen that we can get
field values of a class by using the Field class. Now we can also set
different field values of that class by using set() method
variables and methods declared in abstract class is abstract or not
variables and methods declared in abstract class is abstract or not variables and methods declared in abstract class is abstract
write a program to demonstrate wrapper class and its methods......
write a program to demonstrate wrapper class and its methods...... write a program to demonstrate wrapper class and its methods
Abstract class or methods example-1
;Animal class"); // this
// ...;form Animal class");
}
}
class ...;called form BuzzwordAnimal class");
}
Object Class Methods in Java
We are going to discus about Object Class Methods in Java... or indirectly. There are many methods defined in java.lang.Object
class...(), wait(), etc
Java object class methods are:-
finalize()
clone()
equals
Operating System Information
information about our operation system. In this example we are getting the
OS name...
Operating System Information
... os.orch.
The System class contains several useful class fields
Explain final class, abstract class and super class.
Explain final class, abstract class and super class. Explain final class, abstract class and super class.
Explain final class, abstract class and super class.
A final class cannot be extended. A final class
Overriding methods
,same argument and same return type as a method in the superclass.
class Animal... for grass");
}
}
class Cat extends Animal {
public void eat(String str) {
System.out.println("Drinking for milk");
}
}
class Dog extends Animal
Functions and Methods
the day number from the main class. The function uses a switch-case statement... and display it on console.
import java.util.*;
class CubeOfNumbers{
public... using switch case statement.
import java.util.*;
class FindDay
{
public
Functions and Methods
is equilateral,isosceles or scalene.
import java.util.*;
class TypeOFTriangle
Creation of methods
Creation of methods I have a only single class and its having only one method ie., main method only.... i need to develop another method...;
import java.lang.String;;
public class BankClass {
public static void main
abstract class
abstract class Explain the concept of abstract class and it?s use with a sample program.
Java Abstract Class
An abstract class is a class that is declared by using the abstract keyword. It may or may not have
Post your Comment | http://www.roseindia.net/discussion/21986-Getting-Methods-Information-of-a-class.html | CC-MAIN-2015-35 | refinedweb | 937 | 54.73 |
Prerequisites for Reference Code Samples
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
Most of the code samples included in the Class Library and Web Service Reference conform to a standard format. The samples are designed to be copied into a console application and run as a complete unit. Any exceptions are noted in the sample.
Before running the code samples, you must set up the development environment, configure the application, and change generic constant values to match your environment.
Set Up the Development Environment
Set up a test Project Server system.
Use a test Project Server system whenever you are developing or testing. Even when your code works perfectly, interproject dependencies, reporting, or other environmental factors may cause unintended consequences.
In some cases you may need to do remote debugging on the server or set up an event handler. For information about remote debugging, see Walkthrough: Creating a Custom Project Server Web Part or How to: Write and Debug a Project Server Event Handler.
Set up a development computer.
You will usually access the Project Server Interface (PSI) through a network. The code samples are designed to be run on a client separate from the server except where noted.
Install Microsoft Visual Studio 2005. Except where noted, the code samples are written in Microsoft Visual C# for use with Microsoft Visual Studio 2005.
Copy Project Server DLLs to the development computer. Copy the following assemblies from [Program Files]\Microsoft Office Servers\12.0\Bin on the Project Server computer to the development computer.
Microsoft.Office.Project.Server.Library.dll
Microsoft.Office.Project.Shared.dll
Microsoft.Office.Project.Server.Events.Receivers.dll
Configure the Application
Create a Windows Console Application.
You will paste the code into this application.
Paste the code.
Copy and paste the complete code sample into the Program.cs file of the application.
Set the namespace.
You can change either the namespace listed at the top of the sample to the application default namespace, orproperties pane (on the Project menu, click CreateNewAssignment Properties). Paste the namespace in the Default namespace text box on the Application tab.
Set the Web references.
Many examples require a reference to one or more Web services. These are listed in the sample itself or in the comments that precede the sample. To get the correct namespace of the Web references, be sure to set the default namespace first.
To set a Web reference, do the following:
In Solution Explorer, right-click the References folder, and then clickAdd Web Reference.
In the URL box, type. If you have Secure Sockets Layer installed, you should use the HTTPS protocol instead of HTTP. Replace ServerName with the name of the server you are using. Replace ProjectServerName with the virtual directory name of your project server site, such as PWA. Replace ServiceName with the name of the service needed, such as Project. Click Go.
OR
Open your Web browser, and navigate to, substituting HTTPS for HTTP if necessary. Save the file to a local directory, such as c:\ServiceName.wsdl. In the Add Web Reference dialog box, for URL, type the file protocol and the path to the file, such as:\ServiceName.wsdl.
The previous URL is the standard URL for Project Server services. If other services are required, they are noted in the example.
After the reference resolves, type the reference name in the Web reference name box. The code samples use a standard of ServiceNameWebSvc. For example, the Project Web service would be named ProjectWebSvc.
For application components that must run on the Project Server computer and have elevated permissions, use the local URL in the Shared Service Provider. For more information about when and how to use the local URL, see Finding the PSI Web Services.
Project Server applications often use other Web services, such as Windows SharePoint Services Web Services. For an example of how to use SharePoint data from the Lists Web service, see Windows SharePoint Services Infrastructure for Project Server.
Set the local DLL references
Any local references for the code sample are listed in the using statements at the top of the sample.
In Solution Explorer, right-click the References folder, and then click Add Reference.
Click Browse, and then browse to the location where you have stored the Project Server DLLs you copied earlier. Choose the DLLs you need.
Click OK.
Set any other required references.
These references are listed at the top of the sample.
Change Generic Constant Values
Most samples have one or more variables that you must update for the sample to work properly in your environment. In the following example, if you have SSL installed, use the HTTPS protocol instead of HTTP. Replace ServerName with the name of the server you are using. Replace ProjectServerName with the virtual directory name of your project server site, such as PWA.
const string PROJECT_SERVER_URI = "";
Any other variables that must change are noted in the code at the top of the sample.
Other Prerequisites
Any other prerequisites are noted in the sample.
Verify
How to view the results from the code sample is not always straightforward. For example, if you create a project, you must publish it before it can appear in the Project Web Access Project Center.
You can verify the code sample results in the following ways:
Use Microsoft Office Project 2007 client to obtain the project from the Project Server computer, and view the items you want.
View the Queue log in Project Web Access My Queued Jobs ().
View published projects in Project Web Access Project Center ().
Use the Project Web Access Server Settings area to view all queues and enterprise objects (). However, you must have administrative permissions before you can access this area.
Clean up
You can use the Project Web Access Server Settings area to manage enterprise data (). This allows you to delete old items, force check-ins, and manage the job queue for all users, and perform other administrative tasks.
See Also
Tasks
Walkthrough: Creating a Custom Project Server Web Part
How to: Write and Debug a Project Server Event Handler
Concepts
Finding the PSI Web Services
Using the PSI in Visual Studio
Windows SharePoint Services Infrastructure for Project Server
Other Resources
Developer Center: Windows SharePoint Services
Developer Portal: SharePoint Server 2007 | https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2007/aa568853%28v%3Doffice.12%29 | CC-MAIN-2020-10 | refinedweb | 1,078 | 56.66 |
In this section, we will create our first LVT program,
simple.
simple
is a very basic (and very boring) program that displays a window on the screen,
and then exits when the window is closed.
simple.cpp:
#include <lvt/lvt.h> int main(int argc, char *argv[]) { LVT::App myApp; LVT::Wnd myWnd; myApp.Init(&argc, &argv); myWnd.Create("My Window"); myApp.Run(myWnd); return 0; }
Let's examine the individual pieces of the code.
#include <lvt/lvt.h>
Most LVT programs will begin by including lvt/lvt.h. This header contains the most common class definitions and is sufficient for most programs.
LVT::App myApp; LVT::Wnd myWnd;
Every LVT program contains exactly one
App object and
one or more
Wnd objects. Notice that both objects are in the
LVT namespace, so we must qualify them. Alternatively, we could
have brought them into scope with a
using namespace
LVT statement.
myApp.Init(&argc, &argv);
The first thing any LVT program must do is call the
App::Init
function.
Init establishes a connection to the windowing system and initializes the windowing
portion of the library.We pass
Init the address of the
argc and
argv variables. This
will parse the command line for common options such as
--display that well-behaved X11 programs
are expected to understand. You must call
Init before calling any other LVT
object member function.
myWnd.Create("My Window");
Wnd::Create creates the window and sets its title (in this case,
the title is "My Window").
Create does not show (or present) the window.
Create
will return
false if the creation was not successful. Once the call
to
Create succeeds, OpenGL is initialized, and we are ready to begin drawing.
myApp.Run(myWnd);
App::Run initializes the message loop and begins processing
messages.
Run takes one optional argument: a reference to the applications "main" window.
Run will also show the window passed to it. When this window is closed, the messageloop will end,
and
Run will return.
To compile
simple on UNIX and UNIX-Like systems, we will make use of the
pkg-config
utility to manage the library dependencies. We can compile the program like this:
$ g++ -o simple simple.cpp `pkg-config --cflags --libs liblvt`
To compile
simple on Windows systems, we link against either liblvt.lib, or liblvtd.lib (for
debugging). LVT provides a default implementation of
WinMain that calls a user-supplied
main
function. This ensures that any LVT program will compile on any LVT-supported platform. If you wish to use your
own
WinMain instead of
main include a
#define LVT_NO_DEF_WINMAINstatement before including
lvt/lvt.h. Some LVT classes contain inlined calls to OpenGL, so we will also need to link against opengl32.lib. The LVT source distribution contains Visual Studio project files for all sample programs. You can use these as templates for creating your own LVT programs.
If all went well, we should be able to run our new program and see a very basic, very boring window that should look something like this.
In the next section, we'll look at handling user input, so that our window can actually do something useful. | http://liblvt.sourceforge.net/doc/guide/ch01.html | CC-MAIN-2017-17 | refinedweb | 525 | 67.04 |
Hi there,
I have got this problem which is rather puzzling, to me at least.
My team-mate and I each did our coding and they work as standalone. His part is the UI and mine the backend processing.
He did his code using BlueJ using JDK 1.3, I did mine in JCreator using JDK 1.4.2_8. (I know its bad to not use the same version... :o but please read on.)
Apparently when compiling his code using BlueJ on my pc (WinXP), there were some compilation errors, and I fixed them. (Most prob due to different JDK versions. The error was in his type casting.) Compiled them again as standalone on my pc and they worked fine once more when i run them.
Now I tried to run his applet code with my code integrated, through BlueJ, by just integrating one simple function as a test. The applet opens and loads up. All the UI appears. Tried the function but cannot work. :eek:
Next I tried using JCreator to compile his code with mine, it compiled fine. Then I created a html file with the <applet> tags. It opens up the applet as before with all the UI buttons loaded but the integrated function cannot work. :eek:
Next I used the commands at command prompt:
appletviewer sample.htm
The applet opens up and works fine. The integrated command is working. :!:
The integrated command is opening a textfile and retrieve and store its contents into an arraylist. Upon user clicking a button on the UI, it would seek out the a particular cell of contents in the arraylist.
I did some debugging for the failed scenarios and discovered that my code could not find my myTextFile.txt file when it exists on the same directory. Tried to convert file type from unix to windows, still have the same problem. :cry:
Could someone please enlighten me on how to go about solving this problem please...
Very sincerely,
Rackus
Code: UI Snipplet: ======== public class UIFILE extends JApplet implements MouseListener, ActionListener, ItemListener { .... ... //declaration of global variables private TextArea TA = new TextArea (5,10); myClassFile cs = new myClassFile; ... ... ... public void actionPerformed ( ActionEvent e ) { Object source = e.getSource(); ... ... if (source == getContent ) { TA.append("Contents: "+cs.retrieveDetails("XXX")); } ... ... } ... ... ... } BackEndProcessing Snipplet: ===================== pulic class myClassFile { ..... //declaration of my global variables readFile rf = new readFile(); ..... .... public myClassFile() { rf.openNstore(); //opens the txt file and stores it into an array list. as standalone it works. } ... ... public String retrieveDetails( String toCheckAgainst ) { String result = rf.getValue(toCheckAgainst); //it gets the value. works as standalone. return result; } ... .... ... }
Edited 3 Years Ago by happygeek: fixed formatting | https://www.daniweb.com/programming/software-development/threads/23228/help-applet-only-works-in-appletviewer-but-not-in-html-file-with-applet-tags | CC-MAIN-2016-50 | refinedweb | 434 | 69.28 |
Algorithms and OOD (CSC 207 2013F) : Readings)]
Summary: We consider “unit testing”, an approach to software development and to the verification of computer programs. We also introduce JUnit, a unit testing framework for Java.
Most computer programmers strive to write clear, efficient, and correct code. It is (usually) easy to determine whether code is clear. With some practice and knowledge of the correct approaches, one can determine how efficient code is (or should be). However, it is often difficult to determine whether or not, but for many programs, it. (Automated proof systems can help with all of this, but they are beyond the scope of this course.).
What should a test suite look like? First, it should be as comprehensive as possible. That is, it should poke into the nooks and crannies of the code, looking at not only special cases, but also a variety of general cases. Second, it should be as automatic as possible. Evidence suggests that programmers are less likely to take the time to test “by hand” or to compare actual output to expected output. (Computers are also really good at comparing things, so why would you ask a human to do so?) An ideal test suite is easy to run (usually just one button), and gives either a quick affirmation that all tests passed or a summary of what tests failed. (Some only tell you the first test that failed, which is useful, too. You shouldn't use code that doesn't pass all of its tests.)
Testing is also a core component of many agile software development methodologies. Agile programmers have found that writing tests early helps programmers think about what they want their code to achieve and having convenient and comprehensive tests gives programmers confidence to try new approaches.
Most agile testing starts with a concept called “Unit Testing”. In unit testing, you focus on testing the small units of a program - individual procedures, objects, and perhaps small sets of cooperating objects. While you will eventually need to test the combination of smaller units, making sure that your basic units work correctly is an important place to start.
Most tests resemble the things you would do by hand - When I give this procedure this input, do I get this output? You'd probably run experiments like that while developing your code, so why not document them as code? It doesn't take long (in most cases, less time than it would to run the program and compare answers by hand). You can also take advantage of the computer to run more tests and to automate tests. For example, if you were writing a square root procedure, instead of just checking that the square root of 4 is 2 and the square root of 100 is 10, you can confirm that the square root of the square of i is i for every i from, say, 1 to 100.
One of the first unit testing frameworks was SUnit, designed for the smalltalk language. It was soon ported to Java, as JUnit. It remains one of the most popular unit testing frameworks for Java, and so it will be the framework we use in this course.
JUnit provides most of what you want in a testing framework:
We also use JUnit because it is integrated into Eclipse.
To create a new JUnit test for a class in Eclipse, right click the class that we want to test then choose New JUnit Test Case” window should appear. Once there, click the button. You can now select the methods that you want to test. After that, click the button. You now have a test class, typically in the same package as your original class.> . A “
Within the test class that you just made, there will be methods that are
prefixed with the word
test and the annotation
@Test. These are what you will use to test each method
you have chosen. At the moment they all should have a simple body,
something like,
fail("Not yet implemented");
We will replace this line with our test or tests. To start with, we'll
use the
assertEquals method, which takes three
parameters: a string that describes the test, the expected value, and
the expression to test. For example, if I've written a method called
average in the
Math class,
I might do a simple test with
assertEquals("averaging 1 and 3", 2, Calculator.average(1,3));
While
assertEquals will be our primary tools,
JUnit provides a variety of other kinds of assertion tests. You
can read documentation at.
You can put as many assertions in a test as you want, but JUnit will only tell you if they all succeeded - the first one that fails will trigger an error.
You may also find it useful to split your test into multiple methods.
As long as you annotate each with
@Test (and, in some
versions of JUnit, make sure the procedure name starts with
test), JUnit will run them. But even if you have multiple
methods, JUnit will generally still stop with the first one.
For example, suppose we want to test this class.
package taojava.examples.junit; /** * A simple set of mathematical methods for testing with JUnit. */ public class MyMath { /** * Compute the average of two integers, rounded down. * * @param left * One of the two integers * @param right * The other integer */ public static int average(int left, int right) { return (left + right) / 2; } // average(int,int) /** * Determine if a number, n, is even. */ public static boolean isEven(int n) { return ((n % 2) == 0); } // isEven } // class MyMath
A preliminary set of tests might look something like the following.
package taojava.examples.junit; import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; public class MyMathTest { @Test public void testAverage() { assertEquals("zero", 0, MyMath.average(0, 0)); for (int i = 0; i < 100; i++) { assertEquals(i + " vs " + -i, 0, MyMath.average(i, -i)); } // for } // testAverage @Test public void testIsEven() { for (int i = -100; i < 100; i += 2) { assertEquals(i + " is even", true, MyMath.isEven(i)); assertEquals((i + 1) + " is odd", false, MyMath.isEven(i + 1)); } // for } // testIsEven } // MyMathTest
As you may have noted, in order to use the static procedures from
MyMath, we have to precede them with the class name.
Java expects you to be very careful on naming the methods you use.
Note that all of the tests must be preceded by
@Test. If you remove that text, JUNit will no longer
run it. (Try it and see.)
JUnit may not run the tests in the order you expect. So
make sure not to rely on values you set up in one test in another test.
For example, if you are working on lists and add an element to the list
in
testA, you may not find that the element
is there in
testB. Similarly, at first
glance it might seem that these two tests could not both succeed:
int x = 3; @Test public void testOne() { assertEquals(3, x); x += 1; assertEquals(4, x); } // testOne @Test public void testTwo() { assertEquals(3, x); x += 1; assertEquals(4, x); } // testTwo
However, JUnit essentially resets the environment between every tests. And that's a good thing. You should be able to write tests that are not affected by what happens in other tests. (Yes, that's probably another form of encapsulation.)
So, what should we do if we want to do the same setup for all of
our tests, setup that requires additional code. One possibility
is to create a method and then just call it from each test. But
JUnit provides another option. In particular, JUnit provides the
@Before annotation which you can add to any procedure
you want called before every test. Traditionally, that procedure is
called
setUp, and you should probably use
that name for clarity.
Warning! On occasion, Eclipse seems to forget about the
@Before annotation. In those cases, creating a new JUnit
Test Case and clicking the box to include
setUp
usually works.
setUp
@Test
@Before. | http://www.math.grin.edu/~rebelsky/Courses/CSC207/2013F/readings/unit-testing.html | CC-MAIN-2017-51 | refinedweb | 1,332 | 62.98 |
#include <CbcBranchUser.hpp>
Inheritance diagram for CbcBranchUserDecision:
Definition at line 11 of file CbcBranchUser.hpp.
Clone.
Implements CbcBranchDecision.
Initialize i.e. before start of choosing at a node.
Implements CbcBranchDecision.
Returns nonzero if branching on first object is "better" than on second (if second NULL first wins).
This is only used after strong branching. The initial selection is done by infeasibility() for each CbcObject return code +1 for up branch preferred, -1 for down
Implements CbcBranchDecision.
Compare N branching objects.
Return index of best and sets way of branching in chosen object.
This routine is used only after strong branching. This is reccommended version as it can be more sophisticated
Reimplemented from CbcBranchDecision.
Illegal Assignment operator. | http://www.coin-or.org/Doxygen/CoinAll/class_cbc_branch_user_decision.html | crawl-003 | refinedweb | 116 | 51.55 |
Multiple web services on single server causing object undefined errorsMSO Simon Oct 12, 2009 3:14 AM
Hi,
I've currently got a bit of a strange problem within a web service that is proving difficult to debug.
There are the web service urls :
api.domain.com -> /var/www/html/api.domain.com/ -> CF mapping to MYSERVICE
testapi.domain.com -> /var/www/html/testapi.domain.com/ -> CF mapping to MYSERVICE_test
In both instances the cfcs that contain the code to be translated into a WSDL reside in /api/..., in the case of this example, /api/common.cfc. wsargs constists simply of refreshwsdl true.
If I call the following 2 lines ...
obj_myservice = CreateObject('webservice','',wsargs);
obj_myservice_test = CreateObject('webservice','',wsargs);
I then call the same method in both, and they are successful. When checking the "Data & Services" -> "Web Services" panel within the CF control panel, only the web service "" is listed, and not testapi.domain.com......
If I reverse the order in which the WSDL's are loaded then this switches, and testapi.domain.com..... gets listed under "Web Services" but api.domain.com..... does not. In essence it appears as though for some reason the CF server overwrites one with the other. The exact "object undefined" error is proving difficult to reproduce reliably.
This appears to happen no matter which server is accessing the web service, be it the same server or a remote server. All servers involved are running CF8. Accessing the 2 WSDL files in a browser results in the 2 WSDLs being rendered correctly with different namespace values.
On the same server are 2 more services
MYSERVICE2
MYSERVICE2_test
These reside in the /api2 directories on the same 2 subdomains, api. and testapi. MYSERVICE2 and MYSERVICE2_test appear to conflict with each other. MYSERVICE and MYSERVICE_test appear to conflict with each other. MYSERVICE and MYSERVICE2 do not appear to conflict with each other.
Is there a configuration change or anything like that which I should be aware of that would prevent me doing the above? The 2 /api/ directories are nearly identical with the exception that the namespace and complex type names have been set to & MYSERVICE in the first, and & MYSERVICE_test in the second url.
I have also tried mapping /MYSERVICE and /MYSERVICE_test within /opt/coldfusion8/WEB-INF/jrun-web.xml to no avail.
Any help would be appreciated. If there is any useful information that I have missed off please let me know and I'll dig it out.
- Simon H
1. Re: Multiple web services on single server causing object undefined errorsMSO Simon Oct 12, 2009 3:57 AM (in response to MSO Simon)
Hi,
As an extension to the above
Server Test service "Live" service
1 ("dev") devtest devlive
2 ("test") testtest testlive
I currently have a test script (TEST1) that performs the following :
CreateObject + call method from devlive
CreateObject + call method from devtest
CreateObject + call method from testtest
The script errors on the third, when it attempts to call a method from devtest. On the server on which this test script is running, by the end of this, there are the following 2 web services in the Coldfusion control panel :
I have a second test script (TEST2) on a second server distinctfrom the first test script server, on which the following is performed :
CreateObject + call method from testlive
If I execute TEST2, then it executes fine. If I execute TEST1 straight after, then I receive the following error on TEST1
AxisFault
faultCode: {}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXException: Deserializing parameter 'objectFetchReturn': could not find deserializer for type {}details
Where WEBSERVICE.types.common.details is a complex type (/api/types/common/details.cfc). If I then run the TEST2 script again straight after, the same error appears (with WEBSERVICE in place of WEBSERVICE_test). If I execute TEST2 twice in a row, or TEST1 twice in a row, then the error disappears"test" server has got jrun-web.xml edited to include the following, which "dev" does not.
<virtual-mapping>
<resource-path>/WEBSERVICE_test</resource-path>
<system-path>/var/www/html/testapi.domain.com/api</system-path>
</virtual-mapping>
<virtual-mapping>
<resource-path>/WEBSERVICE</resource-path>
<system-path>/var/www/html/api.domain.com/api</system-path>
</virtual-mapping>
I hope that this extended explaination helps.
Simon H
2. Re: Multiple web services on single server causing object undefined errorsMSO Simon Oct 12, 2009 6:25 AM (in response to MSO Simon)
Hi,
As an extra bit, if I use the "Web Services" panel to define both web services and name them, and then CreateObject by name rather than url, this does not seem to cause errors, so I get a feeling this may be a solution.
Still doesn't really explain why this is the case though
- Simon H
3. Re: Multiple web services on single server causing object undefined errorsGArlington Oct 12, 2009 8:08 AM (in response to MSO Simon)
I suspect that you problem is caused by DNS lookups, CF gets requests for different web services (live/test/dev) but becuase the names are identical itattempts to reslove the names and gets one IP address/name only...
This is my theory...
4. Re: Multiple web services on single server causing object undefined errorsMSO Simon Oct 12, 2009 8:15 AM (in response to GArlington)
I had originally considered that however it would not explain why the following 2 urls :
didn't then result in 2 webservices benig set up. I could understand if it went on the concept that it resolved dev.domain.com and test.domain.com to be the same IP and they had the same path.
Both WEBSERVICE and WEBSERVICE_test are mapped to /api/ within their relevant webroots. For reference, the following is also acceptable :
It could just be due to having messed up namespacing. On the test copy I have hardcoded references to complex types and interfaces to link to WEBSERVICE_TEST.types....... and namespace to. If there was a way to leave complex type/interface references to be a relative naming then that might help, however I have been unable to find one. | https://forums.adobe.com/thread/505195 | CC-MAIN-2018-17 | refinedweb | 1,015 | 53.92 |
14 May 2010 10:54 [Source: ICIS news]
TOKYO (ICIS news)--Tonen General Sekiyu posted a fourfold year-on-year increase in its first-quarter net profit to yen (Y) 31.6bn ($340.3m), as a result of equity valuation gains arising from the formation of a joint venture, the Japanese refiner said on Friday.
During the first three months to 31 March 2010, Tonen General recorded extraordinary income of Y20.3bn that related to the formation of the joint venture Toray Tonen Specialty Separator Godo Kaisha, which involved the company’s battery separator film subsidiary and Toray Industries, the refiner said.
Operating profit for the three-month period was up 41% year on year to Y18.4bn, while net sales increased 21% to Y586.9bn, Tonen General said.
The increase in net sales was due to higher product prices resulting from a rise in crude costs, the refiner said.
In the chemical segment, first-quarter operating profit was Y6.45bn, reversing from an operating loss of Y2.26bn in the first quarter of 2009, due partly to higher margins for aromatics and olefins, the company said.
First-quarter net sales in the chemical segment were up 76% year on year at Y61.6bn, the company said.
?xml:namespace>
($1 = Y92.85)
For more on aromatics and ole | http://www.icis.com/Articles/2010/05/14/9359455/tonen-general-posts-fourfold-rise-in-q1-net-profit-to.html | CC-MAIN-2014-49 | refinedweb | 218 | 66.44 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.