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 |
|---|---|---|---|---|---|
Eclipse Community Forums - RDF feed Eclipse Community Forums typedefs in the RTSC spec world <![CDATA[Discussion on typedefs in RTSC ---------------------------------------------------- I will post this mail chain to the newsgroup. Best Wishes Amit Mookerjee ------------------------------------------------------------ -------------------- From: Bob Frankel [mailto:bios.bob.frankel@gmail.com] Sent: Tuesday, May 05, 2009 12:47 PM To: Mookerjee, Amit Subject: Re: typedefs in the RTSC spec world in retrospect, we should have had this conversation on the rtsc newsgroup.... Mookerjee, Amit wrote: Bob, Great explanation! Thanks. Best Wishes Amit Mookerjee ------------------------------------------------------------ -------------------- From: Bob Frankel [mailto:bios.bob.frankel@gmail.com] Sent: Tuesday, May 05, 2009 7:51 AM To: Mookerjee, Amit Subject: Re: typedefs in the RTSC spec world this "feature" of C -- that struct (and enum) tags are in their own namespace -- has always been a source of confusion; C++ "fixed" the problem by effectively having the construct 'struct S { ... }' mean 'typedef struct S { ... } S'. in the TISB coding standards, for instance, we've always recommend including the struct (enum) tag when defining a struct (enum) typedef.... in the case of a struct, you *must* included the tag if you want to reference the struct type inside its own definition.... typedef struct TreeNode TreeNode; struct TreeNode { TreeNode* left; TreeNode* right; } now, you can do this "all at once", but then you'd have to reference the struct type by its "tag" (which happens to be the same, since they are really in different namespaces). typedef struct TreeNode { struct TreeNode* left; struct TreeNode* right; } TreeNode; [the tisb coding conventions dictate the first pattern] to keep the spec a little cleaner looking, we simply allow.... struct TreeNode { TreeNode* left; TreeNode* right; } [we automatically generate the extra 'typedef struct TreeNode TreeNode'; incidently, this is how you declare this type in C++; i also think C99 and possibly GCC support this form now???] as it turns out, 'struct S' *is* a new (and distinct!!!) type from any other; a 'typedef' (contrary to the name) does *not* create a new type!!!! the latter is effectively an alias for some *existing* type; the name of the typedef, of course, will generally carry some semantics -- but it is *not* enforced by the compiler. i can, for example, typedef 'Weight' and 'Distance' to 'Int' -- and yet i can free mix them in a program!!!! both 'struct S' and 'enum E' truly create *new* types (though the latter can be coerced into integers).... wrapping these declarations in a typedef does *not* create a new type by rather an alias for an existing one.... Mookerjee, Amit wrote: Bob, In some prototyping work I wrote a target module in the following manner: module H264Enc { typedef struct { int x; } MotionVector; instance: create(); Int32 process(Int32 *input,Int32 *output); internal: . } generating interfaces for package codecs.h264enc (because package/package.xdc.inc is older than H264Enc.xdc) ... translating H264Enc "codecs/h264enc/H264Enc.xdc", line 9: no viable alternative at input 'struct' It appears that typedef of structures is not supported in the spec. I could work around the problem by defining a struct struct MotionVector { Int16 x; Int16 y; }; And then using it in a fairly convenient way internal: struct Instance_State { MotionVector MV[352][288]; }; However, I should have been able to use typedef as well. On the other hand typedefs like typedef int foo; work as expected. This is non-intuitive for a C programmer. Is there any rationale for the support of typedefs in this manner? Best Wishes Amit Mookerjee Texas Instruments Inc.]]> Amit Mookerjee 2009-05-05T21:59:15-00:00 | https://www.eclipse.org/forums/feed.php?mode=m&th=937&basic=1 | CC-MAIN-2020-50 | refinedweb | 584 | 61.97 |
customer privacy
Kerrykins does not gather details of customers except their purchase history. This is to assist in any future purchases or complaints. Contact details are deleted every 8-10 weeks or earlier. Shopping cart history is deleted every 8-10 weeks or earlier. Kerrykins does not pass on nor allow any 3rd party to use of customers' details. Card payment services merchant monthly statements are held safely and securely until destroyed. Customer information is stored securely and supervised by a trained person.
VAT
Kerrykins is presently Not Vat Registered so there is no tax on your orders
Kerrykins Covers for Office Chairs was established in 2011 in Edinburgh, Scotland, designing, making and selling decorative removable coverslips for office chairs to serve the needs of businesses and organizations. We are currently based in Cumbernauld, near Glasgow.
Tel. **44 (0)1236731366
Kerrykins 39 Millcroft Road Cumbernauld Scotland G67 2QE U.K.
@kerrykinsdesign
Which cover to buy?
If you need a cool, breathable cover for your office chair, choose our range
polyester/viscose/spandex
or
polyester/elastane
Suitable for swivel fabric or mesh office chairs that have a separate backrest and seat. Not suitable for office chairs that have backrest and seat joined together at the armrest. These covers are machine-washable and are free from flame retardant chemicals that can cause cancers or sterility.
Kerrykins
brushed polyester covers
are suitable for all types of office chair upholstery. They are great for extra comfort for those long work hours. and are recommended for chairs where the original upholstery has worn through.
These covers are machine-washable and are not treated with
sprays or flame retardant chemicals that can cause cancers or sterility.
Kerrykins
pure wool seat covers
are naturally flame retardant and can help stop the spread of fire by acting as a barrier. The covers are ideal for workplaces where there has to be at least crib 5 or crib 7 flame retardant specs. The pure wool seat covers not machine washable. These covers are free from flame retardant chemicals that can cause cancers or sterility.
The backrest piece covers the front of the backrest only. Extra pieces are available to cover the reverse of the backrest also.
How do they work?
Watch our fitting demonstration on Youtube:
and see how simply a Kerrykins cover can be fitted
Kerrykins office chair cover sets are designed for swivel / revolving type of office chairs and have 2 separate pieces: - one piece to fit the seat part of the chair and one piece to fit the backrest part of the chair. To work, they need to be able to individually fit around the backrest and sides.
What chairs are not suitable?
If your office chair has armrests that are joined to both the backrest and the seat and would prevent the cover from fitting around, Kerrykins will probably not be able to fit.
If your office chair is a one-piece chair and the back is moulded together without any divide, Kerrykins will not be able to fit.
If your office chair has a design that does not have 4 clear edges on either side or the backrest part, Kerrykins will most likely not fit.
If your office chair is not any of the sizes listed, or if you're not sure, ask to have a cover Bespoke made. Prices are on the Bespoke webpage.
Extra backrest pieces
If you need an extra piece of fabric to cover the reverse side of the backrest, please include this in your order. Price £5.70
Despatch times
Purchases are generally despatched in 1-3working days. Bespoke orders usually take a little longer. Delivery is via Royal Mail signed for 1st class (UK) International sales are sent air mail tracked and signed for. EU destinations 3-5 working days. US and Canada, Australia, New Zealand 7-10 working days after despatch. For specific details please follow your parcel with the tracking information sent in your despatch confirmation email.
Safety Standards
Kerrykins covers for office chairs products comply with British fire safety standards for small removable decorative covers,(per exemption for removable chair decorations, seat pads, cushion covers and chair throws) and carry the required care labels
Q
. from Nicola in Dundee
I was wondering if your seat covers are made of fire retardant material?
A
.
Kerrykins washable slipcovers
do not use any fire retardant chemicals.
They are a
washable furniture accessory
and are designed to cover only a small portion of the office chair: the front facing area of the seat and back.
Kerrykins slipcovers belong in the
Exempt Category
, and
are classed in the fire regulations , along with
chair throws cushion covers
,
kitchen chair pads
,
and other removable, washable
furniture accessories.
and are
not
required to use fire retardant chemicals (the chemicals would wash out and be useless).
Kerrykins covers carry all the required labels.
Kerrykins offers a range of pure wool naturally
fire retardant covers
with no chemicals,
on the Kerrykins website Seat Covers Only page. Kerrykins fire retardant seat covers are not washable
As far as risk assessment is concerned, they would be low-risk because not only offices and public areas are smoking free but because they can very easily be removed and discarded, being small items.
Returns and Refunds
Kerrykins Covers for Office Chairs are guaranteed for reasonable use and to fit the size of chair they are designed for. Should an issue or problem arise about any of Kerrykins covers, please contact
Customer Service
at
kerrykins@kerrykins.com
or
**44(0)1236731366
If a customer decides to return their purchase for a refund, Kerrykins allows 14 days after delivery, to notify us of the intention to return the item(s) for a refund, and a further 14 days from notification to Kerrykins, to return (or provide proof of posting ) their purchases for a refund. Buyer pays return postage (UK). Refunds will be processed same day (or next working day) of receiving the returned covers, or proof of posting of the covers. Goods must be returned in original condition, thanks.
EU buyers can return items by post using the pre-paid returns label sent along with your item.
For faster refunds, EU buyers can provide to us a proof of posting ticket available at the post office when you post your returns. Please send this in an email to kerrykinsdesign@gmail.com Please make sure the writing on the ticket is clear and can be read.
Sale items are non-returnable
Office opening hours
Mon-Fri 9am - 4pm Sat 9am - 11am
closed Dec.18-27th; Dec.31-Jan5; Good Friday-Easter Monday
Spoof emails
any emails from "administrator@kerrykins.co.uk" are not connected to this business and please delete. That is not Kerrykins email address. Thanks for your assistance
Website Photographs
Colours may vary slightly from photographs displayed on Kerrykins website.
Payment over the phone
Thanks to:
Our customers, past present and future are an integral part of Kerrykins. They have given innovative ideas, patience when things take a little longer than expected, and comments about our products and the service they have received. Thanks.
Your purchases helping others:
This year Kerrykins donates to:
British Legion
fighting malaria in Yemen
DEC Yemen appeal
UNICEF
SSPCA
crowdfunding to save Rob Roy McGregor at Peterculter where Rob Roy allegedly leapt across the waters to escape the redcoats. A dearly loved statue by all kids young and old
Subpages
(1):
GDPR Customer Privacy Statement
|
Recent Site Activity
|
Report Abuse
|
Print Page
|
Google Sites | https://www.sites.google.com/site/kerrykinscoversforofficechairs/about-us | CC-MAIN-2019-09 | refinedweb | 1,249 | 61.77 |
Subject: [ggl] Trying a simple linestring-linear_ring intersection
From: Barend Gehrels (Barend.Gehrels)
Date: 2010-02-28 16:34:48
Hi Elvis,
>> Indeed this is not running; it will be implemented some moment; however the
>> problem you were interested in was getting intersection points between a
>> polygon and a linestring, including their direction, right?
>>
>
> Right.
>
> However, since my last e-mail I've realized that Qt (which is the
> library I'm using for the GUI) has some rudimentary support for
> finding intersection points between lines and polygons. Since my
> requirements are pretty low (for instance all my polygons will be
> convex), I think that I'll be able to hack together the additional
> code that I need to detect if a polygon was "entered" or "leaved" as
> well as the angle of incidence. At least that's what I'm hoping.
>
OK, no problem at all. Actually I'm curious how easy it is using Qt, the
problem you describe is not a standard operation in most libraries, AFAIK.
Just because I was curious and I've said it is not much work, and it
wasn't, I enabled the linestring/polygon get_turns.
I also created a small sample of it, combined with your use case.
The sample gives this figure:
so this is basically probably what you want to know (the line goes from
lower left, via upper-center to the right)
The sample is checked in as 05_b_overlay_linestring_polygon_example. It
creates SVG and does some console output.
I realize that the sample currently contains references to the namespace
boost::geometry::detail; as soon as this is an operation that end users
have to do we have to figure out how these would look like but at least
it should not be in namespace detail... Furthermore the operations are
called like "intersection" and "union" (note: there are some more of
them!), because that is what polygon/polygon intersection would do with
them, but we might consider renaming them to... for example
entering/leaving :-)
This is actually a very nice use case of what people like to do with
Boost.Geometry. Thanks :-)
Note that polygon/linestring intersection (delivering linestrings inside
polygons) is still not yet supported.
> So as it turns out, perhaps a full-blown geometric computation library
> is overkill for my simple application.
>
> That said, support for this would of course be a nice addition to
> Boost.Geometry nonetheless. I just want you to know that my needs are
> not that urgent anymore ;)
>
Sure, it is a nice addition.
> Thanks a lot for the quick support though!
>
Welcome! Success with your project!
Regards, Barend
-------------- next part --------------
Skipped content of type multipart/related
Geometry list run by mateusz at loskot.net | https://lists.boost.org/geometry/2010/02/0639.php | CC-MAIN-2021-04 | refinedweb | 451 | 60.35 |
ok I managed to get this working correctly. The code is to take in a string and add the numbers what I am trying to change is to also allow subtraction including checking the first number for a + or - sign. I have tried many things but I guess I am not seeing hot to set the If statement for that seems to be what would work. NOt sure how to check for - or + using the scanner. Any help would be great.
import java.io.*; import java.util.*; public class Tester { public static void main(String args[]) { Scanner kb = new Scanner(System.in); System.out.print("Enter something like 8 + 33 + 1345 +137 : "); String s = kb.nextLine( ); Scanner sc = new Scanner(s); sc.useDelimiter("\\s*\\+\\s*"); int sum = 0; while(sc.hasNextInt( )) { sum = sum + sc.nextInt( ); } System.out.println("Sum is: " + sum); } } | http://www.javaprogrammingforums.com/whats-wrong-my-code/5652-easy-help-but-cant-figure-out.html | CC-MAIN-2014-10 | refinedweb | 141 | 77.13 |
Hello, am, as many struggling with the “this” keyword. I understand, that it is pointing one level up (like outside a function). Also, that it is pointing to the word, that is to the left of the dot.
But it still is not intuitive for me. Like as in the following example:
import React from 'react' class Counter extends React.Component { constructor() { super() this.state = { counter: 0 } this.handleIncrement = this.handleIncrement.bind(this) } handleIncrement() { this.setState({ counter: this.state.counter += 1 }) } render() { return ( <div> <div>{this.state.counter}</div> <hr /> <button type="button" onClick={this.handleIncrement}>+</button> </div> ) } }
I would really appreciate, if someone could (like in paint) add some arrows to the “this” keyword and explain to me, where is what pointing to.
Thanks in advance! | https://forum.freecodecamp.org/t/understanding-this-in-react-example-with-code/392542 | CC-MAIN-2020-40 | refinedweb | 127 | 62.85 |
Hide Forgot
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901
Description of problem:
Driver can't be created for sourceURL with the new installation.
I installed 8.0 clean with the server option, all packages. I set
/var/lib/pgsql/data/postgresql.conf's tcpip_sockets=true (and uncommented the
line). I also changed the /etc/rc.d/init.d/postgresql script to pass in the -i
parameter. I created a test database, with a best user, and confirmed that I
could get there with psql -U testuser -d testdb. I updated
/var/lib/pgsql/data/pg_hba.conf to allow connections all kinds of ways, one at a
time: localhost at 127.0.0.1 using password, using trust, localhost at
192.168.0.0 using password and trust, host using trust and password. I put the
.jar file in my classpath and compiled a sample script per the example online,
using Class.forName("org.postgresql.Driver") to register the class, which succeeded.
But Connection dbConnect = DriverManager.getConnection("jdbc:postgresql:testdb",
"testdb", "password") failed with an SQLException: can't find driver for URL
jdbc:postgresql:testdb.
I've shown everything I did to the pgsql-jdbc mailing list at postgresql.org. No
one can find anything wrong after many suggestions.
I tried disabling the firewall through the security manager, but every time I
return to it, it is on the default High setting. I don't believe this should be
an issue since this is all on one machine.
Help! Thanks!
d_r_king@yahoo.com
Version-Release number of selected component (if applicable):
How reproducible:
Always
Steps to Reproduce:
1. Configure postgres for tcp/ip in .conf file and init.d script
2. put distribution jar file into classpath
3. Compile this program (from memory here, excuse typos, they're not in the
original):
import java.sql.*;
public class HiDB {
public static void main (String[] args) {
try {
Class.forName("org.postgresql.Driver");
System.out.println("Got driver.");
} catch (SQLException (e) {
System.out.println("No registered driver.");
Connection dbConnect=null;
try {
dbConnect = DriverManager.getConnection("jdbc:postgresql:testdb", "username",
} catch SQLException (e) {
System.out.println(e);
System.out.printStackTrace(e);
}
}
}
4. Compile and run. You won't get a connection. libgcj.something is mentioned;
someone asked why that showed up, but that's deep in the internals. ???
Actual Results: SQLException from Java program.
Expected Results: Connection object returned by function call getConnection().
Additional info:
I have seen a few other notes on the archive of pgsql-jdbc at the postgresql
site from others having problems with Red Hat 8 and JDBC with postgresql. We
also can't compile from source to get around this problem.
I upgraded to the 7.2.3 PostgreSQL version using the Redhat downloads. Still no
luck. I tried uninstalling the packages, and building from the 7.2.3 source from
PostgreSQL, but all the configure options I wanted broke the build. I finally
had to reinstall 8.0 without the database. PostgreSQL 7.2.3 then build and
installed perfectly, and I have it up and running. It cost me days trying to
figure this out. I think that the database isn't fully supported for 8.0 yet,
just 7.3, and shouldn't have been distributed with 8.0.
Reassigning this bug to new owner.
Fernando,
Eventhough this is not an RHDB problem, please have a look.
Maybe it's something in the path.
Cheers,
Patrick
Dennis and I have already worked out the problem. The jdkgcj-0.2.3-1 package
adds a java command to /usr/bin that actually uses GNU Java. So, if this is
installed, one has not only to set the JAVA_HOME variable but also make sure the
PATH has the Java SDK ahead of /usr/bin. This is not a problem with the IBM JRE
(which sets the path correctly) but the Sun ones are not that smart.
We would like to see the need for setting the PATH documented in some more
general place, but the only place we have control of is the JDBC documentation
of the Red Hat Database. I am filing a request that a paragraph be added to the
"Installing the Driver" section (Programmers Guide and HOWTO JDBC document) to
suggest that the user check if the proper java is being used and if not that the
PATH be corrected.
As there is no change in the code I am closing it as NOTABUG (I could not find
anything else more appropriate anyway).
Thanks again to Dennis for spotting this and for helping me track down the problem. | https://bugzilla.redhat.com/show_bug.cgi?id=78301 | CC-MAIN-2020-50 | refinedweb | 775 | 60.82 |
Daniel Shevitz
2008-09-29
Howdy,
I'm having a problem debugging my app. I have my project which is under subversion control. I am using Traits library
code from Enthought as the dominant framework for my app. My code is causing the Traits code to break, so I need to
set a breakpoint in the Traits code.
I don't seem to be able to do this. If I open the code, using File->Open File..., I can't set a breakpoint. I don't want to
import this code into my project II believe this entails copying the code) as this is a large block of code and I don't want to change my pathing and in any case it's the wrong thing to do. So what's the simplest way to set a breakpoint in code
that is on the run path, but nothing more?
thanks,
Danny
Fabio Zadrozny
2008-10-01
Please report that as a bug (I remember that working once, so, maybe something broke it)... Also, please see for the details that should be in the bug report.
Cheers,
Fabio | http://sourceforge.net/p/pydev/discussion/293649/thread/8e7b0aee | CC-MAIN-2015-48 | refinedweb | 188 | 89.08 |
McElwain4,575 Points
How do I get this to work?
I've worked on this a bunch of different ways, but I just can't quite figure out how to get the right outcome,
dicts = [ {'name': 'Michelangelo', 'food': 'PIZZA'}, {'name': 'Garfield', 'food': 'lasanga'}, {'name': 'Walter', 'food': 'pancakes'}, {'name': 'Galactus', 'food': 'worlds'} ] string = "Hi, I'm {name} and I love to eat {food}!" def string_factory(dicts, string): newList = [] newDict = dicts.pop() a = string.format(**newDict) newList.append(a) return newList
3 Answers
Chris FreemanTreehouse Moderator 67,986 Points
You need to add a loop to iterate over the dict_list. Something like:
def string_factory(orders, format_string): formatted = [] for order in orders: formatted.append(format_string.format(**order)) return formatted
Vittorio Somaschini33,371 Points
Hello Nathan.
I am struggling understanding what you wanted to do with your code. Especially the pop method line as I can't really see the need for it.
I have moved back to the code challenge and solved it this way:
I have typed the same code as yours till newList= [], but if I got it right in python we should not use camelCase but something like string_list = [] as per conventions (I think).
After that I have made a loop to go through all the dictionaries in dicts, and just appended the formatted string each time to the string_list we have just initialized. I see you got this part as you wrote a very similar line of code : string.format(**newDict)
After that I have returned the string_list: make sure indentation is good, because the return statement in this case has to have same indentation as the for in loop.
I am going to paste my code below, it is not a very good practice I think as you may want to try and solve it by yourself now before having a look at it, but since I think it is important to understand the solution I came up with, I am going to paste it anyway, so
DO NOT SCROLL DOWN IF YOU WANT TO TRY AGAIN BY YOURSELF!
def string_factory(dicts, string): string_list = [] for dictionary in dicts: string_list.append(string.format(**dictionary)) return string_list
I hope this helped.
Let me know if any other questions.
Vittorio
Nathan McElwain4,575 Points
Thank you both. I was having a hard time figuring out how to iterate through the list. | https://teamtreehouse.com/community/how-do-i-get-this-to-work | CC-MAIN-2022-27 | refinedweb | 390 | 68.91 |
appears to be written by the PLO. Has the Economist turned into a mouthpiece for libel against Israel? Can a state sue a magazine?
This absurdly biased article claiming that Palestinians are being "squeezed" out of the West Bank is based on a lie: the statistic given that 400 Palestinians have been "evicted from the West Bank" this year. The actual number is - zero. The author, whether intentionally or not, misread a report by NGOs (not by the UN, but on the UN website) that said that 379 people were displaced - but they are still on the West Bank.
It's been quite a few hours since I tweeted this to you, and still no correction. Hmmm.
By the way, to watch an accurate report of what is happening in Susiya, see this:
The truth is the EXACT opposite to your report:
"Stealing a State" - from 'Tze'dek' Magazine, Makor Rishon
"While in Israel there are talks of resuming the negotiations, the
Palestinian Authority is establishing facts on the ground. The goal,
which has long since been stated, is to take over areas 'C'.
(Article by by Gil Bringer on March 14, 2012)."
These identical containers are all supplied by the Palestinian Authority with a single purpose - to colonise Area C.
Colonizing their own country... who woulda thought it possible?
It's not their own country. At best it is 'disputed'. The Jews originated from this part of the world 3,000 years ago and Hebron in the middle of area C always had an ancient and continuous Jewish presence from the time until 1929, when they were massacred - Jerusalem had a Jewish majority until 1948 when the Jordanians ethnically cleansed the eastern part of Jews.
The Arabs are trying to steal Jewish history - they have already invented some Muslim prophet so that they can lay claim to Rachel's or Jacob's tomb. They have already done this with scores of Jewish shrines (eg Ezekiel's tomb in Iraq)across the Middle East and North Africa. They are not interested in sharing but in taking over.
I've never put much stock in historical arguments, to be perfectly honest. Any argument about history leads dangerously to a blind manifest destiny. Even for the events you speak of in 1929 and 1948, there are probably few alive today who could have been old enough to participate, let alone actually have done so. You want to take out your historical grievances on them, then I have no bones with it. Hunt them down and hang them, for all I care, they deserve it.
On the other hand, what I do care about is what the state of Israel agreed to do, and has continued to agree to do. That is to, eventually, give the Palestinians a country of their own, on territory that both legally belongs to them - surprise! history doesn't trump international law! - and that Israel has agreed to hand over. In my mind the international law perspective trumps everything. That's the way the world works now; there are no feudal claims or birthright homelands.
Also, syncretism in religions happens all the time. "Stealing" from other traditions is a normal part of life. If someone is trying to prevent you from worshiping at your holy place, that's one thing; if they too want to worship at your holy place without bothering you, who cares?
It's not a 'historical' grievance. You are legitimising the ethnic cleansing of Jews not just from Judea but from all over the Arab world within living memory. It doesn't make it right - because Arabs have evicted Jews from areas they have lived in since time immemorial. And now that Jews can again live where their ancestors lived, you say they have no right to do so.
To have a country is one thing, but why does it have to be 'judenrein'?
As Judaism is older than Islam, there's a lot more Muslim syncretism than the other way around.
Legitimising? Hardly. What happened was wrong. What is happening now is wrong. Two wrongs don't make a right, not least because what is now happening is punishing the sons for the sins of their fathers. Again, I don't care about what's happened since time immemorial. The logic of birthright ownership is fatally flawed. No matter where the Jews - or anyone else, for that matter - might have lived, people live there now.
With your comment about "Judenrein", you miss the point about a state of Palestine. Palestine would be a state where the people who live there - all of them - would have power, representation, and have the ability to influence the supreme law of the land. As they exist now, that would include the settlers, however much they love their cozy extraterritorial legal status. Expelling them without a legal cause would be just as bad as what happens to the Palestinians now..
Oh ho. It took less than a minute of looking through the Oslo accords to find the language that governed the "temporary" Area C, and to find that no administrative privileges or military privileges are granted to Israel over Palestinian civilians. Meanwhile, as the map in the article clearly shows, there are settlements encroaching well into Area B. So whose settlements are illegal and whose are not?
If Abbas stated that no Jews would be allowed to live in a Palestinian state, then that's also wrong. Still doesn't make you right. If there are official levels of discrimination in a future Palestinian state (noting of course that there are explicit levels of discrimination in Israel) then I also think it's racist and wrong. Still doesn't make you right.
"because Arabs have evicted Jews from areas they have lived in since time immemorial" - your comment.
What happened in Europe then?? The Spanish, the Germans, the Polish, the Russians, the French, etc. were all Arabs?? Wow!!!
Illegal Bedouin squatters should be accorded no privileges or - unless in 'Palestine'.I'm more right than you are.
Illegal Bedouin squatters should not be accorded privileges or even - unlike in 'Palestine'.I'm more right than you are.
"Illegal Bedouin squatters should be accorded no privileges or rights, any more than any one who decides to set up home in Central Park Manhattan."
Unfortunately, that's not for you or Israel to decide, but legally for the Palestinian civil government to decide. People who settle on land are often given property rights to that land if none exists before, if the legal framework is right. The United States have a long history of this with its homesteading acts.
The Oslo Accords didn't make Palestinian settlements illegal, the Fourth Geneva Convention did. There is wide consensus on this subject from basically everybody but the current Israeli government.
There is state sanctioned discrimination in Israel - of course there is. Just because the discrimination involves positive rights not granted to non-Jews in Israel doesn't mean it's not discrimination. Jews receive several different kinds of state support not available to Arabs and have an effectively unconditional right to migrate to Israel. Orthodox religious authorities refuse to sanction any but Jewish marriages using their own definition of who is and is not a Jew. My Israeli cousin and his wife had to marry in Cyprus.
The Israeli Administration of Area C has effectively turned a blind eye to this illegal settlement by Bedouins.
What state support is given to Jews and not to Arabs? I would like to know.
Yes Jews have an unconditional right to emigrate to Israel, just as Irishmen, Greeks or Japanese outside their countries have a right to emigrate to their countries. And a good thing too, that there is one state in the world prepared to give Jews unconditional rights, because Jewish citizens of Arab countries - and 52 percent of Israeli Jews hail from Arab and Muslim countries - were stripped of their citizenship and their rights. But of course Israel is always judged in a vacuum and double standards always operate.
State support of Jews is evident in discriminatory tax treatment and direct state funding of religious activity. Not only do religious bodies directly receive funding from the government, and non-Jewish ones receive notably less, the government directly provides additional income and military service exemptions to religious Jews. There is also a great deal of de facto discrimination, where laws are applied unequally. There is a great deal of documented evidence of British Mandate Palestine-era laws on eminent domain selectively used to deprive Arab citizens of Israel of property rights. State development budgets routinely devote under 15 percent of total state infrastructure, business support, and other spending to Arab Israeli areas. That's not the West Bank, that's for Israel proper. There are also significant disparities, on a per-person basis, between state spending on the Arab-language education system and Hebrew-language education system, roughly 1/5. Even taking into account that the average length of education for an Arab-Israeli is three years less than for a Jewish Israeli, there is no way to justify that kind of gap.
.
The interesting aspect of Jewish immigration to Israel is that it is more far-reaching and of an explicitly religious character than any other country. But take your example of an Irishman. If our hypothetical Hibernian is more than one generation removed from a citizen of the Irish Republic, then he is, in fact, not granted the ability to become a citizen. Israel doesn't work like this. In fact, its modus operandi is highly unusual.
.
One can justify accepting Jews persecuted in other nations on humanitarian and asylum-seeking grounds without having to enforce an explicitly religious citizenship criterion.
"And now that Jews can again live where their ancestors lived, you say they have no right to do so" - your comment.
They Jewish people choose the location of Palestine because they were rejected by all the countries of the world (in the Evian Conference). To make it look "legal" - they called it the concept of "national self-determination". This is a total misuse of the term )!!! There is no parallel in recent world history for such a silly assertion!!!. Even if God exists, he is not a real estate agent, who can be used to transfer land rights on earth!!!! No other religion uses ancient texts to claim land!!!.
Much religious activity is funded privately and what state funding there is may well be pulled now if religious schools do not teach the secular curriculum. Re property rights I can point to examples where Arabs are privileged over Jews in terms of leasing land. So British mandate law was good enough for the British but is not now good enough for Israel. De facto discrimination sadly exists in every state, but it is not the same as state-sanctioned discrimination.
State development budgets may be smaller for the Arab sector but Arabs generally pay little tax. Re education Arabs have a three-year headstart in earning terms than Jews do because they are exempt from serving in the army. Tell me - are state budgets smaller for Hispanics in the US?
Re fast-tracking your own nationals many countries do it and not just for a single generation. To get Israeli nationality you only need to have one Jewish grandparent - this is quite different from 'halacha' or Jewish religious law..
No matter what the level of state support, if there is state support for Jewish religious activity without corresponding support for other religious activity, it is discriminatory. No two ways about it.
De facto discrimination is state sanctioned if it is systematically applied by agents and organs of the state. I am not talking about social discrimination, I am talking about systematic discrimination in the eyes of the law. The way British mandate law is applied matters as much as the law on the books. Singapore used British mandate law to justify suing political opponents of the PAP into submission and putting opposition politicians in jail, while the British never did any such thing - in fact, an appeal to the commonwealth Privy Council reversed a ruling against a prominent opposition politician, whereupon the Singapore gov't revoked the right of review by the Privy Council.
That there are examples of Arabs being privileged over Jews in land leases does not mean that this automatically excuses expropriation of Palestinian property rights. It is all a question of relative magnitude.
As for Israeli nationality law, it is explicitly religious. The law of return was recently ruled to not apply to Jews or Jewish descendants that practice a religion other than Judaism.
Finally, your circular argument on Arab-Israelis assumes that infrastructure spending should be targeted at those who pay the most taxes. However, infrastructure spending and business development is essentially universally agreed to be spent on those areas where the spending will be most effective, i.e. where things are the least developed and marginal inputs will have the greatest impact. Arab-Israeli areas of Israel have consistently the worst infrastructure in the country, have the most potential benefit to derive from additional infrastructure, and yet get little.
In the United States budgets for development generally spend more on disadvantaged groups, generally on the basis of income rather than race or religious affiliation. Based on US demographics I'd say its reasonable to assume that Hispanics in the US receive a disproportionate amount of aid per person. I'll give another example: in my home state, poorer and underperforming school districts receive more money than richer districts, which often have to ask for community money to offset budget cuts. These districts are most often urban inner-city districts that are disproportionately made of poor minority students.
In 1850, the total Jewish population in the world was 12 million, of which 10 million lived in Europe.
"Palestine in 1850 had about 350,000 inhabitants, 30% of whom lived in 13 towns; roughly 85% were Muslims, 11% were Christians and 4% Jews".
Your ancestors must have been Asian Jews.
Why is this comment relevant. The situation today is that most Israeli Jews are Asian as you call it - actually from the Middle East and North Africa.
The vast majority of Jews are now Ashkenazi Jews. I guess there was a lot of foul play in Europe over 20 centuries - these Asian Jews could not have become blond by keeping their legs crossed!!!!
Not 'vast majority' - a smaller majority worldwide now in view of the grand job Europe did in destroying its Jews, and a minority in Israel where Middle Eastern Jews predominate
According to the latest Israeli government figures, this is the figure:
52% - Sephardim and Mizrachim.
48% - Ashkenazim.
Therefore, nearly half the population is European Jews.
"It's not their own country. At best it is disputed" - your comment.
What is not disputed is that Palestine is the birthplace of Jesus - and it is where he died. As Easter has just ended - it is a good.
Had Jesus been born now in Palestine, he would certainly have been declared a terrorist by Likud and the Jewish Taliban, and he would have been killed ("targeted assassination").
How history repeats itself. 2,000 years he was killed by the High Priests. Had he been born now, IDF would have gladly done the job!!!!!
There are much more important issues to cover than this half baked one. One issue is how the Moslem brotherhood is driving Egypt to self destruct. Another is the murderous behavior of the Syrian regime towards its own people. These are important and real issues. The "Palestinian issue" is mostly contrived and manufactured by extremists in the west bank and Gaza who are ready to kill anyone, Jewish, Moslem or Christian who is in their way.
wait, do the Arabs have an actual legal, substantiated claim to that land or are they basing the,selves on their illegal conquest and occupation in 634 CE as ownership rights?
Interesting point - and on what basis do the Jews have title to this land??.
In 1922, following the 1917 Balfour Declaration, the 1919 Versailles Peace Conference and the 1920 San Remo Conference and based on the recognition of the past few centuries of the justness of the restoration of the Jews to the homeland, the ultimate international legal body, the League of Nations, awarded a Mandate predicated on the historic connection, i.e., the 3000-year presence of Jews in the country including a tribal federation, a monarchy, a commonwealth and such institutions of rule and power that developed in the country a language, a religion, a culture as well as industry, agriculture and an archaeological presence of buildings, implements, pottery, etc. still being discovered of institutions of state, government, et al., of the Jews and that territory. Jews have current title to the land by force of conquest" - your comment.
You make a big point about "might makes right"!!! Indeed!!! We better listen to you, otherwise the IDF will cut us up into little pieces, our foreskins will be removed and our virgin daughters will be given to Likud politicians for their carnal pleasures.
I wrote "IF MIGHT MAKES RIGHT". Empahsis on "IF".
You must like to write because you wrote 7 paragraphs distorting my argument. Left unsaid is that if might does not make right then the Arabs have no rights or title to the lands by force of conquest either. So where does their right come from exactly? - The Koran?
There is also the small detail of the League of Nations, the San Remo Conference, the British Mandate, Resolution 242, etc.
Not such a fan of International Law now, L6? Gotta hate those double-edge swords. Glad you asked, though.
Actually, the Koran specifies that Israel is for the Jews. It seems Muslims allow Jew-hatred to get in their way of actually obeying their own book. Wouldn't be unprecedented. Christianity has its own dark history that is quite similar.
Their right comes from the fact that they are the native inhabitants of the territory. They were born there. Their parents were born there. Their grandparents were born there. Their great-grandparents were born there. It's called the right of self-determination.
"So where does their right come from exactly?" - your comment.
The Palestinians (Muslims and Christ.:
W"hen"!!!!
Ethnic cleansing was all pre-planned!!!!!!!
All these books, including the Koran, are works of fiction purportedly written by an unknown author. In fact, many of them were written under the influence of intoxicants - it is documented in the Bible..
Fiction speaks the most profound truth. The old testament is the national epic of the Jews, just as the Illiad is the epic of the greeks. Both fact were committed to their present form i about 600BCE. There plats of the bible that referr to events prior to david have very little independent verification in the literature of neighboring cultures. However the events from 1000 BC onwards (basically Judges and Kings onwards) are quite accurate in and can be easily verified from persian, babylonian, Assyrian, greek, and egyptian records. In any event your opinion about the accuracy of the old testament as a historical document is irrelevant since you are not a party to the dispute. The argument over ownership and legitimacy is between the Arabs and the Jews. Both are Semitic peoples and they both accept the historical validity and divinely inspired origin of the old testament. They both accept and venerate the prophets Abraham, Isaac, Jacob, Moses, Aaron, Joshua, Solomon, David and all the other prophets of the old testament. Thus the old testament is the only foundation for dialogue between the parties and it is the only document that confers true legitimacy on claims of land ownership in the middle east.
Absolutely, there are many resolutions of the UN, starting with the creation of Israel. Resolution 186 was designed to resolve huge differences between the warring parties and to bring about a peaceful and equitable division.. There are many moderate people on both sides of this unfortunate conflict. However, on the Israeli side the right-wing predominates - and so do the Jewish Taliban - e.g., the tragic assassination of Mr. Rabin.
The 3 Abrahamic religions have the same myths, stories and legends - and are irrelevant in the 21st century - which is (hopefully) secular. These books need to be discarded in any rational discussion about this (or any other) conflict. If only Abraham had controlled his lust - he f---ed the maid and got her pregnant!!! The entire (sad) saga begins from there.
"Thus the old testament is the only foundation for dialogue between the parties and it is the only document that confers true legitimacy on claims of land ownership in the middle east" - your comment.
What absolute nonsense. Nobody in history has ever used an ancient book to grant title on land. Who do you think God is?? A real estate broker!!!! An estate agent!!!!
At the time the Abrahamic religions arrived in the Middle East, the population of that area was 8% of the population of the planet. How come God did not know what was going on in the rest of the world?? If he did, he would have granted China and Australia (and more) to his "chosen people". This is a great way to grab land. Just occupy any place you like. If anybody asks, just ask them to contact an unknown chap in the sky!!! Evict people from their homes, burn their villages, and create havoc in general - when asked, just say that kindly contact God!!! No wonder the Europeans got fed up!!!!
"Israeli Arab and Druze citizens have rights" - your comment.
Then why is was not aware of this distinction and I do not support it. I went to high school in Israel and we had a debate in civics class where I argued against the travel restrictions on Arab citizens. I visited just last year and I see that these have been lifted.
In fact there were more Israeli Arab tourists in Eilat while I was there than Jewish ones. So progress has occurred.
I regret that this distinction still exists in the ID cards.
Jude
As I said previously, your western opinion is irrelevant since you are not party to the dispute. I can assure you that under shareia law, god is indeed a real estate broker. Also under talmudic law. In fact the ownership of all land in Israel belongs to god and is administered as a religious trust by the state and the rabbinical council. It has a similar status to papal lands and the Vatican enclave in Italy. Mortal men cannot "own" property in the holy-land according to Israeli law. They merely use it temporarily via a long term lease. This is one of the reasons why the idea of ownership of territory on the west bank and the "legality" of israeli settlements is so ridiculous.
Thank you, Jude. I am glad to see that you are a liberal (probably somewhat left-wing) Jewish person. It seems that you do not actually live in Israel.
"the ownership of all land in Israel belongs to god" - your comment.
Several very important questions arise from your??
To be continued..............
Further to my earlier comments regarding your point - i.e., "the ownership of all land in Israel belongs to god and is administered as a religious trust by the state and the rabbinical council" - your comment.
What is the view of the rabbinical council regarding the presence of Christians?? You will recall that the high priests had regarded their prophet (Jesus) as a heretic - and, therefore, had him executed by the Romans. Jesus was a person who wanted to change the norms of society (for the betterment of mankind). He was against the status quo - e.g., he was angry about the weird stuff going on in The Temple (i.e., the incident with the money-changers). His philosophy was at great variance with the High Priests (i.e., the rabbinical council).
Jesus was killed by his own community (i.e., the rabbinical council) - the Romans actually wanted to "pardon" him.
)."
As you are aware, a huge amount of land in Israel is owned by the JNF (Jewish National Fund). Does JNF have authority (by the rabbinical council to own land??
The god in question is a certain "Yahweh", the deity who's works and opinions are recorded in the Old Testament. The one who announced himself to the prophets Abraham, Isaac and Jacob. His land are administered on earth by his chosen people, the Jews. They act much as the royal family of England acts to administer the crown properties. Incidentally, the english royal family also rules by the grace of the same god.
Incidentally the JNF does not own the land, and in fact no person or organization in Israel owns land. They merely lease it on a long term basis. The lease can be renewed on only by agreement of the state and payment of appropriate rental.
"Israeli Arab and Druze citizens have rights and are in fact better off than in most Arab countries economically" - your comment.
This shows your ignorance about history, economics and civil rights movements globally since the 18th century.
The Arabs in Israel have a higher per capita income than those in some other Arab countries. Correct. However, the issue is of civil rights, apartheid,. Israel's isolation in Asia (as a reasonable neighbor) will increase. Peace now is possible - however, after another 3-4 decades of apartheid policies, peace will probably not be achievable.
The Arabs in Israel have not only economic rights and indeed a share in Israeli prosperity they also have the right to vote and elect their members of Parliament. They have political rights. Many serve in the Israeli army as trackers (Bedu) and border guards (Druze).
The comparison with South African apartheid is laughable. Blacks had no right to vote or to be elected in Apartheid south Africa.
Your comparisons with Nazi Germany are shameful.
If you want to be effective make your point with facts not lies and malicious distortions.
The real colonials are the Arabs who have tried to control the Jewish core homelands and distort history to cover this up. That is why they riot when archeologists dig under the western well of the temple. They do not want the physical truth of Jewish precedence in the land to be exposed for all to see.
The Arabs of Judea and Samaria and Gaza are under the control of extremists who will not allow them to settle in a peaceful coexistence with Israel.
One sided peace is no longer acceptable after the Gaza experience. There is clearly no negotiating partner since there is no democratic rule among the Arabs in Judea and Samaria. The peace we could make today would just be a piece of paper to the next Arab strongman. A people to people peace is possible but only after the extremist leaders have been exiled and any remaining "enforcers" are relentlessly pursued and neutralized. If this is not done moderates will continue to be intimidated and killed.
The appropriate solution is to permanently exile the extremists to the lands of their ancestors Saudi Arabia, Egypt, Syria and Jordan. Let the ones remain who wish to live and let live. For those who worship hate and death the door is open to paradise in Saudi, Syria or Egypt etc.
Your extremist and highly racist comments are noted.
Prof. Baruch Kimmerling (Professor of Sociology at the Hebrew University) wrote:
."
I asked you the following??
I await your response to these important points.
"the justness of the restoration of the Jews to the homeland" - your comment.
How do you propose to define what is "a homeland"?? The definitions that I have seen from various comments by Israeli right-wing commentators in TE are based entirely on ancient texts written 24-26 centuries ago. In all countries, title to land is recorded - modern land titling systems were were introduced by the French (in Europe), by the Mughals, Persians and the Turks (in West Asia) and by the Chinese (in East Asia). .
Regarding racism and an "obsession with racial purity. Remember there was a guy in Europe who died in 1945?.
Prof kimmerling is wrong. there are no Palestinians, only Arabs who colonized Israel after the Arab conquest of 642 AD. The very name "Palestinian" tells you that. It is derived from the Philistines an ancient Greek sea people who invaded the coast of Gaza and Ashkelon in 1100 BC.
If Palestinians were indigenous they would have an indigenous SEMITIC name for their group.
Their harsh regime forced many Jews to convert to Islam. Some may want to convert back if they were not in danger of being murdered by Islamic extremists. It should be an Israeli policy to encourage and protect those who discovered their ancient roots and wish to rejoin their people.
Judaism is both a religion and a nationality. This derives from the fact that the Jews never did have a policy of aggressively converting non-nationals unlike Islam and Christianity which do so and sometimes violently.
Some of the policies in current Israel which you term racist are self defensive in nature.
When the ten most prominent Islamic holy men rise up and tell their followers the truth and it is accepted by the masses this defensiveness will end.
All they have to say is that they apologize for Muhammad's murder of the Jews of Medina (Yatrib) and that they acknowledge the great debt owed by Islam to Judaism its parent religion. They would also need to acknowledge that Israel is the ancient home of the Jews and that their history there far predates and exceeds that of the Arabs.
The Jews in turn would relinquish any claims on Yemen, Medina (which they founded), Jordan (part of ancient Israel) and all will be well between the long feuding cousins.
"There have never been "Palestinians" in the land prior to 1917" - your comment.
I think you have a point - i.e., given the amount of slaughter in the Hebrew bible, nobody was left to kill!! However, it seems that!!!!
You state that Prof. Kimmerling is wrong. This is what Albert Einstein wrote (his famous letter published in the New York Times):."
Albert Einstein plus over 2 dozen signatories (American Jewish intellectuals).
Einstein was a great physicist but not a great political leader.
The bad behavior of many extremist Arabs in Judea Samaria and Gaza has proven his opinion wrong.
You can not make peace with people who deny and fact wish to hide history in order to solidify their fake claims for a land that is not theirs.
Engaging in terrorism against civilians justifies harsh measures. I have no fight with individual Arabs who obey the laws and behave in a civilized manner. I have a problem with those who wish to use the tools of democracy to undermine a democracy.
There was no intifada until 1987, do you know why?
Because it took a whole generation of Arabs to grow up under Israeli democracy. This generation managed to figure out that if they protest in Israel they will not be machine gunned as they were under the Jordanians.
When we gave them Gaza they thought this was a show of weakness and started lobbing rockets at Israel. Never again!
"Judaism is both a religion and a nationality" - your comment.
Indeed - it was only a religion for around 24 centuries.).
It would be appreciated if you did not distort historical facts to suit your "wish list".
Hogwash! What a web of deceit!
This comment clearly shows your complete ignorace of Judaism.
Generally Jews married only Jews. Thus it is a nationality not a religion. Jews did not leave Israel voluntarily, they were exiled often sold into slavery. They obviously did not get rich for 2000 years in Europe since whatever possessions they had was often stolen from them by the inquisition that killed them or by the Nobles and kings who chased them out.
For 2,000 years they did not believe many did go to Israel but never in sufficient numbers to even attempt to take it back. It does not matter what ruminations Hertzel went through, Jews would never have been motivated to go to Uganda or Birobidgan.
Neture Karte is a fringe movement so I would not put too many eggs in that basket.
If you think Judaism is only a religion go tell that to the Romans and Greeks who fought them. Go tell it to the Turks, go tell it to The Philistines
and the Amorites and the Arabs. Go tell it to those who have tested the DNA of the Lemba in Africa and of Cohens. Go tell it to my mother!
"Some of the policies in current Israel which you term racist are self defensive in nature" - your comment.
Interesting - it is like saying all the genocide committed by the Jews documented in the Bible was "self defensive". Either this is an absurd joke - or you are helping yourself generously to the bottle!!
Clearly many people would not agree with this view - Jonathan Ben Artzi, [nephew of Israeli Prime Minister Benjamin Netanyahu, who spent eighteen months in jail for refusing to serve in the IDF as a conscientious objector against the Israeli Occupation of Palestine] wrote an article on this issue:
.
The situation in the occupied territories is even worse. Nearly 4 million Palestinians have been living under Israeli occupation for over 40 years without the most basic human and civil rights.."
In Europe, the least we can do is to support the BDS movement and encourage a full boycott of Israeli products. In London yesterday, one of our most famous scientists and intellectuals, Professor Hawking, decided to withdraw from Israel's Presidential Conference in response to requests from Palestinian academics. The Guardian wrote today:
"There can be no going back to endless "dialogue" and fuzzy and toothless talk about "peace" that provides a cover for Israel to entrench its colonization.."
Racism can never be defensive - it is always aggressive in nature!!!!
The issue is were the "revealed books" OT is "myths and stories" - a real God would not have restricted his message to only 8% of the planet's population!!!! Yahweh was drunk (on Manna).
I'm sure, or maybe you don't, that you are a lunatic. You spend hours writing all of this nonsense from your mentally warped point of view. And don't worry, I barely read any of it. Just you writing all of this show's your mental neurosis, which Orwell was right about people who obsessed hating Jews. But hatred--the obsession of it will destroy anyone as it will you, too. Leave Israel and Jews alone, you weirdo.
Thank you for your comment. I note that you joined TE today - since signing up, you have posted 2 comments, both of which were abusive. As you do not read my comments, they are of little concern to you. Like Orwell, I have no problem with Jews (I have relatives in that community). However, like many people of the liberal left in Britain, I have a major problem with expansionist Zionism. Do you read the British press??
The world's sympathy for the so-called Palestinians is sadly misplaced. Israel is not "occupying" the West Bank. It is the so-called Palestinians who are illegally occupying the West Bank. The land of Israel, renamed "Palestine" by the British in 1917, was legally returned to the Jewish people in 1923 by the League of Nations.
Between 1917 and 1947 the British Mandatory illegally encouraged Arabs to settle in Palestine. Between 1948 and 1967 Jordan illegally moved Jordanians into the West Bank. All Arabs illegally occupying the West Bank are either Jordanians or descendants of illegal immigrants who entered between 1917 and 1947. There were no "Palestinians" on Earth before 1948. They have no legal or historic claim to the West Bank or Gaza. The Israel versus Arab conflict will end when the illegal Arab immigrants leave Israel for good.
You're trying to peddle Joan Peters's hoax here? Good luck with that.
Indeed - a fellow barrister (and a QC). Which inn of court did you belong to??
Respond to the points, Froy, rather than showing off the apparent likelihood that you don't actually understand the facts.
Nah, I'm showing off the apparent likelihood that the poster above is unaware (or unconcerned) that this hoax was debunked by Israeli historians themselves, decades ago:
Only shameless (and mostly anonymous) propagandists still have the nerve to parrot this junk.
Are you and Barrister QC the same person?? He is silent after making 1 comment - you seem to have taken his place. An interesting move by Mossad.
This post is rife with misinformation and claims that have been proven unfounded. I am appalled. The attempt to demonstrate that the Palestinian identity is made has been discredited multiple times, by multiple historians and academicians. It's comical to me, however, that this post claims that the British Mandatory powers tried to move Arabs into the territory. That is abjectly false. Usually when some faux-Academic makes that claim, they attribute that attempt to the Ottoman Empire - also false. Then this post tries to continue on and say that Jordan undertook the same policy. Also abjectly false. I would love to see this person's documentation.
Most importantly: it doesn't matter what the Arabic speaking peoples in the territory formerly known as Palestine (for approximately 1900 years) called themselves. The identity changed and grew during that time - it varied depending on village and tribe and region. The important fact - notice, I say fact, as demonstrable through reliable records - is that Arabic speaking peoples have continuously lived in that territory, formerly known as Palestine before the 1948 war, since long before a reestablished Jewish Israel was even dreamt up in Europe in the 1800's.
I would love to ask one of the Palestinians several questions about his family's history. As we all know, Arabs were not in that area of the Middle East until mid Seventh Century. Then they came from Arabia ( hence Arabs ) and conquered the lands to their West including present day Israel. How can the Arabs make any claim as to land ownership ?? Ask a Palestinian where his or her great grand parents were from and to be able to document it. Most were from outside of present day Israel. They are intruders, they are occupiers not " indigenous" populations. Accept the documented facts, not emotional gibberish.
I guess its also appropriate to ask Americans the same question about their family history. Ask any Americans where his ancestors were before 1492. Except for the "indigenous" population (as you put it), most of them were not even from the continent. So would present-day Americans take it well if they were asked to be leave their homes?
You don't need to be a Palestinian to know that most Arabs in the Middle East do not trace their ancestors back to the Arabian Peninsula. Any high school student knows that Arab conquerors actively encouraged conversion to Islam through their tax system, pushing the cultural assimilation of their new subjects, who ended up adopting their ruler's language and customs. Palestinians are just as native as Egyptians, Iraqis, Lebanese or Syrians, descendants of all the ancient peoples who inhabited those lands through the ages: Mesopotamians, Phoenicians, Canaanites... and Israelites.
The indians laid siege to the jamestown colony for the first decade of its existence. It was constant warfare. The colonists nerve forgot the terrible starvation they endured and it poisoned relations for centuries after. The "natives" almost succeeded in wiping out the original band of colonists. There were more then 75% dead of starvation and wounds by the end of the first winter. Reinforcements kept arriving from England and eventually the firepower of the colonists won a toehold. It should be remembered however that of the first wave of english colonies, only Jamestown was so fortunate. I believe 9 in10 were never heard of again.
Thank you for your expert knowledge about ethnic cleansing in North America. I trust that you are equally well versed about the genocide in South America. These glorious examples of mass killing must be a beacon of light for you in your adventures in Palestine.
since we all know the answer, aren't the Arabs lucky that the Jews fought their terror and violence rather than the Americans?
Actually I was only reminded of these old events because of a article describing a recent excavation at the Jamestown fort. They found a skeleton of a young girl who died in 1609, the first year of the colony. She about 16 years old, dismembered, and the meat sliced from the bone leaving the characteristic markings of a butcher knife. Obviously she had died and was immediately consumed by the surviving colonists. Even her brain had been sucked out and eaten. Her remains were then buried in the floor of the kitchen of the fort. It shows how harsh conditions were during the indian siege. Of course there are some contemporary journals that describe how things went during that first winter. But the descriptions of death and starvation are so lurid than many had assumed they were rather exaggerated. I remember the tail of one man who killed his pregnant wife while she was sleeping beside him, then removed the fetus, threw it away in the river and finally butchered and salted her flesh and stored it for his food. He was hung by the other colonists as punishment for this unnatural act. They could not understand or forgive the murder even though everyone else was also eating human flesh.
Froy, what you say is true of most areas of the Middle East. It is also true of some Palestinians. It happens to be less true of Palestinians, by a long shot, then of other Middle Eastern countries.
Gaza is likely a majority Egyptian--of recent vintage. Syrian migrants flooded into Israel--this is not a fabrication by Joan Peters--it is from British Mandatory records. There was indeed an Arab migration from Arabia into Palestine about 400 years ago. The Ottomans transferred Bosnians into Palestine in the mid-19th Century. From among those Palestinians who, indeed, were indigenous, some were actually Jews that got Islamize, and some were Jews that got Christianized.
It is unlikely Palestinians consist of Mesopotamians, Phoenicians or Canaanites. The ancient Israelites wiped out or converted the Canaanites over 3,000 years ago. Mesopotamians never moved to Israel--they destroyed it and left. Phoenicians were in Lebanon, perhaps you are thinking of Philistines--who were wiped out by the Assyrians about 2,740 years ago.
So Palestinian demographics is far more complicated--and far less indigenous--than the demographics of neighboring Arab states.
You'd better not take the Bible at face value to interpret ancient History. You'll end up believing a whole lot of fictitious myths. In any case, assimilated either into Israelite, Samaritan, Persian, Assyrian, Greek, Roman or any of the many other cultures that conquered that benighted patch of land through the ages, Canaanite blood must still flow through the Palestinian veins, just like that of those other groups I mentioned before. It is not a secret that many Palestinians in Nablus are descendants of the 1 million Samaritans that once inhabited the region, and who eventually converted to Islam and adopted Arab culture. It is absurd to assume that Jews or other groups of the region didn't meet a similar fate.
Now, I'm not saying with that that Palestinians are exclusively descendants of ancient indigenous peoples. That would also be absurd, this being a transit region between two continents, through which millions of peoples have passed in one direction or the other one. But from that to say that most Palestinians are descendants of Arab conquerors, or even from recent immigrants, there is quite a stretch, and little precious evidence.
It's just what happens with the story of the Syrians and the rest of tales of recent Arab immigration: it sounds good for hasbara purposes, until you dig up the facts: a British enquiry from 1946 found that most of those Syrian migrants had actually returned home during the Arab uprising in the 30s, never to return, and that demographic growth at the time was mainly due to natural reasons (the birds and the bees, you know):...
Israeli propaganda and the "historians" in its payroll tend to overlook this report. I wonder why.
There is really plenty of evidence for what I mention. There is no record of Philistines or Canaanites inhabiting the region at the time of the Romans.
The Ottomans well-documented their transplantation of Bosnians into Palestine. The British documented Arab immigration into Palestine. A Hamas leader recently proclaimed that Gazans are, in fact, Egyptian...and many Gazans are named "al-Masri," meaning Egyptian.
There was a well-known migration from Arabia to Palestine 400 years ago.
The census of Jerusalem has demonstrated a Jewish plurality since it was first taken in the 1840's.
Mark Twain traversed Palestine and remarked upon how few people lived there.
Samaritans are Israelites. They should return to their roots, and reject their Arab overlords.
1. I did not say there were Canaanites or Philistines at the time of the Romans, but rather that, since these had previously been assimilated by posterior conquerors (Israelites, Assyrians, Babylonians, Persians, Greeks...), Palestinians most likely are also descendants of Canaanites, just like they're most likely descendants of the other groups.
2. The "transplantation" of Bosnians into Palestine seems to have been a minor affair, that Israeli propagandist try to exaggerate to push their ridiculous claims. According to records of the time, some 50 Bosnian refugees arrived in Palestine after Bosnia was take over by Austria in 1878:
"Dr. Gottlieb Schumacher (1857-1924), architect and explorer for the German Society for Oriental Research, one of the German colonists in Haifa, wrote in 1886 that there were 22 Bosnian houses in Caesarea, well built and with shingled roofs. A year later he recorded that there were 35 Bosnian families in Caesarea who built for themselves houses with roofs covered by shingles which remind one of Europe. [...] In the beginning of the nineteen-twenties there were 15 Bosnian families numbering 331 persons in Caesarea. They lived in about 50 homes and had two mosques."...
Hardly impressive
3) Source for your "well-known migration from Arabia to Palestine 400 years ago"?
4) Jerusalem is but one city in Historic Palestine. As a religious pilgrimage center, it is natural that it had large Jewish and Christian communities. The rest of the province, however, was overwhelmingly Arab and Muslim until the 1948 ethnic cleansing.
5) Mark Twain wrote a satire with the aim of making fun of pompous travel books of the time, after spending a few days in Palestine during a short touristic trip, all seen through the prism of the Orientalist prejudice so prevalent at the time. Hardly a demographic treaty.
6) Samaritans don't have "Arab overlords", and I think they can choose for themselves what to do with their lives, if you don't mind. If by Samaritans you mean those who converted to Islam from Samaritanism centuries ago, I'm afraid you're a bit late for that. And a tad presumptuous.
This comment is a bit laughable and demonstrates a lack of perspective in the history of the area under discussion, known variably by the name of Palestine, Israel, Canaan, Filistine, Samaria, Judea, Idumea... among other names. Simply because the peoples who live there now (but are being slowly kicked out) speak Arabic - predominantly - doesn't mean they are necessarily entirely of Arab descent. This is ultimately the Peters argument 2.0 - and like the original Peters argument it is also demonstrably an unfounded argument.
I don't really see how people can still think a two-state solution is possible, with all of these settlements all over the West Bank. The only solution is a one-state solution. If Israel simply annexes the entire West Bank, then the Palestinians will have the full rights of citizens - equal to the settlers. The settlers can live in their beloved "Judea and Samaria", while the Palestinians can have their right to return to their homeland. (It's not reasonable to expect their property to be returned, but they should be allowed to rent or buy property anywhere in the country like other citizens.) Israel would no longer be an exclusively Jewish state, but it would be a true democracy with no occupation. Israel proper is a democracy, but the West Bank is not. If they just bring the West Bank into the democratic fold, then there can be peace in the Middle East.
The jews will never accept a binational state. They demand their independence and autonomy with their own armed forces, political institutions, religious institutions, educational institutions, cultural and scientific institutions, their own media and their own businesses and economy. These objectives require that they have control of a territory with secure and defensible boundaries. Two thousand years of living under the yoke of Christians and Muslims have taught them some hard lesions about why they must rely on themselves. If the Palestinians are in the way of Jewish independence then it is just too bad for them.
Afrikaners wouldn't accept natives as their equals, either. But accept them they did.
So what is the solution?? Remove their foreskins and ravish all the virgins??
"Israel proper is a democracy..."
Really? Then waht are these laws? THUGocracy is more like.
Continues below..
Ethnic cleansing is the main available option. Jordan will make a perfectly nice piece of real estate. Once they get rid of the Hashemites, the palestinians can develop their culture along lines they find congenial. Alternatively we could plunk them down in the British midlands. In any event the palestinians do not have much of a culture worth salvage..
I think your understanding of South Africa is rather limited. Suffice it to say that the analogy is not applicable.
"Recent" compared to who? Perhaps more recent than the hunter-gatherer tribes of South Africa, but they certainly were there long before the Europeans arrived. Your post sounds like the South African version of Joan Peters's "From Time Immemorial" hoax.
On the other hand, I don't see why Jews and Arabs can't implement a "democratic multiethnic state along the lines of Switzerland or Belgium". If your excuse is that Arabs are irrational fanatics that only think about massacring Jews, I think that also sounds like what Afrikaners said about blacks back then. Cheap scaremongering from an elite afraid of losing its privileges.
Actually that is not true. The Bantu speakers including the Zulu's arrived from east africa and the Kohsa speakers arrived from west and central about 400 years ago. They collided with each other and with the europeans. The real original inhabitants are the Kalahari bushmen. They were driven into the desert and are now almost extinct.
Excellent - just read up the case law of the Nuremberg war crimes tribunal - that is how you and your followers will be tried, and probably executed.
Why not revert to either an autonomy with political rights via Jordan or even a condominium? The latest Pal. Authority agreement with King Abdallah II vis-a-vis the Temple Mount is an example of a possible arrangement.
Go examine Egypt, Syria, Iraq, Lebanon, Bahrain, and Yemen, before declaring how well a so-called 'one-state' solution would work.
Wow. Thank you for all those facts. When I said Israel is a democracy, I meant that its citizens enjoy the right to choose their leaders. Clearly the Palestinian citizens of the West Bank do not enjoy these rights. I simply advocate that the Palestinians would enjoy the same rights as the Israelis. Since I don't think a two-state solution is viable, and that everybody must enjoy equal rights and democracy, then a one-state solution is the only option left.
The continued vulnerability of Palestinians to Israeli military orders to me only shows why they need equal citizenship and equal rights. The vast majority of the laws you mentioned apply to people in the occupied West Bank. If Israel annexes the West Bank just like the annexed the Golan Heights and East Jerusalem, then there will be no occupied territories. As for the racial laws in Israel proper, they can be eliminated if Israel becomes a secular democracy with equal rights for all Jews and Arabs.
Because of the settlements. There are so many Israeli settlements in the West Bank and I don't think Israel will ever give them up. That is why the only solution is to give the indigenous Palestinians equal rights.
I am not sure exactly what you mean by that. It sounds like you are saying that countries with Arab majorities are inherently dysfunctional. And that is racist. There are many factors at work in the autocracy and failure of state institutions in the Arab countries you mention, and race is not one of them. On the other hand, if Israeli institutions are preserved then there would be no chaos or state failure.
The main obstacle to a two-state solution is the fact that the Palestinians do not want one. Israel offered to abandon the West Bank in full in 1967, about 90% of it in 2000, 93% in 2001 and 97% with additional swaps to make whole in 2008. All offers were rejected by the Palestinian leadership (and by the full Arab League in 1967).
Now the problem is more intractable, as if that weren't intractable enough. But once again, the reason is not Jewish settlements. There is zero doubt Israel would force out the 80,000 Jewish settlers that enable the 97% relinquishment of the West Bank (plus 3% make-whole from Israel proper) and contiguity for West Bank Palestinians.
Unfortunately, after 46 years of rejecting Israeli offers, Israelis are finally starting to believe the Palestinians that they really do mean "no." Further, the Israeli experiment in making unilateral (non-negotiated) withdrawals from Lebanon and from Gaza have proven out the worst fears--separation and autonomy will not bring peace, but will provide a staging area for missile strikes against Israel. Enabling the West Bank to be used in such a manner would be the end of Israel--and Israelis are currently neither dumb enough or suicidal enough to take that path. Compounding all this, while Israel has been educating its children for over two decades on the Palestinian side of the story, Palestinians have been teaching their school children that the Jews have no roots in Israel and also how to slit Jewish throats as a course at summer camp, using live goats for practice.
You're really about 20 years behind on this story. Sorry.
Israel is the only country in the Middle East with a growing Christian population.
All the shrinkage in Christians living on the West Bank occurred after Arafat's 1993 takeover. Much of it is related to Muslims scaring off Christian shop owners in Bethlehem and taking over their shops.
"The Bantu-speakers had started to make their way south and eastwards in about 1000 BC, reaching the present-day KwaZulu-Natal Province by 500 CE.."......
Arabs from Judea and Samaria used to have greater freedom of travel. In fact many traveled daily to Israeli jobs in Tel Aviv Haifa etc. When many were found to engage in acts of terror their travel privileges were gradually reduced.
Israeli employers turned to Thailand and other countries to hire needed workers.
Its really simple, you reap what you sow.
There are no Palestinians. They have been extinct for 3000 years. The Arab residents of Judea and Samaria are either descended from Jews or from non-indigenous conquerors (Arabs, Greeks, Romans, Turks, Crusaders etc.).
As a jew, I regret the behavior of Israel with the palestinians. It is a disgrace and one day we will pay for it. Once you travel to Hebron and see what is happening there with the majority of the palestinian population to "protect" some religious zealots the idea of the "good" Israel and the bad "Palestine" is very difficult to sustain. I am sorry, but it is about time that we acknowledge that what we do is pure ethnic-cleansing and that place as with some countries, present and past, that we can not use as models.
I relieve you of your Jewishness. Now feel free to continue your lying and propaganda disseminating to your heart's content.
This comment is pitiful, but it is a good example of the "denial of fact" in which a lot of jews, inside and outside Israel, live. One day we will regret this policy!!
There are many moderate Jews who do not agree with Netanyahu and his acolytes. The organisation 'Peace Now' is just one of them.
Ethnic cleansing works. It is needed for survival.
Haha, how backwards you are.
I suppose the Holocaust was necessary too, right?
Do you think the Jews threatened the survival of the German nation? I think some Germans claimed that the Jews were "polluting" the beautiful aryan germ lines of the Germans, but that is not quite the same as a threat to physically attack them and commit genocide.
If there ever were any Jews as stupid as you seem to be, they long ago disappeared up the chimneys of Auschwitz. Anyone with half a brain knows what the arabs have planed for the Jews if they ever get half a chance. You only need to look at how they treat each other to get some sort of hint. Any Jew who would trust such barbarians, to disarm and join with them as part of the same polity, is an utter idiot. Would any sane person trust one of these Islamo-Fascists them with the lives of his wife and children? People who murder little girls for going to school? People who blow up a passover Sader for aged holocaust victims? You might as well ask the Jews to submit themselves to the mercies the Nazis or the Spanish Inquisition.
Ethnic cleansing is the plan. Are you serious??
And I relieve you of humanity.
What kind of sorry comment you posted. Just inches from screaming "self-hating Jew".
You are the hasbaravictim here, and if you weren't behaving that arrogant, I would actually feel sorry for your uninformed behind.
You might wanna look into the Zionist's connection with Hitler and the goods-for-Zionists agreement.
To think that people in 2013 is still that uneducated...
This a pitiful and insulting retort, with arguments that could be easily attributed to the like of Ahmadinejad and other religious lunatics. Dehumanizing entire populations/peoples... this is the type of ideology that has pursued us throughout our history!. What we have suffered should make us the last ones to implement such pogrom policies.
Of course. When peaceful cohabitation is impossible that is all that remains. It worked to solve the "Jewish problem" of the europeans. It will work again. It is the traditional solution to these kinds of intractable conflicts. Best to accept reality and get it over with as quickly as possible.
Quit whining like an idiot. Face reality. Sometimes divorce is the best solution when a couple have an intractable incompatibility. It is not pretty in the short run but the alternative is an eternity of misery to both parties..
As a human, I regret the behavior of Arabs who ethnically cleansed the Jewish population from Judea and Samaria during the Mandate years, pre-48, from Hebron, Gaza, Nablus, Jenin, Jerusalem's Old City, etc., etc., and then desecrated the 2000-year old cemetery on Mt. of Olives after 1948.
Jvem,
Are you arguing that the ethnic cleansing of the Jews from Hebron in 1929 must stand and that Jews should be prohibited from returning to their tiny quarter in that town? Are you arguing that the means required to protect those Jews are unnecessary? Are you arguing that Hebron is a microcosm of the entire situation? (when, in fact, Hebron is exceptional and, further, the larger context is that the Arabs have sought to ethnically cleanse all Jews from all of Israel no matter what, as they are doing with Christians throughout all the Middle East already).
It seems to me, Jvam, that you are looking for things to be ashamed of, kind of like on Yom Kippur, when Jews do a big mea culpa for sins that they didn't even commit, but that other Jews might possibly have.
I do recommend that you become a Christian, as it does appear to be an effective way of expiating all your sins and to stop feeling so guilty, as you appear to feel.
At the same time, I do think you are certifiably insane or woefully ignorant for feeling that any guilt whatsoever falls upon your people's side.
But who am I to judge? I could never walk in the shoes of a persecuted people, many of whom have an obvious case of Stockholm syndrome.
Rebecca, the Zionists during World War II believed, accurately, that the only way a typical European Jew could survive would be to escape to Palestine. The problem with your belief is that it is a gross distortion of context, with the offensive, inaccurate and anti-Semitic intent to make Jews appear to be Nazis.
(see Rebecca's comment way up top)
"Any Jew who would trust such barbarians, to disarm and join with them as part of the same polity, is an utter idiot" - your comment.
You keep talking Arabs and Muslims - yet you never mention Christians and Europeans. Why so??? Are you a victim of the Stockholm syndrome???.
No true Scotsman
This a another of the various vicious replies that my original comment has generated. First let meet assure you that I have no wish to convert to Christianity or any other religion. Second, we are not in 1929, nor in 1939, nor 1948, not in 1187, nor in 1099, nor in the 7th century.... and the roman/bizantine empire fell some time ago. I stick by my original comment: In Hebron in 2013 the majority of the population are being treated in an appalling way in the interests of a small group of hateful religious zealots, which I hope are not representative of the majority of our people. The situation in Hebron makes it difficult to believe that this is a case of the "good" Israelis versus the "bad" Palestine. Even more worryingly for the Jewish state, this situation is a time bomb that will one day explode in our faces. I am ashamed...this is not the country that we should be building in the 21st century, especially if we want to consolidate a state worth living in and fighting for.
Occupied territories, settlements and settlers have absolutely nothing to do with the issue of Mideast peace. This is a myth promulgated and actively promoted by the media to cleanse their collective consciences of the guilt they feel for the oppressed third world peoples. But let's prove my point logically, step by step..
In theory I would support a land for peace deal, but in reality I know that the occupied territories are not the core issue. The core issue for the Palestinian Authority and the Arab governments in the region is the very existence of Israel..
In 2008, Israeli PM Olmert in negotiations with PA president Abbas went even further, He offered 96% of the West Bank with land swaps for the rest (the Gaza had already been surrendered) plus a division of Jerusalem with the Jewish areas to become part of Israel, and the Arab areas to become part of the new state of Palestine. Abbas turned it down without a serious counterproposal.
In 1978 when Sadat declared he wanted peace with Israel, the Likud hawk, Menachem Begin surrendered the entire Sinai for a peace treaty.
In 2007, the uber Likud hawk PM Ariel Sharon unilaterally surrendered the entire Gaza, dragging the settlers from their homes with nothing in return (woops, my mistake, Israel got 10,000 rockets in return, aimed at civiliann centers).
The subterfuge is over. The territories are not the core problem. The core problem is the existence of a cancerous Jewish state in the heart of the Muslim Middle East.
thecamelshumpblog.com
Sure, the fact that Israel is keeping millions of people under military rule, disenfranchised, and pushed into ever-shrinking reservations is not a problem at all. If you don't look at them, they're not there at all! Palestinians don't exist, isn't that Israel's refrain?
So too bad that this non-existent people rejected Israel's generous offer of a string of disconnected and dysfunctional bantustans without real sovereignty (no control of borders, airspace, water, no army, Israeli soldiers in its soil...). It's entirely their fault for being born in a land coveted by Jews arrived from all around the world, and for daring to resist its conquest and colonization.
Wikipedia says that in 1967 there was already a group called PLO. (Haven't been around for that long, but I smelled the rat when you said that Gaza was "surrendered".) Why did PLO exist in 1966, if there no occupied territories, as you say?.
The last ethnic colonization occurred in 642 AD with the Moslem conquest. We respectfully ask the Moslems who do not like living in a Jewsih majority state to go home to their ancestral lands of Arabia.
Clinton and Barak offered them a deal with control of the whole of the west bank and Gaza in 2000. They turned it down and went for broke. Unfortunately it looks like they lost their gamble. So those are the breaks and they ware doomed to be expelled. Life in Jordan and other Arab countries will not be so terrible.
Delusional and misinformed.
Conflicts evolve. The root cause of this one certainly is not just the occupation, but the overall ethnic cleansing and colonization of Palestine in 1948, and the subsequent dispossession of its native inhabitant by foreign Jewish colonialists. But that was something Arab states could have eventually accepted and learned to live with, as the 2002 Arab Peace Initiative proved. Keeping millions of Arabs under foreign military rule, disenfranchised and continuously brutalized, on the other hand, is something that nobody can "live with". It is absurd to expect this conflict to ever end while such situation goes on. The occupation is, at present, what precludes Arab States from accepting a Jewish state in their midst, and what fuels the "irrational hatred" that you mistakenly put as the root cause. Mistaken but convenient, for if something is "irrational", there is nothing that can be done to change it, so occupation can be kept with a clean conscience.
You admitted yourself in a previous comment in this article that "Palestinians are mostly descended from Jews who converted to Christianity and then Islam under severe Byzantine and Moslem oppression". How can you say now that their "ancestral lands" are in "Arabia".
A wee bit contradictory, aren't we?
."
Except... Israel launched the first strikes in 67. IDF archives prove it.
The generals that were thirsty for conquering saw the weak state of especially the Egyptian army and the government didn't go for it straight away as they knew it would be a massacre. However, the hawks got them convinced and has been hiding under hasbara ever since. Now, with the access to the archives, the truth is out - covered only by the many years that has past.
."
Really?! Here's what Gush Shalom (an ISRAELI organisation) has to say about that one:...
For the rest of your rambling: Read up on history.
OMG! Please do some investigation on MEMRI, would you?!
Who happens to be behind MEMRI? How many times have they translated libelous?
No, nevermind. Let me help you:
The guy who runs MEMRI, Yigal Carmon (President & founder) holds the rank of full colonel in Israeli military intelligence. He is an internationally recognized expert, not on translation, but on psychological warfare.
MEMRI has been proven in COURT to have done deliberately false Arabic translations twice--once by CNN, and once by the Guradian (UK). And then there's all the times it was just noticed - not taken to court.
It is ridiculous to start your argument with 1967. Backlash, justified or not, was inevitable after the colonization and ethnic cleansing of Palestine in1948.
You live in a fantasy world about how Israel was created and is being sustained. Apartheid is not sustainable.
It is ridiculous to start your argument with 1967. Backlash, justified or not, was inevitable after the colonization and ethnic cleansing of Palestine in1948.
You live in a fantasy world about how Israel was created and is being sustained. Apartheid is not sustainable.
The PLO was founded in 1964 and its first terror operation was January 1, 1965. And before that the fedyeen in the 1950s. And before that, the Mufti's bands. And the murderous riots of 1920, 1921, 1929, 1936-1939. Nothing to do with borders. It's the Jews.
FROY,
Israel's offers would not have created Bantustans. The West Bank would have been contiguous. There was also an offer for a Palestinian corridor to connect Gaza.
Israel's nationalism is a strange one. Any other people in Israel's shoes would actually push their enemy out. Jews, with all their moral habits, don't do this, despite the suicidal risk it entails and despite their deep connection to all of this very small land.
The story here is quite the opposite of what Europeans, seeking to belatedly correct their own, actually genocidal, colonialist ways wish desperately, for their own soul's imagined expiation, to believe.
The story is one of Arabs ethnically cleansing every non-Arab or non-Muslim group in their midst, and the Jew saying "no"...whilst offering a real and a generous peace...contrary to your central casting Leftist dogma pablum.
Sorry, Froy, but I live in the real world. Keep reading the Nation and your soul will be saved.
It's not apartheid, BaD. Israeli Arabs are the most successful and educated in all the Middle East (not counting oil payments to citizens of the Emirates) and Israeli Arabs are the only Arabs from Morocco to Iraq having freedom to speak and worship as they wish without fear--and females protected from abuse. Israel's universities have proportional enrollment by Arabs, including the Technion, Israel's best school, where 20% of students are Arab.
Israel has several Arab political parties and numerous Arab MP's. Druze and Bedouin serve in Israel's armed forces and have served as ambassadors.
Discrimination is illegal and is actionable. Schools, buses, restaurants, swimming pools, beaches and stores are accessible to all. It just is not apartheid.
As for West Bank and Gaza Palestinians, they live under self-rule.
Take a look at the Camp David offer. It only considered returning to the Palestinians about 73% right after the signature, with an additional 19% to be returned "in 10 to 25 years". Knowing how Israel respects agreements, that could have well meant when Hell froze and thawed all over again.
Besides this, the West Bank would be split in the middle by an Israeli-controlled road from Jerusalem to the Dead Sea, with free passage for Palestinians, although Israel reserved the right to close the road to passage in case of emergency. Israel would retain control of the Palestinian state's borders, airspace, maritime waters, aquifers, and even keep soldiers on its soil. Of course, only token sovereignty over East Jerusalem was agreed, and large settlements cutting deep into the West Bank, isolating Jerusalem from its Arab hinterland, and strangling entire cities like Bethlehem would have remained in place.
You tell me what kind of "sovereign state" is that.
Moreover, negotiations continued after Camp David in 2002 in Taba, Egypt. This time the proposals were more serious, and both sides were "closer than ever to an agreement", according to both sides. Unfortunately, Ehud Barak saw Peace as a threat to its electoral chances, and withdrew from the talks before an agreement was reached.
The liberal/progressive media hard at work making the Jews bad guys and the Palestinians good guys. Which is the opposite of the truth.
Israel is sending a very clear message to the Palestinians - you are not welcome. We conquered this land and it is ours. Just leave.
Amen!
Awesome. So let's all return to the system of might makes right, and an eye for an eye. I love it. Just like Mr. Donald Trump's incredible interview where he expressed his belief that we should return to a system of military conquest in international relations. Human rights and self-determination out the window. I'm not sure where you're from DS, but I think those concepts have been pretty well diffused through today's modern and generally globalized world. Interesting: essentially your argment, to me reads "We've gotten it wrong over the past few centuries, we need to undo everything, and step back to a dog eat dog international community." Based on that, I think we should give Eastern Europe back to Russia, Kuwait back to Iraq, and the US should start conquering and enslaving Central America. Great argument you have there. Any other gems?
This article is just an absurd pathetic piece of hyperbole.
"in the past 45 years of Israeli occupation the army has redistributed around 70% of the West Bank land designated as state-owned either to Jewish settlers or to the World Zionist Organisation"
This is so misleading. It makes it sound like 70% of state owned land is a large amount. Settlements take up less than 5% of the west bank.
All this proves is that the settlements are on public land and NOT private Palestinian land as so many accuse Israel of doing.
"So far this year, Israel’s army has evicted almost 400 Palestinians from the West Bank and dismantled over 200 homes"
So out of 2.5 million people 400 who built houses without proper permits were forced to leave. That is .016% of the population. Hardly driving them out.
Here is just one example of Israel also forcing Jewish settlers out and destroying their homes....
"Settlements take up less than 5% of the west bank."
Actually, this is merely the constructed area. If you include the agricultural area they cultivate, the "buffer zones" they keep, the roads that serve them, etc, their jurisdiction and regional councils extends to more than 42 percent:
"All this proves is that the settlements are on public land and NOT private Palestinian land as so many accuse Israel of doing."
Actually, one full third of them is built on land privately owned by Palestinians, and confiscated from them:...
"So out of 2.5 million people 400 who built houses without proper permits were forced to leave. That is .016% of the population. Hardly driving them out."
It's slow, it's quiet, but it is relentless. Besides, this figure only accounts for the Palestinians expelled from the West Bank altogether, not the Palestinians expelled from Area C into Area A, which is the current Israeli ethnic cleansing policy. Lock them in their reservations and throw away the key (unless they want to leave for good, then silver bridge)..-...
"Here is just one example of Israel also forcing Jewish settlers out and destroying their homes."
The difference being that these Israeli settlers are squatting on occupied territory, which is against International Law, while Palestinians are on their own damn land, from where no foreign power should be allowed to expel them.
We are living under the 'veil of ignorance' therefore the erroneous comparison between anti-Semitism and resistance to racism doesn't surprise me anymore. It is time however that rational and intelligent people take responsibility for spreading objective truth .
Israel commits war crimes and crimes against humanity in full public view and neither the US nor the EU will do anything to sanction the rogue regime. What isn't widely known is the fact that the occupation and ethnic cleansing is funded to a large degree by the global Jewellery industry which facilitates the trade in Israeli diamonds - Israel's No.1 export commodity and a major source of funding for the Israeli military which stands accused of war crimes by the UN HRC, Human Rights Watch and Amnesty International.
Diamonds account for 30% of Israel’s manufacturing exports and generate about $1 billion per year in funding for the Israeli military. Israel’s diamonds evade the human rights strictures of the Kimberley Process which only applies to rough diamonds that fund rebel groups.
Diamonds that fund war crimes are blood diamonds. 50% of the diamonds sold in the US are cut and polished in Israel. Jewellers claim they are conflict-free simply because they are not funding rebel groups. They ignore the fact that they are funding war crimes and ethnic cleansing in Palestine and keep this information hidden from the diamond-buying public.
In 2012 the discovery of a fraudulent bank operating out of the Israeli diamond exchange nearly ruined the diamond industry and resulted in exports plunging by 75% in January and February. Police and taxation authorities were coerced by the industry to drop the investigation.
Jewellers are funding an out of control rogue regime and allowing blood diamonds which generated $11 billion net for the Israeli economy in 2011 to contaminate the global market masquerading as conflict-free diamonds. Consumers should demand that the Kimberley Process bans all blood diamonds and not just those used by rebel groups.
The Palestinians are mostly descended from Jews who converted to Christianity and then Islam under severe Byzantine and Moslem oppression. Current DNA testing confirms this, as well as historical and cultural evidence. The west bank since ancient times has been part of traditional core Israeli-Hebrew lands. At times parts of Jordan and Syria were also under Jewish control all the way to Damascus and Amman, but Israel does not claim these areas.
Lets dispense with the myth of a "Palestinian" people who never existed. Those who are desdcended from the Arab Moslem conquerors of Jerusalem in 642 AD may return to Saudi Arabia and Jordan. Others may in time find and confirm their ancient roots and formally convert to Judaism. Others who want to leave should be given citizenship in some of the Arab countries that cruelly oppressed, killed or evicted their Jews after the creation of the state of Israel. Thus eventually the balance of history will be restored and Justice will be done!
What a bizarre argument. You first say that most Palestinians are mostly descendants from the ancient Israelites, which is true in all likelihood, and proves that they are the true indigenous inhabitant of Palestine, unlike the millions of foreigners who arrived from Poland, Morocco, and elsewhere. But then you decree that these indigenous inhabitants do not actually exist, and call for the expulsion of those "who are desdcended from the Arab Moslem conquerors of Jerusalem in 642 AD". What do you propose, exactly? To DNA-test all inhabitants of Israel and Palestine (or is it only Arabs that bother you?), and kick out from the homes where they were born all those who show non-Israelite DNA? What of those who have both indigenous and Arabian ancestors? And those with Ethiopian or Slavic blood? Eugenics is a slippery slope, you know.
DNA tests show that Palestinian's closest relatives are current European Jews and THAT is the proof that they are descended from the ancient Judahites. So the this proves that both are the true indigenous inhabitants of the land. The rest of the Palestinians DNA is a mix of Greek, Roman, Byzantine, Arab, Egyptian and Turkish.
Before 1947 both Jews and Arabs living in Israel called themselves and were referred to as Palestinians. There was never a Palestinian culture or book before then, nor a palestinian people or government. The dialects of "Palestinians" in the west bank and GAZA are very different. The west Bankers speak in a Jordanian, South Syrian Arabic dialect while the Gazans speak an Egyptian one.
It is only with the advent of the PLO that Palestinians became synanimous eith Arabs living in Israel. The word is of Greek origin and originates from the Sea People (the Philistines) who conquered the coasts of Gaza and Ashkelon about 1100 BC.
The vast majority of the land's inhabitants at the time of the Roman and Arab conquests were Jewish. There was no other ancient indigenous people living there at that time as the Canaanites were long extinct by then.
As to the Torture, killing and expulsion of Jews, there were Jews living in Egypt, Syria, Yemen, Morroco, Tunisia, Algeria Iran and Lebanon long before there were Arabs or Moslems there. Yet the "noble" "indigenous" Arabs found many imaginative ways to abuse and kill them. They also found many ways to kick them out of their ancestral homes in those countries. Jewish trading families founded Medina long before Muhammad. Jewish kings and queens ruled Yemen as earls 1000 BC and into the Byzantine period prior to Muhammad. About half of the Jews living in Israel are descended from "Arabic" Jews". A Jew (IBN Kaldun) Established Al Azhar university in Cairo, probably the oldest university on the planet. We are not asking for those lands back, just for our core ancestral lands.
Nice rant, but you still didn't answer my question: if you admit that Palestinians are "mostly descended from Jews who converted to Christianity and then Islam under severe Byzantine and Moslem oppression", hence true native inhabitants to Palestine, who exactly are the ones you say that "may return to Saudi Arabia and Jordan"? How would you identify them? Would such identification process apply just to Arabs, or also to Jews, to prove beyond doubt that they indeed have ancestors from ancient Israel/Palestine? Would you have them all expelled, even if their families have been living in Palestine/Israel for generations?
Those who are descended from Jews (or not) may formally convert to Judaism to Judaism and stay. Others who do not wish to stay should be accepted as citizens by the Arab countries who expelled and murdered Jews throughout the centuries. Those who wish to stay may do so if they swear allegiance to the Jewish state of Israel. Arab citizens of Israel have a high standard of living and education, many serve in the Army and their woman drive cars and have jobs and a degree of independence. That can not be said for most Arabs in Arab countries. The Druze fare well in Israel as well and are respected.
Arabs countries should also offer compensation to Jewish state for all the Jews they robbed blind and threw out with only the shirt on their back. Jews helped build the great Arab civilization of the golden age, without them there would be no Muhammad and no Koran, as Muhammad was a servant in the home of a Jewish Rabbbi in Medina and that is where he learned about the one god. When Moslem leaders rise up with courage and honesty to thank the Jews for their contributions to Arab culture and Islam, that will be the beginning of reconciliation of the long feuding cousins.
Jewish ancestral lands will never be under Moslem rule again since Moslems have desecrated Jewish cemeteries in and around Old Jerusalem. Never again!
Many of the families descended from the Arb conquerors
are well known such as the Hussaini V=Clan that was allied with Hitler and includes Arafat. They belong in Saudi Arabia where there ancestors came from.
How does being Jewish or any other ethnic group entitle you to anyone else's land? Everyone in this world is a mix anyway and the mixing is accelerating.
Right. So what are the Arabs doing in the ancestral Jewish homelands? What entitles them to be there?
So you would expel anyone from the Husseini clan? What if his/her mother was from a native clan? Or his/her paternal grandmother? Just because ONE of his/her ancestors is from outside Palestine you would expel this person, born in that land, along with most of his/her ancestors?
What about somebody whose surname is Mileikowsky? Would you have him/her prove beyond doubt that at least one of his/her ancestors was born in Israel/Palestine centuries ago? What if his/her ancestors just converted to Judaism at some point of history, as happened in entire regions in Ethiopia, Yemen and Central Asia?
Actually, according to current research central Asia is the location if many of the lost tribes of Israel.
The Pashtun in Afghanistan may be one of these.
I would not expel anyone who has mixed ancestry.
If you have 25% or more of Hebrew descent you may stay. If you convert or are the descendent of converts you may stay. I would reserve the right to expel anyone who engages in or supports terrorist activity (politically motivated crimes like murder, robbery, mass killing etc.). That would include advocacy in support of such political crimes. No democratic country can allow the processes of democracy to be used to destroy (or preach the destruction) of the state.
By your standards, you would not be expelling pretty much anyone, though I doubt any Palestinian would change the religion that makes an intimate part of their identity. In the end you would end up with an Muslim and Arab-majority country, who sooner or later would voter for their own to power, and make the state reflect its new demographic composition, for states are artificial constructs, that can and should evolve and adapt to better suit the interests and wishes of its citizens.
"without them there would be no Muhammad and no Koran, as Muhammad was a servant in the home of a Jewish Rabbbi in Medina and that is where he learned about the one god" - your comment.
You are right - this guy Muhammad surely was a ungrateful chap, like the previous prophet who was also taught by your ancestors. The Jews should have assassinated him in his youth - just like they had Jesus murdered!!!
"A Jew (IBN Kaldun) Established Al Azhar university in Cairo, probably the oldest university on the planet" - your comment.
I know you are very keen to prove that the Jews are Asians - and not converts from Turkish and Bulgarian tribes. More on this issue later. However, distorting history is not going to help the cause.
Toynbee, A Study of History, London - 1935 (Volume 8):
"The Khaldūns were a prominent house of the Muslim aristocracy of Seville who had emigrated from Andalusia to Africa, about a century before ‛Abd-ar-Rahmān ibn Khaldūn's birth, in anticipation of the conquest of Seville by the Castilians".
The family then moved to Tunisia, where he was brought up. Toynbee goes on to say:
"He was."
He was a multifaceted scholar, who is also sometimes referred to as the father of modern economics. He was a secular Andalusian chap - not very religious it seems - however, certainly not Jewish.
You neglected to mention that Jesus was a Jew something that most Christian anti-Semites also conveniently omit. We have your number and we know what sewer of history you come from.
And Mohammad was not an ungrateful chap, he was a murderer as he had the 800 Jews of Yatrib (Medina) murdered after his side won the war with the "Infidels".
My mistake it was Ibn Killis not ibn Khaldun who established Al Azhar University.
_____________________________________________
One of ibn Killis's most remarkable achievements came in 988, when he established the al-Azhar University in Cairo, which became the most important centre of learning in the Islamic world. He also founded a public library in Cairo that contained an estimated 200,000 volumes. Except for a short period in which he was out of power, ibn Killis remained at the helm of Egypt's political life until his death in 991. When ibn Killis was on his deathbed the Caliph, deeply distressed, went to see his Jewish counsellor. He later attended ibn Killis's funeral and laid his former advisor into the grave with his own hands -- an extraordinary honour for a Muslim ruler to show to a Jew.
Read more:...
If the European Jews are converts from Bulgars and Turks (or Khazars) then so are the "Palestinians" since DNA shows them to be closely related.
You rant for half a page without even trying to uncover the truth of who established Al Azhar and the great library in Cairo under the Shia Fatimids.
When the Sunnis took over they burned the library and remade Al Azhar into a Sunni school..
Indeed - you had made a mistake. Hence, the confusion. Incidentally, while I hate all religions (particularly the 3 Abrahamic religions), I am aware that Jews were always given a lot of respect by Muslim rulers - e.g., in Spain, Turkey, Morocco, etc. The major issue of hostility in history was between the Jews and the Christians.
My apologies - obviously both Muhammad and Jesus were Jews, because of the common link with Abraham. I issue that both religions faced was non-acceptance by the Jews, including racism. This racism (in your religious texts) was directed against the Christians (and later, against the Muslims). The nature of the Jewish faith has an inherent bias towards ethnocentric behavior. Christianity and Islam are more inclusive - the Jewish faith is much more exclusive - i.e., unwilling to accept change and integrate with other communities. Here are a few typical quotes from!” There is no such problem with the Muslims, who have always helped the Jews when they were being persecuted - e.g., the Spanish Inquisition.. This is a classical manifestation of Stockholm syndrome.
The Shylock syndrome is also an issue with the Europeans. very few similarities between the European view and the Asian view on this particular point. Asia has never persecuted the Jews, therefore, Asians cannot fully understand what happened in Europe. Why did very civilized people (English, French, Germans, Russians, Spanish, Hungarians, etc.) turn against the Jews??? What is the reality?? Here in Asia we cannot understand is the total failure of the Jewish people to integrate with any community on the planet at any time over the past 28 centuries!!!!!
"The Pashtun in Afghanistan may be one of these" - your comment.
The vast majority of the Pashtuns live in Pakistan - well over 30 million. There are only 12 million in Afghanistan. There are various theories about the historical linkages of the Pashtuns - the most plausible of which is some linkages to ancient Greece and Iran. They speak Pashto - but they also speak Darri (which is a variation of Persian)..
Not completely true. Jews under Moslem rule usually had to pay a heavy dhimma (infidel) tax. They were forbidden most jobs especially government jobs. Exceptions were made for Jewish doctors and some administrators but the high ranking Jew would never know if a hangman's noose or prison was just around the bend.
But yes the Christians usually treated the Jews worse with pogroms, blood libels expulsions etc.
The worse were the crusaders who massacred the Jewish populations on their path including the Jews of Constantinople and Jerusalem.
It is also documented that the Jews of Afghanistan accepted an emissary from Mohammad and were the first mass converts to Islam in that area.
It is also documented that the Jews of Afghanistan accepted an emissary from Mohammad and were the first mass converts to Islam in that area.
Stars of David, swastika's, and several other symbols are actually Hindu (and Indus valley) symbols historically. You need to remember that the Hindu's are Aryans - Hitler goofed up. Afghanistan was a part of several Hindu (and Buddhist) empires. The most important such empire was the Kushan empire.
"General Cunningham identified the Kushans as Gurjars or Gujjar. The word Gusur is referenced in the Rabatak inscription of Kushan king Kanishka. According to some scholars the Word Gusur, which means Kulputra or a "man or woman born in high family", in this inscription stands for Gurjara. Gurjars belonging to Kusana or Kasana clan can be found even today in north western India, Pakistan and Afghanistan. The Gurjars of Central Asia are termed as Gusur (Gujur) even today.
In the 1st century BC, but going in an arc to include the Kabul valley and part of Qandahar in Afghanistan)[citation needed] and established twin capitals near present-day Kabul and Peshawar then known as Kapisa and Pushklavati respectively.
The Kushan writing system used the Greek alphabet, with the addition of the letter Sho.,[vague][when?][dubious – discuss] they used Kushan language legends (in an adapted Greek script), combined with legends in Greek (Greek script) and legends in Prakrit (Kharoshthi script).
The Kushans).."
The capital cities of the Kushan empire were Peshawar and Taxila - these cities are now located in Pakistan.
The origins of Hebrew are deeply influenced by Phoenicia, Persia, Babylon, etc. - all 3 of these civilizations also have very deep links with Western India (now Pakistan). Hebrew (unlike Yiddish) is a very Asian language. The Indus valley civilization - the old river-based trade route (2,000 BC onwards) started from the Indian Ocean and went upwards straight into Afghanistan. Read up on the Indus valley civilization and Alexander the Great - in fact, there are dozens of Greek words in Pashto. You can see why - the Kushan empire used Bactrian Greek as the basis of their official language!!!!!!
"Arabs countries should also offer compensation to Jewish state for all the Jews they robbed blind' - your comment.
Indeed - I guess you have a lot of compensation claims to settle - e.g., Spain, Germany, Poland, Hungary, Russia, etc.
More than half of the Jews in Israel are recent ( the past 60 years) refugees from Arab countries.
This is known and documented. A vast one-sided population exchange has occurred. The only reason that many "Palestinians" have left is because Arab states will not take them. They wish to keep this problem festering so they can accuse Israel of racism when their practice was more like mass murder and mass expulsion. So let the wealthy Arabs ante up and pay for the damage done to the Jews. Do you have a problem with that?
don't waste your time with him dude trust me its not worth it
Slow but relentless ethnic cleansing, Israeli-style.
The solution would be for Israel to annex the West Bank and Gaza and be done with it.
Makes more sense that nibbling a bit here and bit there.
Plus no embarrassing media attention like an American girl getting squashed by a bulldozer and phosphorus shelling etc.
Oh but wait...then Jews would be a minority in their own country...oh well, better continue with the ethnic cleansing.
Israel needs to bide its time until there is somewhere to send the Palestinians to. Just squeeze the Palestinians slowly until a destination opens up. If the so-called "Arab Spring" ever reaches Jordan and overthrows the monarchy, they will have a nice destination. A collapsed Syria is also a possible destination, but impractically distant right now.
The problem is no one wants them the so called Palestinians. Not only Israel, but every single Arab country and all of them collectively. It looks them the Arabs know only too well that "palestinians" are just stray Jews, and so will outsmart the natives of the host countries hands down... ;-(
Ethnic cleansing. Every Israeli's wet dream. Keep dreaming.
Over time I have discovered that the key to understanding Zionism (or any theocratic system) is to read Alice in Wonderland carefully. The religious fundamentalists who are writing comments on TE!'
This conversation is pitiful, and perhaps it is indicative of the intellectual level that Europe has descended to after having murdered or driven out most of its Jewish population.
Israel's foreign trade with the EU (other than Germany) is rapidly declining for reasons that have nothing to do with your hypocritical little boycott proposals (when will you boycott Saudi Arabia for not allowing Christians or Jews to live in their country at all?. It is declining for the simple reason that European economic output is declining as a relative percent of the world economy, and in the last few years even in absolute terms.
The reviled Jews upon whom you heap so much abuse are outproducing not only their Arab enemies, but their European oppressors as well. China, India and Africa are more than willing to pick up the slack. Israel's trade is now mostly with the US and the emerging economies of the world. Farewell Europa.
I wonder what does this spiteful comment have to do with the article at hand.
Israel's economic performance does not change its appalling Human Rights record nor the immorality of its ethnic cleansing policies.
What has trade got to do with ethnic cleansing??
Israel has a sweetheart trade deal with the US plus a torrent of private and public money flowing in the from the US. Of course it is doing well economically. It is, however, on an unsustainable path of theft and exploitation of indigenous people which is finally being noticed by the rest of the word.
Balony! Israel is doing well because its scientific, medicinal and defense innovations are in demand all over the world. It is also a leader in irrigation equipment and techniques. While the Arabs have spent time stagnating Israel has helped a thousand flowers bloom!
Israeli help and know how is probably the only thing that could rescue Egypt from complete economic collapse at this point. Unfortunately, the Moslem brotherhood is doing all it can to bring Egypt over the cliff.
"medicinal and defense innovations are in demand all over the world. It is also a leader in irrigation equipment and techniques" - your comment.
Good point - however, all these successes will evaporate overnight if international sanctions are imposed. The reality is that Israel's only ally is the USA - a rather fragile position. The USA might lose interest one day - unless Israel has good friends in Asia (your new home), it will be very difficult to have a sustainable future for the country.
Not true. With the discovery of vast gas and oil reserves in Israel all sorts of new friends are trying to cozy up to her from Greeks bearing gifts to Russians.
It is the Arab Islamists who are losing friends all over the world. As the Arab winter sets in the world sees many of the Arab countries heading on a path of self destruction and carelessness about the lives of their own people (and outsiders).
Where were your "new friends" when the UN voted unanimously to force Israel to accept UN nuclear inspectors to examine Israel's nuclear facilities?? They all voted against Israel!!!!
jewish justice? | http://www.economist.com/comment/2005779 | CC-MAIN-2015-18 | refinedweb | 16,617 | 63.39 |
Learning Resources for Software Engineering Students »
Reviewers: Jiang Chunhui, Wang Junming
Scala combines object-oriented and functional programming in one concise, high-level language. Scala's static types help avoid bugs in complex applications, and its JVM and JavaScript runtimes let you build high-performance systems with easy access to huge ecosystems of libraries. -- Scala Website
Let's look at some characteristics of Scala mentioned in the above quote:
As Scala supports both OOP and FP paradigms, it is considered a multi-paradigm language. Furthermore, Scala proponents claim it to have a simple syntax that can produce elegant code.
Given below are some noteworthy Scala features:
Scala allows type inference, which means it detects the data type of an expression automatically. The user is not required to annotate redundant type information in Scala.
Type Inference Example:
var x = "foo" var y = 1.5 val z = List(1, 2, 3) x = 3 // Error: type mismatch x = "bar" // OK
All operators in Scala such as
+,
-,
*,
/ are actually methods.
Normally, we write addition in following way:
val a = 1 + 2
However, in Scala, it will be interpreted as following:
val a = 1.+(2)
Knowing that, we are able to overload operators just like method overloading. It allows us to redefine the behavior of arithmetic operators and give them meaning for our own custom classes.
Following is a ComplexInt class which uses operator overloading.
case class ComplexInt(real: Int, im: Int) { def + (other: ComplexInt) = ComplexInt(real + other.real, im + other.im) def * (other: ComplexInt) = ComplexInt( real * other.real - im * other.im, real * other.im + im * other.real ) def unary_- = ComplexInt(-real, -im) def - (other: ComplexInt) = this + -other override def toString = real + " + " + im + "i" }
We are able to use the class like below:
val a = ComplexInt(1, 1) val b = ComplexInt(1, -1) val c = a * b val d = -c + a
In contrast, this is how the same operations would look like if written in Java:
ComplexInt a = new ComplexInt(1, 1); ComplexInt b = new ComplexInt(1, -1); ComplexInt c = a.times(b); ComplexInt d = (c.negative()).add(a);
In scala, types and behavior of objects are described by classes and traits.
Traits are used to share interfaces and fields between classes, which are similar to Java's interfaces.
Classes are extended by subclassing and a flexible mixin-based mechanism to avoid the problems of multiple inheritance.
Classes cannot have static members. A singleton object with same name of the class can be used to achieve the same effect. A singleton object is basically a class that can have only one instance.
The following Scala code illustrates some of the concepts mentioned above:
abstract class ParentTrait { // abstract def print() } class Sample extends ParentTrait { override def print() { println("print in Sample") } } trait TraitA extends ParentTrait { abstract override def print() { println("print in TraitA") super.print() } } trait TraitB extends ParentTrait { abstract override def print() { println("print in TraitB") super.print() } } object Sample { def main(args: Array[String]): Unit = { val example = new Sample with TraitA with TraitB example.print() } }
The output from running the above code:
print in TraitB print in TraitA print in Sample
The explanation is that the call to
print() executes the code in
TraitB, which is the last trait mixed in. Then, through the
super() calls, it threads back through the other mixin traits. And eventually to the code in
Sample. Note thath none of the traits inherited from others.
This is similar to the decorator pattern but is more concise and less error-prone. In other languages, a similar effect could be achieved with a long linear chain of inheritance. But the disadvantage is that for every possible combination, we need to declare an inheritance chain for it.
Have you ever needed to add new function to an existing library? An implicit class in Scala can help you to do so. This technique allows new methods to be added to an existing class using an add-on library such that only code that imports the add-on library gets the new functionality, and all other code is unaffected. See the code below:
object MyExtensions { implicit class IntParity(i: Int) { def isEven = i % 2 == 0 def isOdd = !isEven } } import MyExtensions._ // bring implicit enrichment into scope 4.isEven // -> true 4.isOdd // -> false
This is the implicit class that extend the library of class
Int. The name of the class does not matter. After importing this class, we can use
isEven() and
isOdd() method just as if it has been declared in the original
Int class.
Scala has built-in support for pattern matching, which can be thought of as a more extensible version of a
switch statement, where arbitrary data types can be matched. The
match operator is used to do the pattern matching.
There are many kinds of pattern matching in Scala, let's start with a simplest pattern matching function:
def matchTest(x: Int): String = x match { case 0 => "zero" case 1 => "one" case 2 => "two" case _ => "many" } matchTest(0) // zero matchTest(3) // many matchTest(1) // one
The parameter
x is the left operand of the
match operator and on the right is an expression with four cases. Each case expression is tried to see if it will match, and the first match will be returned. The last case
_ is a "catch all" case which can match all inputs.
The pattern matching in Scala also includes Case Class Matching, List Matching, Type Matching, Tuple Matching etc. See here for more details.
Following is an example of QuickSort algorithm to show how strong is Scala's pattern matching:
def qsort(list: List[Int]): List[Int] = list match { case Nil => Nil case pivot :: tail => val (smaller, rest) = tail.partition(_ < pivot) qsort(smaller) ::: pivot :: qsort(rest) }
Explanation of the code:
Nilonly matches the object
Nil(Empty list). But
pivot :: tailmatches a non-empty list, and it will destructure the list according to the pattern given. In this case, the code will have a variable
pivotholding the head of the list, and another variable
tailholding the tail of the list.
tail.partitionis a tuple. In this case, the code will have a variable
smallerholding the first element of the tuple, and another variable
restholding the second element of the list.
There are mainly two ways to work in Scala.
A more detailed tutorial can be found here: Tour of Scala
Some useful resources are listed below if you want to learn more about Scala:
Scala Exercises is a series of lessons and exercises created by 47 Degrees. It's a great way to get a brief introduction to Scala while testing your knowledge along the way.
Functional Programming Principles in Scala, free on Coursera. This is a course about functional programming given by Martin Odersky himself. You can access the course material and exercises by signing up for the course.
allaboutscala provides detailed tutorials for beginners.
More details can be find here: Scala Learning Resources. | https://se-education.org/learningresources/contents/scala/Scala.html | CC-MAIN-2019-26 | refinedweb | 1,152 | 63.39 |
public class Base
{
Base() {
preProcess();
}
void preProcess() {}
}
public class Derived extends Base
{
public String whenAmISet = "set when declared";
@Override void preProcess()
{
whenAmISet = "set in preProcess()";
}
}
what do you think the value of whenAmISet will be when a new Derived object is created?
public class Main
{
public static void main(String[] args)
{
Derived d = new Derived();
System.out.println( d.whenAmISet );
}
}
Give yourself a few minutes to look it over before reading ahead. It's a really simple example to follow, so no fair compiling and running it to find out. Think you know the answer?
It appeared to most people that the output should be "set in preProcess()". The reasoning went that when the Derived constructor is called, it implicitly calls the Base constructor via a call to super() that the constructor inserts automatically for you. The Base constructor then makes a call to the most specific copy of preProcess() that it can find, the one in the partially constructed Derived class, which sets the value of the whenAmISet member variable.
This, of course, is wrong. If you compiled and ran the code above you found that it prints out "set when declared". So what happened there? Is the Base class preProcess() method getting called? Nope. (Go ahead and put a print statement in each preProcess() method if you don't believe me.)
Here's the sequence of events:
- The Derived constructor is called.
- Memory for Derived member variables is allocated.
- The Base constructor is called implicitly.
- The Base constructor calls preProcess().
- preProcess sets whenAmISet value to "set in preProcess()".
- Derived class member initializers are called.
- The body of the Derived class constructor is called.
How do we know this is the right sequence? Let's take a closer look at the significant steps.
- We call the constructor.
- We know the memory for Derived class member variables is allocated before any line of code is run in its constructor. If this weren't the case then the call to preProcess() in the Base class wouldn't be able to set the value of whenAmISet and print it's value (which isn't in the code above, but you can try it and see that this works).
- Java inserts a call to super() at the beginning of the constructor unless you include it yourself.
- We know this by looking at the code.
- Also known by code inspection.
- The initialization must be happening after the call to preProcess(). The Derived class's preProcess() method is getting called, and it is setting whenAmISet's value to "set in preProcess()". Again, if you don't believe me, print out the value of whenAmISet right after it gets set in the Derived preProcess() method.
- We're calling the default (empty) constructor, so there's nothing more to see here.
So what can we take away from all of this? First, never count on any operation being atomic unless you've tested and proven it to be so (and sometimes not even then). Second, and more to the point, be careful initializing member variables in a method of a derived class if that method gets called by the base class constructor. It might be even better to try and avoid calling methods in your base constructors that are overridden by derived classes, and conversely, avoid overriding methods in derived classes that are called by the constructor in the base class. Be careful if you do, and don't say I didn't warn you about what might happen.
Further Reading
I could hardly finish without mentioning that Joshua Bloch and Neal Gafter wrote an entire book full of similar puzzles called Java Puzzlers: Traps, Pitfalls, and Corner Cases. Check it out if you'd like being your team's source for Java trivia and minutae.
10 comments:
One thing I dislike about Java is that puzzlers like this one (that defy intuition) seem to appear more often than not. Are they corner cases or is it just poor design? Personally, I'm not sure what to think (and don't have the Java-fu to make that decision and much less to make such a claim)
Great post, however! Keep on the good work =)
Nicolas,
Good point. Many languages have these corner cases that you have to watch out for, but that doesn't exonerate Java for having so many of them. C++ and Perl are two other languages whose syntax make it notoriously easy to shoot yourself in the foot. I know a lot of people are moving towards languages like Ruby and Lisp, at least in part because the simple syntax of those languages cut down on the number of "gotchas" you have to look out for. There is a benefit to having only one right way to do something. Do tools like PMD and Checkstyle even exist for Lisp?
When discussing this particular puzzler with my co-workers, we decided that it did seem like a rather questionable choice to have the initialization after any constructor code had run.
Thanks for commenting, and for reading.
I don't agree with this description of the first step of the construction process: "The Derived constructor is called (member variables are declared, methods defined)."
Declaration and definition are compile-time concepts, not run-time concepts. Nothing at all is done with methods at instance construction (the instance doesn't acquire new instances of each method, for example) and what happens with member variables is that *before* the constructor is invoked memory is reserved for them and set to their default values. See the specification here:
"Whenever a new class instance is created, memory space is allocated for it with room for all the instance variables [...] All the instance variables in the new object, including those declared in superclasses, are initialized to their default values (§4.12.5)."
There follows a section describing how the constructors are invoked and that explicitly states that initializers are run after base class constructors are invoked.
Weeble,
Thanks for catching that. Of course the methods are a part of the class, so they aren't really defined at run time, but my point was that they already exist before any code in the constructor is executed. I was trying to make that a little bit simpler conceptually, but as you pointed out, I failed at that. The method just existing as a part of the class definition is simpler, so I took it out of my description. I corrected the mistake and tried to make it more descriptive of what actually happens at run time.
Thanks also for pointing out the relevant part of the Java specification that deals with this puzzle. I had looked for it and gave up when I didn't find it in chapter 8 on Classes.
Sorry, I realise now I sounded a bit gruff in my response. I was just in a bit of a hurry.
It is a confusing little corner of the language. I think it behaves in this strange way because Java lets you access other instance fields in a field initializer, and thus it has to make sure the base class constructor has been executed before the initializers can be evaluated. C# behaves more intuitively (at least to me), but doesn't allow you to access instance fields/methods from a field initializer.
I should point out I'm no Java expert. I mostly do C#. I might be wrong.
Weeble,
No need to apologize, you didn't sound gruff to me at all, plus you made this post better. I like it when people point out my mistakes because that's how I learn new things.
Good point about accessing other instance fields in initializers. I hadn't realized that C# behaved differently.
Thank you, I really appreciate your comments.
@nicolaslara
re "bad design", I'd characterize it as _different_ design. C++ chooses the route that base classes construct entirely before derived classes -- that the object isn't even a "derived" instance until the base ctor completes. as a consequence, calling 'preProcess' from the base cannot invoke derived::preProcess, because it "doesn't exist yet". Java follows the simpler implementation route, probably as a natural consequence of how its runtime typing works using tagging instead of vtables -- tags aren't allowed to change, so to get the C++ behavior they'd need to add another integer field somewhere, perhaps to each object instance, to track where in the construction process they are. That would be a waste for such an edge case. So (i assume) they took a calculated risk and changed how construction and virtual dispatch take place.
Of course, the _real_ question is, given all this, why don't they have some sort of warning when a constructor calls a virtual method? Here, the virtual default comes back to bite you. If there really is an override somewhere in the inheritance tree, calling it from the constructor is probably broken.
(I know it's idiomatic in Java to use virtual methods to allow a derived class to customize base constructor behavior -- of course, constructor parameters can do that too. Perhaps we consider using those more often, and mark functions used by constructors as sealed. I think everyone knows how function argument passing is supposed to work by now)
Aaron,
I'm glad you pointed out this not-so-subtle difference between C++ and Java. Every method in Java is virtual unless you specify otherwise (by explicitly declaring it final). This is a convenience most of the time, but as you said, it bites you here.
This comment also reminded me that this was discussed briefly in Josh Bloch's Effective Java. In the chapter titled "Design and document for inheritance or else prohibit it" (chapter 15 in the 1st ed., the only one I have with me), Bloch states that "Constructors must not invoke overridable methods, directly or indirectly." He then goes on to explain that unexpected behavior may result.
This does seem like it calls for at least a warning from the compiler.
The sequence of events isn't quite right. I just created a version of this program that used a custom class I made instead of String for the data member so I could print a line when it was created. The sequence is:
1. Base constructor
2. Derived preProcess (NOT the Base preProcess). This is confirmed by both a print statement in the preProcess() method and the data member's class;
3. Base constructor end;
4. Derived's data member initializer, which overwrites the previously set value.
Try it.
William,
I said that the Base constructor calls preProcess(), not that it calls its own preProcess(). The one that gets exectuted is the one in the Derived class. | http://www.billthelizard.com/2009/06/java-puzzler.html | CC-MAIN-2017-47 | refinedweb | 1,793 | 63.19 |
.
Jython also allows you to avoid the ubiquitous Java get/set methods, allowing your program to have a more Pythonic style. When Jython sees a line of code such as:
x = javaObj.attribute
a Java call of the method
javaObj.getAttribute(), if such a method exists, is automatically generated. Similarly, an assignment to
javaObj.attribute is converted to a call to
javaObj.setAttribute.
Frequently, you will need to call a Java method that requires a Java array as an argument. Under normal circumstances, Jython will automatically convert a Python list or tuple to an array of the appropriate type when needed. This assumes that each item in the list or tuple can be converted to the appropriate type -- if not, Jython will raise a runtime error. So the Jython list
[1, 2, 3] can be converted to a Java
int[],
long[],
java.lang.Integer[], or
java.lang.Object[] as needed (but not, for example, to a
java.lang.String[]).
However, that conversion creates a copy of the list, and in some cases that's not what you want. For example, if the method you are calling changes the list in-place, the change will not propagate back to the Jython code, since the array is only a copy of the Jython list. Jython provides the
jarray module to simplify the direct creation of Java arrays when needed.
You can create blank arrays with the
zeros method.
>>> import jarray >>> jarray.zeros(5, 'i') array([0, 0, 0, 0, 0], int)
The first argument is the length of the array, and the second is either a character representing a basic type, or a Java class name.
>>> jarray.zeros(4, java.lang.String) array([None, None, None, None], java.lang.String)
You can create arrays directly from Python sequences, by using the
array method.
>>> jarray.array([8, 9, 2, 1], 'i') array([8, 9, 2, 1], int)
Now, the first argument is a Python sequence, and the second is still the class or type signature.
In the case where the Java method is overloaded and has more than one definition, Jython will attempt to match the call to the correct method based on the number and runtime type of the arguments.
Although the details can get complex, the basic idea is simple: Jython first attempts to choose a method with the same number of arguments as the call, and if there is more than one, it chooses the method whose required type is most similar to the calling object. In general, Jython prefers methods with basic Java types over methods with Java object types.
A Jython object can be declared as a subclass of a Java object by using the standard Python syntax:
class JythonString(java.lang.String): pass
Java interfaces can also be implemented in this way. Jython does not do a compile-time check to determine if all methods in an interface are actually defined -- calling an undefined method will raise a runtime exception.
Although Jython does have multiple inheritance, there is one limitation concerning Java objects. A Jython class can have at most one Java ancestor. This is true whether the ancestor is a direct parent, or an indirect parent via another Jython class.
Java subclasses behave differently when constructed. If a Jython class has a Java parent, and that parent has a no-argument constructor, that constructor is automatically called at the end of the Jython class'
__init__ method, or before a Java attribute is used within that
__init__ method. This is different from the normal Python behavior, where a parent class constructor is never called automatically. This is done to ensure that the Java objects are properly initialized before use.
Unlike ordinary Python objects, you cannot create new attributes in a Java object instance simply by assigning to it -- the instance must have been declared in Java. Attempting to assign to an instance of a Java class that does not exist will raise an error.
>>> x = java.util.ArrayList() >>> x.language = 'english' Traceback (innermost last): File "console", line 1, in ? TypeError: can't set arbitrary attribute in java instance: language
To work around this limitation, you can create a subclass of the Java class -- it can be an empty subclass. You can then add attributes to instances of the subclass:
>>> class NewArrayList(java.util.ArrayList): ... pass ... >>> x = NewArrayList() >>> x.>> x.language 'english'
Java objects cannot be serialized using the standard Python
pickle and
cPickle modules. Both Java and Jython objects can be serialized using normal Java serialization. However, when deserializing a Jython object you cannot use the normal
java.io.ObjectInputStream class, you must use the Jython-specific
org.python.util.PythonObjectInputStream, as shown here:
import java.io as io import org.python.util as util class TestClass(io.Serializable): def __init_ _(self, value=0): self.value = value self.message = "Serialized" def toString(self): return "Message: %(message)s value: is %(value)s" % self.__dict_ _ instance = TestClass(3) outFile = io.FileOutputStream("test.ser") outStream = io.ObjectOutputStream(outFile) outStream.writeObject(instance) outFile.close( ) inFile = io.FileInputStream("test.ser") inStream = util.PythonObjectInputStream(inFile) readInstance = inStream.readObject( ) print readInstance.toString( ) Message: Serialized value: is 3
If you do not use the
PythonObjectInputStream, you will get a runtime error because the ordinary Java
ObjectInputStream has difficulty finding and recreating the dynamically loaded proxy classes used for Jython's Java inheritance.
Finally, here are a few of the most important differences between Jython and Cpython, not directly related to object usage:
-Ooptimization flag.
For more information on Jython, see the main Jython site at, and get a copy of our recent book, Jython Essentials.
Noel Rappin has a Ph.D. in computer science from the Georgia Institute of Technology, where his research included methods for teaching Object-Oriented Programming and Design. He has extensive production experience in both Java and Python.
Return to the Python DevCenter. | http://www.onlamp.com/lpt/a/python/2002/04/11/jythontips.html | CC-MAIN-2014-41 | refinedweb | 974 | 57.06 |
Asked by:
Office Communicator unable to connect through CISCO VPN
- Hello,
Newly installed OCS 2007 server. Works fine in the office but will not connect through Cisco VPN. It times out and says the server is not available. I removed the "fixup protocol sip 5060" line from the ASA as noted in a KB article to resolve this issue. No luck. I am using TCP not TLS. I can ping all DNS entries when connected to the VPN. sip.domainname.com, sipinternal.domainname.com, and sipexternal.dmainname.com. Does anyone have any idea what else I can look at. I enabled the advanced logging for the Office Communicator client and I will try it out tonight to see if I can generate some more usefull information.
Thanks.Monday, September 15, 2008 8:53 PM
Question
All replies
Communicator is not designed to work over VPN
You should use an EDGE Server if you want users to connect via InternetMonday, September 22, 2008 4:21 PM
Try hardcoding your client to use the same name and port for both internal and external servers:
go to tools->options->advanced
select "manual configuration"
Internal: sipinternal.domainname.com:5060
External: sipinternal.domainname.com:5060
Connect using: TCP
By the way - why are you using TCP rather than TLS? It's not recommended or secure. If this is a production deployment, I'd look into getting the correct certs and using TLS.
Regards,
MattMonday, September 22, 2008 4:40 PM
Deli's statement is misleading. There is no inherent design aspect of Communicator that would cause it fail over a VPN. Many customers do not allow applications to be accessible from the internet and therefore require VPN to access Communicator. I could list a number of customers that are successfully using Communicator over various types of VPNs, and I have personally tested Communicator over a customer's Cisco VPN as recently as last month.
Ping is a good first step but you should also test port connectivity. Try telnet poolname.domain.com 5060. If you get a blank screen then it was succesful. Posting your Communicator log would also be helpful.Monday, September 22, 2008 4:43 PMModerator
- I have had others tell me OCS was not designed to work over VPN. If that is the case why did MS write KB911786. I have no need to open up my internal OCS to the world, just my laptop fleet when they are out of the office. They already connect thrugh a VPN so why should I purchase another server and server license to alow this? Doesn't matter.
I am using TCP simply because I'm not familiar with TLS. Can anyone recommend any documentation for deploying OCS with TLS? I've read everythgin MS has to offer as far as documentation goes and in my opinion it leaves alot to be desired.
To answer some questions, I can ping everything by name when cnnected to the VPN. Poolname.domainname.com and .local. I have not yet tried to telnet to 5060 but I will try that tonight.
Thanks,Monday, September 22, 2008 7:39 PM
Hi,
I echo Mike's message: OCS works with VPN for sure, end of story. However, the important point is that OCS was designed to be able to work without a VPN as well; that appeals to a lot of people. So if you already require a VPN, then fine and dandy, OCS will still work. However, many people would rather avoid having to use a VPN because it can be a costly solution. OCS gives you the flexibility to either use or not use a VPN.
Now I will say that putting voice and video over a VPN connection does tend to decrease performance because the VPN connection has some network overhead and uses TCP, which is slower than UDP (OCS uses UDP for voice and video). So voice and video will probably perform slightly better without the VPN connection. But it will still work with it.
As for TLS vs. TCP - TLS just is encrypted (Transport Layer Security) using SSL certificates. It still uses TCP, just with added security of SSL. All of the OCS 2007 deployment documentation refers to using TLS rather than just TCP. It does take extra effor to set up, but I think most people feel the extra time is worth it for the added security of having all traffic encrypted.
Regards,
MattMonday, September 22, 2008 7:57 PM
That KB article specifically references an issue with some PIX firewalls and how they handle SIP over TLS. Microsoft did not 'design' the TLS protocol, so publishing a technical bullentin is not confirmation of an inherent lack of design on their part.
Also the Edge Server is used for more than just external client connections, without it you won't be able to take advantage of Federation or Public IM connecitivty either. If those features are not required, and you don't have one of the 'bad' PIX firewalls then you can certain get some functionailty for remote users via VPN.Monday, September 22, 2008 8:42 PMModerator
Just to be clear, I did not state that it would not work over VPN
It is just that you might experience problems because of the VPN / Firewall stuffMonday, September 22, 2008 9:37 PM
Thanks Matt & Jeff. I couldn't have said it better myself.Monday, September 22, 2008 11:41 PMModerator
- I think we've gotten a little side tracked. I'm not arguing against the use of an Edge server in every scenario just in mine. I have no need for one as I'm not planning to have any public IM connectivity at this time, etc, etc. I simply need to be able to connect to an internal OCS server through a VPN. I've gotten TLS working internally now so I'm going to try again through the VPN to see if it will function. I may later decide an Edge server is the way to go if I start using more features if OCS. I'm planning to test this afternoon so I will post the results.
Thanks,Tuesday, September 23, 2008 3:48 PM
- One thing to keep in mind on this topic is if one is using Automatic Configuration and where DNS lookups are directed during the VPN session. Things like split-tunneling might impact what records are resolvable and could cause unwanted connections as the 'wrong' records are resolved by the client. Just something to think about...Tuesday, September 23, 2008 9:35 PMModerator
Can you try something for me the next time you VPN in... can you manually configure the Communicator client to point to the Pool FQDN (Or std edition FQDN if appropriate). Then test connection.
If that fails, then manually configure pointing to the IP address of the OCS server. (TCP obviously until you get TLS setup)
What will this do?? Point us to a DNS issue and narrow down the scope for sure. Also any additional logging you can do would help.Wednesday, September 24, 2008 3:20 AM
- Thanks for all the comments. I resolved this last night. The fix was to use the FQDN instead of the IP adress when setting the manual configuration. I think it was tied to the certificate not having the IP address but only the FQDN. Who knows. In any case as soon as I changed this it started working.Wednesday, September 24, 2008 12:59 PM
- That would do it; the FQDN that the client uses must match the Subject Name of the attached certificate. Using any different CNAME record or IP address would technically resolve and connect, but a certificate error would appear in client's the Application Event Log reflecting that.Wednesday, September 24, 2008 1:26 PMModerator
So you were using TLS and not TCP? Sorry I misunderstood then, I thought you were only using TCP.
So next step is you will need to get automatic configuration working... manual config sucks and doe not allow you to be flexible.
-JayFriday, September 26, 2008 6:11 AM
- Friday, September 26, 2008 12:59 PMModerator
Okay, my turn
So first off as it relates to the original poster's scenario, it absolutely would have prevented the issue he ran into by putting an IP address in the manual configuration. And this was a mistake from someone fairly knowledgeable with OCS. Now multiply that potential risk times X number of users who have a fraction of the OP's skills.
While you are correct that there is a small portion of DNS scenarios that support SRV records, that scenario is getting smaller and smaller. Again as it relates to the original poster's scenario, it would not apply as I assume they are using MS DNS. Een if using a 3rd party DNS such as QIP, it is supported.
In regards to LCS to OCS migrations... to me that is an even better scenario to use SRV records for auto-configuration. First, if they are doing a rip and replace, then the FQDN would most likely be different.. from LCS01.company.com to OCS01.company.com for example. Second, in an integration/migration scenario, you would want the automatic configuration mechanism to point users to OCS instead of LCS.
In staging environments, not sure why that would matter as no matter which server you try to connect to, it will direct the user to the server they are homed on. This "Director" function is inherent in every Std/EE pool, whether or not it is deployed as a dedicated "Director".
While you are correct about a single SRV record per SIP namespace, again that has no relevance IMO, because again, if the SRV record points the user to LCS for example, and the user is homes on OCS, then the client will get redirected automatically to the correct server.
Excellent point on GPO's, but to be honest, most administrators I deal with have ZERO control of GPO's or logon scripts. In either script or GPO scenario, it usually takes much longer than putting in a request for a single DNS change.
Assigning users to different pools based on OU is a rare occurance, but again, by rt clicking on the OU or multi-selecting all of the users in the OU, you can use the OCS user wiz to provision all the users to a particular pool with a few mouse clicks. But honestly, what does that have to do with DNS resolution of a preferred OCS server? No matter where they get sent initially on sign in, they will get routed to the correct server.
So in summary, from my perspective it is much easier to change a single DNS entry, that it is to write/modify a script, get permissions for GPO additions, etc. Keep it simple, and let OCS and DNS do it's thing. Do you prefer to type in IP addresses into a web browser to get to your favorite webpage? Not me, call me lazy, but I prefer to let DNS do it's thing
Thank you for the discussion!
JayFriday, September 26, 2008 7:02 PM
That is a MUCH better post and I cannot disagree with any of your points. I simply balked at the previous "manual config sucks" statement with no details behind it as posts like that could potentially scare readers away from a possible solution, not to mention posts like that are not really a good contribution to the discussion and solutions. Examples like above are much more welcome.
And FWIW, I make the same recommendations to cleint regarding Automatic Configuration, as it's what Microsoft intended to be used in deployments and is the best solution for 90% of environments. But manually controlling those settings has it's advantage as well in certain scenarios. For example it's handy to use for migrating pilot groups from LCS to OCS while not affecting the mass majority of users and then when a tipping point is reached in the migration process the SRV records and manual settings can be flip-flopped.Friday, September 26, 2008 7:35 PMModerator | https://social.microsoft.com/Forums/en-US/733fb12e-edaa-47c7-b529-5a6ca590dbb5/office-communicator-unable-to-connect-through-cisco-vpn?forum=communicationsserversetup | CC-MAIN-2015-48 | refinedweb | 2,035 | 61.77 |
:
- Add some global methods or properties (e.g. this is what Vuex or vue-router does).
- Add one or more global assets (e.g. something like a stylesheet with/or a JavaScript library).
- Add some component options by global mixin (e.g. this is what vue-html-to-paper does).
- Add some Vue instance methods by attaching them to Vue.prototype (e.g. this is what vue-axios does).
- A library that provides an API of its own, while at the same time injecting some combination of the above.!).
How to Add a Vue.js Plugin to Your Project..
How to Build Your Own Vue.js Plugin from Scratch?
Step 1: Initializing the Plugin Structure
Let’s create an empty folder for our package and initialize NPM. This will generate a new
package.json file. We’ll deal with it later.
$:
npm install -g @vue/cli npm install -g @vue/cli-service-global
Now if you run:
$ vue serve NiceHandsomeButton.vue
Visit. A blank page should appear in your browser. Let’s work on our button component from now on!
You can read more about @vue/cli-service-global in the official documentation. This addon is that it is quite useful for working on a single
.vuefile without scaffolding an entire project with
vue create my-new-project.
Step 2: Working on Our Handsome Button Component
Template @ <slot></slot> </button> </template>
We have kept things simple, but here are a few things to note:
- I am using BEM. If you are not familiar with it, please read this now: MindBEMding — getting your head 'round BEM syntax.
- I added the props
color,
sizeand
rounded. As their names indicate, they will allow us to control the color, the size and whether or not our button should be rounded.
- I’m also using a slot for the content so that we can use it like a normal button
<nice-handsome-button>My Button Label</nice-handsome-button>.
JavaScript>
Style
Last but not least, let’s style our component.
.
Step 3: Write the Install Method
Before we start this section, let’s create an
index.js file in your src folder.
Remember that
Vue.use() global we talked about earlier? Well… what this function does is call the
install() method that we will define now.
This function takes two parameters: the
Vue constructor and the
options object that a user can set. You can skip the last argument if you don’t need it as it is optional. But if you want to make your plugin customizable, this is where you will catch the different parameters:
Vue.use({ param: "something" })`. // Then in your install method options.param will equal to "something"
In
index.js, let’s import our component and define our
install method.
import NiceHandsomeButton from "./NiceHandsomeButton.vue"; export default { install(Vue, options) { // Let's register our component globally // Vue.component("nice-handsome-button", NiceHandsomeButton); } };
Congratulations, you almost made it!
Step 4: Reworking
package.json
Open your
package.json file that you created when running
npm init.
{ "private": false, "name": "nice-handsome-button", "version": "0.0.1", "description": "A nice handsome button you will love", "author": "Nada Rifki", "license": "MIT", "main": "./dist/index.cjs.js", "scripts": { "dev": "vue serve NiceHandsomeButton.vue", "build": "bili --name index --plugin vue --vue.css false" }, "files": [ "dist/*" ] }
A few notes:
privateis set to
false. This means your package is public (i.e. everyone is able to see and install it).
- Choose a
namefor your package. You have to make sure that it’s not already taken.
- The version number is set to
0.0.1. You will have to increment this number every time you publish an update for your package. If you are not familiar with semantic versioning, I highly recommend you read this.
- Choose a description that describes your package in a few words. This will help other developers understand what pain your plugin solves.
- The
mainis the primary entry point to your program. That is, if your package is named
foo, and a user installs it, and then does
require("foo"), then your main module’s exports object will be returned.
- The
scriptsproperty is a dictionary containing script commands that you can easily run with
npm run.
- The
filesproperty specifies which files should be published on NPM. It is usually a bad idea to publish everything. We’ll be using
bili, so all files in
distfolder should be included.
You can read more about all these properties in the official NPM documentation.
Bundling Your Library
In case you don’t know, bundling is the process of grouping all your code from all your files in your project into one single file. The reason behind is simply to increase performance. This will also minify the code and do some other cool things.
To do so, we’ll use Bili, a fast and zero-config library bundler that uses Rollup.js under the hood.
Let’s install it.
$:
module.exports = { banner: true, output: { extractCSS: false, }, plugins: { vue: { css: true } } };
All you have left to do is run the command below on your terminal and your package is bundled — it’s as easy as 1-2-3!
$ npx bili
You should obtain a new
dist folder with a
index.cjs.js file.
By default
<style>tag in Vue SFC will be extracted to the same location where the JS is generated but with
.cssextension. That’s why we added
--vue.css falsein the command above.
To learn more about Bili and how to customize it, I recommend you take a look at the documentation.
Sharing Your Wonder on NPM.
You can check that you are logged in by typing
npm whoami. This should display your username.
There is now only one terminal command that stands between you and publishing your package:
$ npm publish
And voilà!
To update your package, just increment the
version number in your
package.json and rerun
npm publish.
How to Use Your Newly Published Library.
<nice-handsome-button :My Button</nice-handsome-button>
Where to Go from There?
There is a lot you can do now and that’s awesome! You learned how to package your first component and publish it on NPM for everyone to use. But don’t stop now! Here are a few ideas that may inspire you:
- Improving this button component by allowing people to set an icon on the left, managing other events like
mouseenteror
mouseoutand so on.
- Adding new components to this one and releasing a design system.
- Building a different plugin like a directive or a mixin.
Easy peasy! Finally, we’re done. You can find the plugin’s final code on my GitHub. Feel free to give me your feedback or to reach me on Twitter @RifkiNada if you need help. Enjoy and have a good day! | https://laptrinhx.com/vue-js-how-to-build-your-first-package-publish-it-on-npm-24068819/ | CC-MAIN-2020-45 | refinedweb | 1,131 | 69.07 |
Conjury::Core - the foundation of Perl Conjury
use Conjury::Core; tie I<HASH>, Conjury::Core::Journal, F<filename>; $spell = Conjury::Core::Spell->new ( I<HASH> ); cast_warning ( I<LIST> ); cast_error ( I<LIST> ); [$spell =] name_spell ( I<HASH> ); @spells = fetch_spells ( I<HASH> ); $spell = Conjury::Core::deferral ( I<HASH> ); $spell = Conjury::Core::filecopy ( I<HASH> ); $spell = Conjury::Core::dispell ( I<HASH> );
The Conjury::Core module is the foundation of the Perl Conjury software construction framework. You need to understand this module before you design other Perl Conjury modules, especially application-specific ones referenced in your Conjury.pl files.
In addition to some exported functions, there are four Perl packages in the
Conjury::Core namespace: Conjury::Core::Context, Conjury::Core::Journal and Conjury::Core::Spell.
A "context" is an association between a directory within the source file hierarchy and the spells defined by the Conjury.pl file there. (The name of the spell definition file may differ on your platform. See Conjury.)
A
Conjury::Core::Context object encapsulates this association. It should be treated like a structure with named members. Most of its methods are not really for public use.
The 'Directory' method returns the name of the directory associated with the context.
The
$Current_Context package variable always contains a reference to the current context object. The
$Top_Context package variable always contains a reference to the context at the top of the source file hierarchy.
A "journal" is a file that contains the persistent data that Perl Conjury uses to record the signatures of actions as they are performed, so that they can be skipped on subsequent runs when the signature for products are known not to have changed.
It probably should not be implemented as a tied hash, but it is. It should be treated like an opaque object.
Create a journal using the
tie builtin and specifying the name of the file to write.
A "spell" is an object that encapsulates the action required to perform a task, typically for constructing or erasing files. A spell is usually associated with a list of factors, other spells representing actions that must be taken first, if the spell is to succeed.
All spells have a profile which is used in computing the signature of the spell. Before an action is taken for a spell, the signatures of all its factors are appended to the profile for the spell, then reduced with the MD5 cryptographic hash function to become the signature for the spell.
When a spell creates product files, the names of the files and the signature of the spell that produced them is journaled to a file. In this way, if the signature for a file is found to have changed since it was last journaled, it is because the spell responsible for creating it has acquired a new profile, or one of its factors has a new signature.
If a factor of a spell specifies a file not produced by any spells, that file is treated as a source file, and its modification time is appended to the profile of the spell which considers it a factor. In this way, changes to the modification time of a source file results in a cascading change to the signature of every spell that references it in its tree of factors.
Use the
Conjury::Core::Spell-new> subroutine to construct a spell object. The named parameters are all optional, but using some of them implies a requirement for the use of others. A spell constructed with no parameters has no action, no profile, i.e. it generates no effect on the signature of spells that consider it a factor.
The named parameters of the
new method in detail:
Associates the spell with a journal object. This is usually not necessary when the spell has no product files. Spells that have products should always journal their signatures, but it is not required.
Specifies the list of factors for the spell. These may be references to other spell objects or the names of spells to fetch using the
fetch_spells function.
Specifies the name of the file, or a list of the names of files, produced by the action of the spell. When the spell is created, the names of the products are stored internally in a global hash available to the
fetch_spells function.
Specifies the action to take when the spell is invoked. The first and second form result in the scalar (or the list of scalars) to be used with the
system builtin function.
The third form is for specifying a closure that takes a reference to the spell object as its only argument. If you use a closure, you will be required to specify a profile for the closure. This is because you cannot convert a code block into a string very easily in Perl.
When a spell is invoked, its action is executed in the context in which it was created. Actions return boolean true on failure.
Specifies the profile for an action. The first form is the simple case, i.e. the string is used as the profile for an action closure. You should provide a profile that uniquely describes the action to take, including the name of the action function and the values of any parameters used in the construction of the closure.
The second form is the more complicated case, i.e. the profile is, itself, a closure. Closure profiles require no arguments, and they are called during the invocation phase immediately before the factors are invoked. The explanation for why you would want to use this form is tedious, esoteric and best not presented during dinner. Hint: C language dependency scanning is one case.
The
name_spell and
fetch_spells functions should probably be moved into an appropriate Conjury::Core::Xxxxx namespace. If they stay where they are, then the contents of
@EXPORT should be moved to
@EXPORT_OK. It remains unclear what is the right thing to do here-- but it will be. It will.
cast_warning
Prints a warning message to the standard output. Use this function like the print builtin function. A prefix is inserted to identify the message as a warning from the cast utility, and a newline is appended.
cast_error
Prints an error message to the standard output and dies. Use this function like the die builtin function. A prefix is inserted to identify the message as an error from the cast utility, and a newline is appended.
name_spell
name_spell (Spell => spell, Context => context, Name => [ name1, name2, ... ], # array or scalar is okay Default => 1)
Assigns names in a context to a spell. The 'Spell' argument is the only required argument. The others are all optional.
If no context is specified, then the current context is assumed.
If the 'Default' argument is specified, or the 'Name' argument is unspecified or specifies an empty list, then the spell is explicitly assigned to the list of unnamed spells in the context. These spells are typically the 'default' spells that are invoked when no names are given to the cast utility from the command line.
fetch_spells
fetch_spells(Name => name, Context => context, Require => 1)
Returns a list containing references to all the spell objects with the name in the context.
If the name is not specified, then the list will contain references to all the unnamed spell objects. You can use a list of names to fetch all the spell objects for the whole list at once. A spell will be fetched if its product matches the specified name, or the spell was explicitly assigned the name with the name_spell function.
If the context is not specified, the current context is assumed.
Spells for products created in other contexts can be fetched using either an absolute or a relative pathname. Be careful that the path you specify contains no symbolic links or references to parent directory pointers, i.e. the '..' directory, as these may not be resolved properly.
If the 'Require' argument is not set, then an empty list is a permissible result.
deferral
$spell = deferral(Directory => [ dir1, dir2, ...], Name => name, If_Present => 1);
Creates a spell object that defers its actions to the named spells in contexts associated with other directories. The 'Name' argument is used with the
fetch_spellsfunction to find all the named spells in each directory.
There must be a spells definition file in each of the named directories, unless the 'If_Present' argument is defined.
The 'Name' argument may specify a single name or a list of names. If it is a list of names, then all the names are passed to the
fetch_spellsfunction for each directory at a time.
filecopy
$spell = filecopy (Journal => journal, Factors => [ spell1, spell2, ... ], Directory => directory, File => [ file1, file2, ... ], # array or scalar is okay Permission => permission, Owner => [ user, group ];
Creates a spell object that copies a file or a list of files to a directory.
The 'File' argument is required and must specify a filename or a list of filenames. The 'Directory' argument is required and must specify the destination directory for the copy action.
Use the optional 'Factors' argument to add spells explicitly to the list of factors. If there are already spells that produce the files in the 'File' list, they need not be listed here. They will be fetched and automatically appended to the factors list.
Use the optional 'Journal' argument to specify a journal object for the spell.
Use the optional 'Permission' argument to specify that the
chmodbuiltin should be used to set the access permissions associated with the files after they have been copied to the destination. The syntax requirements for
chmodapply.
Use the optional 'Owner' argument to specify that the
chownbuiltin should be used to set the user and group ownership after the files have been copied to the destination. The syntax requirements for
chownapply.
dispell
$spell = dispell (Journal => journal, Factors => [ spell1, spell2, ... ], Directory => [ directory1, directory2, ...] # array or scalar okay File => [ file1, file2, ... ], # array or scalar okay Glob => [ expression1, expression2, ...] # array or scalar okay Require => 1;
Creates a spell object that erases files or lists of files in a directory.
At least one of the arguments, 'File', 'Glob' and 'Directory' is required. The 'File' argument specifies a filename or a list of filenames to unlink with the 'unlink' builtin function. The 'Directory' argument specifies a directory or a list of directories to remove with the 'rmtree' function in File::Path. The 'Glob' argument specifies a filename globbing expression that is resolved in the action function into a list of files and directories that are dispelled as if they were specified in 'File' or 'Directory' argument lists.
The 'Require' argument is optional. If it is set, then the files and directories to be unlinked or removed are required to exist when the action is executed to erase them.
Use the optional 'Factors' argument to add spells explicitly to the list of factors.
Use the optional 'Journal' argument to specify a journal object for the spell.
James Woodyatt <jhw@wetware.com> | http://search.cpan.org/~jwoodyatt/Conjury-Core-1.004/lib/Conjury/Core.pm | CC-MAIN-2014-23 | refinedweb | 1,816 | 63.49 |
Azure Database for PostgreSQL - Single Server
This article provides considerations and guidelines for working with Azure Database for PostgreSQL - Single Server.
What is an Azure Database for PostgreSQL server?
A server in the Azure Database for PostgreSQL - Single Server deployment option is a central administrative point for multiple databases. It is the same PostgreSQL server construct that you may be familiar with in the on-premises world. Specifically, the PostgreSQL service is managed, provides performance guarantees, exposes access and features at the server-level.
An Azure Database for PostgreSQL server:
- Is created within an Azure subscription.
- Is the parent resource for databases.
- Provides a namespace for databases.
- Is a container with strong lifetime semantics - delete a server and it deletes the contained databases.
- Collocates resources in a region.
- Provides a connection endpoint for server and database access
- Provides the scope for management policies that apply to its databases: login, firewall, users, roles, configurations, etc.
- Is available in multiple versions. For more information, see supported PostgreSQL database versions.
- Is extensible by users. For more information, see PostgreSQL extensions.
Within an Azure Database for PostgreSQL server, you can create one or multiple databases. You can opt to create a single database per server to utilize all the resources, or create multiple databases to share the resources. The pricing is structured per-server, based on the configuration of pricing tier, vCores, and storage (GB). For more information, see Pricing tiers.
How do I connect and authenticate to an Azure Database for PostgreSQL server?
The following elements help ensure safe access to your database:
Managing your server
You can manage Azure Database for PostgreSQL servers by using the Azure portal or the Azure CLI.
While creating a server, you set up the credentials for your admin user. The admin user is the highest privilege user you have on the server. It belongs to the role azure_pg_admin. This role does not have full superuser permissions.
The PostgreSQL superuser attribute is assigned to the azure_superuser, which belongs to the managed service. You do not have access to this role.
An Azure Database for PostgreSQL server has default databases:
- postgres - A default database you can connect to once your server is created.
- azure_maintenance - This database is used to separate the processes that provide the managed service from user actions. You do not have access to this database.
- azure_sys - A database for the Query Store. This database does not accumulate data when Query Store is off; this is the default setting. For more information, see the Query Store overview.
Server parameters
The PostgreSQL server parameters determine the configuration of the server. In Azure Database for PostgreSQL, the list of parameters can be viewed and edited using the Azure portal or the Azure CLI.
As a managed service for Postgres, the configurable parameters in Azure Database for PostgreSQL are a subset of the parameters in a local Postgres instance (For more information on Postgres parameters, see the PostgreSQL documentation). Your Azure Database for PostgreSQL server is enabled with default values for each parameter on creation. Some parameters that would require a server restart or superuser access for changes to take effect cannot be configured by the user.
Next steps
- For an overview of the service, see Azure Database for PostgreSQL Overview.
- For information about specific resource quotas and limitations based on your service tier, see Service tiers.
- For information on connecting to the service, see Connection libraries for Azure Database for PostgreSQL.
- View and edit server parameters through Azure portal or Azure CLI.
Feedback | https://docs.microsoft.com/en-us/azure/postgresql/concepts-servers | CC-MAIN-2019-39 | refinedweb | 585 | 57.37 |
Extract All Classes Loaded in the JVM into a Single JAR, it would not be a problem, but when we are building an applet, the size of the applet and all its JARs matters.
I needed to remove all unused classes from the JARs that my applet was including a part of itself. For example the Bouncy Castle JARs were about 1,6 MB but the applet used only a small part of all algorithms and standards implemented by these JARs.
Extracting All Classes Loaded in the JVM
My final goal was not only to remove all unused classes from all JAR files but also merge these JARs along with the applet classes into a single JAR file that has the smallest possible size. I came with the idea to run the applet, to go through all its functionality and to get a list of all classes currently loaded into the JVM executing the applet. At this moment all classes required by the applet for its normal work will be loaded in the JVM and all classes that was never used by the applet will not be loaded in the JVM. If I package all these classes into a new JARs, it will contain the minimal set of classes nedded by the applet along with the applet classes.
As fas as I know how the JVM and the class loaders behave, this should be correct – we can expect all classes required by the applet to be loaded in the JVM after its entire functionality is accessed at least once.
I had a serious problem: how to get a list of all classes loaded in the JVM.
List All Classes Loaded in the JVM
Geting a list of all classes that are loaded in the JVM at some moment is not easy job. We can write Java agent through the java.lang.instrument API but I needed to do this at runtime (just to add few lines to the applet). I found in Google a very nice class for accessing all classes loaded in the JVM written by Vladimir Roubtsov and published in Java World (). With few modifications it successfully listed all classes loaded in my applet.
Create a Single JAR with All Classes Loaded in the JVM
The next step was to create a single JAR with all classes loaded in the JVM. This was not complex. I created a class with few methods for copying all currently loaded classes into some directory specified as parameter. Here is the source code:
import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URL; /*** * This class extracts all classes loaded in the JVM and their binary contents * (.class files) into given directory so that you can create JAR archive later. * @author Svetlin Nakov - */ public class AllClassesInJVMExtractor { private final static int BUFFER_SIZE = 4096; public static void extractAllClassesFromJVM(String destFolder) throws IOException { ClassLoader appLoader = ClassLoader.getSystemClassLoader(); ClassLoader currentLoader = AllClassesInJVMExtractor.class.getClassLoader(); ClassLoader[] loaders = new ClassLoader[] { appLoader, currentLoader }; final Class< ?>[] classes = ClassScope.getLoadedClasses(loaders); for (Class< ?> cls : classes) { String className = cls.getName(); URL classLocation = ClassScope.getClassLocation(cls); System.out.println("Extracting class: " + className + " from " + classLocation); String destFileName = destFolder + "/" + className.replace(".", "/") + ".class"; copyFile(classLocation, destFileName); } } private static void copyFile(URL sourceURL, String destFileName) throws IOException { File destFile = new File(destFileName); File destDirectory = destFile.getParentFile(); destDirectory.mkdirs(); InputStream srcStream = sourceURL.openStream(); try { OutputStream destStream = new FileOutputStream(destFile); try { copyStreams(srcStream, destStream); } finally { destStream.close(); } } finally { srcStream.close(); } } private static void copyStreams(InputStream srcStream, OutputStream destStream) throws IOException { byte[] buf = new byte[BUFFER_SIZE]; while (true) { int bytesRead = srcStream.read(buf); if (bytesRead == -1) { // End of stream reached return; } destStream.write(buf, 0, bytesRead); } } }
It is not a rocket science. I go through all classes loaded by the current class loader and by the system class loader, get their fully qualified name (e.g. org.bouncycastle.cms.CMSSignedData) and their source URL location (e.g. jar:file:/C:/PROJECTS/GeneratePKCS7andVerify/lib/bcmail-jdk15-140.zip!/org/bouncycastle/cms/CMSSignedData.class) and I copy their binary contents (from the URL) to the destination folder (into a .class file). In the mean time I recreate the package structure (following the full class name with all its packages). Finally I get a directory containing all class files loaded in the JVM at the time of caling my method and I can manually package them in a JAR (removing beforehand all system Java classes). That’s all. I use slightly modified version of ClassScope.java.
You can download a fully functional example here (Eclipse project): ExtractAllClassesFromJVMIntoJAR.zip.
2 Responses to “Extract All Classes Loaded in the JVM into a Single JAR”
I used AllClassesInJVMExtractor , but still collected classes were encrypted!
I thought encrypted classes has to be decrypted before load in JVM, So i expected to collect original classes from memory against an encrypted jar file!!!
Have you any idea?
Can any body help me for gathering encrypted classes in decrypted form???
thanks
Click That Link
Extract All Classes Loaded in the JVM into a Single JAR | Svetlin Nakov’s Blog | http://www.nakov.com/blog/2008/08/27/extract-all-classes-loaded-in-the-jvm-into-a-single-jar/ | CC-MAIN-2018-34 | refinedweb | 851 | 55.84 |
Configuring your driver for ArangoDB access
In this chapter you’ll learn how to configure a driver for accessing an ArangoDB deployment in Kubernetes.
The exact methods to configure a driver are specific to that driver.
Database endpoint(s)
The endpoint(s) (or URLs) to communicate with is the most important parameter your need to configure in your driver.
Finding the right endpoints depend on wether your client application is running in the same Kubernetes cluster as the ArangoDB deployment or not.
Client application in same Kubernetes cluster
If your client application is running in the same Kubernetes cluster as the ArangoDB deployment, you should configure your driver to use the following endpoint:
https://<deployment-name>.<namespace>.svc:8529
Only if your deployment has set
spec.tls.caSecretName to
None, should
you use
http instead of
https.
Client application outside Kubernetes cluster
If your client application is running outside the Kubernetes cluster in which the ArangoDB deployment is running, your driver endpoint depends on the external-access configuration of your ArangoDB deployment.
If the external-access of the ArangoDB deployment is of type
LoadBalancer,
then use the IP address of that
LoadBalancer like this:
https://<load-balancer-ip>:8529
If the external-access of the ArangoDB deployment is of type
NodePort,
then use the IP address(es) of the
Nodes of the Kubernetes cluster,
combined with the
NodePort that is used by the external-access service.
For example:
https://<kubernetes-node-1-ip>:30123
You can find the type of external-access by inspecting the external-access
Service.
To do so, run the following command:
kubectl get service -n <namespace-of-deployment> <deployment-name>-ea
The output looks like this:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR example-simple-cluster-ea LoadBalancer 10.106.175.38 192.168.10.208 8529:31890/TCP 1s app=arangodb,arango_deployment=example-simple-cluster,role=coordinator
In this case the external-access is of type
LoadBalancer with a load-balancer IP address
of
192.168.10.208.
This results in an endpoint of.
TLS settings
As mentioned before the ArangoDB deployment managed by the ArangoDB operator
will use a secure (TLS) connection unless you set
spec.tls.caSecretName to
None
in your
ArangoDeployment.
When using a secure connection, you can choose to verify the server certificates provides by the ArangoDB servers or not.
If you want to verify these certificates, configure your driver with the CA certificate
found in a Kubernetes
Secret found in the same namespace as the
ArangoDeployment.
The name of this
Secret is stored in the
spec.tls.caSecretName setting of
the
ArangoDeployment. If you don’t set this setting explicitly, it will be
set automatically.
Then fetch the CA secret using the following command (or use a Kubernetes client library to fetch it):
kubectl get secret -n <namespace> <secret-name> --template='{{index .data "ca.crt"}}' | base64 -D > ca.crt
This results in a file called
ca.crt containing a PEM encoded, x509 CA certificate.
Query requests
For most client requests made by a driver, it does not matter if there is any kind of load-balancer between your client application and the ArangoDB deployment.
Note that even a simple
Service of type
ClusterIP already behaves as a
load-balancer.
The exception to this is cursor-related requests made to an ArangoDB
Cluster
deployment. The Coordinator that handles an initial query request (that results
in a
Cursor) will save some in-memory state in that Coordinator, if the result
of the query is too big to be transfer back in the response of the initial
request.
Follow-up requests have to be made to fetch the remaining data. These follow-up requests must be handled by the same Coordinator to which the initial request was made. As soon as there is a load-balancer between your client application and the ArangoDB cluster, it is uncertain which Coordinator will receive the follow-up request.
ArangoDB will transparently forward any mismatched requests to the correct Coordinator, so the requests can be answered correctly without any additional configuration. However, this incurs a small latency penalty due to the extra request across the internal network.
To prevent this uncertainty client-side, make sure to run your client application in the same Kubernetes cluster and synchronize your endpoints before making the initial query request. This will result in the use (by the driver) of internal DNS names of all Coordinators. A follow-up request can then be sent to exactly the same Coordinator.
If your client application is running outside the Kubernetes cluster the easiest way to work around it is by making sure that the query results are small enough to be returned by a single request. When that is not feasible, it is also possible to resolve this when the internal DNS names of your Kubernetes cluster are exposed to your client application and the resulting IP addresses are routable from your client application. To expose internal DNS names of your Kubernetes cluster, your can use CoreDNS. | https://www.arangodb.com/docs/devel/deployment-kubernetes-driver-configuration.html | CC-MAIN-2021-31 | refinedweb | 836 | 51.68 |
On Fri, 2 Jun 2000, M. Greenblatt wrote:
> Ed-
>
> Since read() is required to return an int between 0 and 255 why is it
> necessary to check that this value is positive? Shouldn't we be doing
> something like:
>
>
> byte bytes[] = new byte[2];
>
> if (read(bytes, 0, 2) != 2)
> return -1;
>
> return (bytes[0] << 8) | bytes[1];
This version of read (read(byte[],int,int)) operates differently: it reads
bytes, *not* integers. When I wrote a test program, the JVM treated them
as signed bytes.
> And submit a bug report to the JVM developer if we're getting signed
> bytes? ;-)
>
> Also, it's not necissary to explicitly cast byte to int (though it
> doesn't hurt). Finally, you might want to test if -bytes[0] is faster
> than bytes[0] + 256.
Unfortunately, that produces a different result:
-10 + 256 == 246
-(-10) == 10
The method I showed yields identical results to the previous JServ method,
where as -bytes[i] wouldn't ... this is because of how signed values are
implemented.
thanks --
Ed | http://mail-archives.apache.org/mod_mbox/tomcat-dev/200006.mbox/%3CPine.LNX.4.21.0006021634210.3696-100000@ambient.collab.net%3E | CC-MAIN-2013-48 | refinedweb | 172 | 72.46 |
Ruby Array Exercises: Check whether the number of 2's is greater than the number of 5's of a given array of integers
Ruby Array: Exercise-34 with Solution
Write a Ruby program to check whether the number of 2's is greater than the number of 5's of a given array of integers.
Ruby Code:
def check_array(nums) ctr = 0 i = 0 while i < nums.length if (nums[i] == 2) ctr = ctr + 1 elsif (nums[i] == 5) ctr= ctr - 1 end i += 1 end return (ctr > 0) end print check_array([3, 5, 3, 3]),"\n" print check_array([2, 3, 2, 5]),"\n" print check_array([2, 2, 5, 5]),"\n"
Output:
false true false
Flowchart:
Ruby Code Editor:
Contribute your code and comments through Disqus.
Previous: Write a Ruby program to check whether the sum of all the 3's of an given array of integers is exactly 9.
Next: Write a Ruby program to check whether every element is a 3 or a 5 | https://www.w3resource.com/ruby-exercises/array/ruby-array-exercise-34.php | CC-MAIN-2021-21 | refinedweb | 167 | 57.74 |
/* * . * * RCS source control definitions needed by rcs.c and friends */ /* Strings which indicate a conflict if they occur at the start of a line. */ #define RCS_MERGE_PAT_1 "<<<<<<< " #define RCS_MERGE_PAT_2 "=======\n" #define RCS_MERGE_PAT_3 ">>>>>>> " #define RCSEXT ",v" #define RCSPAT "*,v" #define RCSHEAD "head" #define RCSBRANCH "branch" #define RCSSYMBOLS "symbols" #define RCSDATE "date" #define RCSDESC "desc" #define RCSEXPAND "expand" /* Used by the version of death support which resulted from old versions of CVS (e.g. 1.5 if you define DEATH_SUPPORT and not DEATH_STATE). Only a hacked up RCS (used by those old versions of CVS) will put this into RCS files. Considered obsolete. */ #define RCSDEAD "dead" #define DATEFORM "%02d.%02d.%02d.%02d.%02d.%02d" #define SDATEFORM "%d.%d.%d.%d.%d.%d" /* * Opaque structure definitions used by RCS specific lookup routines */ #define VALID 0x1 /* flags field contains valid data */ #define INATTIC 0x2 /* RCS file is located in the Attic */ #define PARTIAL 0x4 /* RCS file not completly parsed */ /* All the "char *" fields in RCSNode, Deltatext, and RCSVers are '\0'-terminated (except "text" in Deltatext). This means that we can't deal with fields containing '\0', which is a limitation that RCS does not have. Would be nice to fix this some day. */ struct rcsnode { /* Reference count for this structure. Used to deal with the fact that there might be a pointer from the Vers_TS or might not. Callers who increment this field are responsible for calling freercsnode when they are done with their reference. */ int refcount; /* Flags (INATTIC, PARTIAL, &c), see above. */ int flags; /* File name of the RCS file. This is not necessarily the name as specified by the user, but it is a name which can be passed to system calls and a name which is OK to print in error messages (the various names might differ in case). */ char *path; /* Use when printing paths. */ char *print_path; /* Value for head keyword from RCS header, or NULL if empty. HEAD may only * be empty in a valid RCS file when the file has no revisions, a state * that should not be able to occur with CVS. */ char *head; /* Value for branch keyword from RCS header, or NULL if omitted. */ char *branch; /* Raw data on symbolic revisions. The first time that RCS_symbols is called, we parse these into ->symbols, and free ->symbols_data. */ char *symbols_data; /* Value for expand keyword from RCS header, or NULL if omitted. */ char *expand; /* List of nodes, the key of which is the symbolic name and the data of which is the numeric revision that it corresponds to (malloc'd). */ List *symbols; /* List of nodes (type RCSVERS), the key of which the numeric revision number, and the data of which is an RCSVers * for the revision. */ List *versions; /* Value for access keyword from RCS header, or NULL if empty. FIXME: RCS_delaccess would also seem to use "" for empty. We should pick one or the other. */ char *access; /* Raw data on locked revisions. The first time that RCS_getlocks is called, we parse these into ->locks, and free ->locks_data. */ char *locks_data; /* List of nodes, the key of which is the numeric revision and the data of which is the user that it corresponds to (malloc'd). */ List *locks; /* Set for the strict keyword from the RCS header. */ int strict_locks; /* Value for the comment keyword from RCS header (comment leader), or NULL if omitted. */ char *comment; /* Value for the desc field in the RCS file, or NULL if empty. */ char *desc; /* File offset of the first deltatext node, so we can seek there. */ off_t delta_pos; /* Newphrases from the RCS header. List of nodes, the key of which is the "id" which introduces the newphrase, and the value of which is the value from the newphrase. */ List *other; }; typedef struct rcsnode RCSNode; struct deltatext { char *version; /* Log message, or NULL if we do not intend to change the log message (that is, RCS_copydeltas should just use the log message from the file). */ char *log; /* Change text, or NULL if we do not intend to change the change text (that is, RCS_copydeltas should just use the change text from the file). Note that it is perfectly valid to have log be NULL and text non-NULL, or vice-versa. */ char *text; size_t len; /* Newphrase fields from deltatext nodes. FIXME: duplicates the other field in the rcsversnode, I think. */ List *other; }; typedef struct deltatext Deltatext; struct rcsversnode { /* Duplicate of the key by which this structure is indexed. */ char *version; char *date; char *author; char *state; char *next; int dead; int outdated; Deltatext *text; List *branches; /* Newphrase fields from deltatext nodes. Also contains ";add" and ";delete" magic fields (see rcs.c, log.c). I think this is only used by log.c (where it looks up "log"). Duplicates the other field in struct deltatext, I think. */ List *other; /* Newphrase fields from delta nodes. */ List *other_delta; #ifdef PRESERVE_PERMISSIONS_SUPPORT /* Hard link information for each revision. */ List *hardlinks; #endif }; typedef struct rcsversnode RCSVers; /* * CVS reserves all even-numbered branches for its own use. "magic" branches * (see rcs.c) are contained as virtual revision numbers (within symbolic * tags only) off the RCS_MAGIC_BRANCH, which is 0. CVS also reserves the * ".1" branch for vendor revisions. So, if you do your own branching, you * should limit your use to odd branch numbers starting at 3. */ #define RCS_MAGIC_BRANCH 0 /* The type of a function passed to RCS_checkout. */ typedef void (*RCSCHECKOUTPROC) (void *, const char *, size_t); struct rcsbuffer; /* What RCS_deltas is supposed to do. */ enum rcs_delta_op {RCS_ANNOTATE, RCS_FETCH}; /* * exported interfaces */ RCSNode *RCS_parse (const char *file, const char *repos); RCSNode *RCS_parsercsfile (const char *rcsfile); void RCS_fully_parse (RCSNode *); void RCS_reparsercsfile (RCSNode *, FILE **, struct rcsbuffer *); extern int RCS_setattic (RCSNode *, int); char *RCS_check_kflag (const char *arg); char *RCS_getdate (RCSNode * rcs, const char *date, int force_tag_match); char *RCS_gettag (RCSNode * rcs, const char *symtag, int force_tag_match, int *simple_tag); int RCS_exist_rev (RCSNode *rcs, char *rev); int RCS_exist_tag (RCSNode *rcs, char *tag); char *RCS_tag2rev (RCSNode *rcs, char *tag); char *RCS_getversion (RCSNode *rcs, const char *tag, const char *date, int force_tag_match, int *simple_tag); char *RCS_magicrev (RCSNode *rcs, char *rev); int RCS_isbranch (RCSNode *rcs, const char *rev); int RCS_nodeisbranch (RCSNode *rcs, const char *tag); char *RCS_whatbranch (RCSNode *rcs, const char *tag); char *RCS_head (RCSNode * rcs); int RCS_datecmp (const char *date1, const char *date2); time_t RCS_getrevtime (RCSNode * rcs, const char *rev, char *date, int fudge); List *RCS_symbols (RCSNode *rcs); void RCS_check_tag (const char *tag); int RCS_valid_rev (const char *rev); List *RCS_getlocks (RCSNode *rcs); void freercsnode (RCSNode ** rnodep); char *RCS_getbranch (RCSNode *rcs, const char *tag, int force_tag_match); char *RCS_branch_head (RCSNode *rcs, char *rev); int RCS_isdead (RCSNode *, const char *); char *RCS_getexpand (RCSNode *); void RCS_setexpand (RCSNode *, const char *); int RCS_checkout (RCSNode *, const char *, const char *, const char *, const char *, const char *, RCSCHECKOUTPROC, void *); int RCS_checkin (RCSNode *rcs, const char *update_dir, const char *workfile, const char *message, const char *rev, time_t citime, int flags); int RCS_cmp_file (RCSNode *, const char *, char **, const char *, const char *, const char * ); int RCS_settag (RCSNode *, const char *, const char *); int RCS_deltag (RCSNode *, const char *); int RCS_setbranch (RCSNode *, const char *); int RCS_lock (RCSNode *, const char *, int); int RCS_unlock (RCSNode *, char *, int); int RCS_delete_revs (RCSNode *, char *, char *, int); void RCS_addaccess (RCSNode *, char *); void RCS_delaccess (RCSNode *, char *); char *RCS_getaccess (RCSNode *); void RCS_rewrite (RCSNode *, Deltatext *, char *); void RCS_abandon (RCSNode *); int rcs_change_text (const char *, char *, size_t, const char *, size_t, char **, size_t *); void RCS_deltas (RCSNode *, FILE *, struct rcsbuffer *, const char *, enum rcs_delta_op, char **, size_t *, char **, size_t *); void RCS_setincexc (void **, const char *arg); void RCS_setlocalid (const char *, unsigned int, void **, const char *arg); char *make_file_label (const char *, const char *, RCSNode *); extern bool preserve_perms; /* From import.c. */ extern int add_rcs_file (const char *, const char *, const char *, const char *, const char *, const char *, const char *, int, char **, const char *, size_t, FILE *, bool); void free_keywords (void *keywords); | http://opensource.apple.com/source/cvs/cvs-42/cvs/src/rcs.h | CC-MAIN-2014-52 | refinedweb | 1,269 | 58.92 |
Querying By Post Format
tax_queryargument for
WP_Query. To query for all posts with the quote format, we would create our
WP_Querylike this:
$args = array( 'post_type' => 'post', 'tax_query' => array( array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => 'post-format-quote', ) ) ); $query = new WP_Query( $args );
Note that in the above example, the term is prefixed with "post-format-". Also keep in mind that we can pass an array of terms to the terms argument in the
tax_query in order to query by more than one format.
Making A Post Format Menu
If you have lots of posts on your site in a few post formats you probably want to highlight each format. For example, if you are a visual artist using your blog to show off your videos and images, and are using post formats, you can create a menu with your posts of the format video and image separately.
The first step is to set up an array of arguments for
WP_Query, just like the one I showed you above, except this time without the specific post format specified in the "terms" argument of the
tax_query and an array of formats, along with labels to use in the menu output.
Here is what these two arrays look like:
// initial WP_Query args $args = array( 'post_type' => 'post', 'posts_per_page' => 5, 'tax_query' => array( array( 'taxonomy' => 'post_format', 'field' => 'slug', ) ) ); // formats to show $formats = array( array( 'name' => 'video', 'label' => 'Videos' ), array( 'name' => 'image', 'label' => 'Photos' ), );
With these two arrays, we can create a
foreach loop out of the second array, to query for posts with the current format and outputting a list of the posts. This will involve, in each iteration of the loop, adding the terms argument using
set(), creating a instance of
WP_Query, looping through it, and then unsetting the terms argument.
Inside of the
WP_Query while loop we can use
get_term_link() to create a link to the post format's archive page, which is really a taxonomy term archive. For the individual posts, we can use
get_permalink() to create the link to the post. Here is what the loop looks like:
echo '<nav class="menu">'; echo '<ul>'; foreach ( $formats as $format ) { //convert name key to the proper name for the term $term_name = 'post-format-'.$format[ 'name' ]; //add a terms arg to the tax_query's args $args[ 'tax_query' ][ 0 ][ 'terms' ] = $term_name; $query = new WP_Query( $args ); if ( $query->have_posts() ) { echo '<li>'.get_term_link( $term_name, 'post_format' ).'</li>'; echo '<ul class="'.$term_name.'-submenu">'; while ( $query->have_posts() ) { echo '<li><a href="'.get_permalink( $query->post->ID ).'" />'.get_the_title( $query->post->ID ).'</a></li>'; } //endwhile wp_reset_postdata(); echo '</ul></li>'; } //endif //before moving to next itteration remove the term from the WP_Query args unset( $args[ 'tax_query' ][ 0 ][ 'terms' ] ); } //endforeach echo '</ul></nav>';
Be sure to add any additional classes or IDs to the markup to make this generic code look like a menu in your theme and feel free to substitute the formats that are being shown according to your needs.
Removing Post Formats From the Main Blog Index
Now that you have a menu for your post formats, you may want to exclude posts of certain formats from your main blog index. This will allow you to use your blog as a blog and the post format menu to highlight videos, images, audio files or other formatted posts.
In order to keep posts of a specific format, you will need to use a
pre_get_post filter to add a
tax_query to the main query. The
tax_query will look similar to the ones I already showed you, but will have an extra argument to exclude posts with the format, using the "operator" argument. By setting operator to "NOT IN" any matching posts will be excluded.
This query will also be wrapped in the conditional
is_home() to ensure it only affects the main blog index.
Here is what the action and callback function look like:
add_action( 'pre_get_posts', 'slug_no_videos_home' ); function slug_no_videos_home( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $tax_query = array( array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => 'post-format-video', 'operator' => 'NOT IN', ) ); $query->set( 'tax_query', $tax_query ); } return $query; }
As you can see in the callback, we define a
tax_query, using the
NOT IN operator and then use the set method to add the
tax_query to the main query of the blog index.
Go Forth and Format
Through out this five-part series, you have learned what post formats are, how to add support for them to your theme, how to use them in the loop, target them with custom CSS, bulk update them, and use them as content organizing tool.
Armed with this knowledge, you can create mor e powerful themes that make data portability a breeze.
Envato Tuts+ tutorials are translated into other languages by our community members—you can be involved too!Translate this post
| https://code.tutsplus.com/articles/getting-the-most-of-post-formats-content-organization-tools--wp-34886 | CC-MAIN-2020-29 | refinedweb | 787 | 59.98 |
Autoregression, or an autoregressive model, is a type of predictive modeling that uses linear regression on past values to predict the next value in a time series.
You’ll learn what autoregression is and how to forecast the price of Bitcoin using an AR model in this post. All the code is on the Analyzing Alpha GitHub Repository
You should already understand Time Series Analysis with Python.
What Is Autoregression?
Autoregressive models forecast a series based solely on the past values of the series. An AR model that uses the past price lag is an autoregressive model of order one, or AR(1) for short. An AR model that uses the past two lags is an AR(2) model, and an AR(p) model is an AR process of p lags.
We can see that clearly with the following formula, which we’ll say Bitcoin’s returns where:
rt = b + phi * r_t1 + epsilon_t
- b: The bias
- rt: The return we’re predicting.
- phi: The slope coefficient.
- r_t1: The previous period’s return.
- epsilon_t: The error.
We can make a more generalized autoregression model of order p where p is the number of lagged coefficients.
rt = b + phi_t1 + phi_t2 + epsilon_t2 … + epsilon_t1
An AR(1) model is:
- white noise when phi = 0
- a random walk when phi = 1
- a random walk with drift when phi = 1 and b not 0
- mean reverting when phi < 1
Since stationarity is an assumption with many of the time series forecasting models, including autoregression, phi will always be between -1 and 1.
Speaking of stationary time series, let’s dig into some code.
First, let’s get the minute price data for Bitcoin and resample it into 4-hour bars. Then, as we’ve learned in previous lessons, we’ll transform it using both log to reduce variance and differencing to remove trend. We’ll then validate that the return series is stationary using an Augmented Dickey-Fuller test.) btc_log = np.log(btc_price_history.resample('4H', closed='left') \ .agg({'close':'last'})).diff(1).dropna() print(btc_log) make_plot(btc_log)
close date 2020-04-01 04:00:00 -0.007523 2020-04-01 08:00:00 -0.005499 2020-04-01 12:00:00 -0.008979 2020-04-01 16:00:00 -0.004729 2020-04-01 20:00:00 0.069989
Bitcoin’s returns look stationary. Let’s verify this assumption by performing an Augmented Dickey-Fuller (ADF) test.
from statsmodels.tsa.stattools import adfuller t_stat, p_value, _, _, critical_values, _ = adfuller(btc_log.values, autolag='AIC') print(f'ADF Statistic: {t_stat:.2f}') print(f'p-value: {p_value:.2f}') for key, value in critical_values.items(): print('Critial Values:') print(f' {key}, {value:.2f}')
ADF Statistic: -9.84 p-value: 0.00 Critial Values: 1%, -3.43 Critial Values: 5%, -2.86 Critial Values: 10%, -2.57
The ADF test statistic gives us -9.84 with a critical value for 1% at -3.43. This means Bitcoin’s returns are stationary, and we can say that with significant confidence.
With the stationary assumption met, let’s move on to autocorrelation.
What Is Autocorrelation?
Autocorrelation, also known as serial correlation, refers to the linear relationship between lagged values of a time series. More specifically, the error term for a period is correlated with the error from another period.
Think about it this way — if the price of coffee has increased over the past year, it’ll likely increase next month, too.
There are two ways past prices affect the future price of coffee:
- Directly
- Indirectly
Let’s pretend it’s December.
A poor Brazilian coffee harvest in October affects January’s price. Additionally, increased demand in the holiday shopping season this month directly affects the price of coffee in January. These month’s price changes directly affect January’s future price and are aptly named direct effects.
Alternatively, the price in October affects November’s prices, which affects the prices in December that affect January’s price — all prices have an indirect “chaining” effect on next month’s price — named indirect effects.
We care about autocorrelation and the above effects when discussing autoregressive models because we want to create the best possible model by picking the optimal lag value p. In other words, what lagged values are most correlated with our predicted value, and are they statistically significant?
Let’s analyze the autocorrelation of Bitcoin’s returns with lags up to 10.
corrmat = btc_log.copy() for i in np.arange(1,11): name = 'p' + str(i) corrmat[name] = cormat['close'].shift(i) corrmat.dropna(inplace=True) corrmat.corr()
It looks like the correlation is pretty cold, and the heatmap isn’t very helpful. A better way is to use autocorrelation and partial autocorrelation functions and associated plots.
The blue shaded area on the plots is the Barlett confidence intervals at 95% confidence.
For our purposes, we want to understand if a past lag affects the future price. With this in mind, we want to analyze the direct effect and not the indirect effect. This means that we’ll want to use the PACF for our lags and not the ACF.
In other words, according to the partial autocorrelation plot below, if the most recent past price is positive or negative, we can expect prices to mean revert on the four-hour timeframe more often than not. The second lag is within the confidence intervals, so it’s not significant. And the third lag is above the confidence bands so we can expect there to be a slightly positive correlation.
Now keep in mind — the correlation value according to the partial autocorrelation function is low for past returns is low. This does make sense. In trading, there is almost zero obvious alpha.
What Is an Optimal Lag Value?
That brings us to selecting the optimal time lag for our autoregressive model. We see that lag 1, lag 3, lag 6, lag 12, lag 15, lag 23, lag 24, and lag 26 are outside the blue-shaded region and are statistically significant. So what lag should we use?
It’s a balance between underfitting and overfitting. Let’s use the time lag variables 3 and 24 for our autoregressive models.
Forecasting with Autoregressive Models
We now have stationary data and an optimal lag parameter selected, now it’s time to use this modeling technique to forecast Bitcoin’s future returns.
We’ll split our time series data into training data and test data, and use 80% of the past data for training and save 20% for the predicted values.
We’ll first import ARIMA from the statsmodels library; then, we’ll set a rolling window and create two variables — one for each AR model. The first variable in the order tuples selects the p values.
from time import time from statsmodels.tsa.arima.model import ARIMA s = rolling_window = int(len(btc_log) * 0.8) order3 = (3,0,0) order24 = (24,0,0)
Now we’ll create a model, then train it, and then print out the summary statistics. We’ll also show how the AR(24) model is much more computationally complex than the AR(3) model.
# Create and fit the model, and print out summary stats and duration start = time() mod = ARIMA(endog=s, order=order3) res = mod.fit() end = time() print(res.summary()) print(f"It took {round(end - start,2)} seconds to fit the AR3 model")
SARIMAX Results ============================================================================== Dep. Variable: close No. Observations: 1751 Model: ARIMA(3, 0, 0) Log Likelihood 5087.324 Date: Mon, 17 May 2021 AIC -10164.649 Time: 12:05:41 BIC -10137.309 Sample: 04-01-2020 HQIC -10154.542 - 01-17-2021 Covariance Type: opg ============================================================================== coef std err z P>|z| [0.025 0.975] ------------------------------------------------------------------------------ const 0.0010 0.000 2.912 0.004 0.000 0.002 ar.L1 -0.0272 0.020 -1.391 0.164 -0.066 0.011 ar.L2 -0.0051 0.014 -0.377 0.706 -0.032 0.022 ar.L3 0.0801 0.018 4.534 0.000 0.045 0.115 sigma2 0.0002 2.75e-06 63.615 0.000 0.000 0.000 =================================================================================== Ljung-Box (L1) (Q): 0.01 Jarque-Bera (JB): 4535.14 Prob(Q): 0.94 Prob(JB): 0.00 Heteroskedasticity (H): 1.64 Skew: -0.21 Prob(H) (two-sided): 0.00 Kurtosis: 10.87 =================================================================================== Warnings: [1] Covariance matrix calculated using the outer product of gradients (complex-step). It took 0.28 seconds to fit the AR3 model.
start = time() # Create and fit the model mod = ARIMA(endog=s, order=order24) res = mod.fit() end = time() print(res.summary()) print(f"It took {round(end - start,2)} seconds to fit the AR24 model")
SARIMAX Results ============================================================================== Dep. Variable: close No. Observations: 1751 Model: ARIMA(24, 0, 0) Log Likelihood 5102.688 Date: Mon, 17 May 2021 AIC -10153.375 Time: 13:05:58 BIC -10011.209 Sample: 04-01-2020 HQIC -10100.823 - 01-17-2021 Covariance Type: opg ============================================================================== coef std err z P>|z| [0.025 0.975] ------------------------------------------------------------------------------ const 0.0010 0.000 3.202 0.001 0.000 0.002 ar.L1 -0.0304 0.021 -1.470 0.141 -0.071 0.010 ar.L2 0.0024 0.017 0.142 0.887 -0.031 0.036 ar.L3 0.0942 0.020 4.764 0.000 0.055 0.133 ar.L4 0.0291 0.017 1.739 0.082 -0.004 0.062 ar.L5 -0.0150 0.019 -0.800 0.423 -0.052 0.022 ar.L6 -0.0787 0.022 -3.641 0.000 -0.121 -0.036 ar.L7 -0.0284 0.019 -1.457 0.145 -0.067 0.010 ar.L8 0.0182 0.020 0.927 0.354 -0.020 0.057 ar.L9 0.0430 0.020 2.159 0.031 0.004 0.082 ar.L10 0.0050 0.020 0.245 0.807 -0.035 0.045 ar.L11 0.0193 0.018 1.046 0.296 -0.017 0.055 ar.L12 -0.0415 0.021 -1.952 0.051 -0.083 0.000 ar.L13 -0.0410 0.023 -1.783 0.075 -0.086 0.004 ar.L14 -0.0288 0.020 -1.430 0.153 -0.068 0.011 ar.L15 -0.0010 0.022 -0.045 0.964 -0.045 0.043 ar.L16 0.0194 0.020 0.978 0.328 -0.019 0.058 ar.L17 0.0021 0.024 0.090 0.929 -0.044 0.049 ar.L18 -0.0114 0.023 -0.505 0.613 -0.056 0.033 ar.L19 -0.0372 0.020 -1.878 0.060 -0.076 0.002 ar.L20 -0.0425 0.023 -1.872 0.061 -0.087 0.002 ar.L21 -0.0065 0.021 -0.310 0.757 -0.048 0.035 ar.L22 0.0208 0.020 1.022 0.307 -0.019 0.061 ar.L23 0.0090 0.021 0.422 0.673 -0.033 0.051 ar.L24 -0.0423 0.019 -2.196 0.028 -0.080 -0.005 sigma2 0.0002 2.97e-06 57.984 0.000 0.000 0.000 =================================================================================== Ljung-Box (L1) (Q): 0.05 Jarque-Bera (JB): 4832.85 Prob(Q): 0.82 Prob(JB): 0.00 Heteroskedasticity (H): 1.63 Skew: -0.20 Prob(H) (two-sided): 0.00 Kurtosis: 11.13 =================================================================================== Warnings: [1] Covariance matrix calculated using the outer product of gradients (complex-step). It took 24.63 seconds to fit the AR24 model.
In the SARIMAX Results tables, we see a lot of statistical data. I’ve created another blog post to cover how to interpret ARIMA results.
We’ll use three as our p-value in our autoregressive model as the BIC is lower than the AR(24).
Let’s create a function to predict the return and apply it to our data set. We’ll also need to shift the output by one as our prediction is for the next period.
def pred_price(train, oder): mod = ARIMA(endog=train, order=order) res = mod.fit() pred = res.forecast() return(pred[0])
btc_log['pred'] = btc_log['close'].rolling(rolling_window) \ .apply(lambda x: pred_price(x, order3)) btc_log['pred'] = btc_log['pred'].shift(1)
We can see the prediction isn’t that great in the following plot. Regardless, let’s take it to the next step and implement a basic trading strategy.
Autoregressive Bitcoin Trading Strategy
Now it’s time to trade the autoregressive model. We’ll buy when the predicted price is above the prior prediction.
df['signal'] = np.where(df['pred'] > df['pred'].shift(1), 1, -1) df['returns'] = df['signal'] * df['close'] fig = go.Figure(data=go.Scatter( y=np.exp(df['close'].cumsum()), x=df.index, name="Actual") ) fig.add_trace( go.Scatter( y=np.exp(df['returns'].cumsum()), x=df.index, name="Strategy") ) fig.update_layout(title=dict(text="Bitcoin AR Strategy Returns",font=dict(size=24)), legend=dict(font=dict(size=20)), width=2000, height=1250) fig.update_xaxes(tickfont=dict(size=20, color="#434")) fig.update_yaxes(tickfont=dict(size=20, color="#434")) fig.show()
While these results don’t beat our benchmark, let’s try to improve them by trying out other autoregressive models.
The Bottom Line
In this tutorial, you predicted the future returns of Bitcoin using an ARIMA model of order 3 with moderate success.
You learned that autoregression models try to predict a dependent variable using linear regression against past lagged variables or independent variables. AR models assume stationarity as the historical distribution needs to resemble the future distribution. | https://analyzingalpha.com/autoregressive-model-python | CC-MAIN-2022-33 | refinedweb | 2,257 | 59.3 |
Change default behaviour of mongoTemplate.find
Is there any way to modify every query prepared by mongotemplate.find spring boot 2?
I want to modify every find query prepared by spring data mongo find . I want to add custom query after every find query to mongo.
How can I achieve that in spring boot 2.
I want to override find methods of mongo template with my own implementation and want to add some custom query on top of find query which was built by crud repository methods.
MongoTemplate (Spring Data MongoDB 2.2.7.RELEASE API), public class MongoTemplate extends Object implements MongoOperations, Map the results of an ad-hoc query on the default MongoDB collection to a List Triggers findOneAndReplace to replace a single document matching Criteria of Must not be null. callback - callback object that specifies the MongoDB action. you can change this by going to the Document Library Settings => Advanced Settings => Opening Documents in the Browser Here you have the option to set the default behavior to "Open in the client application", which will open every Office document in the desktop app and not online.
I want to add some custom query by overriding methods of mongotemplate to every find method of crud repository
Spring Data MongoDB, Adding behaviour to single repositories; 4.4.2. Adding custom behaviour to all repositories. II. Reference Documentation Mongo JSON based query methods and field restriction; 6.3.3. Type-safe Query Also change the version of Spring in the pom.xml to be MongoTemplate no longer takes a default collection name. Note, that MongoDB limits the number of results by default. Make sure to add an explicit limit to the NearQuery if you expect a particular number of results. MongoDB 4.2 has removed the geoNear command.
you would need to customize the repository class implementation for the mongoDB.
below is the sample code to help you understand how to add customized query in the repository. you would need to twik the code as per your requirement after getting the result.
public interface PersonRepository extends PagingAndSortingRepository<Person, String> { List<Person> findByLastname(String lastname); Page<Person> findByFirstname(String firstname, Pageable pageable); Person findByShippingAddresses(Address address);
}
you can visit this page for proper understanding
Spring Data MongoDB Changelog , [DATAMONGO-629] - Different results when using count and find with the in MongoTemplate * [DATAMONGO-608] - Release 1.1.2 Changes in version 1.1.1. the default value for the mongo-ref attribute of the mongo:db-factory configuration mongo db ** Improvement * [DATAMONGO-139] - Startup behavior should be About two thirds of the executives admitted that their typical behavior is competitive: return the aggression and argue to win. The other third said they typically do the opposite: retreat, recoup, and try again later. But either way, it was a default reflex – not a strategic response. We all have default behaviors.
Iterate a Cursor in the mongo Shell, Manually Iterate the Cursor; Iterator Index; Cursor Behaviors; Cursor Information In the mongo shell, when you assign the cursor returned from the find() method to shellBatchSize to change the number of iteration from the default value 20 . You should find it set to Multimedia keys & can select Function keys instead. The settigs will revert to their default when you restart the PC. 2 Reboot into the BIOS & look for the Multimedia key item. Changing this to Function keys instead will change the default behaviour.
$switch (aggregation), Although optional, if default is unspecified and no branch case evaluates to true, $switch returns an error. Behavior¶. The various case statements do not need.
Spring Data MongoDB - Reference Documentation, For information on the Spring Data Mongo source code repository, nightly builds, and By default this query will be derived from the query you actually trigger. To change behavior for all repositories, you need to create an It’s default behaviour is storing the fully qualified classname under _class inside the document for the top-level document as well as for every value if it’s a complex type and a subtype of the property type declared.
- More details on what you're looking to do? Do you want to supplement a query with more criteria to limit results? Run another query after each query? Give some more details about your specific case so SO can be of more help to you | http://thetopsites.net/article/51805171.shtml | CC-MAIN-2020-45 | refinedweb | 721 | 54.42 |
Base62 is a tiny package for Base62 encoding/decoding values. It is tested, documented, easy-to-use and supports Apple Platforms, as well as Linux.
I use this as encoding mechanism for my own URL shortener but this is a general purpose implementation that should suffice all use cases that require Base62 encoding/decoding.
Base62 is distributed using the Swift Package Manager. To install it into a project, add it as a dependency within your
Package.swift manifest:
let package = Package( ... dependencies: [ .package(url: "", from: "0.1.0") ], ... )
Then import Base62 wherever you’d like to use it:
import Base62
Using Base62 is incredibly easy, as it focusses on a single responsibility and does that nicely.
Base62 ships with a single object that provides encoding and decoding functionality.
let base62Encoded = Base62.encode(2021) // 2021 == "wz" let base62Decoded = try Base62.decode("GitHub") // "GitHub" == 38750631667
There are also extensions for
String and
Int available, if you prefer to use them rather than the
Base62 object directly.
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | https://swiftpack.co/package/marcelvoss/Base62 | CC-MAIN-2021-21 | refinedweb | 174 | 50.43 |
Please note patch 1 and especially 4.
Just helping out.
-Victor
patchfile1.txt
--------------
I'm interested in sending a patches to fix a problem I'm
encountering. I'm using jasper save myself deployment time by
testing the integrity of the webapp.
The simple fix is to replace '-' with '_' with jasper's
org.apache.jasper.compiler.TagBeginGenerator
I currently have a project where a taglib contains a dash for one of
its tag elements. e.g. <cache:clear-cache name=..../>
The author of the taglib justly refuses to change the name of the
tag element since it is within or not out bounds with the taglib
specification.
However, jasper creates corresponding java files for these tag elements
by
appending _jspx_th or _jspx_eval to the name.
The dash are not allowed in variable assignment and the compiler
complains.
patchfile2.txt
--------------
For org.apache.jasper.runtime.JspWriterImpl
my jikes compiler complains of a catch Exception that is never thrown.
I agree with it and confused by what is to be gained from
a try catch around System.getProperty("line.separator") since
the value would be null if the value was never assigned.
I think the author wanted
if (lineSeparator == null) lineSeparator = "\r\n";
However, I fail to see when this situation would occur since
each operating system environment would had a VM that would
have this value defined.
patchfile3.txt for org.apache.jasper.runtime.JspFactoryImpl
same as JspWriterImpl
patchfile4.txt
a. to reduce javadoc warning by including classpath
b. also the introduction of build.properties for centralization of
customization by using <property file="build.properties"/>
c. Please also note the introduction of sax2.jar and w3cdom2.jar to
reduce dependency on parser.jar and focus on jaxp.jar
Analogy. avoid import java.util.*;
versus
import java.util.Vector; ... etc. to what is required.
So while jaxp-1.1 utilize crimson.jar versus
jaxp-1.0.2 utilizing parser.jar
we don't care because the only important jar files
for compiling are sax2.jar, w3cdom2.jar, and jaxp.jar.
The same does not hold true when utilizing jasper to
convert a jsp into a java file. But that is not the role
of the cvs rather than the user of the jakarta-tomcat jasper
functionality to determine which javax.xml.parser.DocumentBuilderFactory
he/she wants to use.
p.s. Currently their is a bug in crimson.jar since it does
specifcy a necessary DTD method that jasper requires.
patchfile5.txt
update to src/test/build.xml to also change ${servlet22.jar} to
${servlet.jar} | http://mail-archives.apache.org/mod_mbox/tomcat-dev/200104.mbox/%3C52E3FC36641FD511BF3C0008C7A4CD9D652AC9@chiec01.eb.com%3E | CC-MAIN-2016-26 | refinedweb | 424 | 53.78 |
aio_return - get return status of asynchronous I/O operation
Synopsis
Description
Errors
Versions
Example
Colophon
#include <aio.h>
ssize_t aio_return(struct aiocb *aiocbp);
Link with -lrt..
If the asynchronous I/O operation has completed, this function returns the value that would have been returned in case of a synchronous read(2), write(2), fsync(2) or fdatasync(2), call.
If the asynchronous I/O operation has not yet completed, the return value and effect of aio_return() are undefined.
The aio_return() function is available since glibc 2.1.
POSIX.1-2001, POSIX.1-2008.
See aio(7).
aio_cancel(3), aio_error(3), aio_fsync(3), aio_read(3), aio_suspend(3), aio_write(3), lio_listio(3), aio(7)
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at. | http://manpages.sgvulcan.com/aio_return.3.php | CC-MAIN-2018-26 | refinedweb | 140 | 56.86 |
Java 8 interface changes include static methods and default methods in interfaces. Prior to Java 8, we could have only method declarations in the interfaces. But from Java 8, we can have default methods and static methods in the interfaces.
Table of Contents
Java 8 Interface.); } }
Notice that log(String str) is the default method in the
Interface1. Now when a class will implement Interface1, it is not mandatory to provide implementation for default methods of interface. This feature will help us in extending interfaces with additional methods, all we need is to provide a default implementation.
Let’s say we have another interface with following methods:
package com.journaldev.java8.defaultmethod; public interface Interface2 { void method2(); default void log(String str){ System.out.println("I2 logging::"+str); } }
We know that Java doesn’t allow us to extend multiple classes because it will result in the “Diamond Problem” where compiler can’t decide which superclass method to use. With the default methods, the diamond problem would arise for interfaces too. Because if a class is implementing both
Interface1 and
Interface2 and doesn’t implement the common default method, compiler can’t decide which one to chose.
Extending multiple interfaces are an integral part of Java, you will find it in the core java classes as well as in most of the enterprise application and frameworks. So to make sure, this problem won’t occur in interfaces, it’s made mandatory to provide implementation for common default methods of interfaces. So if a class is implementing both the above interfaces, it will have to provide implementation for
log() method otherwise compiler will throw compile time error.
A simple class that is implementing both
Interface1 and
Interface2 will be:
package com.journaldev.java8.defaultmethod; public class MyClass implements Interface1, Interface2 { @Override public void method2() { } @Override public void method1(String str) { } @Override public void log(String str){ System.out.println("MyClass logging::"+str); Interface1.print("abc"); } }
Important points about java interface default methods:
- Java interface default methods will help us in extending interfaces without having the fear of breaking implementation classes.
- Java interface default methods has bridge down the differences between interfaces and abstract classes.
- Java 8 interface default methods will help us in avoiding utility classes, such as all the Collections class method can be provided in the interfaces itself.
- Java interface default methods will help us in removing base implementation classes, we can provide default implementation and the implementation classes can chose which one to override.
- One of the major reason for introducing default methods in interfaces is to enhance the Collections API in Java 8 to support lambda expressions.
-.
- Java interface default methods are also referred to as Defender Methods or Virtual extension methods.
Java Interface Static Method
Java interface static method is similar to default method except that we can’t override them in the implementation classes. This feature helps us in avoiding undesired results incase of poor implementation in implementation classes. Let’s look into this with a simple example.
package.
package.
Interface Null Check Impl Null Check
If we make the interface method from static to default, we will get following output.
Impl:
boolean result = MyData.isNull("abc");
Important points about java interface static method:
- Java interface static method is part of interface, we can’t use it for implementation class objects.
- Java interface static methods are good for providing utility methods, for example null check, collection sorting etc.
- Java interface static method helps us in providing security by not allowing implementation classes to override them.
- We can’t define interface static method for Object class methods, we will get compiler error as “This static method cannot hide the instance method from Object”. This is because it’s not allowed in java, since Object is the base class for all the classes and we can’t have one class level static method and another instance method with same signature.
- We can use java interface static methods to remove utility classes such as Collections and move all of it’s static methods to the corresponding interface, that would be easy to find and use.
Java Functional Interfaces
Before I conclude the post, I would like to provide a brief introduction to Functional interfaces. An interface with exactly one abstract method is known as Functional Interface.
A new annotation @FunctionalInterface has been introduced to mark an interface as Functional Interface. @FunctionalInterface annotation is a facility to avoid accidental addition of abstract methods in the functional interfaces. It’s optional but good practice to use it.
Functional interfaces are long awaited and much sought out feature of Java 8 because it enables us to use lambda expressions to instantiate them. A new package
java.util.function with bunch of functional interfaces are added to provide target types for lambda expressions and method references. We will look into functional interfaces and lambda expressions in the future posts.
Awesome blog on Strream API with examples. Thanks a lot Pankaj ji.
If we able to define the default methods in interface now from Java 8, then what is the difference between abstract class and interface? And when to use what?
abstract class is a class and interface is a interface, class has a state but interface don’t have any state and, In abstract class allows constructor and an interface don’t allow constructor.
Correct Explanation of static methods in java 8 interface. Thanks
Thank you for sharing. What’s next?
Hi Pankaj,
I went interview. in interview asked two quetions,
1) why one abstract method in functional Interface.
2)how to guess the types(data types) compile.
please help me this question ansewer.
hi rajesh
i would like to answer for your first question by contradiction
we c’nt have more than one abstract method in functional interface because
example : let suppose we allowed more than one abstract method in functional interface as you already know that in lamda expression we d;nt mention name of method , and your interface contain more than one abstract method than how compiler will know which method you wan to implement in your lamda expression
is make any sense ?
thank you
As tanuj1110 said its 50% agreed but I have one doubt.
public Animal {
void firstMethod();
int secondMethod(String str);
}
In the above example its good to recognize which method I am calling if I use lamda for example:
Animal animal1 = s -> System.out.println(“Doing something”);
Animal animal2 = (String s) -> return s.length();
In this scenario by seeing the method arguments we can get to know which method we are calling. Why java is not implemented in this way
Ramachandrappa Kalavakuri:
You have to accept what is given. Don’t suggest them(Oracle Developers) what to do and what not to what not to. And seems like you didn’t understand the lambda concept well.
A poor way to reply.
Hi Ramachandra your doubt Is correct but there is very huge issue in performance. Consider 100 methods in functional interface and for choosing the implementation Jvm needs to check 100 times type of return data and provide the implementation it is its one issue I guess there may be more.
you are able to call both method because those two method are declared in class ”’Animal”. try interface.”
Can you please explain me this again? with some example. I am not able to comprehend the above point.
The reasoning for “why a default method in an interface cannot override the methods of java.lang.Object” given in this blog is not clear to me as well. But as per what I read from other online materials, the reasoning is as follows:
1. The “java.lang.Object” class methods such as equals, hashCode and toString are all about an object state and it is the class that owns the object state. Interface does not own the object state. Hence, it is best if the class is determining what should go into the equals or hashCode or toString method rather than an Interface overriding these methods by means of ‘default’ methods.
2. Interfaces are designed for multiple inheritance. Consider the following class definition:
class Foo implements Bar, Moo {
// Implementation of Foo, that doesn’t override equals method
}
Suppose that the ‘Foo’ writer looks at the Bar and Moo interfaces, and finds that there is no implementation of ‘equals’ method and decides to use the default java.lang.Object class’ default equals method and implements his code accordingly. But later, someone has edited the Bar interface to include a default method that overrides the ‘equals’ method. Now, the equality functionality of Foo class is broken. To avoid these kind of issues, the Java designers decided to not to allow overriding any java.lang.Object class method.
As I have clearly mentioned, even if we define Object class methods in an interface, it will be useless because the Object class method will get called. That’s why I think it’ better to not even allow it.
Hi Pankaj,
I respect your work. It is very helpful. Yes, you did mention that Object class methods won’t be called. But Sreedevi has explained us as to why the developers of API have decided to go by that route. I found her explanation helpful. Thanks to both of you.
Strange !! but I can write main method in interface and execute it without writing main method in a class.
I would like know about this behavior
sahi pakde hain, in my view java is becoming weird in the name of new features.
i don’t think you can do that
public class TestJava8 implements A {
}
interface A{
public static void main(String[] args){
System.out.print(“Java “);
}
}
when i run this code, i get
Error: Main method not found in class com.codenamesid.applicationseries.algorithms.TestJava8, please define the main method as:
public static void main(String[] args)
public interface DefaultInterface {
public static void main(String[] args) {
System.out.println(“Interface with Main”);
}
}
Executing an interface – LOL
great explanation
awesome article, thanks man!
Interface1.print(“abc”); there is no such method in Interface1.
What is the main use of default method in interface? how can we access or make use of it?
Main use of default method is basically to remove necessity of rather unavoidable base class that implements interface. Now generic common implementations don’t need to reside in base class, but it can be well included in interface as default method and all implementing class inherits it and directly use it, of course it can be overridden too.
Very well explained. Great job. Thanks very much for sharing.
static is a keyword which makes any variable or method a class level variable or class level method ,means we can access it by our class name without making object of class. Thanks for sharing this.
Can we create a static method in an interface and can i call class object with it’s static method.
Yes you can.
If you want to call the static method defined in the interface then you would have to do it this way only
InterfaceName.staticMethodName();
can I not invoke the static method of the interface through the class it implements
For example
interface A {
static void say() {
system.out.println(“hello”);
}
public class B implements A {
}
public class C {
public static void main(String args[]) {
B.say();
}
}
will the above code not print “hello”. Should we invoke it through interface name?
yes you can call static method of interface with the interface name
this line will through compile time error – B.say(); it should be A.say()
Hi Pankaj,
Thanks again for useful content.
Dear
nitish , it is good to see
Dear
pankaj thanks again
Hi Pankaj,
Can you please explain the below conflict.
Journaldev says
.”
But
“By adding a default method to an interface, every implementing class automatically inherits this behavior. Some of these classes might have not been designed with that new functionality in mind, and this can cause problems. For instance, if someone adds a new default method default void foo() to an interface Ix, then the class Cx implementing Ix and having a private foo method with the same signature does not compile.”
As per this again any changes to interfaces will effect the implementation classes right?
thanks in advance,
Aruna.
It will compile and class method will execute.
It won’t compile as it can result into reducing the visibility of the method, which can result into the compile time error.
Hi Pankaj,
Is it mandatory for the implementation classes to use the default methods
(or)
is it optional to use default methods.
I mean does the rule of abstract methods of interface apply to default methods making it mandatory for the implementation classes to have default methods in their code.
Thankyou.
Its not mandatory as the interface is already providing a default definition and that’s the sole purpose.
Hi Pankaj,
thank you so much for the tutorials.
And I couldn’t under stand the 6th point from default.”
So what exactly does this explain?
does it say that “if any class in the hierarchy has a method with same signature as of the default method of base interface.”
what does the compiler use:
a) the implementing class method
(or)
b) the default method of the base interface?.
(or)
c)will the compiler throw an error.
Thanks,
Aruna.
It means if we have a method say void foo() in interface X and void foo() in Object class and a class Y implements X then using foo() method in Y will inherit it’s features from Object and not from X
Its not that complicated. Take your example.
Interface I has default method foo. Now Class X implements Interface I and provides implementation for foo, overriding essentially. Then Class Y extends Class X. So, we now have I –> X –> Y. If Y uses method foo, implementation of X is invoked; thereby rendering the default implementation in Interface I useless.
Clear so far, with me?
Now, second point.
If Interface I provides default implementation of equals (a method in Object class); and now Class X implements Interface I, whose equals method will it use: Interface I’s or Object class’? Remember that Interface I and Object class have no connection. To avoid this confusion, the Java language architects added this check in the compiler to not allow default implementation of methods provided in the Object class already.
Hope that clarifies.
@Override
public void log(String str){
System.out.println(“MyClass logging::”+str);
Interface1.print(“abc”);
}
it should be Interface1.super.log(“abc”);
@Override
public void log(String str){
System.out.println(“MyClass logging::”+str);
Interface1.print(“abc”);
}
it should be Interface1.log(“abc”);
It must be Interface1.super.log(“abc”) instead of Interface1.log(“abc”)
I didn’t got the point number 4 for static method points :
We can’t define interface static method for Object class methods, we will get compiler error as “This static method cannot hide the instance method from Object”.
public interface Interface {
default void play(){
System.out.println(“this is play method”);
}
static boolean equals() {
System.out.println(“Interface Null Check”);
return true;
}
}
static boolean equals() is not object equals method
try below:
static boolean equals(Object obj)
Hi Pankaj – Thanks for such a concise and self-explanatory blogpost.
Quick question – I am trying to understand why is it that Functional Interfaces can have ONLY one method ?
Why not overloaded methods ? For example –
operate(int a, int b)
operate(float a, float b)
I guess that is to keep things simple because method names are not used while calling them.
The underlying answer to your question is the fact that Functions are not [yet] “First-class Citizens” in Java. This essentially means that while lambdas provide a nice, convenient syntax, there are still being wrapped within a interface under the hood [in other words, lambdas are backward compatible with these interfaces]. And because of this, Functional Interfaces can have only one method. Hope that helps.
Functional interfaces can have only one ‘Abstract method’. Other methods like default or static may or may not exist.
hi,
indeed i would also like to know what is with that print from line 9, Interface1, default method.
Thanks in advance.
regards
Nice catch, i have removed that code and updated the post.
Excellent explanation and useful replies. Thanks Pankaj for your blog entries!
I suggest we replace line 8 of the MyDataImpl class to the shorter version shown below. It is more concise and common usage, while providing the same result as the current version. Thanks!
return str == null;
yes make sense, but to convey the idea easily I think it’s better to have ternary operator. It’s more like developers choice of using the code. Thanks!
Could you please explain how this got printed if we remove static from the interface method
MyData Print::
When he removed the static qualifier, then the implementation class overrode the now non-static method isNull, so when he called print(“”), the interface called the implementation’s version of isNull, which returned ‘false’, allowing the print to occur.
Thanks Paul for the explanation.
Very good explanation indeed ! !
One very minor observation : In the class Interface1, line 9 -> is the print(str) a typo ?
Thanks !
yes it was typo, i have removed it and updated the post.
With interface default methods there may also be a scenario where an interface is extending another interface and both of those interfaces have same default method.
It will be the case of overriding super class method.
Very nice explanation…Thanks..
I like the new static interface methods feature, but I don’t think what you suggested here is a good idea – an interface is meant to be implemented, to expand the protocol of an object, whereas utility classes such as Collections are just containers for utility functions, which is a bit of a hack, as Java does not provide support for standalone functions.
I think classes are a better choice. Given the newfound power of interfaces, we should leave them for what they are meant for, to define partial protocols (and implementations) for objects in an object-oriented program, and continue to use classes as a pattern for holding non-OO functionality.
is that better than using classes?
Oh, I see now, you are talking about helper classes that were creared to complement an interface. In that case, I do see merit in your suggestion.
Thanks for the comment and understanding. 🙂
Superb explanation , we are awaited for next post .
great tutorials
cleatly explains the concept without deviating
from the topic.
Awaiting for your future posts on
functional interfaces and lambda expressions.
it’s already posted, search for it and you will find it. 🙂 | https://www.journaldev.com/2752/java-8-interface-changes-static-method-default-method | CC-MAIN-2021-21 | refinedweb | 3,127 | 55.95 |
JS: Import/Export
New in ES2015.
Basic Import/Export Examples
Export Multiple Names
// file lib.js const f1 = ((x) => (x+1)); const f2 = ((x) => (x+2)); export {f1,f2};
// main.js import {f1, f2} from "./lib.js"; console.log ( f1(1) );
And here's the HTML to load the main.js
<script type="module" src="./main.js"></script>
Note, you must have
type="module".
Basic Default Export
Before JavaScript ES2015, it is common for a lib to export just 1 value. (typically a object, such as
xyz, with many methods as properties.
For example, JQuery does this with dollar sign
$ as name.
[see jQuery Tutorial by Example]
).
JavaScript ES2015 has a special syntax for exporting just 1 value, and calls it “default” export/import.
Here's a basic example:
// file lib2.js // export a object export default { f1: ((x) => x+1), f2: ((x) => x+2), }; // note, no name is given to the object
// main.js // import a value from lib2.js , and name it g import g from "./lib2.js"; console.log ( g.f1(1) );
And here's the HTML to load the main.js
<script type="module" src="./main.js"></script>
Note, you must have
type="module".
Export Explained
Export, is to mark names or values. (the “name” can be variable name, function name, class name, object name, etc.).
The purpose of the marking is so that another file can “import” these marked names or values.
There are 2 kinds of export:
- named export → mark several names or values.
- default export → mark just 1 value for export, called the “default” export.
They are separate as 2 kinds because each has different syntax, and each also have different import syntax.
Note, from language design point of view, “default” export is not necessary, because you can just do named export with 1 name. But people find it convenient to have 1 special syntax that just export/import 1 value.
You can mix named export and default export. That is, you can export 1 or more names/values, and also export 1 value as the “default”.
When people import from your library, they can do any of:
- Import 1, or some, or all named export.
- Import just the “default” export.
- Import both some/all exported names and the default export value.
Export Syntax for Named Export
There are several syntax for named export.
Following forms put all export names together.
export { name1, name2 … };
export { name1 as name_1, name2 as name_2 …};
Following forms mark export at the same line as declaration:
export let name …;
export function name(…){…}
export class name {…}
Note,
let with multiple names or assignment also works. And also work with
var and
const. (constant must have a value when declared.)
[see JS: let Declaration]
Export Syntax for Named Export from a Module
You can export names from another module you loaded.
export * from path;
export { name1, name2 … } from path;
export { name1 as name_1, name2 as name_2 … } from path;
Export Syntax for Default Export
Default Export is a syntax that marks just 1 value for export.
export default expression;
export default function …(…) {…}
Note, the above form of
function can also be
class and
function*
[see JS: Class Tutorial]
[see JS: Generator Function]
You can also use this form:
export { name1 as default };
Export Syntax for Default Export from a Module
export { default } from path;
Import Syntax for Default Export
import new_name from path;
Import Syntax for Named Export
import { name1 , name2 … } from path;
import { name1 as name_1 … } from path;→ rename some exported names.
import * as new_name from path;→ get all exported names from path, attach to new_name as properties.
Load Module
This will just load module:
import path;
Cross Origin Error
Import/export do not work over local file system. You'll get a cross origin error.
If you want to test them, you need to have the html page from a http server. You can start a local server.
Import/Export, Top-Level Only
Import/Export must be top level only. Meaning, it cannot happen inside a block of code or in if statement.
Import/Export Are Hoisted
The position of import or export statement in source file does not matter.
For example, this is ok:
console.log ( f(1) ); import {f} from "./lib.js";
Import/Export Are Static
Import/export are static. For example, it's impossible have code that determines which name to import/export.
Import and Export Are Ad-Hoc Syntax of Little Language
The import/export syntax are little ad-hoc language, having nothing to do with rest of JavaScript language syntax.
For example, the
{} in
export {name1,name2}
are not object nor code block.
Module Path Syntax
2018-03-19 in safari, this is is error:
<script type="module" src="main.js"></script>
you get:
TypeError: Module specifier does not start with "/", "./", or "../".
must be like this
<script type="module" src="./main.js"></script>
2018-03-19 in safari, this is error
<script src="./main.js"></script>
you get
SyntaxError: Unexpected token '{'. import call expects exactly one argument.
must be
<script type="module" src="./main.js"></script>
If your code uses
import or
export, then it must be loaded as module.
Reference
ECMAScript 2015 §ECMAScript Language: Scripts and Modules#sec-modules
Or, Buy JavaScript in Depth | http://xahlee.info/js/js_import_export.html | CC-MAIN-2018-26 | refinedweb | 871 | 67.15 |
1 ERTS Release Notes
This document describes the changes made to the ERTS application.
1.1 Erts 6.3
Fixed Bugs and Malfunctions
Fix HiPE debug lock checking on OS X 64bit
Position-independent code is mandatory on OS X. We use r11 as an intermediate register to fill BIF_P->hipe.bif_callee. This fixes the following error when doing `make debug FLAVOR=smp`:
clang -cc1as: fatal error: error in backend: 32-bit absolute addressing is not supported in 64-bit mode
Own Id: OTP-12188
Fix race bug that could cause VM crash in erlang:port_get_data/1 if the port was closed by a concurrent process. Also fix fatal bug if port_set_data/2 is called with a non-immediate data term. Both bugs exist since R16B01.
Own Id: OTP-12208
Correct make variable SSL_DED_LD_RUNTIME_LIBRARY_PATH when erl_xcomp_sysroot ends with a slash.
Own Id: OTP-12216 Aux Id: seq12700
Fix two cases of unreachable code caused by false use of assigment operators.
Own Id: OTP-12222
Fix bug when hipe compiled code makes tail call to a BIF that disables GC while trapping (sush as binary_to_list, list_to_binary, binary_to_term, term_to_binary).
Own Id: OTP-12231
Fix bug when a migrated empty memory carrier is reused just before it should be destroyed by the thread that created it.
Own Id: OTP-12249
Prevents compile-time errors in NIFs, when the compiler is instructed to treat missing field initializers as errors, by adding an initializer for the new options field which was added to ErlNifEntry for 17.3.
Own Id: OTP-12266
Fixed CPU topology detection on FreeBSD systems where Erlang/OTP is compiled by new C compilers (including, but possibly not limited to, gcc 4.9 and clang).
Own Id: OTP-12267
Use C99 function isfinite() instead of finite() when available on non GCC compilers.
Own Id: OTP-12268
Fix bug on windows where an incorrect number of links could be returned when doing file:read_file_info on a directory.
Own Id: OTP-12269
Fix rare bug when purging module on VM started with +Meamin.
Own Id: OTP-12273
Repair run_erl terminal window size adjustment sent from to_erl. This was broken in OTP 17.0 which could lead to strange cursor behaviour in the to_erl shell.
Own Id: OTP-12275 Aux Id: seq12739
Fixed bug on windows causing gen_tcp/udp to return an error when given an fd to work with.
Own Id: OTP-12289
Fix various internal erts issues where negating a signed integer in C would trigger undefined behavior. This fixes issues when dividing with bignums and list_to_integer.
Own Id: OTP-12290
When flushing output to stdout on windows, the emulator could sometimes hang indefinitely waiting for the flush to complete. This has been fixed.
Own Id: OTP-12291
Fix so that non-smp emulators with dirty scheduler support shows the correct number of dirty schedulers when calling erlang:system_info(system_version).
Own Id: OTP-12295
Add nif_version to erlang:system_info/1 in order to get the NIF API version of the runtime system in a way similar to driver_version.
Own Id: OTP-12298
Fix bug that could cause the return value from dirty NIF with zero arity to be treated as garbage, leading to VM crash.
Own Id: OTP-12300
Improve allocation carrier migration search logic. This will reduce the risk of failed migrations that could lead to excess memory consumption. It will also improve smp performance due to reduced memory contention on the migration pool.
Own Id: OTP-12323
Improvements and New Features
Introduced support for eager check I/O.
By default eager check I/O will be disabled, but this will most likely be changed in OTP 18. When eager check I/O is enabled, schedulers will more frequently check for I/O work. Outstanding I/O operations will however not be prioritized to the same extent as when eager check I/O is disabled.
Eager check I/O can be enabled using the erl command line argument: +secio true
Characteristics impact when enabled:
- Lower latency and smoother management of externally triggered I/O operations.
- A slightly reduced priority of externally triggered I/O operations.
Own Id: OTP-12117
Fix erts .app-file
Own Id: OTP-12189
Add configure option --with-ssl-incl=PATH to support OpenSSL installations with headers and libraries at different places.
Own Id: OTP-12215 Aux Id: seq12700
Optimization of atomic memory operations with release barrier semantics on 32-bit PowerPC when using the implementation included in OTP.
Own Id: OTP-12250
Minor adjustment of scheduler activation code making sure that an activation of a scheduler is not prevented by its run-queue being non-empty. (Thanks to Songlu Cai)
Own Id: OTP-12287
Improved support for atomic memory operations provided by the libatomic_ops library. Most importantly support for use of native double word atomics when implemented by libatomic_ops (for example, implemented for ARM).
The $ERL_TOP/HOWTO/INSTALL.md document now also more clearly describes when you want to build together with a libatomic_ops installation.
Own Id: OTP-12302
Add configure option --with-ssl-rpath to control which runtime library path to use for dynamic linkage toward OpenSSL.
Own Id: OTP-12316 Aux Id: seq12753
Added systemd notify support to epmd
Own Id: OTP-12321
1.2 Erts 6.2.1
Fixed Bugs and Malfunctions
Fix bug when an migrated empty memory carrier is reused just before it should be destroyed by the thread that created it.
Own Id: OTP-12249
Repair run_erl terminal window size adjustment sent from to_erl. This was broken in OTP 17.0 which could lead to strange cursor behaviour in the to_erl shell.
Own Id: OTP-12275 Aux Id: seq12739
1.3 Erts 6.2
Fixed Bugs and Malfunctions
General documentation updates.
Own Id: OTP-12052
A bug in the VM code implementing sending of signals to ports could cause the receiving port queue to remain in a busy state forever. When this state had been reached, processes sending command signals to the port either got suspended forever, or, if the nosuspend feature was used, always failed to send to the port. This bug was introduced in ERTS version 5.10.
In order for this bug to be triggered on a port, one had to at least once utilize the nosuspend functionality when passing a signal to the port. This by either calling
- port_command(Port, Data, [nosuspend | Options]),
- erlang:send(Port, {PortOwner, {command, Data}}, [nosuspend | Options]),
- erlang:send_nosuspend(Port, {PortOwner, {command, Data}}), or
- erlang:send_nosuspend(Port, {PortOwner, {command, Data}}, Options).
Thanks Vasily Demidenok for reporting the issue, and Sergey Kudryashov for providing a testcase.
Own Id: OTP-12082 Aux Id: OTP-10336
Fix size overflow bug at memory allocation. A memory allocation call, with an insane size close to the entire address space, could return successfully as if it had allocated just a few bytes. (Thanks to Don A. Bailey for reporting)
Own Id: OTP-12091
Fix various issues where negating a signed integer would trigger undefined behaviour. This fixes issues in the enif_make_int64 interface and some edge cases inside the erlang runtime system.
Own Id: OTP-12097
The documentation erroneously listed the +swct command line argument under +sws.
Own Id: OTP-12102 Aux Id: OTP-10994
Profiling messages could be delivered out of order when profiling on runnable_procs and/or runnable_ports using erlang:system_profile/2. This bug was introduced in ERTS version 5.10.
Own Id: OTP-12105 Aux Id: OTP-10336
Various logging fixes, including: Add run queue index to the process dump in crash dumps.
Add thread index to enomem slogan when crashing.
Remove error logger message for sending messages to old instances of the same node.
Own Id: OTP-12115
Fix compiler warnings reported by LLVM
Own Id: OTP-12138
Correct conversion of MIN_SMALL by list_to_integer/1 and binary_to_integer/1. The bug produced an unnormalized bignum which can cause strange behavior such as comparing different to a correct MIN_SMALL integer. The value MIN_SMALL is -(1 bsl 27) = -134217728 on a 32-bit VM and -(1 bsl 59) = -576460752303423488 on a 64-bit VM. (Thanks to Jesper Louis Andersen, Mikael Pettersson and Anthony Ramine for report, patch and optimization suggestion)
Own Id: OTP-12140
Fix bug in term_to_binary that reallocates binary with inconsistent size information. Bug has never been confirmed to be the cause of any faulty behavior.
Own Id: OTP-12141
Real_path method used while prim loading archive files was not taking into account the fact that windows directory symlinks can be across different drives.
Own Id: OTP-12155
Improvements and New Features
Add log2 histogram to lcnt for lock wait time
Own Id: OTP-12059
Introduced enif_schedule_nif() to the NIF API.
The enif_schedule_nif() function allows a long-running NIF to be broken into separate NIF invocations without the help of a wrapper function written in Erlang. The NIF first executes part of the long-running task, then calls enif_schedule_nif() to schedule a NIF for later execution to continue the task. Any number of NIFs can be scheduled in this manner, one after another. Since the emulator regains control between invocations, this helps avoid problems caused by native code tying up scheduler threads for too long.
The enif_schedule_nif() function also replaces the enif_schedule_dirty_nif() in the experimental dirty NIF API. Note that the only incompatible changes made are in the experimental dirty NIF API.
See the NIF documentation for more information.
Thanks to Steve Vinoski.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-12128
1.4 Erts 6.1.5 Erts 6.1.1
Fixed Bugs and Malfunctions
Fixed ETHR_FORCE_INLINE which caused the build to break on some platforms without adequate thread support (VxWorks).
Own Id: OTP-12010
1.6 Erts 6.1
Fixed Bugs and Malfunctions
The documentation for spawn_opt/5 now has a note mentioning that the monitor option is not supported.
Own Id: OTP-11849
Fix broken system monitoring of large_heap for non-smp VM. No message for large_heap was ever sent on non-smp VM. Bug exist since R16B.
Own Id: OTP-11852
The emulator without SMP support crashed when passing a message to a process without enough heap space for the message. This bug was introduced in erts-6.0.
Own Id: OTP-11887 Aux Id: OTP-11388
Fix race between ETS table deletion and unfixation that could cause VM crash. The race could happen between a terminating process that does not own the table but has a fixation on it and another process that deletes the table (maybe the owner terminating) at the same time. Bug existed since R15B02.
Own Id: OTP-11892
The string following the -eval option when invoking erl would not be properly translated from UTF-8 to a list of Unicode characters (as would the arguments for -run).
That bug would cause the build of Erlang/OTP to fail when building in a directory whose pathname contained non-US ASCII characters encoded in UTF-8. (Thanks to Eric Pailleau for reporting this bug.)
Own Id: OTP-11916
Fix erts_debug:size/1 to handle Map sizes
Own Id: OTP-11923
Removed erlang:bitstr_to_list/1 and erlang:list_to_bitstr/1. They were added by mistake, and have always raised an undefined exception when called.
Own Id: OTP-11942
Fixed compilation using mingw-w64 on Windows.
Thanks to Jani Hakala.
Own Id: OTP-11945
The git sha is no longer printed in the shell start header when erlang is built from a tagged git release.
Own Id: OTP-11961
Fixed a bug where send trace events were erroneously dropped when the send was done to a registered process. This bug was introduced in R16B.
Own Id: OTP-11968
The systemd features of epmd have been removed from epmd by default. To enable them you have to build erlang with the configure option --enable-systemd.
Own Id: OTP-11921
Removed Erlang wrapper code used when calling binary_to_term/1, and binary_to_term/2. This improves the performance of these BIFs especially when they are called with small binaries as input.
Own Id: OTP-11931
Add erlang:system_info(tolerant_timeofday), an API to check whether compensation for sudden changes of system time is enabled or not.
Own Id: OTP-11970
1.7 Erts 6.0.1
Fixed Bugs and Malfunctions
Fix broken system monitoring of large_heap for non-smp VM. No message for large_heap was ever sent on non-smp VM. Bug exist since R16B.
Own Id: OTP-11852
Fixed type spec of erlang:system_info/1.
Own Id: OTP-11859 Aux Id: OTP-11615
1.8 Erts 6
Allow loading of NIF library with unicode path name
Own Id: OTP-11408
Allow loading of driver with unicode path name
Own Id: OTP-11549
Fixed a bug where starting Erlang without having an open stdin on fd 0 would sometimes deadlock the emulator when terminating.
Own Id: OTP-11558
The option '-names' in epmd now works on Windows (Thanks to Johannes Weißl)
Own Id: OTP-11565
Correction of the examples in escript documentation. (Thanks to Pierre Fenoll).
Own Id: OTP-11577
Fix bs_get_integer instruction
The instruction bs_get_integer could unnecessarily trigger a garbage collection in failure cases which is unwanted or outright dangerous.
Ex:
<<X:Sz,_/bits>> = <<"some binary">>
Previously, if Sz induced X to a bignum it would reserved memory size this on the heap via a garbage collection before checking if the size could actually match.
It will now check the binary size before triggering a collection.
Own Id: OTP-11581
Remove heap space overestimation in binary_to_term (and remote message reception) for integers in the intervals [-2147483648,-1] and [256,2147483647] on 64-bit emulators.
Own Id: OTP-11585
Add support for detecting the separate tinfo library from ncurses (Thanks to Dirkjan Ochtman)
Own Id: OTP-11590
Deprecation warning for system_flag(cpu_topology) has been extended for removal in OTP 18 (Thanks to Steve Vinoski for the update)
Own Id: OTP-11602
Documentation improvement regarding some awkward wording around the +spp flag. (Thanks to Brian L. Troutwine )
Own Id: OTP-11607
Fixed bug where sendfile would return the wrong error code for a remotely closed socket if the socket was in passive mode. (Thanks to Vincent Siliakus for reporting the bug.)
Own Id: OTP-11614
Increase garbage collection tenure rate
The garbage collector tries to maintain the previous heap block size during a minor gc, i.e. 'need' is not utilized in determining the size of the new heap, instead it relies on tenure and garbage to be sufficiently large.
In instances during intense growing with exclusively live data on the heap coupled with delayed tenure, fullsweeps would be triggered directly after a minor gc to make room for 'need' since the new heap would be full.
To remedy this, the tenure of terms on the minor heap will always happen (if it is below the high watermark) instead of every other minor gc.
Characteristics Impact: Reduced CPU-time spent in garbage collection but may infer delays in collecting garbage from the heap. Tweak 'fullsweep_after' options to increase gc pressure if needed.
Own Id: OTP-11617
Fix bug when comparing integers with floats larger than 2^992. The bug could potentially cause memory corruption on 32-bit emulators.
Own Id: OTP-11618
Cross-compilation fixes for TileraMDE-3.0.1.125620
Own Id: OTP-11635
sendfile no longer uses async threads by default
This has been done because a slow client attack is possible if the async thread pool is used. The scenario is:
Client does a request for a file and then slowly receives the file one byte at a time. This will eventually fill the async thread pool with blocking sendfile operations and thus starving the vm of all file operations.
If you still want to use the async threads pool for sendfile an option to enable it has been introduced.
Thanks to Christopher Faulet for identifying this vulnerability.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-11639
Do proper rollback of calls to enif_open_resource_type when load/upgrade callbacks of NIF library return failure.
Own Id: OTP-11722
Changed the default configuration when configuring with $ERL_TOP/configure to be the same as when configuring with $ERL_TOP/otp_build configure.
Previously floating point exceptions got enabled by default on Linux when HiPE was enabled when configuring with $ERL_TOP/configure, but not when configuring with $ERL_TOP/otp_build configure. The default is now in both cases not to use floating point exceptions since there still exist unresolved issues with floating point exceptions on Linux.
For more information see $ERL_TOP/HOWTO/INSTALL.md.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-11723
A comment in erl_db_tree.c no longer differ from the code. (Thanks to Cobus Carstens)
Own Id: OTP-11793
Fix epmd debug functionality for VxWorks (Thanks to Jay True)
Own Id: OTP-11808
Use closefrom/2 when available in child_setup (Thanks to Rick Reed and Anthony Ramine)
Own Id: OTP-11809
Fix dtrace/systemtap bug where the probe arguments would be concatenated due to faulty length calculation.
Thanks to Michal Ptaszek and Scott Lystig Fritchie
Own Id: OTP-11816
It is now better documented that the +fn* flags to erl also affect how command line parameters and environment variables are read. (Thanks to Vlad Dumitrescu)
Own Id: OTP-11818
Improvements and New Features
Options to set match_limit and match_limit_recursion are added to re:run. The option report_errors is also added to get more information when re:run fails due to limits or compilation errors.
Own Id: OTP-10285
Dialyzer's unmatched_return warnings have been corrected.
Own Id: OTP-10908
A common case is to wrap an argument to list_to_binary/1 in a list to ensure conversion can happen even though the argument may already be a binary. Take special care of this case and do not copy binary.
Impact: May cause incompatibility since a single binary is no longer copied. Use binary:copy/1,2 instead.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-11082
Make erlang:open_port/2 spawn and spawn_executable handle unicode.
Own Id: OTP-11105
Handle unicode (widestring) in erl, erlc, heart, etc on windows.
Own Id: OTP-11135
Filenames containing UTF-8 encoded characters can now be handled by erlc.
If you have set the ERLC_EMULATOR environment variable, note that erlc in OTP 17 will only work with erl in OTP 17 since the protocol between the erlc program and the erl_compile module has changed.
Own Id: OTP-11248 new optional scheduler utilization balancing mechanism has been introduced. For more information see the +sub command line argument.
Characteristics impact: None, when not enabled. When enabled, changed timing in the system, normally a small overhead due to measuring of utilization and calculating balancing information. On some systems, such as old Windows systems, the overhead can be quite substantial. This time measurement overhead highly depend on the underlying primitives provided by the OS.
Own Id: OTP-11385
Cleanup 'Buckets' and 'Time left' fields in crashdump to ease parsing.
Own Id: OTP-11419
erlang:binary_to_term will now cost an appropriate amount of reductions and will interrupt (yield) for reschedule if the term is big. This avoids too long schedules when binary_to_term is used. (Thanks to Svante Karlsson for the original patch)
Impact: Programs running binary_to_term on large binaries will run more smoothly, but rescheduling will impact the single process performance of the BIF. Single threaded benchmarks might show degraded performance of the BIF, while general system behaviour will be improved.
Own Id: OTP-11535 Aux Id: OTP-11388
Added high resolution icon for windows. (Thanks to Daniel Goertz for the inspiration.)
Own Id: OTP-11560
Migration of memory carriers has been enabled by default on all ERTS internal memory allocators based on the alloc_util framework except for temp_alloc. That is, +M<S>acul de is default for these allocators. Note that this also implies changed allocation strategies for all of these allocators. They will all now use the "address order first fit carrier best fit" strategy.
By passing +Muacul 0 on the command line, all configuration changes made by this change will be reverted.
Characteristics impact: Improved memory characteristics with a smaller memory footprint at the expense of a quite small performance cost.
Own Id: OTP-11604 Aux Id: OTP-10279
A clarification has been added to the documentation of -on_load() in the Reference Manual that it is only recommended for loading NIF libraries.
Own Id: OTP-11611
+fnaw is now default when starting the emulator; it used to be +fnl.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-11612
The previously deprecated driver API function driver_async_cancel() has been removed. Due to this, the driver API version has been bumped to 3.0.
Thanks to Steve Vinoski.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-11628
Experimental "dirty scheduler" functionality has been introduced. In order to try the functionality out, you need to pass the command line argument --enable-dirty-schedulers to configure when building the system.
Dirty schedulers can currently only be used by NIFs on a system with SMP support. More information can be found in the erl_nif(3) documentation, the erl(1) documentation, and in the git commit comment of commit 'c1c03ae4ee50e58b7669ea88ec4d29c6b2b67c7b'.
Note that the functionality is experimental, and not supported. This functionality will be subject to backward incompatible changes. You should not enable the dirty scheduler functionality on production systems. It is only provided for testing.
Thanks to Steve Vinoski.
Own Id: OTP-11629
Improve reduction cost and yielding of term_to_binary. The reduction cost is increased and garbage collection is disabled during yield.
Impact: Improves system responsiveness when term_to_binary is called with large terms without significant degradation of single threaded performance.
Own Id: OTP-11648 Aux Id: OTP-11388
By default, the system's version of zlib will be used, provided its version is 1.2.4 or higher; otherwise the built-in zlib will be used. The built-in version of zlib has been bumped to 1.2.8. (Use the --enable-builtin-zlib option to configure to force the use of the built-in zlib.)
Own Id: OTP-11669
The default float encoding in binary_to_term and external_size has been changed to use minor_mode 1 instead of 0.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-11738
Introduced the configure option --with-assumed-cache-line-size=SIZE. For more information see $ERL_TOP/HOWTO/INSTALL.md.
Own Id: OTP-11742
Halfword emulator is marked as deprecated. It still works as before but is planned to be removed in a future major release.
Own Id: OTP-11777
The external format for Maps has changed in a way that is not compatible with the format used in OTP 17.0-rc1 and OTP 17.0-rc2.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-11782
Fixed faulty make dependency that would make some make versions fail while building gen_git_version.mk.
Own Id: OTP-11784
Introduced functionality for allowing old drivers and NIF libraries to be loaded during a transition period. For more information see the version management section in the erl_driver(3) documentation and the version management section in the erl_nif(3) documentation.
Own Id: OTP-11799
Support file paths longer than 259 characters on Windows. Long absolute paths are automatically converted to UNC format with a \\?\ prefix which is the only way to represent long paths. The 259 character limit still applies for individual file names, relative paths and the current working directory.
Own Id: OTP-11813
Document that escript:create/2 also accepts a 3-elements tuple containing files and zip:create/3 options to build a zip file.
Thanks to Pierre Fenoll
Own Id: OTP-11827
Add systemd socket activation for epmd.
Thanks to Matwey V. Kornilov
Own Id: OTP-11829
1.9 Erts 5.10.10 Erts 5.10.4
Fixed Bugs and Malfunctions
When normalizing paths, erl_prim_loader would always convert backslash to forward slash. This is correct on Windows, but not on other operating systems. erl_prim_loader now checks which OS is running before performing this conversion.
Own Id: OTP-11170
Fixed syslog defines and defined LOG_ERR for systems without syslog.h. Thanks to Matt Lewandowsky.
Own Id: OTP-11349
Check all pattern arguments passed to binary:matches/2. Thanks to Mike Sassak.
Own Id: OTP-11350
Fix two small silent rules omissions. Thanks to Anthony Ramine.
Own Id: OTP-11351
Teach configure to detect if posix_memalign cannot align to more than the system page size.
For cross-compiled systems a new environment variable called erl_xcomp_posix_memalign has been introduced to indicate whether posix_memalign should be used.
Own Id: OTP-11371
Fix bsr bug occurring when shifting a huge number a huge number of bits to the right. Thanks to Lars Hesel Christensen.
Own Id: OTP-11381
Fix memory leak for distributed monitors
Own Id: OTP-11410
Fix various typos in erts, kernel and ssh. Thanks to Martin Hässler.
Own Id: OTP-11414
Crashdumps initiated by out-of-memory on process spawn could cause the beam to segfault during crashdump writing due to invalid pointers.
The pointers are invalid since the process creation never finished. This fix removes these processes from the printouts. Reported by Richard Carlsson.
Own Id: OTP-11420
Crash dumps from 64-bit Erlang machines would have all memory addresses truncated to 32 bits, which could cause trouble inspecting processes message queues and stacks in the crashdump viewer.
Own Id: OTP-11450
Threads other than schedulers threads could make thread unsafe accesses when support for migration of memory carriers had been enabled, i.e., when the +M<S>acul command line flag had been passed to erl. This could cause corruption of the VMs internal state.
This bug was introduced in erts-5.10.2 when the support for migration of memory carriers was introduced.
Own Id: OTP-11456 Aux Id: OTP-10279
Fix bug in binary_to_term for invalid bitstrings and very large binaries (>2Gb).
Own Id: OTP-11479
Under rare circumstances a process calling inet:close/1, gen_tcp:close/1, gen_udp:close/1, or gen_sctp:close/1 could hang in the call indefinitely.
Own Id: OTP-11491
Fix bug that could cause a 32-bit emulator to always crash at start (since R16B01) depending on the alignment of static data in the beam executable.
Own Id: OTP-11496
Fix benign bugs regarding bitstring compare. Only a nuisance for debug and valgrind VM.
Own Id: OTP-11501
Silence warnings (Thanks to Anthony Ramine)
Own Id: OTP-11517
The default wordsize of the emulator (beam) is now determined by compiler default on Mac OSX (Darwin). This was previously forced to 32bits by the configure script unless otherwise specified.
Own Id: OTP-11521
Improvements and New Features
A new memory allocation feature called "super carrier" has been introduced. The super carrier feature can be used in different ways. It can for example be used for pre-allocation of all memory that the runtime system should be able to use.
By default the super carrier is disabled..
Since it is disabled by default there should be no impact on system characteristics if not used.
This change has been marked as a potential incompatibility since the returned list when calling erlang:system_info({allocator, mseg_alloc}) now also include an {erts_mmap, _} tuple as one element in the list.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-11149
Added erlang:system_info(ets_limit) to provide a way to retrieve the runtime's maximum number of ETS tables. Thanks to Steve Vinoski
Own Id: OTP-11362
Add new BIF os:unsetenv/1 which deletes an environment variable. Thanks to Martin Hässler.
Own Id: OTP-11446
Introduced a new guarantee regarding exit signals from ports:
If the process calling one of the synchronous port BIFs listed below is linked to the port identified by the first argument, and the port exits before sending the result of the port operation, the exit signal issued due to this link will be received by the processes before the BIF returns, or fail with an exception due to the port not being open.
The synchronous port BIFs are:
- port_close/1
- port_command/2
- port_command/3
- port_connect/2
- port_control/3
- erlang:port_call/3
- erlang:port_info/1
- erlang:port_info/2
Note that some ports under certain circumstances unlink themselves from the calling process before exiting, i.e. even though the process linked itself to the port there might be no link triggering an exit signal.
Characteristics impact: The return or exception from the synchronous port BIF will be delayed if the port simultaneously exit due to some issue unrelated to the outstanding synchronous port BIF call. In all other cases characteristics are unchanged.
Own Id: OTP-11489
1.11 Erts 5.10.3.1
Improvements and New Features
Memory allocators will be able to create sys_alloc carriers as fallback, if mseg_alloc cannot create more carriers, on systems with posix_memalign() support. This is similar to how it worked in pre-R16 releases.
Windows systems will create carriers using _aligned_malloc() and can by this use the new optimized allocator header scheme introduced in R16 on other platforms.
Own Id: OTP-11318
1.12 Erts 5.10.3
Fixed Bugs and Malfunctions
The documentation of predefined types and built-in types has been corrected.
Own Id: OTP-11090
Fix changing terminal parameters in to_erl
Change the behaviour of to_erl to use TCSADRAIN instead of TCSANOW when changing terminal parameters. This makes the serial driver wait for the output queues to be empty before applying the terminal parameter change. Thanks to Stefan Zegenhagen.
Own Id: OTP-11206
The default value of {flush, boolean()} in erlang:halt/2 is documented to be 'true' if the status is an integer. The implementation behaviour was reversed. The Implementation is now corrected to adhere to the documentation. Thanks to Jose Valim for reporting the error.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-11218
Fix serious race bug in R16B01 that could cause PID mix-ups when a lot of processes were spawned and terminated in a very rapid pace on an SMP emulator with at least two scheduler threads.
Own Id: OTP-11225
Validating a trace pattern with the option silent no longer incorrectly enables/disables the silent option of the calling process.
Own Id: OTP-11232
Fixed a bug where GCC 4.8 and later use a more aggressive loop optimization algorithm that broke some previously working code in the efile driver. Thanks to Tomas Abrahamsson for reporting this issue.
Own Id: OTP-11246
Fixed bug when printing memory allocator acul option in crash dump.
Own Id: OTP-11264
Opening a new compressed file on Windows could in rare (random) cases result in {error,eisdir} or other error codes although it should have succeeded. This is now corrected.
Own Id: OTP-11265
Fixed a race condition when closing a trace port that would cause the emulator to crash.
Own Id: OTP-11290
Improvements and New Features
There is a new somewhat experimental socket option 'netns' that can set the network namespace for a socket on Linux:es where it is supported. See the documentation.
Own Id: OTP-11157
New allocator strategy aoffcbf (address order first fit carrier best fit). Supports carrier migration but with better CPU performance than aoffcaobf.
Own Id: OTP-11174
Introduced functionality for inspection of system and build configuration.
Own Id: OTP-11196
Fix matching of floating point middle-endian machines. Thanks to Johannes Weissl.
Own Id: OTP-11201
Fix compile error on ARM and GCC versions greater than 4.1.0. Thanks to Johannes Weissl.
Own Id: OTP-11214
run_erl: Redirect standard streams to /dev/null. Thanks to Johannes Weissl.
Own Id: OTP-11215
Misc. corrections in documentation for erl_driver. Thanks to Giacomo Olgeni.
Own Id: OTP-11227
Fix documentation regarding binary_part.
Own Id: OTP-11239
Make edlin understand a few important control keys. Thanks to Stefan Zegenhagen.
Own Id: OTP-11251
Export type zlib:zstream/0. Thanks to Loic Hoguin.
Own Id: OTP-11278
Add erl option to set schedulers by percentages.
For, add. The +SP option also interacts with any settings specified with the +S option, such that the combination of options "+S 4:4 +SP 50:50" (in either order) results in 2 scheduler threads and 2 scheduler threads online.
Thanks to Steve Vinoski
Own Id: OTP-11282
Extend erl_driver interface with lock names
Lock and thread names are already a feature in the driver interface. This extension will let developers read these names which eases debugging.
Own Id: OTP-11303
Fix incorrect values returned by integer_to_binary/2. Thanks to Juan Jose Comellas.
Own Id: OTP-11311
Fix system_flag scheduling_statistics - disable . Thanks to Steve Vinoski.
Own Id: OTP-11317
The documentation of predefined types has been corrected Thanks to Kostis Sagonas.
Own Id: OTP-11321
1.13 Erts 5.10
Compilation fixes for NetBSD. Thanks to YAMAMOTO Takashi.
Own Id: OTP-10941
Fixed a race condition when using delayed_write when writing to a file which would cause the same data to be written multiple times.
Own Id: OTP-10984
Fix small memory leak from tracing with option meta.
Own Id: OTP-10997
Correct typo in erlsrv usage. Thanks to Bryan Hunter
Own Id: OTP-11002
ct_run: delete unused function. Thanks to Tuncer Ayaz.
Own Id: OTP-11003
Corrections to run_erl/to_erl handshake behaviour.
Own Id: OTP-11012
Fix typo in type: erlang:process_info_item(). Thanks to Andrew Tunnell-Jones.
Own Id: OTP-11024
Fix src/dest overlap issue in ttsl driver. Thanks to Steve Vinoski.
Own Id: OTP-11064
When sending to a port using erlang:send(Port, Msg, [nosuspend]), the send operation was performed synchronously. This bug has now been fixed.
Own Id: OTP-11076 Aux Id: OTP-10336
Runtime system could crash when reporting stale driver_select().
Own Id: OTP-11084
Fix lock order violation for memory instrumentation (+Mim, +Mis, +Mit).
Own Id: OTP-11085
Fixed some compilation warnings on miscellaneous platforms. Thanks to Anthony Ramine.
Own Id: OTP-11086
Fixed issue when flushing i/o during shutdown on windows where the Erlang VM would sometime hang due to a race condition.
Own Id: OTP-11096
Fixed issue where repeated calls to erlang:nodes() could cause unnecessary contention in the dist_table lock.
Own Id: OTP-11097
Properly guard WIDE_TAG use with HAVE_WCWIDTH in ttsl_drv. Thanks to Anthony Ramine
Own Id: OTP-11106
Fix some Makefile rules that didn't support silent rules. Thanks to Anthony Ramine.
Own Id: OTP-11111
Fix receive support in erl_eval with a BEAM module. Thanks to Anthony Ramine.
Own Id: OTP-11137
erlang:now() could suddenly jump ~24 days into the future on Windows. This is now corrected. Thanks to Garret Smith for reporting and testing fixes.
Own Id: OTP-11146
erlang:term_to_binary will now cost an appropriate amount of reductions and will interrupt (yield) for reschedule if the term is big. This avoids too long schedules when term_to_binary is used.
Impact: Programs running term_to_binary on large terms will run more smothly, but rescheduling will impact the single process performance of the BIF. Single threaded benchmarks will show degraded performance of the BIF when called with very large terms, while general system behaviour will be improved. The overhead for allowing restart and reduction counting also degrades local performance of the BIF with between 5% and 10% even for small terms.
Own Id: OTP-11163
Improvements and New Features
Replaced the lock protecting gathering of garbage collection statistics with a lock-free solution.
Own Id: OTP-10271 Aux Id: kunagi-108 [04c5410f-9cc4-4696-8639-36bf98686c7a-7].
Own Id: OTP-10279
Change specs for spawn_opt to use the process_level() type declaration instead of re-defining it in various places. Thanks to Kostis Sagonas.
Own Id: OTP-11008
Postscript files no longer needed for the generation of PDF files have been removed.
Own Id: OTP-11016
A new better algorithm for management of the process, and port tables has been introduced.
Impact on the characteristics of the system:
- The new algorithm ensures that both insert and delete operations can be made in O(1) time complexity. Previously used algorithm either caused insert or delete to be O(N).
- The new algorithm will also ensure that reuse of identifiers will be less frequent than when the old algorithm was used.
- Previously used algorithm ensured that the latest created identifier compared as the largest when comparing two identifiers of the same type that had been created on the same node as long as no identifiers had been reused. Since identifiers can be reused quite fast, one has never been able to rely on this property. Due to the introduction of this new algorithm this property will not hold even if no identifiers has been reused yet. This could be considered as an incompatibility.
Due to the above mensioned potential incompatibility, it will still be possible to enable the old algorithm for some time. The command line argument +P legacy will enable the old algorithm on the process table, and +Q legacy will do the same for the port table. These command line arguments are however deprecated as of their introduction and have been scheduled for removal in OTP-R18.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-11077
Support wide characters in the shell through wcwidth(). Thanks to Anthony Ramine. Reported by Loïc Hoguin.
Own Id: OTP-11088
Added total used memory for each process in erlang crash dumps.
Own Id: OTP-11098
Added support for hipe on Raspberry Pi (armv6l). Thanks to Klaus Alfert.
Own Id: OTP-11125
Remove 'query' from the list of reserved words in docs. Thanks to Matthias Endler and Loïc Hoguin.
Own Id: OTP-11158
Lift static limitation (FD_SETSIZE) for file descriptors on Mac OS X. (Thanks to Anthony Ramine)
Own Id: OTP-11159
Known Bugs and Problems
Miscellaneous native code in OTP misbehave either due to lengthy execution, or due to not bumping reductions properly. Problems typically occur when passing huge sets of data to a misbehaving BIF. Fixing this has high priority and is being worked on, but there will remain issues like this for some time.
In order to alleviate problems with scheduling which might occur when executing misbehaving native code, the command line argument +sfwi has been introduced.
By default this feature is disabled and you are advised not to enable it if you do not encounter problems with misbehaving native code.
When enabled it has the following impact on the characteristics of the system:
- Work will always be distributed between schedulers even when executing misbehaving native code.
- It may cause an increased amount of processes and/or ports bouncing between schedulers which in turn will cause a performance loss.
- It may cause reduced performance due to reduced or lost work compaction when all schedulers do not execute under full load.
- An increased contention on run queue locks.
Own Id: OTP-11164
1.14 Erts 5.10.1.2
Fixed Bugs and Malfunctions
A bug in the implementation of offline schedulers has been fixed. The bug was introduced in OTP-R16A/ERTS-5.10, and caused work-stealing between schedulers to fail. This in turn, caused work to accumulate in some run-queues. The bug was only triggered when there were offline schedulers in the system, i.e., when the amount of online schedulers was less than the total amount of schedulers. The effect of the bug got more severe the larger amount of offline schedulers the system had.
Own Id: OTP-11022 Aux Id: OTP-9892
1.15 Erts 5.10.1.1
Fixed Bugs and Malfunctions
The BIF is_process_alive/1 could prematurely return false while the process being inspected was terminating. This bug was introduced in ERTS-5.10.
Own Id: OTP-10926
Fix a problem in erlang:delete_element/2 where the call could corrupt one word of stack if the heap and stack met during call.
Own Id: OTP-10932
The +sws<value> and +swt<value> system flags failed if no white space were passed between the parameter and value parts of the flags. Upon failure, the runtime system refused to start.
Own Id: OTP-11000
Improvements and New Features
Scheduler threads will now by default be less eager requesting wakeup due to certain cleanup operations. This can also be controlled using the +swct command line argument of erl(1).
Own Id: OTP-10994
1.16 Erts 5.10.1
Fixed Bugs and Malfunctions
Threads created internally in the runtime system by vanilla, fd, and spawn drivers on Windows systems could make thread unsafe calls to driver_select().
Own Id: OTP-10802
Threads created internally in the runtime system by the vanilla, fd, and spawn drivers on Windows systems could make unsafe memory accesses to driver data after port had terminated.
Own Id: OTP-10803
The runtime system could crash when flushing data to standard out or standard error on Windows.
Own Id: OTP-10807
Bugs due to the port optimizations introduced in erts-5.10/OTP-R16A have been fixed:
- Memory leak when terminating ports
- Memory leak when reaching the system limit of maximum amount of concurrently existing ports
- Crashs due to missing, or late test of bad port handle
- The newly introduced driver API function erl_drv_busy_msgq_limits() could not be used by dynamically linked in drivers on Windows
Own Id: OTP-10809 Aux Id: OTP-10336
Fix {packet,httph} header capitalization for unrecognized header fields longer than 20 charachters such as Sec-Websocket-Version. The limit is simply raised from 20 to 50 characters with the hope that valid headers longer than 50 are not used.
Own Id: OTP-10824
Fix rounding issues in float_to_list/1,2. Thanks to Serge Aleynikov
Own Id: OTP-10837
Fix memory leak in file driver introduced in R16A.
Own Id: OTP-10841
A bug in an ERTS internal queue implementation could cause the loss of a wake up signal to a consumer thread. This has now been fixed.
The effect of this bug, when triggered, was often only a small or even no delay of certain operations. This since, threads often are woken due to other unrelated reasons. However, if the consumer thread was not woken due to other reasons when the bug was triggered, these operations could be left hanging, potentially for ever. Such effects seems to have been very rare, but we have on at least one occasion gotten a report about such an issue.
Operations potentially effected by this bug:
- Inspection of memory allocation status
- The Erlang process calling erlang:memory/[0,1], or erlang:system_info({allocator|allocator_sizes, _}) could potentially hang waiting for responses from involved threads.
- Async thread pool jobs
- An async thread pool job request and/or reply could potentially be left hanging. In OTP this only effected file operations, but user implemented drivers using the async thread pool were also effected. In the file operation case, this would typically translate into an Erlang process potentially hanging on the file operation.
- Shutting down the runtime system
- Due to the issue with the async thread pool mentioned above, flushing of I/O while terminating the runtime system could also potentially hang.
- ETS memory deallocation
- Scheduled jobs handling deallocation of the main structure of an ETS table could potentially hang. This more or less only translates into minor memory leaks.
- Shutting down distribution
- The distribution shutdown phase used when manually shutting down the distribution, i.e., when calling net_kernel:stop(), could potentially hang.
Own Id: OTP-10854
OS X Snow Leopard now only uses write, as writev does not work properly on very large files.
Own Id: OTP-10858
Fixed a bug where line oriented file I/O using read_ahead was very slow for files with very large difference in line length.
Own Id: OTP-10859
In erts-5.10 (R16A) faulty hashvalues were produced for non-ASCII atoms (characters in byte-range 128..255). This has now been fixed and hashvalues conforms to previous OTP releases.
Own Id: OTP-10860
Fixes of memory accesses that might be thread unsafe when the runtime system has been linked against third-party libraries for atomic memory operations during the build. Most builds are uneffected by this bug. If triggered, the runtime system will most likely crash more or less immediately.
Own Id: OTP-10875 Aux Id: OTP-10854
Fixed a bug where it was longer possible to give the +sws proposal flag to non-smp emulators.
Own Id: OTP-10881 Aux Id: seq12258
Faulty type to bytes read for ReadFile on Windows. This could cause windows systems to misbehave. The correct type is now used.
Own Id: OTP-10890
Change default max ports for Windows to 8192. Having a too large value caused Windows to not be able to recover properly. If you want to use another value, pass +Q Value to erl or werl.
Own Id: OTP-10892
Fix rare crash on halfword vm during code loading.
Own Id: OTP-10896
Improvements and New Features
Tuple funs (deprecated in R15B) are no longer supported.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-10170
Added four new bifs, erlang:binary_to_integer/1,2, erlang:integer_to_binary/1, erlang:binary_to_float/1 and erlang:float_to_binary/1,2. These bifs work similarly to how their list counterparts work, except they operate on binaries. In most cases converting from and to binaries is faster than converting from and to lists.
These bifs are auto-imported into erlang source files and can therefore be used without the erlang prefix.
Own Id: OTP-10300 Aux Id: kunagi-74 [74]
The experimental support for packages has been removed.
Own Id: OTP-10348 Aux Id: kunagi-316 [227]
The driver API function erl_drv_consume_timeslice(), and the NIF API function enif_consume_timeslice() have been introduced.
These functions are provided in order to better support co-operative scheduling, improve system responsiveness, and to make it easier to prevent misbehaviors of the VM due to a process or port monopolizing a scheduler thread. They can be used when dividing lengthy work into a number of repeated calls without the need to use threads.
Own Id: OTP-10810
The list_to_integer/2 bif has been optimized when used with bases other than 10.
Own Id: OTP-10834 Aux Id: kunagi-74 [74]
The git commit sha of the HEAD commit is now added to the Erlang shell when compiling a non-released Erlang version.
Own Id: OTP-10838
Change caching policy for memory segment allocator. For instance, prefer sbc segments over mbc segments, caching policy is time-arrow aware, evicting older cached segments to store newer segments.
The default number of cachable segment has been increased from five to ten segments. This can be modified, same as before, with the command line option +MMmcs 5
Impact: Increased speed for processing on larger objects, e.g. binaries. Slight increase of mapped and resident memory. Tune your system with memory options to erl for best performance.
Own Id: OTP-10840
Updated config.sub and config.guess to latest version from gnu.org
Own Id: OTP-10848
Add an xcomp file for Blue Gene/Q. Thanks to Kostis Sagonas.
Own Id: OTP-10849
Cleanup of documentation of the type language. Thanks to Kostis Sagonas.
Own Id: OTP-10850
Change the return value of hipe_bifs:remove_refs_from/1. Thanks to Kostis Sagonas.
Own Id: OTP-10851
As of ERTS-5.10/OTP-R16A node names passed in the EPMD protocol are required to be encoded in UTF-8. Since EPMD previously accepted latin1 encoded node names this is an incompatibility. However, since Erlang nodes always have required characters in node names to be 7-bit ASCII characters (and still do require this), this incompatibility should not effect anyone using EPMD as an Erlang Port Mapper Daemon.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-10872 Aux Id: OTP-10753
The +pc flag to erl can be used to set the range of characters considered printable. This affects how the shell and io:format("~tp",...) functionality does heuristic string detection. More can be read in STDLIB users guide.
Own Id: OTP-10884
Fix a number of type cast errors related to formatted printing on Win64 that can potentially cause problem when the Erlang VM exceeds 4 GB of ram. (Thanks to Blaine Whittle for the original patch)
Own Id: OTP-10887
The effect of the deprecated environment variable ERL_MAX_PORTS had been removed premeturely. It has now been readded. Note that this is still scheduled to be released in R17B.
Own Id: OTP-10895
1.17 Erts 5.10
Fixed Bugs and Malfunctions
Set new peeled off SCTP socket to nonblocking socket (Thanks to Jonas Falkevik)
Own Id: OTP-10491
Fix various typos (thanks to Tuncer Ayaz)
Own Id: OTP-10611
Fix fd leak when using async thread pool
When using the async thread pool, if an erlang process asks to open a file and it gets shutdown/killed while the file:open/2 call hasn't returned, it's possible to leak a file descriptor against the target file. This has now been fixed. (Thanks to Filipe David Manana)
Own Id: OTP-10677
Use sys/types.h instead of string.h to pull ssize_t definition to erl_driver.h. This fixes build issue on NetBSD. (Thanks to Yamamoto Takashi).
Own Id: OTP-10699
Arguments given with the -run or -s flags to erl are now translated according to the file name encoding mode of the runtime system.
Own Id: OTP-10702
The octet counters in the gen_tcp/inet interface could behave in unexpected ways on 64bit platforms. The behaviour is now as expected.
Own Id: OTP-10746
Certain linux kernels, most notably in redhat and CentOS distribution, had a bug in writev which generated an infinite loop in the tcp code of the VM. The bug is now worked around.
Own Id: OTP-10747
A process that got killed (got an exit signal) while operating on a compresseed file, could cause a segmentation fault in the VM. This is now corrected. Thanks to Filipe David Manana for identifying the problem and submitting a solution.
Own Id: OTP-10748
Windows previously used three digit exponent in formatting which caused difference between platforms, as can be seen by float_to_list/1. This has now been fixed.
Own Id: OTP-10751
Improvements and New Features]
It is now allowed to define stubs for BIFs, to allow type specs to be written for BIFs. For example, if there is BIF called lists:member/2, a dummy definition of lists:member/2 is now allowed.
Own Id: OTP-9861
Process optimizations. The most notable:
- New internal process table implementation allowing for both parallel reads as well as writes. Especially read operations have become really cheap. This reduce contention in various situations. For example when, spawning processes, terminating processes, sending messages, etc.
- Optimizations of run queue management reducing contention.
- Optimizations of process internal state changes reducing contention.
These changes imply changes of the characteristics the system. Most notable: changed timing in the system.
Own Id: OTP-9892 Aux Id: OTP-10167
Non-blocking code loading. Earlier when an Erlang module was loaded, all other execution in the VM were halted while the load operation was carried out in single threaded mode. Now modules are loaded without blocking the VM. Processes may continue executing undisturbed in parallel during the entire load operation. The load operation is completed by making the loaded code visible to all processes in a consistent way with one single atomic instruction. Non-blocking code loading will improve realtime characteristics when modules are loaded/upgraded on a running SMP system.
Own Id: OTP-9974
In the SMP emulator, turning on and off tracing will no longer take down the system to single-scheduling.
Own Id: OTP-10122
Remove VxWorks support
Own Id: OTP-10146
Added a general framework for executing benchmarks of Erlang/OTP. Benchmarks for the Erlang VM and mnesia have been incorporated in the framework.
For details about how to add more benchmarks see $ERL_TOP/HOWTO/BENCHMARKS.md in the source distribution.
Own Id: OTP-10156
Optimized deletion of ETS-tables which significantly improves performance when large amounts of temporary tables are used.
This change imply changes of the characteristics the system. Most notable: changed timing in the system.
Own Id: OTP-10167 Aux Id: OTP-9892
Tuple funs (deprecated in R15B) are no longer supported.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-10170
New internal header scheme for allocators
Impact: Reduces size on object allocated in multiblock carriers by one word
Own Id: OTP-10273 Aux Id: kunagi-20 [20]
Major port improvements. The most notable:
- New internal port table implementation allowing for both parallel reads as well as writes. Especially read operations have become really cheap.This reduce contention in various situations. For example when, creating ports, terminating ports, etc.
- Dynamic allocation of port structures. This allow for a much larger maximum amount of ports allowed as a default. The previous default of 1024 has been raised to 65536. Maximum amount of ports can be set using the +Q command line flag of erl(1). The previously used environment variable ERL_MAX_PORTS has been deprecated and scheduled for removal in OTP-R17.
- Major rewrite of scheduling of port tasks. Major benefits of the rewrite are reduced contention on run queue locks, and reduced amount of memory allocation operations needed. The rewrite was also necessary in order to make it possible to schedule signals from processes to ports.
- Improved internal thread progress functionality for easy management of unmanaged threads. This improvement was necessary for the rewrite of the port task scheduling.
- Rewrite of all process to port signal implementations in order to make it possible to schedule those operations. All port operations can now be scheduled which allows for reduced lock contention on the port lock as well as truly asynchronous communication with ports.
- Optimized lookup of port handles from drivers.
- Optimized driver lookup when creating ports.
- Preemptable erlang:ports/0 BIF.
- Improving responsiveness by bumping reductions for a process calling a driver callback directly.
These changes imply changes of the characteristics of the system. The most notable:
- Order of signal delivery
- The previous implementation of the VM has delivered signals from processes to ports in a synchronous stricter fashion than required by the language. As of ERTS version 5.10, signals are truly asynchronously delivered. The order of signal delivery still adheres to the requirements of the language, but only to the requirements. That is, some signal sequences that previously always were delivered in one specific order may now from time to time be delivered in different orders. This may cause Erlang programs that have made false assumptions about signal delivery order to fail even though they previously succeeded. For more information about signal ordering guarantees, see the chapter on communication in the ERTS user's guide. The +n command line flag of erl(1) can be helpful when trying to find signaling order bugs in Erlang code that have been exposed by these changes.
- Latency of signals sent from processes to ports
- Signals from processes to ports where previously always delivered immediately. This kept latency for such communication to a minimum, but it could cause lock contention which was very expensive for the system as a whole. In order to keep this latency low also in the future, most signals from processes to ports are by default still delivered immediately as long as no conflicts occur. Such conflicts include not being able to acquire the port lock, but also include other conflicts. When a conflict occur, the signal will be scheduled for delivery at a later time. A scheduled signal delivery may cause a higher latency for this specific communication, but improves the overall performance of the system since it reduce lock contention between schedulers. The default behavior of only scheduling delivery of these signals on conflict can be changed by passing the +spp command line flag to erl(1). The behavior can also be changed on port basis using the parallelism option of the open_port/2 BIF.
- Execution time of the erlang:ports/0 BIF
- Since erlang:ports/0 now can be preempted, the responsiveness of the system as a whole has been improved. A call to erlang:ports/0 may, however, take a much longer time to complete than before. How much longer time heavily depends on the system load.
- Reduction cost of calling driver callbacks
- Calling a driver callback is quite costly. This was previously not reflected in reduction cost at all. Since the reduction cost now has increased, a process performing lots of direct driver calls will be scheduled out more frequently than before.
Potential incompatibilities:
- driver_send_term() has been deprecated and has been scheduled for removal in OTP-R17. Replace usage of driver_send_term() with usage of erl_drv_send_term().
- driver_output_term() has been deprecated and has been scheduled for removal in OTP-R17. Replace usage of driver_output_term() with usage of erl_drv_output_term().
- The new function erl_drv_busy_msgq_limits() has been added in order to able to control management of port queues.
The driver API version has been bumped to 2.1 from 2.0 due to the above changes in the driver API.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-10336 Aux Id: OTP-9892
The experimental support for packages has been removed.
Own Id: OTP-10348 Aux Id: kunagi-316 [227]
Wrong parameters when setting seq_trace-tokens from within a trace-pattern could crash the VM. This is now corrected.
Own Id: OTP-10522
Erlang specification 4.7.3 defines max tuple size to 65535 elements It is now enforced to no more than 16777215 elements (arity 24 bits)
Previous edge cases (28 bits) were not validated and could cause undefined behaviour.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-10633
Add insert_element/3 and delete_element/2
Own Id: OTP-10643
The previous default of a maximum of 32768 simultaneous processes has been raised to 262144. This value can be changed using the the +P command line flag of erl(1). Note that the value passed now is considered as a hint, and that actual value chosen in most cases will be a power of two.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-10647 Aux Id: OTP-9892, OTP-10336
The previously (in R15) proposed scheduler wakeup strategy is now used by default. This strategy is not as quick to forget about previous overload as the previous strategy.
This change imply changes of the characteristics the system. Most notable: When a small overload comes and then disappears repeatedly, the system will for a bit longer time be willing to wake up schedulers than before. Timing in the system will due to this also change.
The previous strategy can still be enabled by passing the +sws legacy command line flag to erl.
Own Id: OTP-10661 Aux Id: OTP-10033
The +stbt command line argument of erl was added. This argument can be used for trying to set scheduler bind type. Upon failure unbound schedulers will be used.
Own Id: OTP-10668
Support ANSI in console
Unix platforms will no longer filter control sequences to the ttsl driver thus enabling ANSI and colors in console. (Thanks to Pedram Nimreezi)
Own Id: OTP-10678
Add file:allocate/3 operation
This operation allows pre-allocation of space for files. It succeeds only on systems that support such operation. (Thanks to Filipe David Manana)
Own Id: OTP-10680
Treat -Wreturn-type warnings as error when using GCC (Thanks to Tuncer Ayaz)
Own Id: OTP-10683
Implement ./otp_build configure --enable-silent-rules
With silent rules, the output of make is less verbose and compilation warnings are easier to spot. Silent rules are disabled by default and can be disabled or enabled at will by make V=0 and make V=1. (Thanks to Anthony Ramine)
Own Id: OTP-10726
Use share flags for all file operations on Windows. Thanks to Filipe David Borba Manana.
Own Id: OTP-10727
Make/fakefop adjustments. Thanks to Tuncer Ayaz and Sebastian Rasmussen.
Own Id: OTP-10733
The runtime system will now by default use 10 async threads if thread support has been enabled when building the runtime system.
This will prevent long blocking file-operations from blocking scheduler threads for long periods of time, which can be harmful. Apart from file-operations, it also effects other operations scheduled on the async thread pool by user implemented drivers.
The amount of async threads can be controlled by using the +A command line argument of erl(1). When running some offline tools you might want to disable async threads, but you are advised not to in the general case. Instead, you might want to increase the amount of async threads used.
This change imply changes of the characteristics the system compared to the previous default. The responsiveness of the system as a whole will be improved. Operations scheduled on the async thread pool will get an increased latency. The throughput of these operations may increase, or decrease depending on the type of the operations and how they get scheduled. In the case of file operations, the throughput very much depends on how the Erlang application access files. Multiple concurrent accesses to different files have the potential of an increased throughput.
Own Id: OTP-10736
The default reader group limit has been increased to 64 from 8. This limit can be set using the +rg command line argument of erl(1).
This change of default value will reduce lock contention on ETS tables using the read_concurrency option at the expense of memory consumption when the amount of schedulers and logical processors are beween 8 and 64. For more information, see documentation of the +rg command line argument of erl(1).
Own Id: OTP-10737
New BIF float_to_list/2 which solves a problem of float_to_list/1 that doesn't allow specifying the number of digits after the decimal point when formatting floats (Thanks to Serge Aleynikov).
Own Id: OTP-10752
Limited support for unicode atoms in the external format and in the internal representation of the vm. This is a preparative feature in order to support communication with future releases of Erlang/OTP that may create unicode atoms.
Own Id: OTP-10753.18 Erts 5.9.3.1
Known Bugs and Problems
Create an erl_crash.dump if no heart exists and no ERL_CRASH_DUMP_SECONDS is set (behaviour changed).
Don't create an erl_crash.dump if heart do exists and no ERL_CRASH_DUMP_SECONDS is set (behaviour not changed).
This changes the behaviour back to the R15B02 default considering if a beam was running with no heart.
Own Id: OTP-10602
1.19 Erts 5.9.3
Fixed Bugs and Malfunctions
Fix linking in OpenBSD. (Thanks to Matthew Dempsky)
Own Id: OTP-10395
Fix bug causing fallback atomics to be used even though healthy gcc atomics or libatomic_ops was detected.
Own Id: OTP-10418]
Fix bug where MSVRT100.dll was not included in the windows installer.
Own Id: OTP-10481
In the expression <<Bin/binary,...>>, if Bin was a bitstring with a size not a multiple of 8, either no exception was generated or an incorrect exception was generated. (Thanks to Adam Rutkowski for reporting this bug.)
Own Id: OTP-10524
The runtime system could crash while scheduling a port task. The port task was scheduled either due to an external I/O event being triggered, a driver timeout being triggered, or data being sent over a distribution channel.
Own Id: OTP-10556
erlang:memory(ets) erroneously included the size of each ETS-table main structure twice.
Own Id: OTP-10558
Fix compile error in generated file hipe_amd64_bifs.S for Solaris.
Own Id: OTP-10577
A faulty spec for process_info/2 could cause false dialyzer warnings. The spec is corrected.
Own Id: OTP-10584
In very rare cases, the VM could crash if a garbage collector was called while executing an appending bit syntax instruction. The symptom was a core when reallocating memory in the function erts_bs_append. The garbage collector bug is now corrected.
Own Id: OTP-10590
Improvements and New Features
Improve support for building and testing in embedded ppc environments.
Own Id: OTP-10265 Aux Id: kunagi-159 [daf97f67-5724-4812-a5b6-7e86990133d2-1]
Due to a race condition on Windows, sometimes when printing to standard output and then immediately terminating erlang all data would not be printed. The emulator now waits for all data to be printed before exiting.
Own Id: OTP-10325 Aux Id: kunagi-166 [dd72d0e2-3e76-4a51-8b56-7564e24eecae]
The frequency with which sleeping schedulers are woken due to outstanding memory deallocation jobs has been reduced.
Own Id: OTP-10476 Aux Id: OTP-10162
Clearer warnings about the dangers of misuse of native functions and drivers have been added to the documentation.
Own Id: OTP-10557
1.20 Erts 5.9.2
Fixed Bugs and Malfunctions
Fix erl_prim_loader errors in handling of primary archive. The following errors have been corrected:
- If primary archive was named "xxx", then a file in the same directory named "xxxyyy" would be interpreted as a file named "yyy" inside the archive.
- erl_prim_loader did not correctly create and normalize absolute paths for primary archive and files inside it, so unless given with exact same path files inside the archive would not be found. E.g. if escript was started as /full/path/to/xxx then "./xxx/file" would not be found since erl_prim_loader would try to match /full/path/to/xxx with /full/path/to/./xxx. Same problem with ../.
- Depending on how the primary archive was built, erl_prim_loader:list_dir/1 would sometimes return an empty string inside the file list. This was a virtual element representing the top directory of the archive. This has been removed.
Thanks to Tuncer Ayaz and Shunichi Shinohara for reporting and co-authoring corrections.
Own Id: OTP-10071
Fix: Add port-I/O statistics for active once and true and not only active false.
Own Id: OTP-10073
The 64-bit windows installer did not look in the right directories for 64-bit version of Microsoft Visual C++ 2010 Redistibutable Package and hence took the wrong decision about having to install the redistributable package if the 32-bit version was installed but not the 64-bit and vice versa. This bug has now been fixed Furthermore the sub-installer for the redistributable package is now run in silent mode if the erlang installer is.
Own Id: OTP-10096
epmd would fail to start automatically when starting a distributed erlang node installed in a location with a whitespace in the path.
Own Id: OTP-10106
A more or less harmless bug that sometimes caused memory deallocations to be delayed longer than intended has been fixed.
Own Id: OTP-10116
Fix bug causing emulator crash when running HiPE on ARM. Bug has existed since R15B.
Own Id: OTP-10137
A bug regarding spaces in C function prototypes has been fixed. (Thanks to Richard O'Keefe.)
Own Id: OTP-10138
Corrected dtrace pid length in message related probes. (Thanks to Zheng Siyao)
Own Id: OTP-10142
Correct formating in exit error messages
Ensure displayed sizes are not negative. (Thanks to Michael Santos)
Own Id: OTP-10148
fix escript/primary archive reloading
If the mtime of an escript/primary archive file changes after being added to the code path, correctly reload the archive and update the cache. (Thanks to Tuncer Ayaz)
Own Id: OTP-10151
Doc fix: link from erlang:now/0 to os:timestamp/0
Sometimes os:timestamp/0 is more appropriate than erlang:now/0. The documentation for the former has a link to the latter; this patch adds a link in the other direction to make os:timestamp/0 more visible. Thanks to Magnus Henoch
Own Id: OTP-10180
The caret in the werl window (on Windows) could appear at the wrong place after regaining focus. This is now corrected.
Own Id: OTP-10181
Fix bug that in some cases could cause corrupted binaries in ETS tables with compressed option.
Own Id: OTP-10182
Fix use of "clever" mktime
Commit 1eef765 introduced regression (conditional _always_ evaluates to true) in which erlang:localtime_to_universaltime/2 stopped working on systems configured with timezone without DST (i.e. UTC) on *BSD platforms: 1> erlang:localtime_to_universaltime({{2012,1,1},{0,0,0}}, true). ** exception error: bad argument Thanks to Piotr Sikora
Own Id: OTP-10187
Fix bug in ets:test_ms/2 that could cause emulator crash when using '$_' in match spec.
Own Id: OTP-10190
Supplying a filename longer than the operating system MAX_PATH to file:read_link/1 would cause a crash (Segemntation fault/Critical Error) on all platforms. This is now corrected.
Own Id: OTP-10200
If Perl was configured to interpret files as being encoded in UTF-8, the build would crash in make_preload. (Thanks to Aaron Harnly for noticing this issue.)
Own Id: OTP-10201
Fix support for leap seconds-aware timezones
erlang:universaltime_to_localtime is leap seconds-aware (since 2008), however erlang:localtime_to_universaltime is not, which gives surprising results on systems configured with leap seconds-aware timezones: 1> erlang:universaltime_to_localtime({{2012,1,1},{0,0,0}}). {{2012,1,1},{0,0,0}} 2> erlang:localtime_to_universaltime({{2012,1,1},{0,0,0}}). {{2012,1,1},{0,0,24}} and completely breaks calendar:local_time_to_universal_time_dst: 3> calendar:local_time_to_universal_time_dst({{2011,1,1},{0,0,0}}). [] Thanks to Piotr Sikora
Own Id: OTP-10227
erlsrv: gracefully stop emulator on Windows shutdown
Windows will send the SERVICE_CONTROL_SHUTDOWN event to the service control handler when shutting down the system. Instead of ignoring the event, erlsrv will now invoke the stop action. Likewise, the Erlang emulator (and it's po drivers) must not quit upon reception of the CTRL_SHUTDOWN_EVENT event in th console control handler. Thanks to Jan Kloetzke
Own Id: OTP-10228
Fix dtrace bug in file rename operation.
Own Id: OTP-10234
Fix bug in memory management of driver port data locks (PDL). In some cases PDLs could be deallocated before ready_async or async_free callback was called.
Own Id: OTP-10249
Improvements and New Features
Add port and suspend options to lock-counter profiling. (Thanks to Rick Reed)
Own Id: OTP-10051
Latency when using the active_once option in gen_tcp communication is reduced.
Own Id: OTP-10055 Aux Id: sto139
Remove bit8 option support from inet
Own Id: OTP-10056
The OS Pid of a port program is now available by calling erlang:port_info(Port,os_pid), Thanks to Matthias Lang for the original patch.
Own Id: OTP-10057
Fix openpty usage in run_erl.
Reopening a slave file descriptor which was closed earlier could lead to a misbehaving connection. This has now been remedied.
Own Id: OTP-10076
Remove all code, documentation, options and diagnostic functions which were related to the experimental hybrid heap implementation.
Own Id: OTP-10105
Optimizations of memory deallocations.
Own Id: OTP-10162 Aux Id: OTP-7775
Optimization of process locking.
Own Id: OTP-10163
Added a xcomp example file for powerpc-dso-linux-gnu
Own Id: OTP-10198
Detect when middle endian doubles are used by a platform and account for it when decoding floats. (Thanks to Mike Sperber)
Own Id: OTP-10209
1.21 Erts 5.9.1.2
Fixed Bugs and Malfunctions
On Linux systems using heart (erl -heart) and a HEAR_BEAT_TIMEOUT less than default, heart could fire even though Erlang was running fine after approx 298 to 497 days (depending on kernel config). This was due to the behaviour of the times(2) system call. Usage of times(2) is now replaced with clock_gettime(2) and the CLOCK_MONOTONIC clock, resulting in a more stable solution. The Erlang VM itself has used clock_gettime(2) on linux since before R12B, so this only affects the heart program.
Own Id: OTP-10111 Aux Id: seq12075
1.22 Erts 5.9.1.1
Fixed Bugs and Malfunctions
If threads support for the runtime system had been disabled at compile time (--disable-threads had been passed to configure), and the +A command line argument of erl was passed when starting the runtime system, driver_system_info() erroneously claimed that the runtime system had async threads even though it had not.
Due to this bug the file driver did not split tasks into smaller chunks, but instead completed the whole task at once, i.e., the scheduler got occupied with I/O for a longer time than intended.
Own Id: OTP-10059
Improvements and New Features
A proposal for a new scheduler wakeup strategy has been implemented. For more information see the documentation of the +sws command line argument of erl.
Own Id: OTP-10033 Aux Id: Seq12025
A switch for configuration of busy wait length for scheduler threads has been added. For more information see the documentation of the +sbwt command line argument of erl.
Own Id: OTP-10044 Aux Id: Seq11976
The extra memory barriers introduced by bug-fix OTP-9281 were unnecessarily used also on tables without the write_concurrency option enabled. This could unnecessarily degrade performance of ETS tables without write_concurrency on some hardware (e.g. PowerPC) while not effecting performance at all on other hardware (e.g. x86/x86_64).
OTP-9281 (R14B03): ETS tables using the write_concurrency option could potentially get into an internally inconsistent state.
Own Id: OTP-10048 Aux Id: OTP-9281
1.23 Erts 5.9.1
Fixed Bugs and Malfunctions
erlang:system_profile errorneous profiled the profiler process when observing runnable processes. This has been corrected.
Own Id: OTP-9849
Calling trace_info/2 asking for information about a function that had native could could crash the run-time system.
Own Id: OTP-9886
reduce smp locking time range in erts_garbage_collect (thanks to Jovi Zhang)
Own Id: OTP-9912
Fix typo in supervisor behaviour doc (Thanks to Ricardo Catalinas Jiménez)
Own Id: OTP-9924
Correct spelling of registered (Thanks to Richard Carlsson)
Own Id: OTP-9925
erts: Remove unused variable (Thanks to Jovi Zhang)
Own Id: OTP-9926
Fix bug in ETS with compressed option and insertion of term containing large integers (>2G) on 64-bit machines. Seen to cause emulator crash. (Thanks to Diego Llarrull for excellent bug report)
Own Id: OTP-9932
Handle Linux OS where /sys/devices/system/node is only readable by root. Fallback to /sys/devices/system/cpu for topology info.
Own Id: OTP-9978
Added check to inet driver to avoid building on operating systems that do not yet have IPv6 compatible socket API. (Thanks to Peer Stritzinger)
Own Id: OTP-9996
Fix bug when the number of CPUs actually found is lower than the configured value. (Thanks to Benjamin Herrenschmidt)
Own Id: OTP-10004
The runtime system without SMP support and without thread support erroneously busy waited when no work was present. This bug first appeared in erts-5.9.
Own Id: OTP-10019
Various typographical errors corrected in documentation for common_test, driver, erl_driver and windows installation instructions. (Thanks to Tuncer Ayaz)
Own Id: OTP-10037
Fix memory leak caused by race on exiting process
Own Id: OTP-10041
Improvements and New Features
Add erlang:statistics(scheduler_wall_time) to ensure correct determination of scheduler utilization. Measuring scheduler utilization is strongly preferred over CPU utilization, since CPU utilization gives very poor indications of actual scheduler/vm usage.
Own Id: OTP-9858
ERTS internal API improvements. In some cases the amount of atomic read operations needed have been reduced due to this.
Own Id: OTP-9922
Known Bugs and Problems
enif_make_copy may invalidate enif_inspect_binary.
Own Id: OTP-9828
1.24 Erts 5.9.0.1
Fixed Bugs and Malfunctions
A feature test for the lwsync instruction performed on PowerPC hardware at runtime system startup got into an eternal loop if the instruction was not supported. This bug was introduced in erts-5.9/OTP-R15B.
Own Id: OTP-9843
I/O events could potentially be delayed for ever when enabling kernel-poll on a non-SMP runtime system executing on Solaris. When also combined with async-threads the runtime system hung before completing the boot phase. This bug was introduced in erts-5.9/OTP-R15B.
Own Id: OTP-9844
1.25 Erts 5.9
Fixed Bugs and Malfunctions
A few contracts in the lists module have been corrected.
Own Id: OTP-9616
Fixed memory leak in enif_inspect_io_list_as_binary when applied on a process independent environment.
Own Id: OTP-9668
The number of beam catches allowed in code are no longer statically defined and will grow according to its need.
Own Id: OTP-9692
Add missing parenthesis in heart doc.
Add missing spaces in the Reference Manual distributed section.
In the HTML version of the doc those spaces are necessary to separate those words.
Own Id: OTP-9693
Fixes module erlang doc style: option description (Thanks to Ricardo Catalinas Jiménez)
Own Id: OTP-9697
Specifying a scope to binary:match/3 when using multiple searchstrings resulted in faulty return values. This is now corrected.
Own Id: OTP-9701
The runtime system crashed if more than one thread tried to exit the runtime system at the same time.
Own Id: OTP-9705
Fix documentation for erlang:process_flag/2
For the subsection about process_flag(save_calls, N) there's an unrelated paragraph about process priorities which was copied from the preceeding subsection regarding process_flag(priority, Level). (Thanks to Filipe David Manana)
Own Id: OTP-9714
Calls to erlang:system_flag(schedulers_online, N) and/or erlang:system_flag(multi_scheduling, block|unblock) could cause internal data used by this functionality to get into an inconsistent state. When this happened various problems occurred. This bug was quite hard to trigger, so hopefully no-one has been effected by it.
A spinlock used by the run-queue management sometimes got heavily contended. This code has now been rewritten, and the spinlock has been removed.
Own Id: OTP-9727
Use libdlpi to get physical address (Thanks to Trond Norbye)
Own Id: OTP-9818.
Own Id: OTP-7775
The ethread atomic memory operations API used by the runtime system has been extended and improved.
The ethread library now also performs runtime tests for presence of hardware features, such as for example SSE2 instructions, instead of requiring this to be determined at compile time.
All uses of the old deprecated atomic API in the runtime system have been replaced with the use of the new atomic API. In a lot of places this change imply a relaxation of memory barriers used.
Own Id: OTP-9014
enif_get_reverse_list function added to nif API. This function should be used to reverse small lists which are deep within other structures making it impractical to do the reverse in Erlang.
Own Id: OTP-9392
The deprecated concat_binary/1 BIF has been removed. Use list_to_binary or iolist_to_binary/1 instead.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-9421
Erlang/OTP can now be built using parallel make if you limit the number of jobs, for instance using 'make -j6' or 'make -j10'. 'make -j' does not work at the moment because of some missing dependencies.
Own Id: OTP-9451
Line number and filename information are now included in exception backtraces as a fourth element in the MFA tuple. The information will be pretty-printed by the shell and used by common_test to provide better indication of where a test case.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-9468
All binary constants used to be handled as heap binaries (i.e. the entire binary would be copied when sent to another process). Binary constants larger than 64 bytes are now refc binaries (i.e. the actual data in the binary will not be copied when sent to another process).
Own Id: OTP-9486
If a float and an integer is compared, the integer is only converted to a float if the float datatype can contain it. Otherwise the float is converted to an integer.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-9497
Add NIF function enif_is_number
This function allows for easily determining if a term represents or not a number (integer, float, small or big).(Thanks to Filipe David Manana)
Own Id: OTP-9629.
Own Id: OTP-9631.
Own Id: OTP-9632
Changed the internal BIF calling convention. Will make simpler faster code and allow BIFs with an arbitrary arity.
Own Id: OTP-9662
Windows native critical sections are now used internally in the runtime system on Windows as mutex implementation. This since they perform better under extreme contention than our own implementation.
Own Id: OTP-9671
Convert some erl_nif macros into inline functions. Allow for better compile time type checking. (Thanks to Tuncer Ayaz)
Own Id: OTP-9675
The +scl command line flag has been added. It can be used for disabling compaction of scheduler load. For more information see the erl(1) documentation.
Own Id: OTP-9695
The build system has been updated so that Erlang/OTP can be built on Mac OS X Lion systems without a GCC compiler. The INSTALL guide has been updated with instructions on how to install a GCC compiler and build Erlang/OTP with it, in order to get a run-time system with better performance.
Own Id: OTP-9712
When loading a module, the system use to run on a single scheduler during the entire loading process. This has been changed to only take down the system just before inserting the loaded code into the system tables, resulting in a much shorter disruption if a module is loaded in a busy system. (Suggested by Bob Ippolito.)
Own Id: OTP-9720
Possible to run HiPE without floating point exceptions (FPE). Useful on platforms that lack reliable FPE. Slower float operations compared to HiPE with FPE.
Own Id: OTP-9724
As of ERTS version 5.9 (OTP-R15B) the runtime system will by default not bind schedulers to logical processors.. Due to this, we change the default so that the user must make an active decision in order to bind schedulers.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-9726
The use of erlang:system_flag(scheduler_bind_type, _) and erlang:system_flag(cpu_topology, _) have been deprecated and scheduled for removal in erts-5.10/OTP-R16. For more information see the documentation of erlang:system_flag/2.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-9749
An ancient workaround for a Windows bug was removed from the open_port code, open_port({spawn,...}...) is now faster. Thanks to Daniel Goertzen.
Own Id: OTP-9766
The use of deprecated 32bit time_t on 32bit Windows is removed.
Own Id: OTP-9767
The NIF reload mechanism is deprecated. Do not use it as an upgrade method for live production systems. It might be removed in future releases. It can still serve as a development feature but a warning message will be logged each time it is used.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-9771
The driver interface has been changed to enable 64-bit aware drivers. Most importantly the return types for ErlDrvEntry callbacks 'call' and 'control' has ben enlarged which require drivers to be changed or they will cause emulator crashes. See Rewrites for 64-bit driver interface in the driver manual.
Due to this driver version management is now mandatory. A driver that is not written with version management or a driver that was compiled with the wrong major version will be not be loaded by the emulator.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-9795
Eliminate use of deprecated regexp module
Own Id: OTP-9810
1.26 Erts 5.8.5
Fixed Bugs and Malfunctions
Several bugs concerning constant binary constructions such as <<0:4294967295>> have been corrected. Depending on the actual size of the binary and the type of run-time system (32-bit, halfword, 64-bit), such expression could either crash the run-time system or make the loader refuse loading of the module.
Own Id: OTP-9284
The Erlsrv utility failed to stop the erlang machine if no StopAction was defined when the service was stopped. This is now corrected.
Own Id: OTP-9344
Due to a bug in glibc the runtime system could abort while trying to destroy a mutex. A fix for this was introduced in R14B02. This fix did, however, not solve the problem. The runtime system will now issue a warning instead of aborting.
Own Id: OTP-9373 Aux Id: OTP-9009
Replace atom in DRV macro in prim_file with string
An experimental version of Dialyzer discovered that the atom that replaced the DRV macro in prim_file ends up in calls to erlang:open_port({spawn, Driver}, Portopts) as the Driver argument. The documentation states that this call requires a string there.
This change is also consistent with the one introduced in commit 0f03b1e9d2bef3bc830c31a369261af4c5234727 by Kostis Sagonas.
Own Id: OTP-9377
Fix typos in the epmd documentation (Thanks to Holger Weiß )
Own Id: OTP-9387
Fix faulty integer terms created by NIF API from 64-bit integers on halfword emulator. (Thanks to Paolo Negri and Paul Davis)
Own Id: OTP-9394
Fix epmd crash on vxworks caused by faulty argument to select() system call.
Own Id: OTP-9427 Aux Id: seq11855
The ets:test_ms function could in rare cases truncate the error messages. This is now corrected.
Own Id: OTP-9435
Fix bug related to hibernate and HiPE (clear F_HIBERNATE_SCHED flag)
F_HIBERNATE_SCHED flag that was introduced in b7ecdcd1ae9e11b8f75e must be cleared in hipe_mode_switch as well. Otherwise, processes running HiPE code that hibernate, wake up and then trap into a BIF will not be rescheduled.(Thanks to Paul Guyot)
Own Id: OTP-9452
Fix bug in FreeBSD topology detection code (Thanks to Paul Guyot)
Own Id: OTP-9453
Fix use of logical operator && with constant operand instead of bitwise & (Thanks to Cristian Greco)
Own Id: OTP-9454
inet: error if fd does not match socket domain
If an IPv4 fd is opened as an IPv6 socket, unexpected behaviour can occur. For example, if an IPv4 UDP socket is opened and passed into Erlang as an IPv6 socket, the first 3 bytes (corresponding to 1 byte representing the protocol family, 2 bytes set to the port) are stripped from the payload. The cause of the UDP payload truncation happens in inet_drv.c:packet_inet_input when a call to inet_get_address fails silently because the family is set to PF_INET6 but the buffer len is the size of an IPv4 struct sockaddr_in.
(Thanks to Andrew Tunnell-Jones for finding the bug and the test case!)
Own Id: OTP-9455
erts: use a union to avoid strict aliasing issues
Use a union for pointer type conversion to avoid compiler warnings about strict-aliasing violations with gcc-4.1. gcc >= 4.2 does not emit the warning. erts: adapt matrix_nif to R14 erl_nif API changes (Thanks To Tuncer Ayaz)
Own Id: OTP-9487
fix 64-bit issues in the garbage collection (Thanks to Richard Carlsson)
Own Id: OTP-9488
epmd: fix compiler warnings
Suppress compiler warnings about ignored return values. (Thanks to Michael Santos )
Own Id: OTP-9500
Fix non-existing function (erlang:disconnect/1) in distributed reference manual (Thanks to Fabian Król)
Own Id: OTP-9504
Document fdatasync -lrt requirement (SunOS <= 5.10) (Thanks to Tuncer Ayaz)
Own Id: OTP-9512
Let epmd ignore empty ERL_EPMD_ADDRESS
If the environment variable ERL_EPMD_ADDRESS is set to the empty string, empd now behaves like it does by default when ERL_EPMD_ADDRESS is unset. That is, in this case, epmd now listens on all available interfaces instead of using only the loopback interface, which happened because epmd added the loopback address to the (in this case empty) list of addresses specified via ERL_EPMD_ADDRESS.
Also, epmd now ignores ERL_EPMD_ADDRESS if it contains only separator characters (comma and space).
The same applies to epmd's -address option.(Thanks to Holger Weiß)
Own Id: OTP-9525
Remove dead code in erl_compile (Thanks to Tuncer Ayaz)
Own Id: OTP-9527
Add erlang:external_size/2 BIF
This BIF's second parameter is a list of options. Currently the only allowed option is {minor_version, Version} where version is either 0 (default) or 1. (Thanks to Filipe David Manana )
Own Id: OTP-9528
Fix enif_compare on 64bits machines
In 64bits machines the Sint type has a size of 8 bytes, while on 32bits machines it has a 4 bytes size. enif_compare was ignoring this and therefore returning incorrect values when the result of the CMP function (which returns a Sint value) doesn't fit in 4 bytes. (Thanks to Filipe David Manana)
Own Id: OTP-9533
Implement or fix -Werror option
If -Werror is enabled and there are warnings no output file is written. Also make sure that error/warning reporting is consistent. (Thanks to Tuncer Ayaz)
Own Id: OTP-9536
In some rare cases we did not have a run queue when scheduling misc ops. This is now fixed.
Own Id: OTP-9537
Remove misc. compiler warnings
Own Id: OTP-9542
Erlang/OTP can now be built on MacOS X Lion.
Own Id: OTP-9547
XML files have been corrected.
Own Id: OTP-9550 Aux Id: OTP-9541
Fix potential errors inspired by running cppcheck(1) (Thanks to Christian von Roques)
Own Id: OTP-9557
When auxiliary work was enqueued on a scheduler, the wakeup of the scheduler in order to handle this work could be lost. Wakeups in order to handle ordinary work were not effected by this bug. The bug only effected runtime systems with SMP support as follows:
- Deallocation of some ETS data structures could be delayed.
- On Linux systems not using the NPTL thread library (typically ancient systems with kernel versions prior to 2.6) and Windows systems, the {Port, {exit_status, Status}} message from a terminating port program could be delayed. That is, it only effected port programs which had been started by passing exit_status as an option to open_port/2.
Own Id: OTP-9567
Handle rare race in the crypto key server functionality
Own Id: OTP-9586
Improvements and New Features
Types and specifications have been added.
Own Id: OTP-9356
New allocator strategy "address order first fit". May ease the emptying of memory carriers and thereby real release of memory back to the OS.
Own Id: OTP-9424
The new erlang:check_old_code/1 BIF checks whether a module has old code.
Own Id: OTP-9495
Update documentation and specifications of some of the zlib functions.
Own Id: OTP-9506
Detect the available CPUs on IRIX
Add support for querying the number of configured and online processors on SGI systems running IRIX.(Thanks to Holger Weiß)
Own Id: OTP-9531
1.27 Erts 5.8.4
Fixed Bugs and Malfunctions
Fix binary and iolist overflow problems. Typically problems arose in length calculation where the result would exceed (1 bsl 32 - 1).
Own Id: OTP-9118
Using the old erlang shell (i.e. erl instead on werl) on windows and doing several init:restart's would eventually hang the VM. That is no longer the case.
Own Id: OTP-9139
Removed recursive C code when printing Erlang terms to buffers, avoiding stack overflows that could cause VM to crash.
Own Id: OTP-9140
The send_timeout option in gen_tcp did not work properly in active mode or with {active,once} options. This is now corrected.
Own Id: OTP-9145
Fixed various typos across the documentation (Thanks to Tuncer Ayaz)
Own Id: OTP-9154
Remove duplicate stack entries which could occur after calling certain BIFs.
Own Id: OTP-9163
A race when starting two nodes simultaneously using run_erl has been removed.
Own Id: OTP-9164
Add documentation on .erlang processing back again (Thanks to Gabor Liptak)
Own Id: OTP-9189
Remove gratuitous paren in driver_entry(Thanks to Tuncer Ayaz)
Own Id: OTP-9192
Fix some wrong pointer dereferences (Thanks to Cristian Greco)
Own Id: OTP-9194
erts: Remove unused variables (Thanks to Tuncer Ayaz)
Own Id: OTP-9205
The documentation for init:get_args/0 has been removed. init:get_args/0 itself was deprecated in R9C and removed in R12B. (Thanks to Eric Pailleau.)
Own Id: OTP-9209
Allow user to specify the IP address epmd binds to
The IP address(es) epmd binds to can now be specified by the user, either via epmd's new "-address" option or (if that's not used) by setting the environment variable ERL_EPMD_ADDRESS. Multiple addresses may be specified using a comma-separated list. If the loopback address is not in this list, it will be added implicitly, so that the daemon can be queried by an interactive epmd process.(Thanks to Holger Weiß)
Own Id: OTP-9213
epmd: include host address in local access check. (Thanks to Michal Santos and Tom at diogunix.com)
Own Id: OTP-9214
Fix list returned by net_kernel:epmd_module
Function epmd_module of net_kernel returns a list instead of an atom, when the epmd_module-flag is used. (Thanks to Markus Knofe)
Own Id: OTP-9215
Fix epmd's dbg_perror() output
The dbg_perror() function now hands the current errno value over to dbg_gen_printf(). This fixes the problem that errno had been reset to zero by the time it was used (to print the corresponding error message) in the dbg_gen_printf() function. (Thanks to Holger Weiß)
Own Id: OTP-9223
heart: remove garbage appended to heart command
heart:get_cmd/0 is documented to return an empty string if the command is cleared. get_cmd/0 returns 2 extra bytes: 1 byte for the trailing null, 1 byte from the op (the op is an unsigned char and 2 bytes are allocated for it in the returned buffer). (Thanks to Michael Santos)
Own Id: OTP-9224
file: fix hang reading compressed files
The gzio driver goes into an infinite loop when reading past the end of a compressed file. Reported-By: Alex Morarash (Thanks to Michael Santos)
Own Id: OTP-9245
Eliminate alias warnings from gcc 4.5.2
Own Id: OTP-9250
Unsigned integer may overflow in error message (Thanks to Michael Santos)
Own Id: OTP-9251
Driver names should be strings, not atoms
Own Id: OTP-9253
driver_entry: Remove gratuitous paren and fix typo (Thanks to Tuncer Ayaz)
Own Id: OTP-9254
Fix format specifiers in erl_exit messages
Fix an error message by using an unsigned integer specifier as seen in a tweet by @metabrew: #erlang VM crashed with "no next heap size found: -2090496108, offset 0", suddenly allocated all available RAM
Also correct mis-typed string formats in bif.c.(Thanks to Michael Santos)
Own Id: OTP-9262
net_drv: remove unused tcp request id inet_drv: remove gratuitous assignment (Thanks to Tuncer Ayaz)
Own Id: OTP-9263
Teach run_erl RUN_ERL_DISABLE_FLOWCNTRL for disabling flow control
Flow control can cause unwanted behaviour of the beam process, if accidentally hit Ctrl-S (instead of Ctrl-D to detach) the entire beam may be blocked.
Fix this problem by making it possible to turn off flow control by setting the environment variable RUN_ERL_DISABLE_FLOWCNTRL. (Thanks to Jonas Faklkevik)
Own Id: OTP-9270
The following bugs due to missing memory barriers have been fixed:
ETS tables using the write_concurrency option could potentially get into an internally inconsistent state.
ETS tables using the ordered_set option could potentially get into an internally inconsistent state.
A number of memory barriers have been added when building with the libatomic_ops API (i.e. when passing --with-libatomic_ops=PATH to configure) and the tilera atomics API (i.e. when building for the tilera chip). Note that these bugs were due to erroneous usage of the APIs, and not in the implementations of the APIs. When using these APIs the following bugs where present:
The BIF erlang:ports/0 could return an erroneous result.
A thread blocking other threads during code loading, or setup of tracing could potentially read invalid data.
Fixation of ETS tables could potentially get into an internally inconsistent state.
Own Id: OTP-9281
Fix halfword bug for ETS ordered_set when doing select/match with partly bound key.
Own Id: OTP-9292
Fix bug in code:is_module_native that caused crash for deleted modules.
Own Id: OTP-9298
Calling driver_async_cancel() could cause a scheduler thread to enter an eternal loop doing no useful work. (Thanks to Anders Ramsell)
Own Id: OTP-9302
Improvements and New Features
New enif_is_exception function to allow NIFs to determine whether an ERL_NIF_TERM represents an exception. (Thanks to Steve Vinoski)
Own Id: OTP-9150
A process being garbage collected by another process could be scheduled on another scheduler. This prevented this scheduler from doing any useful work until the garbage collection was done. This either occurred due to a explicit call to the garbage_collect/1 BIF, or due to a garbage collection part of code loading. A process being garbage collected like this will now not be scheduled until the garbage collection has completed.
Own Id: OTP-9211
Remove unnecessary validation copy in prim_file:drv_command/3 (Thanks to Tony Rogvall)
Own Id: OTP-9276
Symbolic link handling on windows have been slightly updated to map error conditions more consequently and correctly read directory links created outside of the Erlang environment.
Own Id: OTP-9279
Halfword emulator memory handling improvements:
Much more of internal memory structures have been made able to use "high" memory and are no longer restricted to the 4Gb limit that still applies for all process heap data.
Fixed faulty values from erlang:memory() caused by 32-bit counter overflow.
New counter low in erlang:memory() that sums up all memory restricted by 4Gb limit.
Own Id: OTP-9291 Aux Id: seq11841
The value set in the undocumented and unsupported ERL_version_FLAGS (e.g. ERL_R14B03_FLAGS) environment variable can now be overridden by the command line (similar to ERL_AFLAGS).
Own Id: OTP-9297
1.28 Erts 5.8.3.2
Known Bugs and Problems
Fix halfword emulator bug in ets:select_delete for ordered_set that caused emulator to crash.
Own Id: OTP-9258 Aux Id: seq11836
1.29 Erts 5.8.3.1
Fixed Bugs and Malfunctions
Ets table type ordered_set could order large integer keys wrongly on pure 64bit platforms. This is now corrected.
Own Id: OTP-9181
The status of a process was unnecessarily set to waiting before a process was enqueued in a run queue. This bug was harmless up until OTP-R14B01. In OTP-R14B02 erlang:hibernate/3 was fixed (OTP-9125). After the introduction of OTP-9125, the previously harmless process status bug sometimes caused erroneous badarg exceptions from process_info().
OTP-9125 also introduced a thread unsafe access to the status field of a process which now also have been fixed.
*** INCOMPATIBILITY with noxs ***
Own Id: OTP-9197
1.30 Erts 5.8.3
Fixed Bugs and Malfunctions
The scroll wheel now scrolls the werl window on Windows.
Own Id: OTP-8985
Some malformed distribution messages could cause VM to crash, this is now corrected.
Own Id: OTP-8993
The OS function getifaddrs() can return NULL in some address fields for e.g PPP and tunnel devices which caused the emulator to segfault. This bug has now been corrected.
Own Id: OTP-8996
The expression <<A:0>> would always produce an empty binary, even if A was not an integer. Corrected to cause a badarg exception if the type of A is invalid. (Thanks to Zvi.)
Own Id: OTP-8997
A bug that potentially could cause an emulator crash when deleting an ETS-table has been fixed. A resource leak when hitting the maximum amount of ETS-tables allowed has also been fixed.
Own Id: OTP-8999
A bug in the exit/2 BIF could potentially cause an emulator crash.
Own Id: OTP-9005
Due to a bug in glibc the runtime system could abort while trying to destroy a mutex. The runtime system will now issue a warning instead of aborting.
Own Id: OTP-9009
A bug in epmd could create strange behaviour when listen() calls failed. This is now corrected thanks to Steve Vinoski.
Own Id: OTP-9024
When setting file_info the win32_driver will now correctly set access and modified time. Previously these entities were swapped.
Own Id: OTP-9046
Setting scheduler bind type to unbound failed if binding of schedulers wasn't supported, or if CPU topology wasn't present. This even though the documentation stated that it is possible to set the bind type to unbound.
Own Id: OTP-9056 Aux Id: Seq11779
Two problems were fixed in crash dump: The time left for timers are now shown as unsigned integers and the contents of ordered_set ETS tables is no longer included.
Own Id: OTP-9057
The VM could fail to set IP_TOS and SO_PRIORITY in certain situations, either because sockets were supplied as open file descriptors, or because SO_PRIORITY by default was set higher than the user can explicitly set it to. Those situations are now handled.
Own Id: OTP-9069
Wx on MacOS X generated complains on stderr about certain cocoa functions not beeing called from the "Main thread". This is now corrected.
Own Id: OTP-9081
Fix a couple typos in driver_entry(3) (thanks to Tuncer Ayaz).
Own Id: OTP-9085
Mention that "-detached" implies "-noinput"
Clarify that specifying "-noinput" is unnecessary if the "-detached" flag is given. (thanks to Holger Weiß)
Own Id: OTP-9086
A potential problem (found by code inspection) when calling a fun whose code was not loaded has been fixed.
Own Id: OTP-9095
The emulator could get into a state where it didn't check for I/O.
Own Id: OTP-9105 Aux Id: Seq11798
Attempting to create binaries exceeding 2Gb (using for example term_to_binary/1) would crash the emulator with an attempt to allocate huge amounts of memory. (Thanks to Jon Meredith.)
Own Id: OTP-9117
Fix erlang:hibernate/3 on HiPE enabled emulator (Thanks to Paul Guyot)
Own Id: OTP-9125
Improvements and New Features
From this release, the previously experimental halfword emulator is now official. It can be enabled by giving the --enable-halfword-emulator option to the configure script.
The halfword emulator is a 64-bit application, but uses halfwords (32-bit words) for all data in Erlang processes, therefore using less memory and being faster than the standard 64-bit emulator. The total size of all BEAM code and all process data for all processes is limited to 4Gb, but ETS tables and off-heap binaries are only limited by the amount of available memory.
Own Id: OTP-8941
32-bit atomic memory operations have been introduced internally in the run time system, and are now used where appropriate. There were previously only atomic memory operations of word size available. The 32-bit atomic memory operations slightly reduce memory consumption, and slightly improve performance on 64-bit runtime systems.
Own Id: OTP-8974
Performance enhancements for looking up timer-entries and removing timers from the wheel.
Own Id: OTP-8990
Write accesses to ETS tables have been optimized by reducing the amount of atomic memory operations needed during a write access.
Own Id: OTP-9000
Strange C coding in the VM made the -D_FORTIFY_SOURCE option to gcc-4.5 react badly. The code is now cleaned up so that it's accepted by gcc-4.5.
Own Id: OTP-9025
The memory footprint for loaded code has been somewhat reduced (especially in the 64-bit BEAM machine).
Own Id: OTP-9030.31 Erts 5.8.2
Fixed Bugs and Malfunctions
Fix format_man_pages so it handles all man sections and remove warnings/errors in various man pages.
Own Id: OTP-8600
The configure command line argument --enable-ethread-pre-pentium4-compatibility had no effect. This option is now also automatically enabled if required on the build machine.
Own Id: OTP-8847
The HiPE run-time in the 64-bit emulator could do a 64-bit write to a 32-bit struct field. It happened to be harmless on Intel/AMD processors. Corrected. (Thanks to Mikael Pettersson.)
Own Id: OTP-8877
A bug in erl_drv_tsd_get() and enif_tsd_get() could cause an emulator crash. These functions are currently not used in OTP. That is, the crash only occur on systems with user implemented NIF libraries, or drivers that use one of these functions.
Own Id: OTP-8889
Calling erlang:system_info({cpu_topology, CpuTopologyType}) with another CpuTopologyType element than one of the documented atoms defined, detected, or used caused an emulator crash. (Thanks to Paul Guyot)
Own Id: OTP-8914
The ERTS internal rwlock implementation could get into an inconsistent state. This bug was very seldom triggered, but could be during heavy contention. The bug was introduced in R14B (erts-5.8.1).
The bug was most likely to be triggered when using the read_concurrency option on an ETS table that was frequently accessed from multiple processes doing lots of writes and reads. That is, in a situation where you typically don't want to use the read_concurrency option in the first place.
Own Id: OTP-8925 Aux Id: OTP-8544
Tracing to port could cause an emulator crash when unloading the trace driver.
Own Id: OTP-8932
Removed use of CancelIoEx on Windows that had been shown to cause problems with some drivers.
Own Id: OTP-8937
The fallback implementation used when no native atomic implementation was found did not compile. (Thanks to Patrick Baggett, and Tuncer Ayaz)
Own Id: OTP-8944
Some integer values used during load balancing could under rare circumstances wrap causing a load unbalance between schedulers.
Own Id: OTP-8950
The windows VM now correctly handles appending to large files (> 4GB).
Own Id: OTP-8958
Name resolving of IPv6 addresses has been implemented for Windows versions that support it. The use of ancient resolver flags (AI_V4MAPPED | AI_ADDRCONFIG) to the getaddrinfo() function has been removed since e.g FreeBSD regard mapped IPv4 addresses to be a security problem and the semantics of the address configured flag is uncertain.
Own Id: OTP-8969
Improvements and New Features
The help texts produced by the configure scripts in the top directory and in the erts directory have been aligned and cleaned up.
Own Id: OTP-8859
When the runtime system had fewer schedulers than logical processors, the system could get an unnecessarily large amount reader groups.
Own Id: OTP-8861
run_rel has been updated to support Solaris's /dev/ptmx device and to load the necessary STREAMS modules so that to_erl can provide terminal echo of keyboard input. (Thanks to Ryan Tilder.)
Own Id: OTP-8878
Buffer overflows have been prevented in erlc, dialyzer, typer, run_test, heart, escript, and erlexec.(Thanks to Michael Santos.)
Own Id: OTP-8892
The runtime system is now less eager to suspend processes sending messages over the distribution. The default value of the distribution buffer busy limit has also been increased from 128 KB to 1 MB. This in order to improve throughput.
Own Id: OTP-8901
The distribution buffer busy limit can now be configured at system startup. For more information see the documentation of the erl +zdbbl command line flag. (Thanks to Scott Lystig Fritchie)
Own Id: OTP-8912
The inet driver internal buffer stack implementation has been rewritten in order to reduce lock contention.
Own Id: OTP-8916
New ETS option compressed, to enable a more compact storage format at the expence of heavier table operations. For test and evaluation, erl +ec can be used to force compression on all ETS tables.
Own Id: OTP-8922 Aux Id: seq11658
Support for detection of CPU topology and binding of schedulers on FreeBSD 8 have been added. (Thanks to Paul Guyot)
Own Id: OTP-8939
Several bugs related to hibernate/3 and HiPE have been corrected. (Thanks to Paul Guyot.)
Own Id: OTP-8952
Support for soft and hard links on Windows versions and filesystems that support them is added.
Own Id: OTP-8955
The win32 virtual machine is now linked large address aware. his allows the Erlang VM to use up to 3 gigs of address space on Windows instead of the default of 2 gigs.
Own Id: OTP-8956
1.32 Erts 5.8.1.2
Fixed Bugs and Malfunctions
Fix that the documentation top index generator can handle an Ericsson internal application group.
Own Id: OTP-8875.33 Erts 5.8.1.1
Fixed Bugs and Malfunctions
1.34 Erts 5.8.1
Fixed Bugs and Malfunctions
Very small floating point numbers generated errors when converting from list to float in some versions of the VM, this is now corrected so that i.e. list_to_float("1.0e-324"). returns 0.0 in all versions of Erlang.
Own Id: OTP-7178
Windows Vista and Windows 7 file system virtualization, which makes "old style" windows programs execute in a file system sandbox, was previously unintentionally turned on for the Erlang VM. This is now corrected so that i.e. writes to C:\Program Files\. without administrator privileges will fail.
Own Id: OTP-7405
Fix faulty 64-bit integer term output from drivers. Large 64-bits integers did not generate correct bignums and could even cause emulator crash. Only affects drivers using ERL_DRV_INT64 or ERL_DRV_UINT64, introduced in R13B03.
Own Id: OTP-8716
Fixed: inet:setopts(S, [{linger,{true,2}}]) returned {error,einval} for SCTP sockets. The inet_drv had a bug when checking the option size.
Own Id: OTP-8726 Aux Id: seq11617
Fix libm linking with --as-needed flag
When building with "--as-needed" linker flags on Linux the build will fail. This has now been fixed.
(Thanks to Christian Faulhammer)
Own Id: OTP-8728
gen_udp:connect/3 was broken for SCTP enabled builds. It did not detect remote end errors as it should.
Own Id: OTP-8729
Reduce the risk of integer wrapping in bin vheap size counting.
The vheap size series will now use the golden ratio instead of doubling and fibonacci sequences.
Own Id: OTP-8730
ETS ordered_set containing [] as key could cause strange thing to happen, like an infinite hanging ets:select.
Own Id: OTP-8732
reference() has been substituted for ref() in the documentation.
Own Id: OTP-8733
When a native compiled module called a not loaded non-native compiled module that had an on_load function, the export entries were trashed after code loading so on the next call from the native compiled module to the non-native compiled the emulator crashed. This bug has now been fixed.
Own Id: OTP-8736
HiPE-enabled Erlang VMs running on BSD systems sometimes generated messages like "Yikes! erts_alloc() returned misaligned address 0x8016a512c". Fixed. (Thanks to Mikael Pettersson.)
Own Id: OTP-8769
A race condition in erts_poll() could cause delay of poll for I/O.
Own Id: OTP-8773
Removed some potential vulnerabilities from the Erlang Port Mapper Daemon (epmd) and straightened up access control. Also removed hazardous interfaces allowing anyone on a machine to forcefully unregister other nodes. This means that the ei_unregister/erl_unregister interfaces in erl_interface is rendered not only error prone and mystifying as before, but totally ineffective. The old behaviour of unchecked node unregistering can be restored if needed, see epmd documentation for details.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-8780
Building in a source tree without prebuilt platform independent build results failed on the SSL examples when:
- cross building. This has been solved by not building the SSL examples during a cross build.
- building on Windows.
Own Id: OTP-8791
inet:getsockopt for SCTP sctp_default_send_param had a bug to not initialize required feilds causing random answers. It is now corrected.
Own Id: OTP-8795 Aux Id: seq11655
The hipe_bifs:get_hrvtime/0 BIF now always returns a real value even if the "perfctr" Linux kernel extension is not available. It used to return a dummy value. (Thanks to Mikael Pettersson.)
Own Id: OTP-8798
Calling a native-code compiled module with an on_load function could cause a crash. (Thanks to Mikael Pettersson.)
Own Id: OTP-8799
The emulator could crash while writing a crash dump if native-compiled modules had been loaded. (Thanks to Paul Guyot.)
Own Id: OTP-8801
The garbage collector could crash if invoked from native-compiled code after a call to a BIF. (Thanks to Paul Guyot.)
Own Id: OTP-8821
A rare memory leak in binary:matches is removed
Own Id: OTP-8823
ets:select_reverse/{1,2,3} are now documented.
Own Id: OTP-7863
External format of integers changed to make full use of all 32 bits of INTEGER_EXT. This is a compatible change as old code can read full 32-bit integers but only produce 28-bit integers as INTEGER_EXT.
Own Id: OTP-8540 Aux Id: seq11534
erlang:localtime_to_universaltime({{2008, 8, 1}, {0, 0, 0}},true) when TZ=UTC now behaves consistently on all Unix platforms.
The problem fixed was originally reported by Paul Guyot on erlang-bugs mailing list:
Own Id: OTP-8580
Optimization reducing memory consumption by two words per ETS object.
Own Id: OTP-8737
Fixes for unsupported halfword-emulator
Own Id: OTP-8745
NIF 64-bit integer support; enif_get_int64, enif_get_uint64, enif_make_int64, enif_make_uint64.
Own Id: OTP-8746
Alignment of trailing data in messages has been adjusted. This in order to be able to pass data of any type as trailing data in the future.
Own Id: OTP-8754
The obsolete/driver.h header file has been removed. It has been obsolete and deprecated since R8B. Drivers that still include obsolete/driver.h must be updated to include erl_driver.h.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-8758
Further lessened the memory requirements of ETS objects.
Own Id: OTP-8762
The broken elib_malloc alternate memory allocator has been removed. erlang:system_info(elib_malloc) will always return false, and in R15, erlang:system_info(elib_malloc) will fail with a badarg exception.
Own Id: OTP-8764
Calling erlang:system_info/1 with the new argument update_cpu_info will make the runtime system reread and update the internally stored CPU information. For more information see the documentation of erlang:system_info(update_cpu_info).
The CPU topology is now automatically detected on Windows systems with less than 33 logical processors. The runtime system will now, also on Windows, by default bind schedulers to logical processors using the default_bind bind type if the amount of schedulers is at least equal to the amount of logical processors configured, binding of schedulers is supported, and a CPU topology is available at startup.
Own Id: OTP-8765
The SMP ERTS internal child waiter thread used on Linux system with NPTL was unintentionally disabled during cross compilation rewrites (OTP-8323 in R13B03). It has now been re-enabled. Enabling it again gives a slight performance improvement.
Own Id: OTP-8774
epmd used to generate a message to the syslog when it started up, which could be annoying. This has been changed to only generate the message if the debug swith is given. (Thanks to Michael Santos.)
Own Id: OTP-8775
The scheduler wakeup threshold is now possible to adjust at system boot. For more information see the +swt command line argument of erl.
Own Id: OTP-88
Optimizations for MIPS when using gcc atomics. (Thanks to Steve Vinoski)
Own Id: OTP-8834
Lock optimization in timer functionality.
Own Id: OTP-8835
Known Bugs and Problems
Fix epmd and build environment to build on VxWorks
Own Id: OTP-8838
1.35 Erts 5.8
Fixed Bugs and Malfunctions
Driver threads, such as async threads, using port data locks peeked at the port status field without proper locking when looking up the driver queue.
Own Id: OTP-8475
The use of mmap() was unnecessarily disabled when cross compiling.
The configure arguments --with-ssl, and --with-odbc refused to accept libraries outside of $erl_xcomp_sysroot when cross compiling for no good reason.
The configure argument --with-odbc didn't handle the value yes correct.
The configure arguments --with-odbc, and --without-odbc have also been added to the configure help.
(Thanks to Steve Vinoski for reporting these issues)
Own Id: OTP-8484
The runtime system crashed if fewer logical processors were found than reported by sysconf( SC_NPROCESSORS_CONF).
Own Id: OTP-8549
Fix memory management bug causing crash of non-SMP emulator with async threads enabled. The bug did first appear in R13B03.
Own Id: OTP-8591 Aux Id: seq11554
Port locks could be prematurely destroyed.
Own Id: OTP-8612
The empd program could loop and consume 100% CPU time if an unexpected error ocurred in listen() or accept(). Now epmd will terminate if a non-recoverable error occurs. (Thanks to Michael Santos.)
Own Id: OTP-8618
When kernel poll has been enabled, a livelock could in rare circumstances occur. Problem reported by Chetan Ahuja, fix by Mikael Pettersson.
Own Id: OTP-8632
Windows: Closing port of program that stalled without reading all data could deadlock scheduler thread.
Own Id: OTP-8641
On some combination of Montavista Linux on Cavium Octeon processors, some socket-related system calls returned other numbers than -1 for errors. This caused a core dump in inet_drv.c. Now the code works around this problem.
Own Id: OTP-8654
Missing memory barriers in erts_poll() could cause the runtime system to hang indefinitely.
Own Id: OTP-8658
ethr_rwmutex_tryrlock() acquired and refused to acquire a lock with inverted logic. The lock was however never acquired in a thread unsafe manner. (Thanks to JR Zhang for noting this issue)
Own Id: OTP-8662
Extreme combinations of register/unregister in a highly parallell SMP application could crash the VM. The error is corrected.
Own Id: OTP-8663
On Windows, files are now opened with FILE_SHARE_DELETE to get closer to Unix semantics.
Own Id: OTP-8667
erlang:system_info(multi_scheduling) sometimes erroneously returned enabled when it should have returned blocked.
Own Id: OTP-8675
Fix bug causing erlang:decode_packet and enif_make_string to generate faulty strings with negative character values for ascii values larger than 127. (Thanks to Paul Guyot)
Own Id: OTP-8685
open_port/2 with the spawn and spawn_executable options can include an {env,Env} option. In some cases unsetting variables would not work on Unix (typically if more variables were unset than were actually present in the environment).
Own Id: OTP-8701
A user defined CPU topology set via a call to erlang:system_flag(cpu_topology, CPUTopology) was not properly verified, and could in worst case cause an emulator crash. The emulator crash could only occur when a user defined CPU topology already existed and was redefined.
Own Id: OTP-8710
Improvements and New Features
The grammar for match specifications in ERTS users guide only described the tracing dialect of match specifications. An informal grammar for the ETS dialect is added.
Own Id: OTP-8086 Aux Id: seq11333
The module binary from EEP31 (and EEP9) is implemented.
Own Id: OTP-8217
New NIF API function enif_make_new_binary
Own Id: OTP-8474
The guard BIF is_boolean/1 (introduced in R10B) has now been included in the lists of BIFs allowed in guards in the Reference Manual.
Own Id: OTP-8477 regular expression with many levels of parenthesis could cause a buffer overflow. That has been corrected. (Thanks to Michael Santos.)
Own Id: OTP-8539
erlang:decode_packet(httph_bin,..) could return corrupt header strings or even crash the VM. This has been fixed. It only happened on 32-bit VM if the header name was unknown and between 16 and 20 characters long. Sockets with simular packet option did not suffer from this bug.
Own Id: OTP-8548)
And some incompatible changes made to the API. For more information see the warning text in erl_nif(3).
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-8555
If the 'fop' program (needed for building PDF files) cannot not be found, it is now possible to build the HTML and man pages anyway (there will also be dummy PDF files with no real content created). (Thanks to Tuncer Ayaz.)
Own Id: OTP-8559
When defining macros the closing right parenthesis before the dot is now mandatory.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-8562
A bug in re that could cause certain regular expression matches never to terminate is corrected. (Thanks to Michael Santos and Gordon Guthrie.)
Own Id: OTP-8589
The erlang:open_port spawn and spawn_executable directives can include an {env,Env} directive to set up environment variables for the spawned process. A bug prevented applications from using {env,Env} to set an environment variable whose value ended with a '=' (equal sign) character; the trailing equal sign was mistaken as an indication that an environment variable was to be cleared from the environment of the spawned process. (Thanks to Steve Vinoski.)
Own Id: OTP-8614 functions file:advise/4 and file:datasync/1 have been added. (Thanks to Filipe David Manana.)
Own Id: OTP-8637
New NIF API functions: enif_make_atom_len, enif_make_existing_atom_len, enif_make_string_len, enif_get_atom_length, enif_get_list_length, enif_is_list, enif_is_tuple (by Tuncer Ayaz)
Own Id: OTP-8640
Support for using gcc's built-in functions for atomic memory access has been added. This functionallity will be used if available and no other native atomic implementation in ERTS is available.
Own Id: OTP-8659
The number of spinlocks used when implementing atomic fall-backs when no native atomic implementation is available has been increased from 16 to 1024.
Own Id: OTP-8660
Writer preferred pthread read/write locks has been enabled on Linux.
Own Id: OTP-8661.. If this is the case you, are are advised to unbind the schedulers using the +sbtu command line argument, or by invoking erlang:system_flag(scheduler_bind_type, unbound).
Own Id: OTP-8666
There is a new option 'exclusive' to file:open/2 that uses the OS O_EXCL flag where supported to open the file in exclusive mode.
Own Id: OTP-8670
Now, binary_to_term/2 is auto-imported. This will cause a compile warning if and only if a module has got a local function with that name.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-8671
Alignment of scheduler data and run queues were adjusted.
Own Id: OTP-8673
Call time breakpoint tracing
- Introduce a call_time option to erlang:trace_pattern/3.This option enables call time breakpoint tracing on code that is executed by processes with call tracing enabled. Call time tracing stores the number of calls and the time spent of each function with this trace pattern enabled. The information can be retrieved with erlang:trace_info/2
- Add a scheduler array for BpData. To solve the issue of multiple schedulers constantly updating the head pointer to the bp data wheel, each scheduler now has its own entrypoint to the wheel. This head pointer can be updated without a locking being taken.
Teach call count tracing to use atomics
- Call count previously used a global lock for accessing and writing its counter in the breakpoint. This is now changed to atomics instead.
- The change will let call count tracing and cprof to scale better when increasing the number of schedulers.
Own Id: OTP-8677.36 Erts 5.7.5.2
Known Bugs and Problems
1.37 Erts 5.7.5.1
Fixed Bugs and Malfunctions
Driver threads, such as async threads, using port data locks peeked at the port status field without proper locking when looking up the driver queue.
Own Id: OTP-8475
Fix memory management bug causing crash of non-SMP emulator with async threads enabled. The bug did first appear in R13B03.
Own Id: OTP-8591 Aux Id: seq11554
1.38 Erts 5.7.5
Fixed Bugs and Malfunctions
Fix binary_to_term crash on compressed term with corrupt size field.
Own Id: OTP-8336
Processes and/or ports could get stuck on a blocked scheduler when erlang:system_flag(multi_scheduling, block) was used.
Processes and/or ports could get stuck on an offline scheduler when schedulers online were reduced using erlang:system_flag(schedulers_online, SchedulersOnline).
Own Id: OTP-8342
Building on Windows will now work if the paths to mc.exe and rc.exe contain spaces. The README.win32 file has been updated with some information about building using Visual Studio 2008. (Thanks to Andrew Thompson.)
Own Id: OTP-8345
EPMD now correctly handles the extra data field which can be given in the ALIVE2_REQ request and retrieved in the PORT2_RESP response. (Thanks to Klas Johansson.)
Own Id: OTP-8361
The configure test for reliable floating point exceptions has been update to work on modern versions of Mac OS X. (Thanks to Trannie Carter.)
Own Id: OTP-8368
ERTS makefiles used to detect the use of a gcc C compiler by checking if CC equaled gcc. That is, the makefiles failed to detect gcc C compilers with other command line names than gcc. `configure' now substitute GCC into the makefiles. If CC is a gcc C compiler, GCC will have the value yes. (Thanks to Jean-Sébastien Pédron)
Own Id: OTP-8373
ETS bug causing the memory counter from ets:info for ordered_set's to sometimes get out of synch and absurdly high.
Own Id: OTP-8377 Aux Id: seq11442
Immediately repeated multi-scheduling block/unblock cycles using erlang:system_flag(multi_scheduling, block | unblock) could deadlock the runtime system.
Own Id: OTP-8386
Fix processes in exiting status that are about to be scheduled, to not be allowed to garbage collect.
Own Id: OTP-8420
Removed bogus "\011" character sequence in documentation.
Own Id: OTP-8422
The re module: A regular expression with an option change at the start of a pattern that had top-level alternatives could cause overwriting and/or a crash. (Thanks to Michael Santos.)
Own Id: OTP-8438
Harmless buffer overflow by one byte in asn1 and ram_file_drv.
Own Id: OTP-8451
Improvements and New Features
Improved GC performance after BIF/NIF call when a lot of heap fragments was created. This will mainly benefit NIFs that return large compound terms.
Own Id: OTP-8240
Incompatible changes in the experimental NIF feature.
- Changed the NIF function prototypes in order to allow more than 3 function arguments.
- enif_get_data renamed as enif_priv_data.
- enif_make_string got a third argument for character encoding.
- The return value of erlang:load_nif/2 on error changed.
Read more in the documentation of erl_nif and erlang:load_nif/2.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-8304
NIF improvements:
- Driver API for multi-threading made available for NIFs.
- Support for mempory managed (garbage collected) resource objects. A way to pass "pointers" to native data structures between C and Erlang in a safe way.
- Support for references, floats and term comparison.
- Various new functions, like enif_inspect_iolist_as_binary, enif_make_sub_binary, enif_get_string, enif_get_atom, enif_make_tuple_from_array, enif_make_list_from_array, enif_make_existing_atom.
Own Id: OTP-8335
Minor alignment adjustments of scheduler specific data.
Own Id: OTP-8341
There is new erlang:binary_to_term/2 BIF that takes an option list. The option safe can be used to prevent creation of resources that are not garbage collected (such as atoms). (Thanks to Jayson Vantuyl.)
Own Id: OTP-8367
The default settings for garbage collection of binaries has been adjusted to be less aggressive than in R13B03. It is now also possible configure the settings for binary GC. See the documentation for spawn_opt/2-5, erlang:system_info/1, erlang:system_flag/2, process_flag/2-3, erlang:trace/3, and the documenation for erl for the new command line options +hms and +hmbs.
Own Id: OTP-8370
A bug causing memory corruption in re:run() has been corrected. (Thanks to Yamashina Hio.)
Own Id: OTP-8375
The -Werror option for erlc and the compiler option warnings_as_errors will cause warnings to be treated as errors. (Thanks to Christopher Faulet.)
Own Id: OTP-8382
An unnecessary lock operation in os:timestamp/0 has been eliminated, making it slightly more efficient. (Thanks to Jonas Falkevik and Tuncer Ayaz.)
Own Id: OTP-8390
There is a new +t emulator option for changing the maximum number of atoms. (Thanks to Julien Barbot.)
Own Id: OTP-8405
Fixed numerous compiler warnings generated by gcc 4.4.1 and tile-cc 2.0.1.78377 when compiling the runtime system.
Own Id: OTP-8412
configure learned the option --enable-m32-build to force the building of a 32-bit run-time on systems where the default C compiler generates 64-bit executables by default.
Own Id: OTP-8415
HiPE now works in the 64-bit emulator on Mac OS X. (Thanks to Geoff Cant.)
Own Id: OTP-8416
Improved handling of symbolic links to escripts
Own Id: OTP-8417
Removed spurious options to the emulator from escript.
Own Id: OTP-8427
Minor documentation fixes. Mainly anchor adjustments.
Own Id: OTP-8457
1.39 Erts 5.7.4
Fixed Bugs and Malfunctions
An insufficient stack allocation was made when reading CPU information on BSD operating systems. (Thanks Michael Turner and Akira Kitada)
Own Id: OTP-8207
A bug when supplying an argument without a dash directly after the program name when starting erlang could prevent distribution to start. This is now corrected.
Own Id: OTP-8209
A ticker process could potentially be blocked indefinitely trying to send a tick to a node not responding. If this happened, the connection would not be brought down as it should.
Own Id: OTP-8218
Using certain firewalls (i.e. MS IAS Client and certain versions of COMODO) could expose an undocumented behaviour in the Win32 socket interface causing the name resolution calls to hang infinitely. This is now worked around by adding possibilities for port programs under Windows to use overlapped I/O on their standard input/output file handles.
Own Id: OTP-8230
Fixed bug on ETS tables with write_concurrency. The emulator could crash when doing a select or match with a bound key without finding any object.
Own Id: OTP-8242
The information-request / information-response, and group-leader-change-request / group-leader-changed-response signal pairs described below did not always adhere to the signal order guarantees of Erlang's signal model in the runtime system with SMP support. These signals could for example sometimes pass exit signals.
The following BIFs behaviors can be modeled as if an asynchronous information-request signal is sent to Pid. If Pid is alive, it responds with an asynchronous information-response signal; otherwise, the runtime system responds with a no-such-process signal. When the response is received, the caller transforms it into the result of the BIF.
- is_process_alive(Pid)
- erlang:process_display(Pid, Type)
- process_info(Pid)
- process_info(Pid, ItemSpec)
When Pid resides on the same node as the caller of group_leader(GroupLeader, Pid), the group_leader/2 BIFs behavior can be modeled as if an asynchronous group-leader-change-request signal is sent to Pid. If Pid is alive, it responds with an asynchronous group-leader-changed-response signal; otherwise, the runtime system responds with a no-such-process signal. When the response is received, the caller transforms it into the result of the BIF. The distributed case which only consists of an asynchronous group-leader-change-request signal and no response is not effected.
Own Id: OTP-8245
Errors in the system_profile documentation has been corrected.
Own Id: OTP-8257
Low watermark socket option modified high watermark instead of low watermark in the inet_driver. (Thanks to Feng Yu and Tuncer Ayaz)
Own Id: OTP-8279
A race condition could cause the runtime system with SMP support to end up in a completely unresponsive state.
Own Id: OTP-8297
Improvements and New Features
The use of pthread_cond_timedwait() have been completely removed from the runtime system. This since its behavior is unpredictable when the system clock is suddenly changed. The previous use of it was harmless.
Own Id: OTP-8193
The documentation is now built with open source tools (xsltproc and fop) that exists on most platforms. One visible change is that the frames are removed.
Own Id: OTP-8201.
Own Id: OTP-8202
The ErlDrvTermData term types used by driver_output_term() and driver_send_term() have been extended with the term types ERL_DRV_INT64, and ERL_DRV_UINT64 for passing 64-bit integers. Also the 64-bit integer data types ErlDrvSInt64 and ErlDrvUInt64 have been introduced.
For more information see the erl_driver(3) documentation.
Own Id: OTP-8205
The instruction for building OTP on Windows was outdated and incomplete, the document is updated.
Also the otp_build script required windows drives to show up in Cygwin using the /cygdrive prefix. That requirement is now removed.
Own Id: OTP-8219
A module can have native implemented functions (NIFs) that are dynamically loaded by calling erlang:load_nif/2. This is an experimental feature that is not yet intended for production systems. It is released with intention to get some early feedback on the interfaces before they are carved in stone.
Own Id: OTP-8220
The float/1 BIF would always force a garbage collection. The BIFs size/1, byte_size/1, bit_size/1, abs/1, and round/1 would force a garbage-collection if the result was not a sufficiently small integer.
Own Id: OTP-8221
The erlang:port_command/3 BIF has been added. erlang:port_command/3 is currently not auto imported, but it is planned to be auto imported in OTP R14. For more information see the erlang(3) documentation.
Own Id: OTP-8225
'configure --enable-darwin-64bit' would fail if Snow Leopard had been booted with the 64-bit kernel. (Thanks to Ryan M. Graham.)
Own Id: OTP-8236
1.40 Erts 5.7.3
Fixed Bugs and Malfunctions
On Windows, open_port({spawn,Command},Opts) could not run executables with spaces in the path or filename, regardless of quoting efforts. While open_port({spawn_executable,Exec},Opts) can run any executable, it was still impossible to use 'spawn' to do the same thing. This is now corrected.
Own Id: OTP-8055
The scheduler bind type processor_spread spread schedulers too much on large NUMA systems.
The new scheduler bind type spread spreads schedulers as much as possible, and behaves as processor_spread previously did. For more information see the documentation of the +sbt command line argument in the erl(1) documentation, and the documentation of erlang:system_flag(scheduler_bind_type, SchedulerBindType).
Own Id: OTP-8063
Automatically detected CPU topology on Linux system could erroneously contain logical processors with -1 as identifiers. This happened when sysconf(_SC_NPROCESSORS_CONF) returned a value larger than the amount of logical processors found.
Own Id: OTP-8064
When the minimal term [] (end of list) was sent as the complete message to a process on another node, and received there, it could not be decoded. This bug is now corrected. Fortunately [] is uncommon as the complete message in real applications but it is a serious bug anyway.
Own Id: OTP-8092
A bug when the floating point exception pointer was not initialized has been corrected. It manifested itself on CentOS 5.1 sometimes when a floating point value was sent to a remote node. Bug reported and patch suggested by David Reiss, confirmed by Mikael Pettersson.
Some build problems on IRIX was also corrected. Problem reported by Patrick Baggett, patch by Mikael Pettersson.
Own Id: OTP-8095
A terminating process could erroneously unregister a name for another process. This could occur under the following conditions: The name of the terminating process was unregistered and then registered for another process simultaneously as the process that first had the name was terminating.
Own Id: OTP-8099 Aux Id: seq11344
Running erlc in a very deep directory (with a path length of more 256 or more characters) would cause the emulator to crash in a call to list_to_atom/1. (Thanks to Chris Newcombe.)
Own Id: OTP-8124
A deadlock of the runtime system could occur when unregistering the name of a port.
Own Id: OTP-8145
Makefile.in has been updated to use the LDFLAGS environment variable (if set). (Thanks to Davide Pesavento.)
Own Id: OTP-8157
The pthread rwlock implemention on Linux could cause starvation of writers. We, therefore, now use our own rwlock implementation on Linux.
Own Id: OTP-8158
Open source Erlang builds are updated to work well on Snow Leopard (MacOS X 10.6)
Own Id: OTP-8168
A call to erlang:system_info(schedulers_online) could end up in an infinite loop. This happened if the amount of schedulers was larger than one, the amount of schedulers online was one, and someone was blocking multi-scheduling.
Own Id: OTP-8169
An error in erlang:system_profile/2 could cause timestamped messages to arrive out of order in the SMP case. This has now been fixed.
Own Id: OTP-8171
binary_to_atom/2 and binary_to_existing_atom/2 would leak memory if the binary contained unaligned data.
Own Id: OTP-8192
The async thread pool in the runtime system without SMP support used a memory allocator that was not thread safe for async jobs.
Own Id: OTP-8194
Improvements and New Features
Processor internal NUMA nodes are now supported in the ERTS internal CPU topology representation. For more information see the documentation of the +sct command line argument in the erl(1) documentation, and the documentation of erlang:system_info(cpu_topology).
Own Id: OTP-8041
Documentation for ets improved about concurrency.
Own Id: OTP-8050
Emulator flags in an escript were earlier inherited to emulators started from from the emulator running the escript. For example when an escript invoked os:cmd("erl"), the new emulator were given erroneous emulator flags. This bug has now been fixed
Escript filenames may now contain dots.
Own Id: OTP-8060
Made some BIFs non-recursive (relational operators,hash and phash) to limit internal stack usage.
Own Id: OTP-8065
Fixed Windows specific bug in erl_prim_loader. Now it handles the root directory (e.g. c:/) better. This bug affected the directory listing in the debugger.
Own Id: OTP-8080 maximum size of the export table has been raised from 65536 to 524288 entries.
Own Id: OTP-8104 Aux Id: seq11345
Fixed bug causing emulator crash when reading a term in external format containing a corrupt list with a negative length.
Own Id: OTP-8117
New emulator flag +sss, to set stack size of scheduler threads.
Own Id: OTP-8119
The Windows utility Erlsrv, run in interactive mode now accepts options for registering internal service name and description field of Windows registry database.
Own Id: OTP-8132
erlang:demonitor(Mon, [flush]) has been optimized. Previously it always searched the message queue of the caller for a 'DOWN' message. Current implementation only search the message queue when necessary. It is quite common that the search is not necessary.
A new option info has been added to erlang:demonitor/2. For more information see the erlang(3) documentation.
Own Id: OTP-8143
I/O tasks could unnecessarily be rescheduled. This was harmless, but not useful work.
Own Id: OTP-8148
Minor improvements of erlang:memory/[1,2].
Own Id: OTP-8152
New configuration option to enable use of shared zlib.
Own Id: OTP-8155
Fixed smp bug in ETS that could cause emulator crash when table with more than 1000 objects accessed by several processes, including calls to variants of select or match combined with concurrent object deletion.
Own Id: OTP-8166 Aux Id: seq11392
The code path interpretation is now more relaxed. The flag -code_path_choice now defaults to relaxed instead of strict. See the documentation of code and init for more info.
Own Id: OTP-8170
Load balancing of run queues and check for I/O are triggered more often than before in situations where processes are scheduled often but are doing very little work each time they execute.
Own Id: OTP-8172
Call tracing binary comprehensions would cause an emulator crash. (Thanks to Paul Mineiro.)
Own Id: OTP-8179
binary_to_term/1 would crash the emulator instead of generating a badarg exception when given certain invalid terms. (Thanks to Scott Lystig Fritchie.)
Own Id: OTP-8180
1.41 Erts 5.7.2
Fixed Bugs and Malfunctions
Crash dumps should now cause less problems for the crashdump_viewer application. (For processes where arity was non-zero, the arguments are now longer printed - they used to be printed in a format that was not parseable.)
Own Id: OTP-7472 Aux Id: seq11019, 11292
Processes could potentially get stuck on an offline scheduler.
Own Id: OTP-7990
binary_to_atom/2 and binary_to_existing_atom/2 could leak memory if they caused a badarg exception.
Own Id: OTP-7997
A process could under very rare circumstances erroneously be resumed.
Own Id: OTP-8000
Load balancing between schedulers could under rare circumstances cause an emulator crash.
Own Id: OTP-8008
erlang:memory(processes_used) always returned 0 instead of the correct value. (Thanks to Geoff Cant)
Own Id: OTP-8022
Fixed a bug that caused error logging from driver_select sometimes with additional symptoms such as failing IP communications or even an emulator crash.
Own Id: OTP-7898 Aux Id: seq11304
Improved SMP concurrency for ETS tables. Several mutating operations can now be performed truly concurrent on different records of the same table. To support this, the table has to be created with option write_concurrency, as it is achieved at the expense of some execution and memory overhead. ets:select and select_count has also been improved for all tables to not acquire exclusive table lock during the iteration.
Own Id: OTP-7922
erl (that is erl.exe and dyn_erl) and erlexec has been made more dynamic so no hard coded paths needs to added at installation time to erl (that is erl.ini and erl). Reltool will make use of this in a future release.
Own Id: OTP-7952
Two new options are added to open_port - spawn_executable which runs external executables in a controlled way, and spawn_driver which only opens port to loaded Erlang drivers. See the erlang manual page for details.
Own Id: OTP-7995
New functionality in ETS to transfer the ownership of a table. A table can either change owner be declaring an "heir", another process that will inherit the table if the owner terminates. A table can also change owner by calling a new function ets:give_away.
Own Id: OTP-8006
Updates to Tilera build environment.
Own Id: OTP-8009
A stack trace was unnecessarily saved during process termination.
Own Id: OTP-8014
User defined CPU topology and scheduler bind type can now be set from the command line when starting an emulator. For more information see the documentation of the +sct, and the +sbt emulator flags in the erl(1) documentation.
The CPU topologies returned from erlang:system_info/1 and erlang:system_flag/2 now always contain the processor level, also when not strictly necessary.
Own Id: OTP-8030
Various fixes in ETS: ets:first could return a deleted key in a fixated table. ets:lookup could return objects out of order if a deleted object was re-inserted into a fixed bag. ets:delete_object could fail to delete duplicate objects in a duplicate_bag.
Own Id: OTP-8040
1.42 Erts 5.7.1
Fixed Bugs and Malfunctions
Fixed a bug on Windows that could make gen_tcp:send hang trying to send an iolist of more than 16 binaries.
Own Id: OTP-7816
The runtime system could under rare circumstances crash during load balancing.
Own Id: OTP-7908 Aux Id: otp-7500
run_erl uses fallback if Unix98 pseudo-terminal is not present on host.
Own Id: OTP-7916 Aux Id: seq11249
A message buffer memory leak in the runtime system without smp support has been fixed.
Own Id: OTP-7941
Attempting to append a binary of 16Mb or greater to another binary using the bit syntax would cause a system_limit exception. There was also several cases when constructing binaries when a badarg exception was generated when it should have been system_limit.
Own Id: OTP-7942
The runtime system with SMP support failed to terminate the caller of link(RemotePid) properly, if RemotePid was the pid of a process on an unreachable node. The calling process was in this case marked as exiting, but never terminated.
Own Id: OTP-7946
Improvements and New Features
Rudimentary support for cross compiling is added to the source release. The support is still in its infancy and has only been used to cross compile on Linux for a different cpu architecture and a different Linux version, but should be extendible to support other platforms as well. The cross configuration files with examples are placed in $ERL_TOP/xcomp/. View README.xcomp and run $ERL_TOP/otp_build -help for further information.
Own Id: OTP-7854
The escape sequence \{ which was given a new interpretation in R13A has retained its old meaning (the ASCII code for {), which means that codes greater than 255 have to be stated using hexadecimal characters (for example, \x{AAA}). The escape sequence \xH where H is a hexadecimal character followed by something else but a hexadecimal character is no longer valid (incompatibility with R13A). Character codes less than 256 can be stated using two hexadecimal characters (for example, \x0D).
Own Id: OTP-7891 Aux Id: OTP-7855
The term_to_binary/1 BIF used to be implemented with recursive C code, which could cause the Erlang emulator to terminate because of a stack overflow.
Also fixed some minor issues in term_to_binary/1 and binary_to_term/1 pointed out by Matthew Dempsky.
Own Id: OTP-7894
Several glitches and performance issues in the Unicode and I/O-system implementation of R13A have been corrected.
Own Id: OTP-7896 Aux Id: OTP-7648 OTP-7887
Minor documentation improvements of the scheduler_bind_type argument of erlang:system_flag/2, and the scheduler_bind_type, and the scheduler_bindings arguments of erlang:system_info/1.
Own Id: OTP-7901 Aux Id: OTP-7777
There is a new BIF erlang:make_tuple/3.
Own Id: OTP-7913
1.43 Erts 5.7
Fixed Bugs and Malfunctions
OpenSource:
FreeBSD leap-seconds are handled according to patch submitted by OpenSource user Kenji Rikitake. No test case covers this functionality (unsupported platform).
Own Id: OTP-7609
A corrected bug in ets for bag and duplicate_bag. A delete/2 or lookup_element/3 could miss objects in a fixed table if one or more objects with the same key had already been deleted.
Own Id: OTP-7665
A new driver call-back stop_select is introduced to allow drivers to de-select and then close a file descriptor in a safe way in a SMP emulator. The old way was not strictly according to posix standard and could in some rare cases lead to unexpected behavior. A new flag ERL_DRV_USE can be passed to driver_select() to tell it that the descriptor should be closed. stop_select is then called when it is safe to do so. Old drivers will however still work as before.
Own Id: OTP-7670
run_erl did in some cases fail to extract control sequences from to_erl (like: winsize=X,Y) and did instead send them to be interpreted by the erlang shell.
Own Id: OTP-7688
A bug in the installer on Windows not updating file associations properly is now corrected.
Own Id: OTP-7746
More space than necessary could be allocated in binaries when appending to a binary (also in a binary comprehension) and the data appended did not consist of wholes bytes (e.g. 13 bits).
Own Id: OTP-7747
The gen_sctp option sctp_peer_addr_params, #sctp_paddrparams{address={IP,Port} was erroneously decoded in the inet driver. This bug has now been corrected.
Own Id: OTP-7755
Outstanding async driver jobs leaked memory if the issuing port died before the async jobs completed.
Own Id: OTP-7784
A bug in the dynamic library loading affecting, among others, OpenSolaris is now corrected. (Thanks to Paul Fisher.)
Own Id: OTP-7796
run_erl compile errors fixed for FreeBSD
Own Id: OTP-7817
A bug in the inet driver for SCTP on Solaris showing for e.g gen_sctp:abort/1 and gen_sctp:eof/1 has been corrected. Patch suggestion by Simon Cornish.
Own Id: OTP-7866
Improvements and New Features
The order of objects visited in select for ordered_set is now documented.
Own Id: OTP-7339
The runtime system with SMP support now uses multiple, scheduler specific run queues, instead of one globally shared run queue.
The lock protecting the shared run queue was heavily contended, and the shared run queue also caused Erlang processes to randomly migrate between schedulers with negative cache effects as a result.
With the current scheduler specific run queue solution, lock contention due to run queue protection has been reduced, and Erlang processes are only migrated when needed to balance the load between the schedulers. The reduced amount of migration also reduce lock contention on locks protecting the scheduler specific instances of the erts internal memory allocators.
The scheduler specific run queues are also a necessity for a lot of future planned NUMA (Non-Uniform Memory Access) specific optimizations.
Own Id: OTP-7500
Message passing has been further optimized for parallel execution. Serial message passing is slightly more expensive than before, but parallel send to a common receiver is much cheaper.
Own Id: OTP-7659
Lock contention on the atom table lock when decoding Erlang terms on the external format has been drastically reduced.
Own Id: OTP-7660
The undocumented, unsupported, and deprecated guard BIF is_constant/1 has been removed.
*** INCOMPATIBILITY with R12B ***
Own Id: OTP-7673
The Erlang process lock implementation has been improved by Mat Hostetter at Tilera Corporation.
Own Id: OTP-7692
A {nodedown, Node} message passed by the net_kernel:monitor_nodes/X functionality is now guaranteed to be sent after Node has been removed from the result returned by erlang:nodes/Y.
Own Id: OTP-7725
The short-circuit operators andalso and orelse no longer guarantees that their second argument is either true or false. As a consequence, andalso/orelse are now tail-recursive.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-7748
Optimization for drivers by creating small binaries direct on process heap.
Own Id: OTP-7762
I bsl N could cause the Erlang virtual machine to run of memory instead generating a system_limit if N was absurdly huge. (Thanks to Daniel Hedlund.)
There would always be a garbage collection when evaluating I bsl N or I bsr N if I was a bignum.
If I is an integer and N a bignum, I bsl N will now cause the correct system_limit exception instead of bad_arith as in earlier releases.
If I is an integer and N a bignum, I bsr N will return either 0 or -1 depending on the sign of I instead of causing a bad_arith exception as in earlier releases.
Own Id: OTP-7764
Scheduler threads can now be bound to logical processors on newer Linux and Solaris systems. More systems will be supported in the future.
In some cases performance has increased drastically when binding schedulers. Schedulers are not bound by default, though. This since it might cause a performance degradation if multiple programs have bound to processors, e.g. multiple Erlang runtime systems. For more information see the documentation of erlang:system_flag/2.
In order to bind scheduler threads the CPU topology need to be known. On some newer Linux and Solaris systems the runtime system automatically detects the CPU topology. If the emulator isn't able to automatically detect the CPU topology, the CPU topology can be defined. For more information see the documentation of erlang:system_flag/2.
Own Id: OTP-7777
The BIFs atom_to_binary/2, binary_to_atom/2, and binary_to_existing_atom/2 have been added.
Own Id: OTP-7804
The amount of schedulers online can now be changed during operation. The amount of schedulers online defaults to the same amount as available logical processors. For more information see the documentation of erlang:system_flag/2 and erl.
Own Id: OTP-7811
The deprecated functions erlang:fault/1, erlang:fault/2, and file:rawopen/2 have been removed.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-7812
Erts internal dynamically allocated process and port specific data for rarely used data. This is used to reduce memory usage of processes and ports that do not use specific functionality. More functionality will be moved to process and port specific data in future releases.
Own Id: OTP-7818
New packet type http_bin for gen_tcp sockets and erlang:decode_packet. It works like http except that strings are returned as binaries instead of lists.
Own Id: OTP-7821
The obsolete wd_keeper program for embedded Solaris systems has been removed.
Own Id: OTP-7822
Nodes belonging to different independent clusters can now co-exist on the same host with the help of a new environment variable setting ERL_EPMD_PORT.
Own Id: OTP-7826
There are new functions erlang:min/2 and erlang:max/2 to calculate the minimum and maximum of two terms, respectively. Note that the functions are not auto-imported, so they need to be imported explicitly or the erlang prefix must be used when calling them.
Own Id: OTP-7841
The copyright notices have been updated.
Own Id: OTP-7851
Enhanced build environment for cross compilation to Tilera Tile architecture.
Support for native ethread atomics on Tilera Tile64/TilePro (Thanks to Tilera Corporation).
Own Id: OTP-7852.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-7855
The PCRE library's exported function names are now prefixed with erts_ in the erlang emulator to avoid clashes with dynamically loaded drivers.
Own Id: OTP-7861
A runtime system with SMP support will now be built by default on most platforms if a usable posix thread library or native windows threads are found.
For more information see the top README file.
Own Id: OTP-7872
1.44 Erts 5.6.5.1
Fixed Bugs and Malfunctions
A corrected bug in ets for bag and duplicate_bag. A delete/2 or lookup_element/3 could miss objects in a fixed table if one or more objects with the same key had already been deleted.
Own Id: OTP-7665.
Own Id: OTP-7738
1.45 Erts 5.6.5
Fixed Bugs and Malfunctions
A bug in inet_drv concerning gen_tcp:connect has been corrected. A connect towards a non-open port through open firewalls could sometimes erroneously be successful. Any subsequent operation would fail, though.
Own Id: OTP-6542
Floating point arithmetics in drivers could cause a runtime system crash and/or unexpected results on runtime systems with floating point exceptions enabled. Floating point exceptions are disabled unless explicitly enabled or if hipe is enabled.
Own Id: OTP-7237
A bug when many sockets got signalled simultaneously causing the emulator to panic with the message "Inconsistent, why isnt io reported?" is now corrected.
Own Id: OTP-7420
Starting erl with option "-detached" now disconnects correctly from terminal session on Unix.
Own Id: OTP-7461
Mended gdb etp-commands for ETS access.
Own Id: OTP-7538
erlang:decode_packet/3 allows white space between HTTP header tag and colon according to RFC2616.
Own Id: OTP-7543
An emulator compiled for SCTP now starts even if the dynamic libraries are not present. The SCTP driver is then of course not loaded.
Own Id: OTP-7551
To build on Mac OS X, 10.3.0 or later is now required because of fixes for two problems:
There would be a resource leak when erl_ddl attempted to unload a driver. This problem has been corrected by using dlopen() (which works on all modern Unix-like platforms) instead of the Mac OS X specific API calls.
Signal handling in the run-time system for HiPE has been updated to work on later versions of Mac OS X than 10.2.x. Therefore, --enable-hipe now works on Mac OS X with Intel CPUs.
Thanks to Geoff Cant for the patches.
Own Id: OTP-7562
Corrected some information about the protocol between EPMD and Erlang nodes. (Thanks to Michael Regen.)
Own Id: OTP-7594
When using erlang:system_monitor(Pid,{long_gc,Time}), and the GC time exceeded 1 second, it sometimes erroneously showed up as about 4300 seconds. (This bug was corrected in R9C, but re-introduced in R12B.) (Thanks to Chris Newcombe.)
Own Id: OTP-7622 Aux Id: OTP-4903, seq8379
Improvements and New Features
The driver entry of a dynamically loaded driver is now copied when loaded which enables some internal optimizations. Note that drivers that modify the driver entry during execution will not work anymore. Such a miss-use of the driver interface is however not supported.
Own Id: OTP-6900
The split function is now added to the re library. Exceptions and errors from both run, replace and split are made more consistent.
Own Id: OTP-7514 Aux Id: OTP-7494
Fixed harmless compiler warnings when building the emulator and minor build changes in order to avoid unnecessary rebuilds.
Own Id: OTP-7530
The reallocation functionality part of the ERTS internal memory allocators, now consider current block in combination with surrounding free blocks as an alternative location for a reallocation.
Own Id: OTP-7555
There could remain false references from a process to a module that has been called earlier, so that the process would be killed if the module was reloaded. (Thanks to Richard Carlsson.)
Also, the fix for this bug also made it possible to make stack backtraces (as returned from erlang:get_stacktrace/0 and other functions) more correct in that the immediate caller is always included in the stack backtrace (it could sometimes be missing).
Own Id: OTP-7559
Improved locking in IO-handling for better smp performance.
Own Id: OTP-7560
Improved BIF rescheduling functionality.
Own Id: OTP-7587
Loading a module compiled with Erlang/OTP R9C and calling module_info/0 in the module would crash the emulator. The emulator now refuses to load any module compiled with R9C or earlier. (Note: only trivial modules compiled with R10B or earlier could be loaded anyway.) (Thanks to Martin Kjellin.)
Own Id: OTP-7590
1.46 Erts 5.6.4.2
Fixed Bugs and Malfunctions
A process calling one of the following BIFs could under very rare conditions deadlock in the runtime system with SMP support: check_process_code/2, garbage_collect/1, process_info/[1,2], system_flag/2, and erlang:suspend_process/[1,2].
Own Id: OTP-7582
A couple of statistics variables were not managed in a thread safe manner in the runtime system with SMP support.
Own Id: OTP-7583
An extremely rare race condition when terminating a process could potentially cause a runtime system crash.
Own Id: OTP-7584
Under certain conditions and when using run_erl/to_erl, the terminal Erlang driver (ttsl_drv) could crash the emulator by doing a division by zero due to incorrect handling of terminals reporting a zero width. For terminals reporting zero width, the driver now fallbacks to a default width of 80 and a default height of 24 (vt100), as a fallback behaviour. This fixes the crashes and also makes output on "dumb" terminals much more readable.
Own Id: OTP-7592 Aux Id: seq11073
1.47 Erts 5.6.4.1
Improvements and New Features
A new erts_alloc parameter +M<S>rmbcmt (relative multiblock carrier move threshold) has been added. It determines when to force a moving realloc in a multiblock carrier when a block is shrunk. For more information see the erts_alloc(3) documentation.
Own Id: OTP-7540
The new option +d can be given to erl to suppress the crash dump generation if an internal error is detected. As a result, a more useful core dump is produced.
Own Id: OTP-7578 Aux Id: seq11052
1.48 Erts 5.6.4
Fixed Bugs and Malfunctions
Double backslashes in format string passed to the erts internal printf implementation produced erroneous results. No such format strings were passed to the erts internal printf implementation, i.e., the bug was therefore completely harmless. (Thanks to Perry Smith.)
Own Id: OTP-7408
Large files are now handled on Windows, where the filesystem supports it.
Own Id: OTP-7410
Bug fixed for {packet,http} when space follows http headers.
Own Id: OTP-7458
The trace option running could cause an emulator crash if the current function couldn't be determined.
Own Id: OTP-7484
Using 16#ffffFFFF as a timeout value in receive...after would often cause a timeout almost at once due to an 32-bit integer overflow. (Thanks to Serge Aleynikov and Matthias Lang.)
Own Id: OTP-7493
A bug in the string:to_integer/1 builtin made the emulator unstable. This is now corrected. (Thanks to Lev Walkin.)
Own Id: OTP-7526
Improvements and New Features.)
Own Id: OTP-7348
The source code for the documentation for some applications (erts, kernel, stdlib, and several others) are now included in the source tar ball. There is currently no Makefile support for building HTML files from the source (such support will be included in a future release).
Own Id: OTP-7406
A lot of frequently accessed memory counters (erts internal) have been removed. This since they hurt performance on the runtime system with SMP support. As a result erlang:memory/[0,1] will only deliver a result if all erts_alloc(3) allocators are enabled (default). The result delivered when all erts_alloc(3) allocators are enabled are both more accurate and less accurate than before. More memory than before are included in the result, but the different parts that are summed are not gathered atomically. A call to erlang:memory/[0,1] is much cheaper for the system than before. This since the information isn't gathered atomically anymore which was very expensive.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-7468
Pre-allocators used for, for example, timers, and messages have been rewritten to be scheduler specific. That is, different schedulers will now allocate from different pools which reduces lock contention.
Own Id: OTP-7470.)
Own Id: OTP-7471.
Own Id: OTP-7477
A new trace option exiting has been added. The exiting trace is similar to the running trace, but for exiting processes. For more information see the erlang(3) documentation.
The erlang:trace/3 bif now doesn't block other scheduler threads if only one tracee is specified in the call to erlang:trace/3.
Own Id: OTP-7481
The re module is extended with repetitive matches (global option) and replacement function.
Own Id: OTP-7494 Aux Id: OTP-7181.)
Own Id: OTP-7506
Setting the {active,once} for a socket (using inets:setopts/2) is now specially optimized (because the {active,once} option is typically used much more frequently than other options).
Own Id: OTP-7520
Known Bugs and Problems
Floating point arithmetics in drivers can cause a runtime system crash and/or unexpected results on runtime systems with floating point exceptions enabled. Floating point exceptions are disabled unless explicitly enabled or if hipe is enabled.
Own Id: OTP-7237
1.49 Erts 5.6.3.3
Fixed Bugs and Malfunctions
Binary construction with an integer field of size 0 at the end of the constructed binary (and the size given in a variable), would cause a write of one byte outside the memory reserved for the binary, which in turn could cause an emulator crash.
Own Id: OTP-7422
A race condition in the dynamic driver implementation could cause an emulator crash. (Thanks to Paul Fisher)
Own Id: OTP-7464
Calls to erlang:system_info(allocated_areas) could cause the runtime system with SMP support to crash.
Own Id: OTP-7474
The env option to open_port() could cause the runtime system with SMP support to crash.
Own Id: OTP-7475
Improvements and New Features
Operations that needed to block other threads in the runtime system with SMP support unnecessarily waited for async threads to block. Most important the erlang:memory/[0,1] bif, code loading, and the erlang:trace/3 bif.
Own Id: OTP-7480
1.50 Erts 5.6.3.2
Fixed Bugs and Malfunctions
Calls to erlang:memory/[0,1] could cause the runtime system with SMP support to crash.
Own Id: OTP-7415
1.51 Erts 5.6.3.1
Fixed Bugs and Malfunctions
Doing local call trace on bit syntax matching code that has been optimized with delayed sub-binary creation could crash the emulator.
Own Id: OTP-7399 Aux Id: seq10978
1.52 Erts 5.6.3
Fixed Bugs and Malfunctions
Only one to_erl process at a time is allowed to connect to the same run_erl pipe. Prevents buggy behaviour when IO from several to_erl's get interleaved.
Own Id: OTP-5107
IPv6 name resolving has now been fixed to use getaddrinfo() patch (thoroughly reworked) courtesy of Love Hörnquist-Åstrand submitted by Fredrik Thulin. It also can use gethostname2() patch (also reworked) courtesy of Mikael Magnusson for debian submitted by Sergei Golovan.
Own Id: OTP-5382
Improved error handling in run_erl
Own Id: OTP-7252
A permanent fix for the deadlock issue temporarily fixed by OTP-7260.
- OTP-7260
- The runtime system with SMP support could under rare circumstances deadlock when a distribution channel was taken down while multiple simultaneous operations were performed on it.
Own Id: OTP-7267 Aux Id: OTP-7260
./configure has been improved to find 64-bit OpenSSL libraries.
Own Id: OTP-7270
A terminating process could under very rare circumstances trigger a bug which could crash the runtime system with SMP support.
Own Id: OTP-7272
SCTP_ADDR_CONFIRMED events are now handled by gen_sctp.
Own Id: OTP-7276
binary_to_term/1 would crash the emulator if the binary data contained an external fun with non-atom module and/or function. Corrected to generate a badarg exception.
Own Id: OTP-7281
On Mac OS 10.5 (Leopard), sending to socket which the other end closes could cause the emulator to consume 100% CPU time. (Thanks to Matthias Radestock.)
Own Id: OTP-7289
The vanilla driver used on Windows could crash the emulator and sometimes produced corrupt files. The vanilla driver is the driver that is used when one only pass a filename as first argument to open_port/2. NOTE: This use of open_port/2 is obsolete, and the documentation of this use has previously been removed. The functionality is only present for backward compatibility reasons and will eventually be removed.
Own Id: OTP-7301
Faulty matching in binaries larger than 512Mb on 64bit machines fixed.(On 32bit, the size limit for binaries is still 512Mb). Thanks to Edwin Fine and Per Gustafsson for finding fault and fix.
Own Id: OTP-7309
crypto:start() on Windows caused emulator to hang on error popup window if openssl DLL was not found. Windows error popups now suppressed.
Own Id: OTP-7325
Configuration option without-termcap can be used to disable the use of termcap libraries for terminal cursor control in the shell.
Own Id: OTP-7338
to_erl reports its terminal window size to run_erl in order to get output formatted accordingly
Own Id: OTP-7342
On Solaris, the compressed option for file operations did not work if the file descriptor happened to be greater than 255 (a problem with fopen() and friends in Solaris itself).
Own Id: OTP-7343 Aux Id: seq10949
A race condition in the runtime system with SMP support causing an erroneous removal of a newly created ets table has been fixed.
The race occurred when a process removed a table during termination simultaneously as another process removed the same table via ets:delete/1 and a third process created a table that accidentally got the same internal table index as the table being removed.
Own Id: OTP-7349
zlib:inflate failed when the size of the inflated data was an exact multiple of the internal buffer size (4000 bytes by default).
Own Id: OTP-7359
If the total number of allowed atoms is exceeded, there will now be a controlled termination of the emulator with a crash dump file. The emulator used to simply crash. (Thanks Howard Yeh and Thomas Lindgren.)
Own Id: OTP-7372
The break handler in werl on Windows could cause the emulator to hang or crash, that is now corrected.
Own Id: OTP-7394 Aux Id: seq10969
The configure script now tests for an serious optimization bug in gcc-4.3.0. If the bug is present, the configure script will abort (if this happens, the only way to build Erlang/OTP is to change to another version of gcc). (Thanks to Mikael Pettersson.)
Own Id: OTP-7397
Improvements and New Features
On Unix, the emulator now notices when the width of the terminal has changed. (Thanks to Matthew Dempsky and Patrick Mahoney.)
Own Id: OTP-7290
There is a new function init:stop/1 which can be used to shutdown the system cleanly AND generate a non-zero exit status or crash dump. (Thanks to Magnus Froberg.)
Own Id: OTP-7308
process_info(Pid, garbage_collection) now returns more information
Own Id: OTP-7311
The hide option for open_port/2 is now documented. (Thanks to Richard Carlsson.)
Own Id: OTP-7358
Known Bugs and Problems
Floating point arithmetics in drivers can cause a runtime system crash on runtime systems with floating point exceptions enabled. Floating point exceptions are disabled unless explicitly enabled or if hipe is enabled.
Own Id: OTP-7237
1.53 Erts 5.6.2
Fixed Bugs and Malfunctions
The maximum length of an atom of 255 characters is now strictly enforced. binary_to_term/1 will now fail with a badarg if an encoded term contains an atom longer than 255 characters. Atoms created by drivers will now be truncated to 255 characters if necessary. (Thanks to Matthew Dempsky.)
Own Id: OTP-7147
A bug in "bignum handling" on some 64bit architectures could cause rem and div operations on large numbers to hang indefinitely. Rem operations involving the smallest negative number representable in 28 bits or 60 bits could also cause access violation and emulator crash. Both errors are corrected.
Own Id: OTP-7177
When doing the initial garbage collection after waking a hibernated process, a fullsweep garbage collection was unnecessarily triggered.
Own Id: OTP-7212
The runtime system with SMP support could under rare circumstances deadlock when a distribution channel was taken down while multiple simultaneous operations were performed on it.
Own Id: OTP-7260
Improvements and New Features
More checksum/hash algorithms from the zlib library are now available as built in functions (like md5 hashes has been for a long time).
Own Id: OTP-7128
Minor improvements in the garbage collector.
Own Id: OTP-7139 Aux Id: OTP-7132
The switch "-detached" to the windows werl program now can create an erlang virtual machine without any main window and without a temporary console showing.
Own Id: OTP-7142
A new BIF ets:update_element/3. To update individual elements within an ets-tuple, without having to read, update and write back the entire tuple.
Own Id: OTP-7200
1.54 Erts 5.6.1.1
Fixed Bugs and Malfunctions
Not enough parameters were passed when sending an error report in erl_check_io.c (Thanks to Matthew Dempsky).
Own Id: OTP-7176
In rare circumstances, complex binary matching code could cause the emulator to crash or not match when it should. (Thanks to Rory Byrne.)
Own Id: OTP-7198
Improvements and New Features
The {allocator_sizes, Alloc} and alloc_util_allocators arguments are now accepted by erlang:system_info/1. For more information see the erlang(3) documentation.
Own Id: OTP-7167
The finishing reallocation of the heap block when hibernating a process is now always moving the heap block since it drastically reduces memory fragmentation when hibernating large amounts of processes.
Own Id: OTP-7187
1.55 Erts 5.6.1
Fixed Bugs and Malfunctions
The SMP emulator on sparc64 erroneously used the sparc32 atomic and the sparc32 spinlock implementations which caused it to crash.
Own Id: OTP-7006
Call tracing the new guard BIFs byte_size, bit_size, or tuple_size and the loading a module that uses one of those functions, could cause the emulator to terminate.
Own Id: OTP-7008
configuring --enable-darwin-universal or --enable-darwin-64bit on MacOSX could result in a non optimized emulator. Top level configure script now corrected.
Own Id: OTP-7014
configuring --with-gd did not produce correct include flags for percept.
Own Id: OTP-7015
Environment variables weren't handled in thread safe manner in the runtime system with SMP support on Windows.
erl_drv_putenv(), and erl_drv_getenv() has been introduced for use in drivers. Do not use putenv(), or getenv() directly in drivers. For more information see the erl_driver documentation.
Own Id: OTP-7035
HIPE: Corrected the choice of interface to the send/3 and setnode/3 BIFs for native-compiled code. Using the incorrect interface could, in unusual circumstances, lead to random runtime errors.
Own Id: OTP-7067
Garbage collections could become extremely slow when there were many keys in the process dictionary. (Thanks to Fredrik Svahn.)
Own Id: OTP-7068
The duplicate documentation directory in the windows installation is removed.
Own Id: OTP-7070
Documentation bugfixes and clarifications.(Thanks to Joern (opendev@gmail.com), Matthias Lang, and Richard Carlsson.)
Own Id: OTP-7079 were effected by this bug.
Own Id: OTP-7080
The break handling code (run when Ctrl-C is hit) could could potentially deadlock the runtime system with SMP support.
Own Id: OTP-7104
A bug in erlang:phash2/1 on 64-bit platforms has been fixed. (Thanks to Scott Lystig Fritchie.)
Own Id: OTP-7127
The emulator could under rare circumstances crash while garbage collecting.
Own Id: OTP-7132
Bit syntax construction with a small integer in a non-byte aligned field wider than the CPU's word size could cause garbage bits in the beginning of the field.
Own Id: OTP-7085
All Windows versions older than Windows 2000 are now not supported by the Erlang runtime system. This since there was a need for usage of features introduced in Windows 2000.
Own Id: OTP-7086
On Unix, denormalized floating point numbers could not be created using list_to_float/1 or binary_to_term/1. (Thanks to Matthew Dempsky.)
Own Id: OTP-7122
Native atomic integers and spin-locks are now also available for the runtime system with SMP support on sparc64.
Own Id: OTP-7130
FP exceptions support for sparc64 userspace on Linux has been added. Note that FP exception support is now turned off by default, so to actually enable it you need to do './configure --enable-fp-exceptions'.
Own Id: OTP-7131
1.56 Erts 5.6
Fixed Bugs and Malfunctions
A bug for raw files when reading 0 bytes returning 'eof' instead of empty data has been corrected.
Own Id: OTP-6291 Aux Id: OTP-6967
All exported functions in gzio.c have now been renamed to avoid conflict with drivers that are indirectly linked with an external zlib library.
Own Id: OTP-6816 Aux Id: OTP-6591
On the 64-bit Erlang emulator, bit syntax construction with integers containing more than 60 bits ("big numbers") into fields with more than 60 bits could produce incorrect results.
Own Id: OTP-6833
When the runtime system failed to allocate memory for binaries, it could dead lock while writing the erl_crash.dump.
Own Id: OTP-6848
The runtime system with SMP support could deadlock if a process called the erlang:suspend_process(Pid) BIF or the erlang:garbage_collect(Pid) BIF while the process identified by Pid was currently running and the process calling the BIFs was terminated during the call to the BIFs.
Processes suspending each other via the erlang:suspend_process/1 BIF or garbage collecting each other via the erlang:garbage_collect/1 BIF could deadlock each other when the runtime system with SMP support was used.
Own Id: OTP-6920
The emulator internal process lock implementation has been rewritten and optimized. A slight risk of starvation existed in the previous implementation. This risk has also been eliminated in the new implementation.
Own Id: OTP-6500
Bitstrings (bit-level) binaries and binary comprehensions are now part of the language. See the Reference Manual.
Own Id: OTP-6558
The windows version of erlang now has SMP support. The SMP emulator is run by default on machines which shows more than one virtual or physical processor.
Own Id: OTP-6560 Aux Id: OTP-6925
The details of the compressed term format has been documented in erl_ext_dist.txt. (Thanks to Daniel Goertzen.)
Own Id: OTP-6755
The runtime system with SMP support is now started by default if more than one logical processor are detected. For more information, see the erl(3) documentation.
Own Id: OTP-6756
The external format for Erlang terms and the distribution protocol are now documented in ERTS User's Guide.
Own Id: OTP-6779
New BIF's erlang:system_profile/1 and erlang:system_profile/2. These BIF's controls concurrency profiling options for processes, ports and schedulers.
Own Id: OTP-6783 Aux Id: OTP-6285
The ErlDrvTermData term types used by driver_output_term() and driver_send_term() have been extended with the term types ERL_DRV_BUF2BINARY, ERL_DRV_EXT2TERM, and ERL_DRV_UINT. ERL_DRV_BUF2BINARY is used for passing and creating a binary, ERL_DRV_EXT2TERM is used for passing terms encoded with the external term format, and ERL_DRV_UINT is used for passing unsigned integers.
Also the data types ErlDrvUInt and ErlDrvSInt have been added which makes it more obvious how arguments to term types are interpreted with regards to width and signedness.
The incorrect data types ErlDriverTerm, ErlDriverBinary, and ErlDriverPort in the erl_driver(3) documentation have been replaced with the correct data types ErlDrvTermData, ErlDrvBinary, and ErlDrvPort.
For more information see the erl_driver(3) documentation.
Own Id: OTP-6823
Miscellaneous improvements of the erts internal thread library.
It now support optimized atomic operations and spin-locks on windows.
Fall-backs based on mutexes and/or spin-locks for missing optimized atomic operations, spin-locks, or rwlocks has been implemented. This makes it possible to compile the runtime system with SMP support on a lot more platforms.
Default stack size on OpenBSD has been increased to 256 kilo-words.
Own Id: OTP-6831 Aux Id: OTP-65
The Erlang driver API has been extended with a portable POSIX thread like API for multi-threading. The Erlang driver thread API provides:
- Threads
- Mutexes
- Condition variables
- Read/Write locks
- Thread specific data
For more information see the erl_driver(3) documentation.
Own Id: OTP-6857
Recursive calls now usually consume less stack than in R11B. See the Efficiency Guide.
Own Id: OTP-6862 Aux Id: seq10746
The deprecated BIFs erlang:old_binary_to_term/1 and erlang:info/1 have been removed.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-6876
Calls to driver call-backs triggered by external events are now scheduled and interleaved with execution of Erlang processes also on the runtime system without SMP support.
Own Id: OTP-6878
Faster arithmetic of integers of more than 27 bits signed (or 60 bits signed on an 64-bit CPU), and also faster integer multiplication. (Thanks to Tony Rogvall.)
Own Id: OTP-6891
Significant improvements of the process_info BIFs:
- process_info/2 can now be called with a list of items as second argument in order to atomically retrieve information about multiple items.
- process_info/[1,2] has been optimized in the runtime system with SMP support. The whole scheduler could previously be blocked for a significant period of time in process_info/[1,2] waiting for a lock on the process being inspected. The Erlang process calling process_info/[1,2] can still be blocked for a significant period of time waiting for the lock, but the scheduler will now be able to run other processes while the process calling process_info/[1,2] waits for the lock.
- process_info/2 now accept a few more items than before.
- The documentation of process_info/[1,2] has been improved.
For more information see the erlang(3) documentation.
Own Id: OTP-6899
open_port({}, []) could crash the emulator. (Thanks to Matthew Dempsky.)
Own Id: OTP-6901
As the linux kernel may generate a minor fault when tracing with CPU timestamps, and there exists no patch to the Linux kernel that fixes the problem, cpu timestamps are disabled on Linux for now.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-6922
driver_caller() can now also be used from the start callback of a driver.
Own Id: OTP-6951
The emulator can now be compiled for 64bit intel, as well as a 32bit universal binary on darwin/MacOSX 10.4 and 10.5.
Own Id: OTP-6961
If open_port fails because all available ports are already in use, it will now throw a system_limit exception instead of an enfile exception. (enfile might still be thrown if the operating system would return ENFILE.)
Own Id: OTP-6968
The spawn_monitor/1 and spawn_monitor/3 BIFs are now auto-imported (i.e. they no longer need an erlang: prefix).
Own Id: OTP-6975
On Windows, the werl window now handles resize, so that the whole window can be utilized. Text selection is also updated to be line oriented instead of rectangle oriented as in earlier versions.
Own Id: OTP-6994 Aux Id: OTP-6933
Kqueue support (kernel-poll) has been enabled on FreeBSD. The problem with kqueue not detecting writes on a pipe on FreeBSD was actually not a kqueue issue, but a writev on pipes issue. Neither poll(), nor select() detected the write when the bug hit. NetBSD and DragonFlyBSD probably have or have had the same bug. This bug should have been fixed in FreeBSD 6.3 and FreeBSD 7.0 thanks to Jean-Sebastien Pedron.
Own Id: OTP-7001
1.57 Erts 5.5.5.5
Fixed Bugs and Malfunctions
Hanging writes on temporarily unavailable NFS filesystems could cause the execution of (not file related) erlang code to get blocked even though I/O threads were used. This is now corrected.
Own Id: OTP-6907 Aux Id: seq10771
1.58 Erts 5.5.5.4
Fixed Bugs and Malfunctions
Data passed to a driver via erlang:port_call could be corrupted when the runtime system with SMP support was used. (Thanks to YAMASHINA Hio.)
Own Id: OTP-6879
In the SMP emulator, if several processes called ets:update_counter/3 (even for different tables) when the counter values exceeded 27 bits, the counter values could be corrupted or the emulator could crash.
Own Id: OTP-6880 Aux Id: seq10760
1.59 Erts 5.5.5.3
Fixed Bugs and Malfunctions
Creating a named table using ets:new/2 or renaming a named table using ets:rename/2 could in rare circumstances succeed, meaning that there would be two or more tables with the same name. Now such call will fail with a badarg exception as it is supposed to do.
ets:delete/1 used on a named table now removes the name immediately so that a new table with the same name can be created.
Turning on call trace on the internal BIF that implements ets:delete/1 would crash the emulator.
SMP emulator only: Using ets:rename/2 on a table that ets:safe_fixtable/2 has been used on could cause an emulator crash or undefined behaviour because of a missing lock.
Own Id: OTP-6872 Aux Id: seq10756, seq10757
1.60 Erts 5.5.5.2
Known Bugs and Problems
ets:select/3 on ordered_set and with a chunksize a multiple of 1000 gave all elements instead of just 1000. Also ets:slot/2 on ordered set could give unexpected results on SMP emulator. Both problems are corrected.
Own Id: OTP-6842
1.61 Erts 5.5.5.1
Fixed Bugs and Malfunctions
All exported functions in gzio.c have now been renamed to avoid conflict with drivers that are indirectly linked with an external zlib library.
Own Id: OTP-6816 Aux Id: OTP-6591
Calling binary_to_term/1 with certain invalid binaries would crash the emulator.
Own Id: OTP-6817
Improvements and New Features
Restored speed of bit-syntax matching of 32 bits integers.
Own Id: OTP-6789 Aux Id: seq10688
1.62 Erts 5.5.5
Fixed Bugs and Malfunctions
The functions in gzio.c have been renamed to avoid conflict with drivers that indirectly linked with an external zlib library.
Own Id: OTP-6591
The emulator without SMP support dumped core if an async-thread finished a job after the emulator had begun writing an erl_crash.dump.
Own Id: OTP-6685
In bit syntax matching, integer fields with greater size than 16Mb would fail to match. (Thanks to Bertil Karlsson and Francesco Pierfederici.)
Matching out a 32-bit integer not aligned on a byte boundary from a binary could cause an heap overflow (and subsequent termination of the emulator).
A module that contained bit syntax construction with a literal field size greater than 16Mb would fail to load.
Several other similar bugs having to do with huge field sizes were eliminated.
Attempting to construct a binary longer than 536870911 bytes will now fail with a system_limit exception (rather than fail in mysterious ways or construct an binary with incorrect contents). Similarily, attempting to match a binary longer than 536870911 bytes will now fail (instead of producing an incorrect result). This limitation has been documented in the Efficiency Guide. (The limit is in the 32-bit emulator; use the 64-bit emulator if you need to handle larger binaries than 536870911.)
Own Id: OTP-6686
Bugs in rem and div of very large numbers are corrected.
Own Id: OTP-6692
erlang:system_info({allocator, Alloc}) didn't allocate enough heap when a bignum was part of the result which could cause an emulator crash.
Own Id: OTP-6693
It was previously not possible to pass erts_alloc the same configuration via the command-line, as used by default.
A +M* command-line argument that configure a size of some sort can now be passed a value that equals the size of the address space. The value used, in this case, will be "the size of the address space" - 1.
Own Id: OTP-6699
SysIOVec* driver_peekq(ErlDrvPort port, int *vlen) did not update *vlen if port was invalid. *vlen is now set to -1 if the port is invalid.
The efile driver expects *vlen to be updated also when the port is invalid. This situation occurs seldom, but when the runtime system has async-threads enabled and ports are killed it can. When it occurred the runtime system crashed.
Own Id: OTP-6729
Improvements and New Features
The section Guards in the chapter The Abstract Format of the ERTS User's Guide has been updated.
Own Id: OTP-6600
The command line flag -args_file FileName, and the environment variables ERL_AFLAGS, and ERL_ZFLAGS for the erl command have been added. For more information see the erl(1) documentation.
Own Id: OTP-6697
The is_constant/1 type test has been deprecated. is_constant/1 is improperly named and almost entirely undocumented.
Own Id: OTP-6731
1.63 Erts 5.5.4.3
Fixed Bugs and Malfunctions
process_flag(trap_exit, Bad) where Bad was a term not equal to true or false, didn't fail with badarg as it should; instead, the failure was silently ignored. This bug was introduced in erts-5.5.2.
Own Id: OTP-6627 Aux Id: OTP-6160
The minimum and default stack size for async-threads has been increased to 16 kilowords. This since the previous minimum and default stack size of 8 kilowords proved to be too small (introduced in erts-5.5.4.2).
Own Id: OTP-6628 Aux Id: OTP-6580, Seq10633
Improvements and New Features
process_flag/2 accepts the new flag sensitive.
Own Id: OTP-6592 Aux Id: seq10555
1.64 Erts 5.5.4.2
Fixed Bugs and Malfunctions
When a port steals control over a file descriptor from another port, the stealing port tests if the other port is alive. This in order to be able to give an accurate error message. In the runtime system with SMP support, this test was done without appropriate locks held. This could in worst case lead to an erroneous error message; therefore, this bug is to be considered harmless.
Own Id: OTP-6602
Improvements and New Features
The default stack size for threads in the async-thread pool has been shrunk to 8 kilowords, i.e., 32 KB).
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-6580
1.65 Erts 5.5.4.1
Fixed Bugs and Malfunctions
Setting the time on the system while using heart on a linux machine where the emulator was built with clock_gettime support (default from Linux 2.6/erts-5.5.4 and upwards), could make the heart command fire. This was due to bug in the heart executable which is now corrected.
Own Id: OTP-6598 Aux Id: seq10614
1.66 Erts 5.5.4
Fixed Bugs and Malfunctions
Corrected misspelling of '-pz' in the help text for erlc. (Thanks to Ulf Wiger.)
Own Id: OTP-6433
The emulator could dump core while writing an erl_crash.dump file if there were funs with a large terms in its environment. Since there is no way to inspect a fun's environment in the crashdump_viewer application anyway, a variables in the environment are now set to [] before dumping the fun. (Thanks to Jean-Sebastien Pedron.)
Own Id: OTP-6504
{Port, {exit_status, S}} messages from ports opened with the exit_status option could under rare circumstances be delayed. This bug was present on Erlang runtime systems without SMP support on all unix operating systems other than SunOS.
Own Id: OTP-6528
A bug in linuxthreads could cause the emulator to dump core when dlerror() was called before the first call to dlopen(). As a workaround the emulator always makes a call to dlopen() on initialization when linuxthreads is used as thread library.
Own Id: OTP-6530
file:sync/1 did not do anything on Windows. Now it calls the system function for flushing buffers (FlushFileBuffers()). (Thanks to Matthew Sackman.)
Own Id: OTP-6531
open_port/2 could on the runtime system with SMP support fail with the wrong exit reason when a port couldn't be created. When this happened the exit reason was typically eintr, or ebusy instead of eagain.
Own Id: OTP-6536
The file driver (efile_drv) did not flush data written using the option 'delayed_write' after the set timeout time, rather at the next file operation. This bug has now been corrected.
Own Id: OTP-6538 OPT
Setting and getting socket options in a "raw" fashion is now allowed. Using this feature will inevitably produce non portable code, but will allow setting ang getting arbitrary uncommon options on TCP stacks that do have them.
Own Id: OTP-6519
Miscellaneous signal handling improvements on the Erlang runtime system with SMP support.
The fallback implementation of spin locks and atomic operations are now implemented using pthread spin locks when pthread spin locks are found on the system.
The Erlang runtime system with SMP support can now run on Linux systems that has Linuxthreads instead of NPTL (Native POSIX Thread Library). Note that the SMP support hasn't been as thoroughly tested with Linuxthreads as with NPTL. A runtime system with SMP support will therefore not be built by default on Linux when NPTL isn't found. In order to force a build of the runtime system with SMP support, pass --enable-smp-support to configure when building OTP.
Own Id: OTP-6525
1.67 Erts 5.5.3.1
Fixed Bugs and Malfunctions
erlang:system_flag(multi_scheduling, block) could cause the emulator with SMP support to deadlock.
Own Id: OTP-6431 Aux Id: OTP-6403
The runtime system with SMP support failed to call the driver timeout callback of ports in state closing. This could cause ports to fail flushing their I/O queues.
Own Id: OTP-6432
The {Port, closed} message from a closed port could arrive at the port owner before Port had been removed from the result of erlang:ports/0 in the runtime system with SMP support.
Own Id: OTP-6437
The async id of async jobs created via driver_async wasn't created in a thread safe manner in the runtime system with SMP support. This could in worst case cause driver_async_cancel() to cancel another async job than intended.
Own Id: OTP-6438
Under rare circumstances a terminating connection between two nodes could cause an instantaneous reconnect between the two nodes to fail on the runtime system with SMP support.
Own Id: OTP-6447
In the documentation of the driver entry field extended_marker of erts version 5.5.3 (driver_entry(3)), the following is stated: "The following fields are ignored if this field is equal to 0". This is a documentation bug and has been changed to: "If this field is equal to 0, all the fields following this field also have to be 0, or NULL in case it is a pointer field".
The runtime check for detection of old incompatible drivers made when loading drivers has been improved. The emulator can, however, not make sure that a driver that doesn't use the extended driver interface.
For more information see the erl_driver(3) and driver_entry(3) documentation.
Own Id: OTP-6452 Aux Id: OTP-6330
When terminating ports on the runtime system with SMP support, removal of links to processes was done without locking the link lock on processes. This could cause an emulator crash.
Own Id: OTP-6475
The emulator with SMP support could crash when a port flushed its I/O queue by calling driver_async() from the timeout driver callback.
Own Id: OTP-6479
Large exit reasons could under rare circumstances cause the runtime system with SMP support to crash.
Own Id: OTP-6521
Improvements and New Features
Faster system calls for keeping the time accurate are used on newer Linux kernels, which can result in a significant speed-up of the emulator on those systems.
Own Id: OTP-6430
Added number of async threads and number of scheduler threads to the system information that can be retrieved via driver_system_info(). For more information see the erl_driver(3) documentation.
Own Id: OTP-6440
When SIGUSR1 is received by the runtime system with SMP support, the erl_crash.dump is now written by a special thread, instead of as before directly from the signal handler.
Own Id: OTP-6465
term_to_binary/2 with compression is now faster.
term_to_binary/2 now accepts the option '{compressed,Level}' for specifying the compression level. Level must be in the range 0 (no compression) through 9 (highest compression level). Default is 6.
Future compatibility bugfix: binary_to_term/1 did not handle the Uniq and Index fields correctly.
Own Id: OTP-6494
Removed unnecessary reallocation when initializing kernel-poll set.
Own Id: OTP-6516
1.68 Erts 5.5.3
Fixed Bugs and Malfunctions
Node and fun table entries could under rare circumstances be deallocated multiple times on the emulator with SMP support.
Own Id: OTP-6369
epoll_wait() can repeat entries for the same file descriptor in the result array. This could cause the ready_input, ready_output, or event callbacks of a driver to unintentionally be called multiple times. We have only noted repeated entries when an error condition has occurred on the file descriptor. In this case, the repeated entries should normally not be a problem for the driver since it should detect the error and de-select the file descriptor. Therefore this bug should be considered harmless. The emulator now coalesce repeated entries into one.
You are only affected by this bug if you are using erts-5.5.2.* and the kernel-poll feature on linux.
Own Id: OTP-6376 Aux Id: OTP-6222
If a process that was waiting in gen_tcp:accept/1 was killed, calling gen_tcp:accept/1 again on the same listen socket would fail with '{error,einval}'.
Own Id: OTP-6381 Aux Id: seq10535
The emulator failed to start on Solaris 10 when kernel-poll support was enabled and the maximum number of filedescriptors configured was less than or equal to 256.
Own Id: OTP-6384 Aux Id: OTP-6222
Process and port timers could fail to work properly on the runtime system with SMP support. Many thanks to Dmitriy Kargapolov and Serge Aleynikov who tracked down this bug.
Own Id: OTP-6387
Bit syntax code compiled by an R10B compiler that matched out a floating point number would not properly check that the floating point number was valid; if the float was, for instance, NaN the emulator could crash.
Own Id: OTP-6395
statistics(runtime) on Windows used to return the elapsed system time for the process, instead of the user time. Corrected. (Thanks to Robert Virding.)
Own Id: OTP-6407
A loadable driver (loaded by erl_ddll) which used driver_async() would cause the emulator to crash. (Thanks to Dmitriy Kargapolov.)
Own Id: OTP-6410
Under rare circumstances the emulator on unix platforms could fail to terminate the Erlang port corresponding to a port program opened with the exit_status option.
Own Id: OTP-6411
A link removed via unlink/1 could under rare circumstances transfer exit signals for a short period of time after the call to unlink/1 had returned when the runtime system with SMP support was used.
Own Id: OTP-6425 Aux Id: OTP-6160
Improvements and New Features
In the runtime system with SMP support, ports are now being scheduled on the scheduler threads interleaved with processes instead of being run in a separate I/O thread.
Own Id: OTP-6262
More interfaces are added in erl_ddll, to support different usage scenarios.
Own Id: OTP-6307 Aux Id: OTP-6234
In the runtime system with SMP support, the global I/O lock has been replaced with a more fine grained port locking scheme. Port locking is either done on driver level, i.e., all ports executing the same driver share a lock, or on port level, i.e., each port has its own lock. Currently the inet driver, the efile driver, and the spawn driver use port level locking and all other statically linked in drivers use driver level locking. By default dynamically linked in drivers will use locking on driver level. For more information on how to enable port level locking see the erl_driver(3) and the driver_entry(3) man pages.
As of erts version 5.5.3 the driver interface has been extended. The extended interface introduce version management, the possibility to pass capability flags to the runtime system at driver initialization, and some new driver API functions. For example, the driver_system_info() function which can be used to determine if the driver is run in a runtime system with SMP support or not. The extended interface doesn't have to be used, but dynamically linked in driver have to be recompiled. For information see the erl_driver(3) and the driver_entry(3) man pages.
NOTE: Dynamically linked in drivers have to be recompiled.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-6330 Aux Id: OTP-6262
A test and debug feature which modifies the timing of the runtime system has been added. For more information, see documentation of the +T<Level> command line argument of erl(1).
Own Id: OTP-6382
The version of zlib () linked into run-time system has been updated to version 1.2.3.
Own Id: OTP-6394
The erlc program now passes on the -smp and -hybrid options to the Erlang emulator it starts. This is mainly useful for compiling native code, because native code must be compiled with same type of run-time system as in which it will be run.
If the -s option is given, erlc now prints a warning that it is deprecated and that it will be removed in R12B.
Own Id: OTP-6398
The schedulers option of erlang:system_flag/2 has been removed, i.e., the number of scheduler threads cannot be changed after emulator boot time any more.
A multi_scheduling option has been added to erlang:system_flag/2. This option can be used for blocking and unblocking multi-scheduling. For more information see the erlang(3) documentation.
Own Id: OTP-6403
A port program that had been started with the exit_status option and closed one of the pipes used for communication with the emulator caused the emulator to continuously poll for termination of the port program. This only became a problem when the emulator didn't have other things to do and the port program closed a pipe much earlier than it terminated. When the emulator had other things to do, such as running Erlang processes, the emulator polled for termination in between scheduling of processes.
Now the emulator doesn't poll for termination of the port program at all; instead, it waits for the child signal from the terminated port program to arrive and then schedules the Erlang port for termination.
The termination of any port programs have also been optimized. Previously the termination of any port program did always cause a scan of a table of the size equal to maximum number of file descriptors. If the maximum number of file descriptors was large, this scan could be quite expensive. Now the search have been reduced to the set of ports started with the exit_status option.
Note, all of the above only applies to Erlang emulators on Unix platforms.
Own Id: OTP-6412 Aux Id: seq10194
* BEAM: added support for floating-point exceptions on FreeBSD (32-bit x86)
* SMP: made locking procedures work even when native lock operations aren't implemented
* SMP: improved timing accuracy in the timer thread (if enabled)
Own Id: OTP-6424
1.69 Erts 5.5.2.2
Fixed Bugs and Malfunctions
A bug in the kernel poll implementation could cause the emulator to omit polling for events on file descriptors. The bug was only present when using the kernel poll implementation based on epoll or kqueue. This bug was introduced in erts-5.5.2.
Own Id: OTP-6344 Aux Id: OTP-6222
1.70 Erts 5.5.2.1
Fixed Bugs and Malfunctions
The run_erl program now acquires its pseudo-ttys using openpty(3), so that it will work on newer Linux distributions that don't have the traditional pseudo-tty devices in the file system. On platforms that don't have openpty(3), run_erl will still search for pseudo-tty devices in the file system.
The run_erl program will now wait using waitpid(3) to prevent the program it spawned to become defunct. run_erl will also terminate after a delay of 5 seconds (to allow any pending output to be written to the log file) if the spawned program terminates even if some child of it still holds stdin and/or stdout open.
Own Id: OTP-6225 Aux Id: seq10500
A bug in ordered_set ETS datatyp caused ets:select (and match) to return faulty results when the table contained process id's from another node.
Own Id: OTP-6338
1.71 Erts 5.5.2
Fixed Bugs and Malfunctions
erlc: A typo in the help text for '-pa path' was corrected.
Own Id: OTP-6218
Failure in port command/control driver callbacks could crash the non-SMP emulator. This bug was introduced in the 5.5 version of erts.
Own Id: OTP-6224
Erroneous "Input driver gone away without deselecting!" error reports could sometimes occur when a driver instance terminated in the ready_output() callback of the driver. This bug was only present in emulators that used poll(). Note, that this bug was harmless, the only effect it had was the erroneous error report.
Own Id: OTP-6229 Aux Id: OTP-3993, Seq5266, Seq7247, OTP-4307
The emulator could cause a type assertion failure while writing an erl_crash.dump, causing the erl_crash.dump to be terminated and a core dump generated.
Own Id: OTP-6235 Aux Id: seq10444
The registered name of a process is now the last observable resource removed before links and monitors are triggered when a process terminates.
Previously ets tables were removed after the registered name. This could cause problems on the runtime system with SMP support for code that expected that ets tables owned by a specific process had been removed if the name of the process had been removed.
Own Id: OTP-6237
Failure to fork() a new (os) process could cause the emulator to deadlock. This bug affect all emulators with SMP support, and emulators with async thread support on SunOS.
Own Id: OTP-6241 Aux Id: OTP-3906
Fprof traces could become truncated for the SMP emulator. This bug has now been corrected.
Own Id: OTP-6246
The undocumented functions inet:getiflist/0,1 inet:ifget/2,3 and inet:getif/1 were completely broken on Windows. That has been fixed.
Own Id: OTP-6255
Behavior in case of disappeared nodes when using the dist_auto_connect once got changed in R11B-1. The timeouts regarding normal distributed operations is now reverted to the old (pre R11B-1).
Own Id: OTP-6258 Aux Id: OTP-6200, seq10449
The bsl and bsr operators could cause the emulator to crash if given invalid arguments. (Thanks to datacompboy and Per Gustafsson.)
Own Id: OTP-6259
driver_cancel_timer() could under certain circumstances fail to cancel the timer on the runtime system with SMP support.
Own Id: OTP-6261
A call to erlang:system_info(info) could deadlock the runtime system with SMP support.
Own Id: OTP-6268
Improvements and New Features
Exit signals are now truly asynchronous in the runtime system with SMP support. This simplifies locking in bifs a lot, and makes process termination cheaper.
Own Id: OTP-6160
When tracing on the runtime system with SMP support it can be difficult to know when a trace has been delivered to the tracer. A new built in function erlang:trace_delivered/1 has been introduced in order to make it easier to know when the trace has been delivered. See the erlang(3) man page for more information.
Own Id: OTP-6205 Aux Id: OTP-6269
Kernel poll support can now be combined with SMP support. Currently the following kernel poll versions exist: /dev/poll, epoll, and kqueue. Linux kpoll has been replaced with epoll. Some time in the future there will also be a kernel poll version using Solaris event ports.
The "check io" implementation for unix has been completely rewritten. The current kernel poll implementation reduce the amount of system calls needed compared to the old kernel poll implementation.
When epoll or kqueue is used either poll or select is used as fallback. Previously only poll could be used as fallback. Since select now can be used as fallback, kernel poll support is now also available on newer MacOSX. Note however, when select is used as fallback, the maximum number of file descriptors is limited to FD_SETSIZE.
Kernel poll support is now enabled by default if /dev/poll, epoll, or kqueue is found when building OTP, i.e. you do not have to pass the --enable-kernel-poll argument to configure. As before, kernel poll is disabled by default in the runtime system. In order to enable it, pass the +Ktrue command line argument to erl.
Note: configure will refuse to enable kernel poll support on FreeBSD since kqueue have problems with (at least) pipes on all version of FreeBSD that we have tested.
Own Id: OTP-6222 Aux Id: seq10380
The erl_ddll module and the code in the emulator have been completely rewritten; several bugs were fixed.
Own Id: OTP-6234
The SMP emulator now avoids locking for the following operations (thus making them as fast as in the UP emulator): atom_to_list/1, atom comparison, atom hashing, erlang:apply/3.
Own Id: OTP-6252
There are new BIFs erlang:spawn_monitor/1,3, and the new option monitor for spawn_opt/2,3,4,5.
The observer_backend module has been updated to handle the new BIFs.
Own Id: OTP-6281
1.72 Erts 5.5.1.1
Improvements and New Features
There is now an option read_packets for UDP sockets that sets the maximum number of UDP packets that will be read for each invocation of the socket driver.
Own Id: OTP-6249 Aux Id: seq10452
1.73 Erts 5.5.1
Fixed Bugs and Malfunctions
Complex pattern matching of strings would fail in the 64 bits emulator because of a bug in the loader. (Thanks to Igor Goryachev.)
Own Id: OTP-6142
-134217728 div 134217728 and -134217728 rem 134217728 would be calculated incorrectly. abs(-2147483648) could in unlucky circumstances cause a heap overflow, as could size(Binary) when size of the binary was larger than 128Mb.
Own Id: OTP-6154
erlang:display/1 displayed erroneous values for negative integers.
Big integers (both positive and negative) were previously displayed in hexadecimal form while small integers were displayed in decimal form. All integers are now displayed in decimal form.
NOTE: erlang:display/1 should only be used for debugging.
Own Id: OTP-6156
A call to erlang:trace/3 with erroneous flags caused the SMP emulator to deadlock instead of exiting the calling process with badarg.
Own Id: OTP-6175
A bug causing the emulator to hang when exiting a process that is exception traced has been fixed.
Own Id: OTP-6180
A memory allocation bug could cause the SMP emulator to crash when a process had executed a receive after with a larger timeout than 10 minutes.
Own Id: OTP-6199
The runtime system with SMP support did not slowly adjust its view of time when the system time suddenly changed.
Timeouts could sometimes timeout too early on the runtime system with SMP support.
Own Id: OTP-6202
Improvements and New Features
The smp runtime system now automatically detects the number of logical processors on MacOSX (darwin) and OpenBSD.
The smp runtime system is now built by default on MacOSX (darwin) on x86.
Own Id: OTP-6119
The -smp command line argument now take the following options: enable, auto, or disable.
Especially the -smpauto argument is useful since it starts the Erlang runtime system with SMP support if it is available and more than one logical processor are detected; otherwise, it starts the Erlang runtime system without SMP support. For more information see the erl(1) man page.
Own Id: OTP-6126
Increased the reduction cost for sending messages in the SMP emulator so it behaves more like the non-SMP emulator.
Own Id: OTP-6196
A port running a dynamically linked-in driver that exits due to the driver being unloaded now exits with exit reason driver_unloaded. Previously the port exited with exit reason -1.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-6204
Changed name of the erlang:system_info/1 argument scheduler to scheduler_id. This since the scheduler argument so easily could be mixed up with the schedulers argument (both returning integers).
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-6208
The changes below were made by Mikael Pettersson, HiPE.
HiPE runtime system:
Reduce overheads in the HiPE runtime system's BIF glue code.
Fix bug when exceptions are thrown from BEAM to HiPE.
Support SPARC on Linux.
Support x86 on FreeBSD.
Floating-point exceptions:
Reduce overheads in checking results of floating-point operations.
Minor bug fix in SSE2 floating-point exception handling.
Support SSE2 floating-point exceptions on 32-bit x86 machines.
Make FP exceptions work in the SMP runtime system on FreeBSD/x86.
Support floating-point exceptions on SPARCs running Linux.
Runtime system:
Minor scheduler optimisation in the non-SMP runtime system.
Substantial reduction of I/O thread overheads in the SMP runtime system if the separate timer thread is used. (In R11B-1, the separate timer thread is not used.)
Own Id: OTP-6211
1.74 ERTS 5.5
Fixed Bugs and Malfunctions
Two bugs fixed: If the environment variable ERL_FLAGS was set, its contents would be appended to the end of the command line even if the command line had an -extra options. Changed to place the options from ERL_FLAGS just before -extra. Also, the -smp and -hybrid flags no longer have any effect if placed after -extra.
Own Id: OTP-6054
Improvements and New Features
The documentation for writing drivers in the ERTS User's Guide has been expanded and updated.
Own Id: OTP-5192
The andalso and orelse operators are now allowed to be used in guards. That also applies to match specifications.
Own Id: OTP-5894 Aux Id: OTP-5149
There is a new trace match spec function {exception_trace} and a corresponding trace message exception_from that can be used to trace on any exit from a function, both normal function return and exception return. See the documentation for details.
The return_to trace message is now also generated when the execution returns to a function due to catching an exception.
Own Id: OTP-5956
Erlang runtime system with SMP (symmetric multi processing) support.
The runtime system with SMP support is in this release focused on stability and there are a number of steps with optimizations to follow before it will take full advantage of multi processor systems. The released system is however truly multi threaded and you will notice increased performance for many applications already. We recommend that you evaluate your application on the SMP version of the runtime system and wait for some more optimizations before you use it in a real product. You will then discover if there are any problems in your application that needs to be fixed in order for it to work properly in a multi threaded environment. More optimized versions of the runtime system with SMP support will be included in the R11B maintenance releases.
The SMP enabled runtime system will be started if the -smp command line argument is passed to the erl command. In order to make use of more than one processor core, multiple scheduler threads are used. By default, the number of scheduler threads will equal the number of processor cores. The number of scheduler threads can be set with the +S command line argument. For more information see the erl(1) man page.
A runtime system with SMP support is by default built on the following platforms if posix threads, and a gcc compiler of at least version 2.95 is found:
Linux with at least kernel version 2.6 and the Native POSIX Thread Library on x86, x86_64, and 32-bits PowerPC.
Solaris of at least version 8 on 32-bits SPARC-V9.
MacOSX of at least version 10.4 (Darwin 8.0) on 32-bits PowerPC.
The runtime system with SMP support is known not to build on:
Windows.
Linux with kernel versions less than 2.4, or without the Native POSIX Thread Library.
Other hardware platforms than x86, x86_64, 32-bits SPARC-V9 and 32-bits PowerPC.
Windows will be supported in a future release.
The runtime system with SMP support might build on other operating systems in combination with supported hardware. In order to force a build of a runtime system with SMP support, pass the --enable-smp-support command line argument to configure. Note, however, that it is not enough that it builds. The underlying thread library and operating system has to provide SMP support as well. If the thread library does not distribute scheduler threads over multiple processor cores then the runtime system will only seemingly provide SMP support. If the runtime system is not built by default on a specific platform, we have not tested it on that platform.
NOTE: The design of SMP support for drivers is ongoing. There will probably be incompatible driver changes (only affecting drivers run on the runtime system with SMP support) released as patches for R11B.
Potential incompatibility: Previously, specific driver call-backs were always called from the same thread. This is not true in the runtime system with SMP support. Calls to call-backs will be made from different threads, e.g., two consecutive calls to exactly the same call-back can be made from two different threads. This will in most cases not be a problem. All calls to call-backs are synchronized, i.e., only one call-back will be called at a time.
In the future the default behavior will probably be the following: Calls to call-backs will, as now, be made from different threads. Calls to call-backs in the same driver instance will be synchronized. It will probably be possible to configure so that all calls to call-backs in all driver instances of a specific driver type will be synchronized. It may be possible to configure so that all calls to call-backs of a driver instance or a of a specific driver type will be made from the same thread.
Parallelism in the Erlang code executed is a necessity for the Erlang runtime system to be able to take advantage of multi-core or multi-processor hardware. There need to be at least as many Erlang processes runnable as processor cores for the Erlang runtime system to be able to take advantage of all processor cores.
An Erlang runtime system with SMP support with only one Erlang process runnable all the time will almost always be slower than the same Erlang runtime system without SMP support. This is due to thread synchronization overhead.
Known major bottleneck in the Erlang runtime system:
Currently the I/O system uses one "big lock", i.e. only one thread can do I/O at a time (with the exception of async threads and threads created by users own linked-in drivers). This is high on the list of things to optimize. Note, code that does not do I/O can be executed at the same time as one thread does I/O.
Some pitfalls which might cause Erlang programs that work on the non-SMP runtime system to fail on the SMP runtime system:
A newly spawned process will often begin executing immediately. Code that expects that the parent process will be able to execute for a while before the child process begins executing is likely to fail.
High priority processes could previously provide mutual exclusion (bad programming style) by preventing normal and low priority processes from being run. High priority processes cannot be used this way to provide mutual exclusion.
erlang:yield() could be used to provide some kind of temporary mutual exclusion (also bad programming style). erlang:yield() cannot be used to provide any kind of mutual exclusion.
Obscure pitfall, only if a process being traced also sends normal messages to the tracer:
The order between trace messages and normal messages is undefined. I.e. the order between normal messages sent from a tracee to a tracer and the trace messages generated from the same tracee to the same tracer is undefined. The internal order of normal messages and the internal order of trace messages will, of course, be preserved as before.
The kernel poll feature is currently not supported by the runtime system with SMP support. It will probably be supported in a future release.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-6006 Aux Id: OTP-6095
Linked-in driver modifications.
Linked-in drivers must be recompiled.
The refc field in the ErlDrvBinary type has been removed. The reference count can be accessed via API functions. For more information see the erl_driver(1) man page.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-6095 Aux Id: OTP-6006
1.75 ERTS 5.4.13
Fixed Bugs and Malfunctions
Large files (more than 2 GBytes) are now handled on Solaris 8.
Own Id: OTP-5849 Aux Id: seq10157
A failing bit syntax construction could fail with the PREVIOUS exception reason that had occurred in the process (instead of with badarg).
Own Id: OTP-5911
When building OTP, the Kernel application was built in both the primary and secondary bootstrap steps, which would cause problems if OTP including its bootstrap is checked into a version control system (such as CVS). (Thanks to Sebastian Strollo.)
Own Id: OTP-5921
binary_to_term(<<131,109,255,255,255,255) and similar expressions used to crash the emulator instead of causing a badarg exception. (Thanks to Matthias Lang.)
Own Id: OTP-5933
erlang:hibernate/3 could sometimes crash the emulator when no heap was needed.
Own Id: OTP-5940
Execution of match specs could under rare circumstances cause the emulator to dump core.
Execution of match specs could cause memory leaks in the hybrid emulator.
Own Id: OTP-5955
A bug in erlang:trace_info/2 when getting info for a function in a deleted module resulting in an emulator crash, has been corrected.
Own Id: OTP-5957
Different (and old) config.guess files in the ERTS and Erl_Interface applications would cause build problems on the new Intel-based iMacs. (Thanks to Sebastion Strollo.)
Own Id: OTP-5967
pthread header and library mismatch on Linux systems (at least some SuSE and Debian) with both NPTL and Linuxthreads libraries installed.
Own Id: OTP-5981
Improvements and New Features
The driver_set_timer did not change the previous timeout if called a second time. Now it works as specified, changing the timeout.
Own Id: OTP-5942
The undocumented {packet,http} option (for the gen_tcp module) did not not work correctly when there were multiple continuation lines. (Thanks to Per Hedeland.)
Own Id: OTP-5945
The setuid_socket_wrap program was corrected to work for C compilers that treat the char type as unsigned. (Thanks to Magnus Henoch.)
Own Id: OTP-5946
1.76 ERTS 5.4.12
Fixed Bugs and Malfunctions
Fixed a minor build problem on Windows.
Own Id: OTP-5819 Aux Id: OTP-5382 OTP-5540 OTP-5577
The delay_send option for gen_tcp was broken on Windows.
Own Id: OTP-5822
Improvements and New Features
The HiPE compiler identifies more leaf functions, giving slightly faster code.
Corrected problems in HiPE's coalescing register allocating that would cause it to fail when compiling very large functions (e.g. some of parse modules in the Megaco application).
Own Id: OTP-5853
1.77 ERTS 5.4.11
erlang:monitor(process,Pid) hanged if Pid referred to a process on a non-existing node with the same nodename as the nodename of node on which the call was made. This bug has now been fixed.
Own Id: OTP-5827
Improvements and New Features
By setting Unix environment variables, the priority for the emulator can be lowered when it is writing crash dumps and the time allowed for finishing writing a crash dump can be set to a certain number of seconds. See the documentation for erl in the ERTS application. (Also, a few other previously undocumented environment variables are now documented.)
Own Id: OTP-5818
Documentation improvements:
- documentation for erlang:link/1 corrected
- command line flag -code_path_cache added
- erl command line flags clarifications
- net_kernel(3) clarifications
Own Id: OTP-5847
1.78 ERTS 5.4.10
Fixed Bugs and Malfunctions
.
Own Id: OTP-5749
Some compiler warnings and Dialyzer warnings were eliminated in the Tools application.
When tracing to a port (which fprof does), there could be fake schedule out/schedule in messages sent for a process that had exited.
Own Id: OTP-5757
Improvements and New Features.
Own Id: OTP-5709 Aux Id: seq10100
The previously undocumented and UNSUPPORTED zlib module has been updated in an incompatible way and many bugs have been corrected. It is now also documented.
*** POTENTIAL INCOMPATIBILITY ***
Own Id: OTP-5715
New socket options priority and tos for platforms that support them (currently only Linux).
Own Id: OTP-5756
Only the emulator is now linked with termcap library in order to decrease library dependencies for other otp programs.
Own Id: OTP-5758
1.79 ERTS 5.4.9.80 ERTS 5.4.9.1
Improvements and New Features
On VxWorks, epmd did not handle file descriptors with higher numbers than 63. Also, if epmd should get a file descriptor with a number >= FD_SETSIZE, it will close a the file descriptor and write a message to the log (instead of mysteriously fail); the Erlang node that tried to register will fail with a duplicate_name error (unfortunately, epmd has no way to indicate to the Erlang node why the register attempt failed).
Own Id: OTP-5716 Aux Id: seq10070
1.81 ERTS 5.4.9
Fixed Bugs and Malfunctions
Timezone data is now initialized better. (was a problem at least on NetBSD 2.0.2) Thanks to Rich Neswold.
Own Id: OTP-5621
The hybrid-heap emulator ('erl -hybrid') is much more stable. We have corrected all known bugs that caused it to dump core while running our test suites.
Own Id: OTP-5634
Fixed rare memory leaks in erlang:demonitor/1 when distributed monitors were removed.
Own Id: OTP-5692
Processes were sometimes unnecessarily garbage collected when terminating. These unnecessary garbage collections have now been eliminated.
Own Id: OTP-5693
Improvements and New Features
The term-building driver functions driver_output_term() and driver_send_term() have been updated:
The ERL_DRV_FLOAT type has been added.
For the ERL_DRV_BINARY type, the length and offset are now validated against the length of the driver binary.
The ERL_DRV_PID type is now implemented (it was documented, but not implemented).
Own Id: OTP-5674
1.82 ERTS 5.4.8
Fixed Bugs and Malfunctions
ets:delete/1 now allows other Erlang process to run when a large table is being deleted.
Own Id: OTP-5572
Erlang/OTP will now build on Mac OS X 10.4 "Tiger" (the problem was that 10.4 has a partially implemented poll() function that can't handle devices). Also, on Mac OS X 10.3 "Panther", Erlang/OTP will now use select() instead of poll() (because poll() on Mac OS X 10.3 is implemented using select()).
Own Id: OTP-5595
A bug in the file driver when opening a file in compressed mode, and the returned allocated pointer from the compressing library was in very high memory (>= 2GB), causing e.g. file:read/2 to return {error,ebadf}, has been corrected.
Own Id: OTP-5618
Improvements and New Features
In the HiPE application, there's a new experimental register allocator (optimistic coalescing), and the linear scan register allocator is now also available on ppc. Plus lots of cleanups.
Minor hybrid heap corrections.
The maximum size of a heap used to be artificially limited so that the size of a heap would fit in 28 bits; that limitation could cause the emulator to terminate in a garbage collection even if there still was available memory. Now the largest heap size for a 32 bit CPU is 1,699,221,830 bytes. (Thanks to Jesper Wilhelmsson.)
Also removed the undocumented +H emulator option.
Own Id: OTP-5596
1.83 ERTS 5.4.7
Fixed Bugs and Malfunctions
to_erl could close unexpectedly on Linux systems. Also, output from the emulator could be lost. Corrected.
Own Id: OTP-5561
Improvements and New Features
The cpu_timestamp option for erlang:trace/3 is now also supported on Linux.
Own Id: OTP-5532 Aux Id: seq9813
The last known werl window size/position is now saved correctly when werl is stopped with the window minimized. A problem with the placement not being saved if the emulator is halted or stopped from the JCL menu has also been fixed.
Own Id: OTP-5544 Aux Id: OTP-5522
1.84 ERTS 5.4.6
Fixed Bugs and Malfunctions
Some math libraries do not always throw floating-point exceptions on errors. In order to be able to use these libraries, floating-point errors are now more thoroughly checked.
Misc floating-point fixes for Linux and MacOSX.
Own Id: OTP-5467
An internal buffer was sometimes not cleared which caused garbage to appear in error messages sent to the error logger.
errno was sometimes clobbered which caused erroneous error reports about poll() errors.
Only emulators on unix platforms were affected by these bugs.
Own Id: OTP-5492
The ethread library now works on OpenBSD.
Own Id: OTP-5515
Corrected a bug in the (undocumented and unsupported) option {packet,http} for gen_tcp. (Thanks to Claes Wikstrom and Luke Gorrie.)
Own Id: OTP-5519
Improvements and New Features
binary_to_term/1 could cause the emulator to crash when given invalid pids or funs.
Own Id: OTP-5484 Aux Id: seq9801
Some more stability problems were fixed in the hybrid-heap emulator.
Own Id: OTP-5489
After werl was closed with the window minimized, it was not possible to restart werl with an open window. A temporary solution has so far been implemented that restores the initial window settings every time werl is started.
Own Id: OTP-5522
1.85 ERTS 5.4.5
Fixed Bugs and Malfunctions
If a process had node links (created by monitor_node/2), executing process_info(Pid,memory) for that process would crash the emulator.
Own Id: OTP-5420
Minor corrections to the help text printed by erlc -help. The documentation for erlc was also slightly updated.
Own Id: OTP-5428
32-bit words were used for offsets in the garbage collector. This caused the emulator to crash on 64-bit machines when heaps were moved more than 4 GB during garbage collection.
Own Id: OTP-5430
is_boolean(42.5) failed to load if optimization was explicitly turned off.
Own Id: OTP-5448
If there was a call to Module:foo/X from any loaded module, the returned by M:module_info(exports) would always include {foo,X} (even though Module:foo/X if was not defined).
Own Id: OTP-5450 Aux Id: seq9722
1.86 ERTS 5.4.4
Fixed Bugs and Malfunctions
The function erlang:float/1 can now be used in match specifications and is recognized by dbg:fun2ms/1 and ets:fun2ms/1. This addition is part of the work to "harmonize" match specification guards with Erlang guards.
Own Id: OTP-5297 Aux Id: OTP-4927
The register/2 BIF would return true even if the second argument was not a pid for living process. Corrected to cause an exception.
Own Id: OTP-5324 Aux Id: seq9698
In the 'bag' type of ets tables, elements having the same key were supposed to be order in insertion order. The would be wrong if a rehash occurred.
Own Id: OTP-5340 Aux Id: seq9704
Fixed a bug in the hybrid heap in distributed send operations.
Own Id: OTP-5361
A BIF erlang:raise/3 has been added. See the manual for details. It is intended for internal system programming only, advanced error handling.
Own Id: OTP-5376 Aux Id: OTP-5257
Mikael Pettersson (HiPE) corrected a few bugs in the emulator that caused problems when compiled with the experimental gcc-4.0.0.
Own Id: OTP-5386
Improvements and New Features
Minor update of the internal documentation of the epmd protocol.
The listen port of epmd has now been registered at IANA:.
Own Id: OTP-5234
run_erl.c now works on Mac OS X and FreeBSD.
Own Id: OTP-5384
A few bugs were corrected in the HiPE application.
Own Id: OTP-5385
1.87 ERTS 5.4.3
Fixed Bugs and Malfunctions
Font and color preferences for werl.exe now can be saved even after the first time you run werl.exe. The window position and size is also saved. Patch from James Hague who did all the hard work.
Own Id: OTP-5250
OTP archive libraries, e.g. the erl_interface library, on MacOSX could not be used without first rerunning ranlib on them. This bug has now been fixed.
Own Id: OTP-5274
Bugs in erlang:hash/2 and erlang:phash/2 on 64-bit platforms have been fixed.
Own Id: OTP-5292
Improvements and New Features
Corrected a crash in the 64-bits emulator.
Corrected a problem in the hybrid heap emulator.
In the chapter about the abstract format in the ERTS User's Guide, updated the last section about how the abstract format is stored in BEAM files.
Own Id: OTP-5262
The maximum number of concurrent threads in the internal ethread thread package has been limited to 2048.
Own Id: OTP-5280
1.88 ERTS 5.4.2.1
Improvements and New Features
If Erlang/OTP was installed in a short directory name, such as C:\Program\erl5.4.2, the emulator would not start.
Own Id: OTP-5254
1.89 ERTS 5.4.2
Fixed Bugs and Malfunctions
If one used select/3 and select/1 on a non-fixed ETS table and deleted objects simultaneously, the emulator could crash. Note that the result of such simultaneous operations on tables that are not in a fixed state is still undefined, but the emulator crash is, needless to say, fixed.
Own Id: OTP-5209 Aux Id: seq9198
Arithmetic with big numbers could crash the emulator.
The HiPE native code compiler and run-time code in the emulator has been updated. (Note: Native code is still not supported.)
Eliminated a few bugs that could crash the hybrid emulator (which is not supported).
Own Id: OTP-5233 Aux Id: seq9587
1.90 ERTS 5.4.1
Fixed Bugs and Malfunctions
The ethread library was unnecessarily rebuilt multiple times during the build process, also a debug version of the library was build during the install phase. These unnecessary builds have now been removed. Note, the content of the installed Erlang/OTP system is not effected at all by this change.
Own Id: OTP-5203
The emulator could fail to clear the memory segment cache. This could potentially cause memory allocation to unnecessarily fail when memory usage was close to its maximum. This bug has now been fixed.
Own Id: OTP-5211
std_alloc (std short for standard) was sometimes called def_alloc (def short for default). std_alloc is now everywhere referred to as std_alloc.
Own Id: OTP-5216
A documentation bug has been corrected in the erts_alloc(3) documentation. It was stated that some of the memory allocators present were by default disabled. This is true for Erlang/OTP R9C, but is not true for Erlang/OTP R10B. In R10B all memory allocators present are enabled by default.
Own Id: OTP-5217
Improvements and New Features
The emulator now close all open files and sockets immediately after receiving an USR1 signal. This causes the emulator to unregister at epmd as early as possible.
Own Id: OTP-5221 Aux Id: OTP-4985, seq9514
Try/catch support in the emulator slightly updated.
Own Id: OTP-5229 | http://www.erlang.org/doc/apps/erts/notes.html | CC-MAIN-2014-52 | refinedweb | 38,509 | 56.15 |
Are there any int to string conversion functions?
Printable View
Are there any int to string conversion functions?
itoa(int,char*,int)
the first int is the integer to change to a string
the char* is where the string is stored
the second int is the radix, or the base of the the first int.
base? what do you mean?
Decimal is base 10, hex is base 16, binary is base 2, etc.
itoa is non-standard.
Use a stringstream
In the new faq thread on the General Disucssions board,
Code:
#include <sstream> //this header automatically includes iostream and is needed for ostringstream
#include <string>
using namespace std;
string IntToString(int num); //this will be our converter function
int main(void)
{ int number=5;
string result=IntToString(number);
cout<<result<<endl;
cin.get();
return 0;
}
string IntToString(int num)
{ ostringstream myStream; //creates an ostringstream object
myStream<<num<<flush;
/*outputs the number into the string stream and then flushes
the buffer (makes sure the output is put into the stream)*/
return myStream.str(); //returns the string form of the stringstream object
}
Code:
template <typename T>
std::string ToString(const T& number)
{
std::ostringstream os;
os << number;
return os.str();
}
True, but two things...
Is a beginner gonna know how to use templates?
Are they needed in this instance?
The answer to both is probably no.
Well, if the only thing being converted are int's, then no, templates aren't necessary at all, but still is good to know what your options are, don't you think?
One should aim at making code reusable, and this was just a very humble example. | https://cboard.cprogramming.com/cplusplus-programming/34663-int-string-functions-printable-thread.html | CC-MAIN-2018-05 | refinedweb | 271 | 71.65 |
Member
28 Points
Feb 21, 2012 03:37 PM|bihariagrawal|LINK
Hi,
I want to know how to retrieve data from URL.
Ex:
How to get access_token value from this URL.
Star
9937 Points
Feb 21, 2012 04:03 PM|me_ritz|LINK
there is nothing like "#" in
that got to be "?" so it becomes
that is what you call querystring and you can access it on index page like this:
string qstring = Request.QueryString["access_token"]; //C#
Dim qstring as string = Request.QueryString("access_token") //VB
More info:
All-Star
19138 Points
Feb 21, 2012 04:11 PM|adeelehsan|LINK
The # sign is not passed over to the server side. So you can not directly get it in code behind. There is a work around using jQuery/JavaScript where you receive it in client side and set it on a server side control and send to server.
See the following link for the example:
All-Star
20565 Points
Feb 21, 2012 04:14 PM|roopeshreddy|LINK
Hi,
Generally the QueryString format will be like this!
which the above QueryString can be retrieved through Request.QueryString["q"]!
If you wan to retrieve values from your URL, then write custom logic to do that!
Check the sample code below!
string strURL = Request.Url.ToString(); string[] strQueryString = strURL.Split(new char[]{'#'}); foreach (string item in strQueryString) { string[] strQueryValues = item.Split(new char[]{'='}); string strKey = strQueryValues[0]; string strValue = strQueryValues[1]; }
Hope it helps u...
Member
194 Points
Feb 22, 2012 04:24 AM|tej narayan|LINK
using System.IO;
using system.Net;
WebClient client = new WebClient();
string htmlCode = client.DownloadString();
uisng the above code you will get data from that site in string format and then you can manipulate by removing html tables
by using c# functions like replace() or remove or any other metgod to get data
I have tried this in my page and is working fine
4 replies
Last post Feb 22, 2012 04:24 AM by tej narayan | http://forums.asp.net/p/1772144/4844206.aspx?Re+How+to+retrieve+data+from+URI+ | CC-MAIN-2014-15 | refinedweb | 327 | 73.58 |
Bah that would never work for us, we're not a faang
The opposite of folks who follow every FAANG trend and over-engineer their companies to death, are the folks who never take advice from the big boys. The ones who read my recap of Software Engineering at Google and said "Yes of course Google can automate all that work, there's entire teams focusing on that! We gotta grind it out! Ain't nobody got time to make their lives easier!!"
You can automate your work and speed up your team. That's what engineering is all about! Making tools that improve people's lives. Yours included.
First you do the work. Then you notice the patterns. Then you automate them away.
Known as the rule of three when coding, it works for tooling and process. When you find yourself doing a repetitive task for the 3rd time, see if you can make it easier.
You go through life accumulating little snippets of code and keyboard shortcuts that make your machine feel just right. A vanilla computer feels like you lost an arm.
That's called "developer experience" (DX) these days. Large companies do in fact have whole teams devoted to DX.
But most don't. A good team shares the improvements everyone makes. When the company grows, some of you become the DX team because you enjoy making everyone faster.
How to automate a painful process
At work, we use a distributed monolith architecture. The result of a partial migration to micro services.
We have a bunch of services, each in its own repository, all sharing the database as the communication layer. You get every downside of a monolith and every downside of micro services. It's great. 🙃
Production deploys hurt. And they're getting worse as the team grows. More frequent or more painful. Choose your poison.
1. spot the problem
Painful deploys are easy to spot. There's a whole book about it called The Phoenix Project.
You'll see behaviors like:
- Folks avoiding deploys
- Nobody wants to deploy their own code
- Finished code sitting around for weeks
- Deploy meetings where everyone gets together and deploys
- Lots of back-and-forth chatter about what is and isn't ready to go out
- Production bugs from incorrect and partial deploys
Deploys should be a non-event. Something that just happens every day. At least.
We use GitOps with automated AWS CodePipeline deploys driven by
git push. The problem is our plethora of microservices that all need to work together.
Other problems may have other symptoms. Pay attention.
2. see the pattern
Going from develop to staging is full of the human element. You need to look at the diff, check the features, and ask every team if it's okay to deploy.
Remember, you don't know what everyone else is doing.
When you're ready, you run a series of commands:
cd ../databasegit checkout developgit pull origin developgit checkout staginggit pull origin staginggit merge developgit push origin staging
Get the latest
develop database and the latest
staging database. Merge. Push.
cd ../microservice1git checkout developgit pull origin developgit checkout staginggit pull origin staginggit merge developgit push origin staging
Do the same for the first microservice. Then the second. Then the third. Then you forget the fourth, do the fifth, and oh hey production bug!
Every damn time my friend.
3. make a script
Look, you're mindlessly doing the same process for every deploy. You know who's good at that? Computers.
You can start with a bash script:
#!/bin/bashgit checkout developgit pull origin developgit checkout staginggit pull origin staginggit merge developgit push origin staging
Put that in every repository, call it
deploy.sh. Now you can deploy with
./deploy. Saves 20 seconds per service, is always correct.
4. make a better script
Would be nice if you could run one script instead of going into every repository 🤔
You can do this with bash, but I've learned my lesson. Use a language you're familiar with when you need loops, conditions, functions, and user input.
That series of commands can become a Node.js function.
import prompts from "prompts"import chalk from "chalk"import { execSync } from "child_process"async function deployRepository(path) {const { yes } = await prompts({type: "confirm",name: "yes",message: `Ready to deploy ${path}?`,initial: true,})if (yes) {const deployCommands = ["git checkout develop","git pull origin develop","git checkout staging","git pull origin staging","git merge develop","git push origin staging",]for (const command of deployCommands) {execSync(command, { cwd: path })}console.log(chalk.green(`\n${path} deployed\n\n`))}}
Prompts lets you ask for user input – "Are you ready to deploy?" in this case. If they answer "yes", you deploy.
Mechanically iterate through the list of commands, use
execSync to run them in your desired directory –
cwd – then use chalk to print a green success message.
Run
deployRepository in a loop over every microservice and you have yourself a huge timesaver!
node deployAll.js
That's a 10min error-prone task whittled down to a quick flick of the wrist. 😍
Later you can make it run every day on its own.
When's it worth automating
As engineers we love to automate tedious work. But it's not always worth it! Use this helpful conversion chart from XKCD:
And remember, automation can be a trap.️ | https://swizec.com/blog/you-dont-need-a-big-team-to-automate-your-work/ | CC-MAIN-2022-27 | refinedweb | 891 | 66.84 |
collection of ideas for avoiding link spam
unsorted no priority just my current ideas
disable save if http links are added to a page. (may make normal users angry)
This can be done already without any code change
- hide pages with http links from crawlers. (that may give spam but no money for that spam)
- whitelisting of allowed http pages, check agains those (may make lots of work, long lists)
- using interwikimap for http (may need an itemrwiki entry fo using http links, can be much work)
- an external link item where the link has to be defined beforehand. Only trusted people can get the right to do that. (extra step, can give lots of items, will likly need a namespace, much additional work for regular users)
- only trusted people are allowed to write http links, same as e.g. textcha disabled group.
only people of a usergroup can edit at all (no anonymous)
This can be done by just using acls without any code change
others | http://www.moinmo.in/ReimarBauer/BraindumpAvoidLinkSpam | crawl-003 | refinedweb | 167 | 72.8 |
Wavelet Transforms¶
New in version 0.9.1: Wavelet functions were only added in version 0.9.1
We are going to use wavelets to transform an image so that most of its values are 0 (and otherwise small), but most of the signal is preserved.
The code for this tutorial is avalailable from the source distribution as
mahotas/demos/wavelet_compression.py.
We start by importing and loading our input image
import numpy as np import mahotas import mahotas.demos from mahotas.thresholding import soft_threshold from matplotlib import pyplot as plt from os import path f = mahotas.demos.load('luispedro', as_grey=True) f = f[:256,:256] plt.gray() # Show the data: print("Fraction of zeros in original image: {0}".format(np.mean(f==0))) plt.imshow(f) plt.show()
(Source code, png, hires.png, pdf)
There are no zeros in the original image. We now try a baseline compression method: save every other pixel and only high-order bits.
direct = f[::2,::2].copy() direct /= 8 direct = direct.astype(np.uint8) print("Fraction of zeros in original image (after division by 8): {0}".format(np.mean(direct==0))) plt.imshow(direct) plt.show()
(Source code, png, hires.png, pdf)
There are only a few zeros, though. We have, however, thrown away 75% of the values. Can we get a better image, using the same number of values, though?
We will transform the image using a Daubechies wavelet (D8) and then discard the high-order bits.
# Transform using D8 Wavelet to obtain transformed image t: t = mahotas.daubechies(f,'D8') # Discard low-order bits: t /= 8 t = t.astype(np.int8) print("Fraction of zeros in transform (after division by 8): {0}".format(np.mean(t==0))) plt.imshow(t) plt.show()
(Source code, png, hires.png, pdf)
This has 60% zeros! What does the reconstructed image look like?
# Let us look at what this looks like r = mahotas.idaubechies(t, 'D8') plt.imshow(r) plt.show()
(Source code, png, hires.png, pdf)
This is a pretty good reduction without much quality loss. We can go further and discard small values in the transformed space. Also, let’s make the remaining values even smaller in magnitude.
Now, this will be 77% of zeros, with the remaining being small values. This image would compress very well as a lossless image and we could reconstruct the full image after transmission. The quality is certainly higher than just keeping every fourth pixel and low-order bits.
tt = soft_threshold(t, 12) print("Fraction of zeros in transform (after division by 8 & soft thresholding): {0}".format(np.mean(tt==0))) # Let us look again at what we have: rt = mahotas.idaubechies(tt, 'D8') plt.imshow(rt)
(Source code, png, hires.png, pdf)
What About the Borders?¶
In this example, we can see some artifacts at the border. We can use
wavelet_center and
wavelet_decenter to handle borders to correctly:
fc = mahotas.wavelet_center(f) t = mahotas.daubechies(fc, 'D8') r = mahotas.idaubechies(fc, 'D8') rd = mahotas.wavelet_decenter(r, fc.shape)
Now,
rd is equal (except for rounding) to
fc without any border effects..
haar(f, preserve_energy=True, inline=False)
Haar transform
mahotas.
ihaar(f, preserve_energy=True, inline=False)
Reverse Haar transform
ihaar(haar(f))is more or less equal to
f(equal, except for possible rounding issues).
mahotas.
daubechies(f, code, inline=False)
Daubechies wavelet transform
This function works best if the image sizes are powers of 2!
mahotas.
idaubechies(f, code, inline=False)
Daubechies wavelet inverse transform | http://mahotas.readthedocs.io/en/latest/wavelets.html | CC-MAIN-2017-47 | refinedweb | 580 | 61.63 |
>>. A custom class can both grab gestures, and expose a QML interface, but this raises the bar for use significantly. It also leaves the current set of declarative elements unloved. This isn't a recipe for a happy ending. ;-(
The observant documentation readers out there may have noted the existence of a GestureArea QML element in the documentation. I won't waste time and screen real estate duplicating what is written there, but I would like to provide a brief sketch. First, please note the caveat: Elements in the Qt.labs module are not guaranteed to remain compatible in future versions. That said, let's take a look at what this element provides:
A GestureArea handles one or more gestures within an area of the screen, much as a MouseArea handles mouse events. Each gesture type is handled by a corresponding signal. To illustrate, QGestureType::TapGesture can be accepted by implementing the Tap signal:
import Qt.labs.gestures 0.1
GestureArea {
onTap: console.log("tap received")
}
Each signal has one or more properties describing the gesture. Going back to the tap, the gesture is described through a point called position. This property contains the point where the tap was registered.
Starting from the labs module described above, we've been experimenting with taking the GestureArea forward toward production quality. The name has been kept, but the rest of the element has seen significant changes. Being developers, we do a lot of our thinking in code (and on whiteboards, but code is compact), so here's something to start the explanation from:
import Qt.labs.gestures 2.0
GestureArea {
Tap: {
when: gesture.hotspot.x > gesture.hotspot.y
onStarted: console.log("tap in upper right started")
onFinished: console.log("tap in upper right completed")
}
}
The first thing is, yes, the version number has jumped. Moving along, the syntax for hooking a gesture has changed. Rather than using a signal, you specify the gesture as a sub-element. All the default gesture names are recognized, and custom gestures can be as well. To do so, the recognizer needs to be registered with Qt via
qmlRegisterUncreatableType() and
qmlRegisterType(). See the GestureArea plugin.cpp for details.
Within a gesture sub-element, there's an optional property called
when. This property is used to specify a set of conditions that dictate when the gesture should be accepted. If an incoming gesture doesn't pass the test, it isn't accepted and future updates will be ignored. You can access the properties of the gesture through the gesture property, as well as anything else that happens to fall in scope.
If the when property evaluates to true, the appropriate gesture state signal (onStarted, onUpdated, onFinished, onCanceled) is invoked.
Our development was guided by a few example interfaces that we thought should be easy to piece together. Along the way we hit a few walls, wrote a few patches, and had a great time.
import Qt 4.7
import Qt.labs.gestures 2.0
Rectangle {
id: rootWindow
width: 320
height: 320
color: "white"
property int inGesture: 0
signal reset
onReset: { color = "#ffffff"; gestureText.text = "Gesture: none"; inGesture = 0 }
Text {
id: gestureText
anchors.centerIn: parent
text: "Gesture: none"
}
GestureArea {
anchors.fill: parent
Pan {
when: inGesture != 2
onStarted: {rootWindow.color = "#fffca4"; inGesture = 1}
onUpdated: gestureText.text = "Pan: X offset = " + gesture.offset.x.toFixed(3)
onFinished: rootWindow.reset()
}
Pinch {
when: inGesture != 1
onStarted: {rootWindow.color = "#a3e2ff"; inGesture = 2}
onUpdated: gestureText.text = "Pinch: scale = " + gesture.scaleFactor.toFixed(3)
onFinished: rootWindow.reset()
}
}
}
This is where we ask something of you, dear readers. Grab the GestureArea module , and start creating. Have a look at the examples for inspiration. The module is targeted at Qt 4.7.1 [Edit: as in should build using, not will be shipping with], and there are some experiments being carried out in this research repository.
And then tell us what you think. This release bears the same warning as the first implementation. We want to stabilize this functionality and get it into the declarative core, but we need | https://www.qt.io/blog/2010/10/05/getting-in-touch-with-qt-quick-gestures-and-qml | CC-MAIN-2019-39 | refinedweb | 669 | 60.51 |
#include <avr/io.h> #include <avr/interrupt.h> void setup() { // initialize the digital pin as an output. DDRB= B11111111; // set PORTB (digital 13-8) to outputs cli(); // disable global interrupts TCCR1A = 0; // set entire TCCR1A register to 0 TCCR1B = 0; // same for TCCR1B TCCR1B |= (1 << CS10); // Set CS10 bit only for prescaler 1 sei(); // enable global interrupts: }void loop() { if (TCNT1 < 5){ PORTB=B10000000; } if (TCNT1 > 20000){ PORTB=B00000000; } }
I need to create 10 different PWM duyt cycle with a MEGA board.
I need to create 10 different PWM duyt cycle with a MEGA board.
Issue is the resolution which is fixed at 8 bit. We need a resolution of more than 10bit...
That shouldn't happen, right?
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
Thank you for subscribing!
Arduino
via Egeo 16
Torino, 10131
Italy | http://forum.arduino.cc/index.php?topic=137397.msg1032272 | CC-MAIN-2015-11 | refinedweb | 153 | 73.68 |
To get started you will want to create a new Windows forms application. You can call it whatever you would like, I called mine CSharpGameProgramming. If you call yours something different you will have to adjust the namespace for the code.
I receive a comment on the first one on why I was using DLLImport to get the TickCount when I could have used Environment.TickCount. The reason was I was going to update this to use a timer with better accuracy. I was going to use DLLImport to import the high resolution timer. Instead I will use the Stopwatch class for the timer. I again will be making a class for the timer. To your project add a class called HiResTimer. I always like to give code to be read and then explain why I did what I did. This is the code for class.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; namespace CSharpGameProgramming { class HiResTimer { Stopwatch stopwatch; public HiResTimer() { stopwatch = new Stopwatch(); stopwatch.Reset(); } public long ElapsedMilliseconds { get { return stopwatch.ElapsedMilliseconds; } } public void Start() { if (!stopwatch.IsRunning) { stopwatch.Reset(); stopwatch.Start(); } } public void Stop() { stopwatch.Stop(); } } }
The Stopwatch class is in the System.Diagonstics namespace so there is a using statement for that namespace. The only field in this class is an instance of the Stopwatch class called stopwatch. In the constructor I create a new instance of the Stopwatch class and call the Reset method of the Stopwatch class. There is a get only property of type long which returns the number of milliseconds that have elapsed since the timer was last reset. The first method is the Start method. What that method does is check to make sure that the stopwatch is not running. If it is already running resetting it and starting it over might not be a good idea. If it is not running I call the Reset method of the Stopwatch class and then the Start method of the Stopwatch class. The second method is the Stop method. The Stop method just calls the Stop method of the Stopwatch class.
What I will do next is modify the Program.cs file. Like in the last tutorial I will be using a game loop to control the flow of the game. In this version though I will be making a slight modification so that when the program exits all items of the form that can be disposed will automatically be disposed of. Change the main method of the Program.cs file to the following.
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); using (Form1 form1 = new Form1()) { form1.Show(); form1.GameLoop(); } }
By using the using statement for creating the form when the form is closed everything in the form that can be disposed of will be. Inside the using statement you need to make sure that the form is visible. You do this by calling the Show method. Next I call the GameLoop method which I will show you in a moment.
Before I get to the GameLoop method there are a number of fields that I want to add to the code of Form1. I will be using these fields in the game, which unlike my other tutorial, will do a little logic and a little rendering so you can see that the game is actually doing something. What you will want to do is add the following fields to the code of Form1.
HiResTimer timer = new HiResTimer(); long startTime; long interval = (long)TimeSpan.FromSeconds(1/30).TotalMilliseconds; Graphics graphics; Graphics imageGraphics; Image backBuffer; Image blackScreen; int clientWidth; int clientHeight; Rectangle image = new Rectangle(0, 0, 40, 50); Point direction = new Point(1, 2);
I will need a timer to control the speed at which the game runs so there is a HiResTimer field. The next field is of type long and it will be used to determine the millisecond at which each game loop starts. The next field is also of type long. I use TimeSpan to set the frame rate at which the game will run. I use the FromSeconds method and pass in 1 over 30 and get the result in milliseconds. What I am aiming for here is a frame rate of about 30 frames per second. Next there are two fields of type Graphics which are used for drawing with GDI+. The first one is for actually drawing to the form. The second one is for drawing to a back buffer. To prevent flickering it is best to draw to a back buffer and then copy the back buffer to the form. The second one is for drawing to the form itself. I also have an Image field for the back buffer. I will frequently need to know the width and height of the client area so there are two fields to hold them. The next two fields will be used to render and preform game logic.
There is one more thing I want to do before I get to the GameLoop method. I want to initialize a few things in the constructor for Form1.
public Form1() { InitializeComponent(); this.DoubleBuffered = true; this.MaximizeBox = false; this.FormBorderStyle = FormBorderStyle.FixedSingle; this.ClientSize = new Size(300, 300); clientWidth = this.ClientRectangle.Width; clientHeight = this.ClientRectangle.Height; backBuffer = (Image)new Bitmap(clientWidth, clientHeight); graphics = this.CreateGraphics(); imageGraphics = Graphics.FromImage(backBuffer); }
You should do things with the form after the call to InitializeComponent because until that is called nothing truly exists on the form. The first thing I do is set the DoubleBuffered property of the form to true to stop flickering. GDI+ is slow, really slow, and it slows down even more in larger areas. To help things along I set the form so it can't be maximized or resized. I then set the client size to 300 pixels by 300 pixels. I set the two fields for the width and height of the client area. Next I create the back buffer image by creating a new Bitmap and casting the result to an Image. The Graphics class does not have a constructor. You need to create them by other means. Controls have the ability to create instances of the Graphics class using the CreateGraphics method so I do that with the form. The Graphics class also has the ability to create an instance using the FromImage method and I do that for the back buffer.
Now it is time for the GameLoop method. The method is pretty much the same as in the last tutorial. This is the code.
public void GameLoop() { timer.Start(); while (this.Created) { startTime = timer.ElapsedMilliseconds; GameLogic(); RenderScene(); Application.DoEvents(); while (timer.ElapsedMilliseconds - startTime < interval) ; } }
What this does is first start the timer. It then loops while the form is open. Each time through the loop it sets the startTime field to be the number of elapsed milliseconds since the timer was started. It then calls a method called GameLogic which will control objects in the game. It is important to update objects in a game before rendering them. It then calls a method RenderScene that will draw the game objects. It then tells the form to process any events that are in the queue of events. The last part is what keeps the game running at a relatively constant speed. It just loops until the elapsed milliseconds in the timer minus the starting value is less than the interval or frame rate.
Like I said the GameLogic method is what controls the objects in the game. In this simple game there is only one object, a rectangle that floats around the window. This is the code for the GameLogic method.
private void GameLogic() { image.X += direction.X; image.Y += direction.Y; if (image.X < 0) { image.X = 0; direction.X *= -1; } if (image.Y < 0) { image.Y = 0; direction.Y *= -1; } if (image.X + image.Width > clientWidth) { image.X = clientWidth - image.Width; direction.X *= -1; } if (image.Y + image.Height > clientHeight) { image.Y = clientHeight - image.Height; direction.Y *= -1; } }
I use the direction field to handle moving the rectangle. I set the initial values to (1, 2). That means that X value is 1 and the Y value is 2. When you are working with graphics in 2D the X coordinate increases as move across the screen. The Y coordinate increases as you move down the screen. So at the start the rectangle will be moving right 1 pixel at a time and 2 pixels down at a time. travelling. Checking for the right hand side is a little more difficult what you do is check to see if the X property plus the width of the rectangle is greater than the width of the client area. If it is set it method. This is where I actually draw something. This is the code for the RenderScene method.
private void RenderScene() { imageGraphics.FillRectangle(new SolidBrush(Color.Black), this.ClientRectangle); imageGraphics.FillRectangle(new SolidBrush(Color.Blue), image); this.BackgroundImage = backBuffer; this.Invalidate(); }
What the RenderScene method does is first fill the back buffer with black using the FillRectangle method of the Graphics class. The overload that I used requires a Brush and a Rectangle. For the brush I created a solid black brush. For the rectangle I use the ClientRectangle property of the form. I then draw a solid blue rectangle using a solid blue brush and the rectangle for the image. I then set the BackGroundImage property of the form to the backBuffer. I then call Invalidate method to tell the form that it needs be be redrawn. | http://www.dreamincode.net/forums/topic/140540-creating-games-with-c%23-part-2/page__pid__1621282__st__0 | CC-MAIN-2016-07 | refinedweb | 1,600 | 76.72 |
On Tue, 31 Mar 2009, Trond Myklebust wrote:> > However, if your mount point filehandle has expired, then chances are> that you'll probably have to look up all the filehandles in the mount> path again too, so why should you cache all that information?No, that' not the caching I was thinking about.I meant literally just the "namespace" thing. Keeping that around as long as you have a export active. How many of those do you have on your average nfs server? Why not just create those nfsd namespaces once for each export at startup, and destroy them at exit. Linus | http://lkml.org/lkml/2009/3/31/564 | CC-MAIN-2014-35 | refinedweb | 102 | 80.11 |
Recently I’ve been toying with React and trying to find the best way to get up and running. After a lot of trial and error I decided to go with webpack as my build tool and share what I’ve learned from my experience with it.
Initializing a project
Since React doesn’t have any tools to generate and manage projects, it’s up to us to set everything up. We need to create the directory, initialize Git, and initialize npm.
mkdir react-project && cd react-project
git init
npm init
After running
npm init, it’s a good idea to add
"private": true to
package.json so we can’t accidentally publish our project to npm.
Setting up webpack
Webpack is the build tool that takes our application code and generates static assets as well as a development server. Webpack has several advantages over other build tools: for example, it strips out unused code, supports hot module replacement, and is easily configured.
To get started we need to install webpack both globally and in the project. We
install it globally to make the
webpack command available and we install it
locally so we can specify which version of webpack the project should use
instead of relying on the global install.
npm install webpack --global
npm install webpack --save-dev
Basic configuration
Let’s start with a basic configuration in
webpack.config.js and build on it as
we go.
module.exports = { context: __dirname + "/app", entry: "./app.js", output: { filename: "app.js", path: __dirname + "/dist", }, }
At the moment we’re telling webpack that our application lives in the
app
directory and the entry point to our application is
app.js. We also tell
webpack to output the resulting JavaScript in
dist/app.js.
We can add a basic
app/app.js to make sure it’s working:
console.log("webpack rocks!");
Now we can run
webpack again and we can see that it creates
dist/app.js and
includes the code that we wrote.
Adding loaders
At the moment our configuration is basically just copying our file to the
dist
folder. The real power of webpack is the loaders that it provides. In this case
we’re going to use loaders to send our code through Babel and transform our
JSX into JavaScript.
Fortunately the Babel loader supports transforming both ES2015 and JSX which
means we can get away with using a single loader instead of requiring both the
babel-loader and the
jsx-loader.
We can install the babel loader with the following command:
npm install babel-loader --save-dev
To use the loader we need to add a
loaders object nested in a
module object
in
webpack.config.js.
module: { loaders: [ { test: /\.js$/, exclude: /node_modules/, loaders: ["babel-loader"], } ], },
Webpack accepts an array of loader objects which specify
loaders to apply to
files that match the
test regex and exclude files that match the
exclude
regex. In this case we’re applying the
babel-loader to all files with a
.js
extension that aren’t in
node_modules.
If we run
webpack we’ll see that webpack still bundles our JavaScript
successfully.
Writing React components
Now that we have a basic webpack configuration set up we can add React to the mix. Let’s install React and write a simple greeting component.
First we need to install React:
npm install react --save
Now we can write a greeting component in
app/greeting.js:
import React from "react"; export default React.createClass({ render: function() { return ( <div className="greeting"> Hello, {this.props.name}! </div> ); }, });
Inside
app/app.js we need to import our new greeting component and render it
on the page.
import React from "react"; import Greeting from "./greeting"; React.render( <Greeting name="World"/>, document.body );
We’re using ES6 modules to import React and the greeting component we just
wrote. The first argument to
React.render is using JSX to render our
Greeting component with the name property being passed in as
World.
JSX is just a more friendly syntax for rendering React components. We could
write it in JavaScript too. When compiled, the
babel-loader will turn our JSX
into the following:
React.createElement(Greeting, {name: "World"})
Now when the application is loaded our
Greeting component will be rendered
with “World” passed in as the
name property.
Adding an index page
React is ready to go, but we need a page to render the content. Let’s create a
basic page in
app/index.html.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Webpack + React</title> </head> <body></body> <script src="app.js"></script> </html>
Webpack needs to copy this file over to our
dist folder for us to use it which
means we’ll need to modify our
entry property in our webpack config and add an
additional loader.
entry: { javascript: "./app.js", html: "./index.html", },
To actually copy the file over we need the
file-loader package, which is a
loader that copies files.
npm install file-loader --save-dev
In our
webpack.config.js file below our first loader object, we can add a
loader object for the index page:
{ test: /\.html$/, loader: "file?name=[name].[ext]", },
Run
webpack one more time and open up the
dist/index.html file in a browser
and you can see our greeting component rendered on the page.
Setting up the webpack dev server
It’s pretty tedious to continue having to type
webpack and refresh the page
each time we make a change. Lucky for us webpack has another module that
provides a development server.
We need to install webpack-dev-server both locally and globally for the same reasons we installed webpack that way. We can install it with the following command:
npm install webpack-dev-server --global
npm install webpack-dev-server --save-dev
To run the dev server run
webpack-dev-server and visit.
Hot module replacement:
npm install react-hot-loader --save-dev
To use the
react-hot-loader loader, we can just prepend it to the
loaders
array in our first loader object.
{ test: /\.js$/, exclude: /node_modules/, loaders: ["react-hot", "babel-loader"], },
Whenever matching files are found they’re now passed through
react-hot first
and then through
babel-loader.
Finally we need to run
webpack-dev-server with two new options:
webpack-dev-server --hot --inline
Now when serving our project webpack injects JavaScript code that connects to the server and waits for module updates to be pushed. When an update is received the module is replaced.
It’s worth noting that not all modules can be replaced. The code in
app/app.js cannot be reloaded and will cause a full page reload but changing
the
Greeting component will trigger a hot module replacement.
To see it in action we can modify our greeting component by wrapping the text
in an
h1 tag. Now the
render function in
app/greeting.js will look like
this:
render: function() { return ( <div className="greeting"> <h1>Hello, {this.props.name}!</h1> </div> ); },
When you save the file you’ll see the page update automatically without a page reload.
For convenience we can add an npm script to run the server with the
--hot
--inline flags so we don’t have to type them out each time.
We can add the command under the
scripts object in
package.json:
"scripts": { "start": "webpack-dev-server --hot --inline" },
To run the server all we have to do is run
npm start and we have a development
server with hot module replacement up and running.
What’s next?
- Learn more about webpack loaders.
- Dive deeper into React’s JSX templates.
- Learn about building React applications with Flux, a design pattern by Facebook. | https://thoughtbot.com/blog/setting-up-webpack-for-react-and-hot-module-replacement | CC-MAIN-2022-40 | refinedweb | 1,284 | 64.61 |
In this module of the Python tutorial, we will learn about Python exception handling methods. This module highlights built in exception in Python classes and also try and except in Python, along with Python try-finally clause and raise exception Python.
What is Exception Handling in Python? Well, before we get you started on Exception Handling in Python, let’s learn about it from the beginning. It is obvious for a developer to encounter a few errors or mistakes in their code file. But what if developers could minimize these errors? Wouldn’t it be great? There are exception handling in Python methods, which help developers deal with potential errors and mistakes. I hope by now you have understood what is exception handling in python.
Lets see all the topics we will be covering in this module:
So, without further delay, let’s get started.
Before discussing on how to deal with errors, let us try and understand what errors are in Python. Errors are nothing but mistakes in the code which are potentially harmful.
There are two types of errors in Python:
Go for this in-depth job-oriented Python Training in Hyderabad now!
Python Syntax Errors occur while writing the code structure.
Example:
test = [1,2,3]
test = [1,2,3]
for i in test:
print(i)
Output:
File “”, line 3
print(i)
^
IndentationError: expected an indented block
Exception in Python is nothing but errors which are encountered at the run time.
Example:
test = [1,2,3]
for i in test:
print(i)
Output:
File “”, line 3
print(i)
^
Indentation Error: expected an indented block
There are some built in exception in Python classes that are already defined for generic cases. They are mentioned in the table below:
We have the perfect professional Python Course in Bangalore for you!
In Python, exceptions can be handled by two new methods:
It gets initiated with a try header line which is followed by a block of indented statements and then by one or more optional except clauses and then at the end an optional else clause can be used as shown below:
try:
Your statements
except Exception_1:
If there is Exception_1 then execute this block- statement
except Exception_2:
If there is Exception_2 then execute this block-statement
else:
if no exception was raised-statement
Now, let us understand this with an example:
try:
fp = open(‘myfile.txt’)
line = f.readline()
i = int(s.strip())
except (IOError,ValueError) as e:
print (“check if the file is read-only.”,e.errno)
except:
print (“Unexpected error”)
What exactly is happening here?
Say, a chunk of code is written inside the try block that is suspected to raise a Python exception. Then, to handle that exception, we write the exception block.
First, the try blockis executed
Note: Python can handle any number of exceptions.
Looking for Python for Data Science Course All-in-1 Combo Training? Enroll now!
When a final clause is used in a try block, then its block of statements is always run by Python, whether an exception occurred while the try block was running or not:
try:
fp = open(“test.txt”, “w”)
try:
fp.write(“Test is not there”)
finally:
print (“So, let us close the file”)
fp.close()
except IOError:
print (“Error: File not found” )
Output:
So, let us close the file
Here, we can notice that the exception block is not executed. This is because the file gets closed after the execution of the finally block.
To trigger exceptions, we need to code raise statements. Their general form is simple: the keyword, ‘raise’, followed by the name of the exception to be raised.
Example:
class RaisingValueError(Exception):
def __init__(self, data):
self.data = data
def __str__(self):
return repr(self.data)Total_movie = int(input(“Enter Total Movies Seen: “))
try:
Num_of_genres = int(input(“Enter Num of genres: “))
if(Num_of_genres < 1):
raise RaisingValueError(“Number of genres can’t be less than 1”)
except RaisingValueError as e:
print (“Try entering again:”, e.data)
Yes, it does make our codes robust and secures from potential errors, but exception handling in Python has a side effect too.
There are two types of errors in Python:
Therefore, we should use exception in Python only when we are unsure of certain part of the code, not for normal error handling cases. This can be understood with the help of an example.
import timeit
setup=”any=0″
statement_1 = ”’\
try:
b=10/a
except ZeroDivisionError:
pass”’
satement_2 = ”’\
if any !=0:
b=10/a”’
print(“time for statement_1=”,timeit.timeit(stmt1,setup,number=100000))
print(“time for statement_2=”,timeit.timeit(stmt2,setup,number=100000))
Output:
time= 0.07828223999999295
time= 0.0019908266666845975
This brings us to the end of this module in Python Tutorial. Now, if you want to know why Python is the most preferred language for data science, you can go through this blog on Python for Data Science.
Further, check out our offers for Python Certification Course and also refer to the trending Python interview questions prepared by the industry experts.
Course Schedule
Leave a Reply Cancel reply
Your email address will not be published. Required fields are marked *
Comment
Name *
Browse Categories | https://intellipaat.com/blog/tutorial/python-tutorial/python-exception-handling/ | CC-MAIN-2021-31 | refinedweb | 857 | 63.7 |
- Code: Select all
global SomeVariable = 'STRING'
If variable values are changed in Child.py, will the values be changed in Parent.py?
global SomeVariable = 'STRING'
DevynCJohnson wrote:I want to know if the child scripts will use the variables and functions created in the parent script.
#!/usr/bin/python3
#Made by Devyn Collier Johnson, NCLA, Linux+, LPIC-1, DCTS
import subprocess
VAR = 'FROM PARENT'
subprocess.Popen('./child.py')
#!/usr/bin/python3
#Made by Devyn Collier Johnson, NCLA, Linux+, LPIC-1, DCTS
subprocess.getoutput('date')
import io, sys
file = open('./test.TXT', 'w'); file.write(VAR); file.close()
#parent.py
var = 'FROM PARENT'
#child.py
from parent import var
with open('test.txt', 'w') as f_out:
f_out.write(var) #-->FROM PARENT
from my_module import *
import my_module
my_module.my_var
import my_module as mine
mine.my_var
I am very careful about variable names, so the negative possibilities of the command do not pertain to me.
Mekire wrote:The question is if others can follow your logic or even if your future self can follow your logic.
Return to General Coding Help
Users browsing this forum: babuvas, Yoriz and 2 guests | http://www.python-forum.org/viewtopic.php?p=4315 | CC-MAIN-2014-52 | refinedweb | 187 | 60.72 |
tmux frequently asked questions ****************************************************************************** * PLEASE NOTE: most display problems are due to incorrect TERM! Before * * reporting problems make SURE that TERM settings are correct inside and * * outside tmux. * * * * Inside tmux TERM must be "screen" or similar (such as "screen-256color"). * * Don't bother reporting problems where it isn't! * * * * Outside, it must match your terminal: particularly, use "rxvt" for rxvt * * and derivatives. * ****************************************************************************** * How is tmux different from GNU screen? tmux and GNU screen have many similarities. Some of the main differences I am aware of are (bearing in mind I haven't used screen for a few years now): - tmux uses a client-server model. Each server has single Unix domain socket in /tmp and within one server there are multiple sessions which may be attached to multiple clients (terminals). This has advantages, notably: windows may be linked simultaneously to multiple sessions; windows may be moved freely between sessions; and a client may be switched between sessions easily (C-b D). There is one major disadvantage: if the server crashes, game over, all sessions die. In practice, however, tmux is quite stable and gets more so as people report any bugs they hit :-). This model is different from screen, where typically each new screen instance is independent. tmux supports the same behaviour by using multiple servers with the -L option but it is not typically recommended. - Different command interfaces. One of the goals of tmux is that the shell should be easily usable as a scripting language - almost all tmux commands can be used from the shell and behave identically whether used from the shell, from a key binding or from the command prompt. Personally I also find tmux's command interface much more consistent and clearer, but this is subjective. - tmux calls window names (what you see in the status line) "names", screen calls them "titles". - tmux has a multiple paste buffers. Not a major one but comes in handy quite a lot. - tmux supports automatically renaming windows to the running application without gross hacks using escape sequences. Its even on by default. - tmux has a choice of vi or emacs key layouts. Again, not major, but I use emacs so if tmux did support only one key set it would be emacs and then all the vi users would get humpy. Key bindings may be completely reconfigured in any case. - tmux has an option to limit the window size. - tmux has search in windows (C-b f). - The window split (pane) model is different. tmux has two objects, windows and panes; screen has just windows. This difference has several implications: * In screen you can have a window appear in several layouts, in tmux a pane can only be in one window (fixing this is a big todo item but quite invasive). * tmux layouts are immutable and do not get changed unless you modify them. * In tmux, all panes are closed when you kill a window. * tmux panes do not have individual names, titles and so on. I think tmux's model is much easier to manage and navigate within a window, but breaking panes off from and joining them to windows is more clumsy. tmux also has support for preset pane layouts. - tmux's status line syntax is more readable and easier to use. I think it'd be hard for anyone to argue with this. tmux doesn't support running a command constantly and always using the last line of its output, commands must be run again each time. - tmux has modern, easily extended code. Again hard to argue screen is better if you have looked at the code. - tmux depends on libevent. I don't see this as a disadvantage: libevent is small and portable, and on modern systems with current package management systems dependencies are not an issue. libevent brings advantages in code simplicity and performance. - screen allows the window to be bigger than the terminal and can pan around it. tmux limits the size to the largest attached client. This is a big todo item for tmux but it is not trivial. - screen has builtin serial and telnet support; this is bloat and is unlikely to be added to tmux. - screen has support for updating utmp. Nobody has really come up with a clean, portable way to do this without making tmux setuid or setgid yet. - Environment handling is different. - tmux tends to be more demanding on the terminal so tends to show up terminal and application bugs which screen does not. - screen has wider platform support, for example IRIX, and for odd terminals. * I found a bug! What do I do? Please send bug reports by email to nicm@users.sourceforge.net or tmux-users@lists.sourceforge.net. Please include as much of the following information as possible: - the version of tmux you are running; - the operating system you are using and its version; - the terminal emulator you are using and the TERM setting when tmux was started; - a description of the problem; - if the problem is repeatable, the steps to repeat the problem; - for screen corruption issues, a screenshot and the output of "infocmp $TERM" from outside tmux are often very useful. * Why doesn't tmux do $x? Please send feature requests by email to nicm@users.sourceforge.net. * Why do you use the screen terminal description inside tmux? It sucks. It is already widely available. It is planned to change to something else such as xterm-xfree86 at some point, if possible. * I don't see any colour in my terminal! Help! On some platforms, common terminal descriptions such as xterm do not include colour. screen ignores this, tmux does not. If the terminal emulator in use supports colour, use a value for TERM which correctly lists this, such as xterm-color. * tmux freezes my terminal when I attach to a session. I even have to kill -9 the shell it was started from to recover! Some consoles really really don't like attempts to set the window title. Tell tmux not to do this by turning off the "set-titles" option (you can do this in .tmux.conf): set -g set-titles off If this doesn't fix it, send a bug * How do I use UTF-8? When running tmux in a UTF-8 capable terminal, UTF-8 must be turned on in tmux; as of release 0.9, tmux attempts to autodetect a UTF-8-capable terminal by checking the LC_ALL, LC_CTYPE and LANG environment variables. list-clients may be used to check if this is detected correctly; if not, the -u command-line flag may be specified when creating or attaching a client to a tmux session: $ tmux -u new Since the 1.0 release, tmux will turn on UTF-8 related options automatically (ie status-utf8, and utf8) if the above conditions are met. * How do I use a 256 colour. * vim or $otherprogram doesn't display 256 colours. What's up? Some programs attempt to detect the number of colours a terminal is capable of by checking the colors terminfo or Co termcap entry. However, this is not reliable, and in any case is missing from the "screen" terminal description used inside tmux. There are two options (aside from using "screen-256color") to allow programs to recognise they are running on a 256-colour terminal inside tmux: - Manually force the application to use 256 colours always or if TERM is set to screen. For vim, you can do this by overriding the t_Co option, see. - Creating a custom terminfo file that includes colors#256 in ~/.terminfo and using it instead. These may be compiled with tic(1). * How do I make Ctrl-PgUp and Ctrl-PgDn work in vim? tmux supports passing through ctrl (and where supported by the client terminal, alt and shift) modifiers to function keys using xterm(1)-style key sequences. This may be enabled per window, or globally with the tmux command: setw -g xterm-keys on Because the TERM variable inside tmux must be set to "screen", vim will not automatically detect these keys are available; however, the appropriate key sequences can be overridden in .vimrc using the following: if &term == "screen" set t_kN=^[[6;*~ set t_kP=^[[5;*~ endif And similarly for any other keys for which modifiers are desired. Please note that the "xterm-keys" setting may affect other programs, in the same way as running them in a standard xterm; for example most shells do not expect to receive xterm(1)-style key sequences so this setting may prevent keys such as ctrl-left and ctrl-right working correctly. tmux also passes through the ctrl (bit 5 set, for example ^[[5~ to ^[[5^) modifier in non-xterm(1) mode; it may be possible to configure vim to accept these, an example of how to do so would be welcome. vim users may also want to set the "ttyfast" option inside tmux. * Why doesn't elinks set the window title inside tmux? There isn't a way to detect if a terminal supports setting the window title, so elinks attempts to guess by looking at the environment. Rather than looking for TERM=screen, it uses the STY variable to detect if it is running in screen; tmux does not use this so the check fails. A workaround is to set STY before running elinks. The following shell function does this, and also clears the window title on exit (elinks, for some strange reason, sets it to the value of TERM): elinks() { STY= `which elinks` $* echo -ne \\033]0\;\\007; } * What is the proper way to escape characters with #(command)? When using the #(command) construction to include the output from a command in the status line, the command will be parsed twice. First, when it's read by the configuration file or the command-prompt parser, and second when the status line is being drawn and the command is passed to the shell. For example, to echo the string "(test)" to the status line, either single or double quotes could be used: set -g status-right "#(echo \\\\(test\\\\))" set -g status-right '#(echo \\\(test\\\))' In both cases, the status-right option will be set to the string "#(echo \\(test\\))" and the command executed will be "echo \(test\)". * tmux uses too much CPU. What do I do? Automatic window renaming may use a lot of CPU, particularly on slow computers: if this is a problem, turn it off with "setw -g automatic-rename off". If this doesn't fix it, please report the problem. * I use PuTTY and my tmux window pane separators are all qqqqqqqqq's! PuTTY is using a character set translation that doesn't support ACS line drawing. With a Unicode font, try setting PuTTY to use a different translation on the Window -> Translation configuration page. For example, change UTF-8 to ISO-8859-1 or CP437. It may also be necessary to adjust the way PuTTY treats line drawing characters in the lower part of the same configuration page. * What is the best way to display the load average? Why no #L? It isn't possible to get the load average portably in code and it is preferable not to add portability goop. The following works on at least Linux, *BSD and OS X: uptime|awk '{split(substr($0, index($0, "load")), a, ":"); print a[2]}' * How do I attach the same session to multiple clients but with a different current window, like screen -x? One or more of the windows can be linked into multiple sessions manually with link-window, or a grouped session with all the windows can be created with new-session -t. * Ctrl and arrow keys doesn't work in putty! What do I do? putty inverts the sense of the cursor key mode on ctrl, which is a bit hard for tmux to detect properly. To get ctrl keys right, change the terminfo settings so kUP5 (Ctrl-Up etc) are the adjusted versions, and disable smkx/rmkx so tmux doesn't change the mode. For example with this line in .tmux.conf (assuming you have TERM set to xterm): set -g terminal-overrides "xterm*:kLFT5=\eOD:kRIT5=\eOC:kUP5=\eOA:kDN5=\eOB:smkx@:rmkx@" Note that this will only work in tmux 1.2 and above. * How can I blank the tmux window? GNU screen has a feature whereby it will blank the screen after a period of inactivity. To do the same thing in tmux, use the lock-command setting, for example (with GNU bash): set -g lock-command 'tput civis && read -s -n1' This will remove the cursor and tell the shell to quit once a key has been pressed. For zsh, use "read -s -k1". In addition, it's possible to have both blanking and locking (for instance via lock(1) or vlock(1)) by using the following: bind x set lock-command '/usr/bin/vlock' \; lock-client \; set lock-command 'tput civis && read -s -n1' *". See the FAQ entry about 256 colors support for more info. Also note that tmux will still display reverse video on terminals that do not support italics. If your urxvt cannot display italics at all, make sure you have an italics capable font enabled, for example, add to ~/.Xdefaults: urxvt.italicFont: xft:Bitstream Vera Sans Mono:italic:autohint=true * How can I make tmux use my terminal's scrollback buffer? Normally, tmux enables the terminal's "alternate screen". Most terminals (such as xterm) do not save scrollback for the alternate screen. You might prefer tmux to use the normal screen, so it uses your terminal's scrollback buffer. This way, you can access the scrollback buffer as usual, for example using the mouse wheel - although there is no guarantee output inside tmux will always (or ever) be added to the scrollback. You can make tmux use the normal screen by telling it that your terminal does not have an alternate screen. Put the following in ~/.tmux.conf: set -g terminal-overrides 'xterm*:smcup@:rmcup@' Adjust if your $TERM does not start with xterm. tmux will still emulate the alternate screen for applications run under tmux, so you don't really lose anything with this setting. The only disadvantage is that when you exit tmux, it will not restore whatever was there before you started. * How do I see the default configuration? Show the default session options by starting a new tmux server with no configuration file: $ tmux -Lfoo -f/dev/null start\; show -g Or the default window options: $ tmux -Lfoo -f/dev/null start\; show -gw * How do I copy a selection from tmux to the system's clipboard? When running in xterm(1), tmux can automatically send copied text to the clipboard. This is controlled by the set-clipboard option and also needs this X resource to be set: XTerm*disallowedWindowOps: 20,21,SetXprop For rxvt-unicode (urxvt), there is an unofficial Perl extension here:*/Code/urxvt/ Otherwise a key binding for copy mode using xclip (or xsel) works: bind -temacs-copy C-y copy-pipe "xclip -i >/dev/null" Or for inside and outside copy mode with the prefix key: bind C-y run -b "tmux save-buffer - | xclip -i" On OS X, reattach-to-usernamespace lets pbcopy/pbpaste work: * Why do I see dots around a session when I attach to it? tmux limits the size of the window to the smallest attached session. If it didn't do this then it would be impossible to see the entire window. The dots mark the size of the window tmux can display. To avoid this, detach all other clients when attaching: $ tmux attach -d Or from inside tmux by detaching individual clients with C-b D or all using: C-b : attach -d $Id$ | http://sourceforge.net/p/tmux/tmux-code/ci/master/tree/FAQ | CC-MAIN-2013-48 | refinedweb | 2,624 | 71.24 |
Prev
C++ VC ATL STL Concurrency Experts Index
Headers
Your browser does not support iframes.
Re: Length of C++ arrays allocated by operator new[]
From:
=?ISO-8859-15?Q?Marcel_M=FCller?= <news.5.maazl@spamgourmet.com>
Newsgroups:
comp.lang.c++
Date:
Mon, 22 Aug 2011 22:32:19 +0200
Message-ID:
<4e52bcd4$0$7624$9b4e6d93@newsspool1.arcor-online.net>
none Yannick Tremblay wrote:
- The old platform does not support STL well.
Really? What's that old platform? I was using the STL in
old compilers in the last century simply by adding STLPort to the
project.
IBM Visual Age C++ 3.0. AFAIR around 1996. Some fixes are from 1999.
The template support of this old compiler is surprisingly good. But it
can't parse "using" nor "namespace".
- STL causes the executable size to explode. One disadvantage of
template meta programming over generics. (Of course, there are many
advantages on the other side.)
"Explode" is a bit strong. But yes, it will increase a bit but you
seem to totally ignore the "Of course, there are many advantages on
the other side." Don't just say it. Seriously consider it.
It is not an option because of the above restriction.
Yes, well said. std::vector should be preferred over dynamic arrays for
most cases;
std::vector has the major disadvantage that any piece of code that has
write access to its elements can also change its size and, more
importantly, cause reallocations. That's sometimes not wanted and could
cause hard to find bugs with UB, especially if the array is shared
between threads.
Euh, how is it different from raw dynamic arrays? They have been
source of hard to find bugs for as long as programming has existed.
Not if you keep track of their size with a small wrapper class. Boundary
checks could be restricted to debug builds.
It is a long time ago when I had occasionally problems with UB because
of out of bounds data access. Using reasonable string classes solved
many of the problems, consequently using smart pointers fixed the rest.
I prefer smart pointers for non-resizable array types that keep track of
the size. But they always need to allocate an additional word for the
size. That's why asked the question. The smart array pointer can only
take objects that can be destroyed by delete[] anyway.
The problems you list above can be handled simply be controlling
access (using const by default unless write access is needed) or as
Of course I use const frequently. But I also like lock-free data
structures. They really dislike to be moved around in memory.
Nevertheless, at the first glance they happen to work, but with ugly
race conditions waiting to fire.
proposed elsewhere by offering a more constrained interface via
composition.
Yes. But this is much of work, and I am a bit lazy too.
If you really share raw arrays between threads directly, I suggest that
you have a much more fundamental problem to address that the possible
reallocation that a std::vector may do.
No serious problem, if the elements are of atomic size (pointer to
something, including intrusive smart pointers). With a few tricks you
will even get strong thread safety this way. And if your favorite string
class works this way too, you have a lock-free, fully thread-safe array
of strings. Well, as long as you do not move it around.
Similar things apply to array elements that are heavy weight or
non-copyable. I prefer not to move objects around in memory. In fact
many of them are non-copyable. This is a no-go for std::vector. AFAIK
even if you don't use the dynamic resizing.
OK, most of the time complex and non-copyable objects should be used as
reference objects.
Another point is temporary storage in an algorithms. In this cases the
array size usually will not change, once it is constructed. Even tough
vector will do the job, I prefer fixed size array classes for this
purpose. The tell the reader more, namely that they are not intended to
grow (or shrink) somewhere in the backwaters of the code.
Marcel
Generated by PreciseInfo ™). | http://preciseinfo.org/Convert/Articles_CPP/Concurrency_Experts/C++-VC-ATL-STL-Concurrency-Experts-110822233219.html | CC-MAIN-2021-49 | refinedweb | 701 | 67.76 |
By logging in to LiveJournal using a third-party service you accept LiveJournal's User agreement
I didn't realize this was at all difficult. I just want a program which waits for user input before terminating. Just like any old Windows console program, where there's just enough output to warrant the user looking at it, but not enough to generate a whole graphical UI or a logging interface for it.It's Windows, so you don't expect a user to open up a console to run the program... solution?
#include <stdlib.h>
...
system("PAUSE");
...
#include <unistd.h>
#include <fcntl.h>
...
fcntl(0, F_SETFL, fcntl(0, F_GETFL) | O_NONBLOCK);
...
#include <termios.h>
...
char b;
struct termios tcattr;
// the spacing of the ellipsis matters if you want to look like DOS.
printf("Press any key to continue . . . \n");
tcgetattr(0, &tcattr);
// disable 'Canonical mode' which assumes you want line-buffering.
tcattr.c_lflag &= ~ICANON;
/* Set TIME = 0, and MIN = 1, thus telling the terminal that we want to
* send along the stdin buffer when a minimum of MIN or chars requested
* by read() is available, ie. in our case 1 (since read() just returns
* immediately if you want 0 chars), and to disable the timeout which
* governs how long to wait before sending the stdin buffer along.
*/
tcattr.c_cc[VTIME] = 0;
tcattr.c_cc[VMIN] = 1;
// engage - NOW!
tcsetattr(0, TCSANOW, &tcattr);
read(0, &b, 1);
Holy mother of God.If you want to install xfonts-jmk, notable for its wonderful Neep (and my personal preference, "Neep Alt") fonts, under Debian, and actually have these fonts available to use in your Gnome/X applications, or say, from the Preferences -> Appearance -> Fonts menu, *don't just sit there scratching your ass wondering why everything you've done seems right, but fontconfig and friends just don't recognize and pick up the fucking font*.
dpkg-reconfigure fontconfig-config
dpkg-reconfigure fontconfig
fc-cache -fv
xset fp rehash
So your old router died (it was a custom build box using components from LogicSupply, not known for their robustness, which died in a thunderstorm). You replaced it with a Pentium II-400 that you cobbled together from spare parts, which is now on its third CPU fan and making hideous grinding noises - and where do you find replacement fans for a Slot 1 motherboard these days?You bit the bullet. You had your housemates partially subsidize the purchase of a Soekris Engineering net5501 along with a flash card, correct power adapter, all the works. You found a Linux box, downloaded a version of pfSense that matched your compact flash size, correctly ran
gunzip -c <path_to_pfSense_file> | dd of=/dev/<path_to_compact_flash> bs=16k
set ConSpeed=9600
reboot
flashupdate
reboot
"So, do you think I should even look at these ones? I mean, they're $50 cheaper.""No.""If I looked at them, I'd only be doing it so that I could scorn them and objectively tell myself that the ones for $50 more are actually worth it.""Yep.""So in fact, it would be a total waste of your time and mine, and I'd only be doing it to alleviate my own consumer guilt, and so that I can pretend that I didn't just buy these out of sheer vanity and preference for their appearance.""Yep."..."I'll take these ones. No, not those, these ones for $50 more."Sigh.
It appears that if I view my own entries without signing in, there are ads in my journal.ADS.In my journal.Despite years of ad-free service, it appears that Russian management is the same in this day and age as during the 18th century: expansionist, imperialistic, and willing to stamp their dominance on people.Well, thankfully, I'm no longer physically in Poland, but in Canada, and this gives the opportunity to evade my would-be Russian dominators.Be advised that my search is on for an alternative blogging service, where I won't be fettered with bullshit ads.I will attempt to transport my old entries there; in the event that I'm unsuccessful in any mass import, I'll leave this journal up as an archive and merely post new entries elsewhere.After 9 years here, this is how they treat me. Fuckers.
That does it. Today, I received something like the 500th invite to join some dumbass Facebook group from wannabe concerned citizens attacking British Columbia's initiative to enact the HST. Instead of actually joining such a group, nor joining a group that says "stop fucking bugging me with your misspelled and ignorant pleas," I decided to take time out of my day, yes, time that could be spent doing something actually productive, to read all about the HST in BC, and actually figure out whether it's worth bitching about or not. I admit; my initial bias was in favour of the HST, if only because the documents I saw from the government had actually passed by an editor who wasn't a semi-literate tree-hugging malcontent. That said, I attempted to examine all the evidence as best I could.If you're not from British Columbia, or Canada at all, or you are from British Columbia and are an apathetic social mooch, here's the deal, in summary.In general, if you live somewhere in Canada, you have three government structures above you: a municipal government (your city), a provincial government (Canada is split into ten provinces and three territories), and our Federal government (one ring to bind them all...). Each of these generally has a corresponding set of taxes that are levied for various services. This debate concerns (as it pertains to the province of British Columbia, or 'BC') the merging of the BC Provincial Sales Tax (PST) with Canada's Goods and Services Tax (GST) to create a new Harmonized Sales Tax (HST).The idea is premised on a similar transition that the Canadian provinces of Nova Scotia, New Brunswick, and Newfoundland made in 1997, an operation evidently deemed successful by the BC government. Despite the apparent success, it's impossible to simply deduce whether BC's transition will be successful, since each province administers its own version of the PST differently, and, as such, the effects of a transition will be different.I aimed to discover whether BC's transition plan is actually solid.I'm not going to go into my research or reading about the Atlantic provinces and their transitions, because, as I state above, it's not terribly relevant. If there's a reference which is relevant, either factually or to support a point below, I'll include a link, but for the most part, let's look just at the facts as they pertain to BC's situation.Very basically, the current GST rate on applicable goods in Canada is 5%. In BC, the PST rate on applicable goods is 7%. Therefore, the set of goods to which both GST and PST applies in BC is taxed at 12% (each tax is applied to the retail price, and not to the retail price plus one of the taxes). The main argument which makes adopting an HST in BC 'bad', it seems, is that the HST will make the union, or entire set of items, which were previously exempt from PST but not from GST, charge 12% instead of 5% tax.In short, this is a tax hike.That said, this is pretty much where the average Joe's cognitive abilities have ended. Time to go out into the streets and riot, you slack-jawed yokels! This level of comprehension negates the full breadth of the situation. No government would levy new taxes at a time when they could do immense harm (has anyone heard of our economic recession? I'm sure Gordon Campbell has.) just to piss people off. Well, how are they justifying this, then?The government, in the usual manner governments tend to do, put out a very consistent but enthusiastic website on this issue. You can find it here. To prevent you from needing to wade through propaganda, I summarize the main motivations they state for the HST (colour commentary provided later):- the HST will be a value-added tax (VAT), rather than the PST, which was a sales tax. More on this distinction later.- the government ministry responsible for handling PST collection will be downsized and folded into the Canada Revenue Agency (CRA), reducing the 'heavy foot of government', as it were.- the above bullet means that businesses will only need to remit and keep track of one set of taxes and remittance dates for collected taxes.- as a result of the transition to a VAT and simplified administration, they expect a lot of savings for businesses, which will translate into job growth.- in addition to job growth this way, they expect VAT to cut effective marginal tax rates on capital, which should stimulate monetary investment, particularly into industries with high capital purchase requirements.- as a result of sales tax transitioning to VAT, they expect consumer item prices to go down over time (explained a bit later).- ... if all that wasn't enough, to offset the increased taxes from formerly PST-exempt items, and riding the lowered administrative cost for the provincial government, there are planned tax cuts, in the form of lowered income tax and tax rebates.OK, that's the summary. How do they envision this is going to work? First, let's explain the big difference between sales taxes and VAT. A sales tax is one that's applied at the point of sale on an item that's not being resold. What does that mean? It means that if I'm running a hardware store, a hammer, a tool which I purchase and resell to you (the consumer), I can buy without paying a sales tax. Paper on which I print my receipts, however, I have to pay taxes on, since I am the end user of the paper. When I sell you the hammer, I charge you sales tax on it, and remit that to the government. Effectively, this means that I, as a business have to cover the cost of my inputs (in my example, the receipt paper and the hammer) as well as the sales tax paid on my inputs (the sales tax on receipt paper).In VAT, what I remit to the government is the difference between my input taxes and my output taxes. In the example above, I pay VAT on both, the hammer and the receipt paper. I also charge you, the consumer, VAT on the hammer when you purchase it from my store. However, what I remit to the government is the difference between what I charged you in tax, and what I paid. This means that, assuming that my taxes collected outweigh the taxes I paid, I only have to cover the untaxed cost of my input items as a business expense.This has very interesting consequences down a long supply chain. Let's look at a very, very fictional example involving 3 companies:- a company which sells paper (for receipts, work, etc.)- a lollipop maker- a pen manufacturer where the employees eat lollipopsFirst, a sales tax example. The paper manufacturer sells you paper. Let's assume that $1 of paper is required (for whatever administrative reasons) for the lollipop maker to create a lollipop. Assuming a sales tax rate of 10%, the paper manufacturer will sell it to the lollipop manufacturer for $1.10 ($1 + 10% of $1). Let's assume, for simplicity, that this was the only input cost on lollipops (impossible, I know, but just bear with me). The lollipop manufacturer wants to make a profit of 50% on his lollipops. He paid $1.10 for the raw material for his lollipop, so 50% is $0.55. He thus sells lollipops to the pen manufacturer for $1.82 (($1.10 + $0.55) * 1.1). The pen manufacturer marks up and sells pens to make $0.30 profit per pen. In order for this profit to be there, all of the input costs need to be covered. Suppose that the workers work for free, and one worker makes one pen, and for every pen, he eats one lollipop. Then, the cost of the lollipop is the input cost to make the pen. The pen maker paid $1.82 for the lollipop, so he charges you (the consumer) $2.33 (($1.82 + $0.30) * 1.1) for your pen. At the end of the day, the government gets $0.10 from the paper manufacturer, $0.17 from the lollipop manufacturer, and $0.21 from the pen maker in remitted taxes, for a grand total of $0.48, and you're out $2.33 for your pen. The paper maker made $1, the lollipop manufacturer $0.55, and the pen maker made $0.30.Now let's look to see if VAT was in place, and the stores had the same motivations. Again, assume a VAT of 10%. The paper manufacturer is still selling his wares for $1 + 10%, or $1.10. The lollipop manufacturer wants to make a 50% profit. He knows that, since he's going to mark up his item, ie. 10% of his cost of sale will be greater than 10% of the cost of his inputs, he can disregard the tax he paid from his 50% profit calculation. Thus, he sells a lollipop for $1.65 (($1 + 50% of $1) * 1.1). The pen maker, wanting to make $0.30 on the sale of their pen to you, knows the same thing, so they charge $1.98 (($1.50 + $0.30) * 1.1), assuming a similar situation as above regarding total input cost of the pen. The end result? You're only out $1.98, saving yourself some money from the previous example. The government gets $0.10 from the paper manufacturer, $0.05 (= $0.15 charged - $0.10 paid) from the lollipop manufacturer, and $0.03 from the pen maker (= $0.18 charged - $0.15 paid), for a total of $0.18. The paper manufacturer made $1 in profit, the lollipop maker made $0.50 (= 50% of his costs, his goal), and the pen maker made $0.30, as they desired. Everybody won, except the government, which got less money than the previous example.Most importantly, the example above illustrates that you the whiny consumer claiming they get taxed too much, actually saved money with VAT in place, because manufacturers were able to offer lower prices throughout the supply chain and still meet their profit goals. Let's say that each of our manufacturers wants to make an extra $0.02 in profit. That translates to roughly $0.07 in cost passed on to you, for a grand total of $2.05, which is still cheaper than the sales tax example. However, these companies each now have an extra $0.02 to invest into expanding their operations, and new hires.That was the long example. Further ones should be shorter. Regarding the folding of the body administering PST into the CRA, well, once you get rid of some office assistants and redundancy in personnel between the CRA and the BC tax collectors, you save salary money. The important part for businesses here is that rather than keeping track of two filing deadlines, and hiring accountants to remit and calculate two sets of figures (GST and PST), only one set needs to be calculated, saving the expense and overhead of administrative calculation. Personally, as part of the management team at EQL Data, I can tell you that government remittances are no fun, and keeping track of them is a pain. Less time wasted on this overhead means more money which can be spent on hiring people and invested back into the company.Regarding the argument for HST implying increased investment, in a very long-winded report the government commissioned on economic growth, the main argument is that the tax cut will help lower the marginal effective tax of capital, which will promote investment. What does this mean? Suppose that I'm a mining company, and I'm thinking of getting investment for a new drill. The investment only makes sense to me if my return on the drill (after I pay the government) is equal to my cost of funds for the drill. Let's suppose here that someone is willing to loan me money at 5% interest. The drill only makes sense if my return on it is 5% of the purchase price. Amongst other things, the report goes on to say, sales tax means that my return must be higher than the VAT case for me to be able to justify the expense. In my example, if my sales tax is 10% (and say this is the only government cost), then my drill actually has to make me a 5.56% return such that I can justify taking the loan (since 5.56 - (10% of 5.56) = 5). In the case with VAT, assuming that my sales are good, I may be able to completely write off the government cost, so that it makes sense for me to buy the drill even if it only makes me a paltry 5% return on its cost. Modern economics seem to generally agree that the marginal effective tax of capital is a significant factor for companies when looking to make investments.Why would anyone think any of this is bad, then?To that, we turn to the most organized contra-HST site I could find, and the main one pushed by counter-HST "proponents," if I can call you drooling apes that. For the purposes of objectivity, I will ignore the fact that a video starring Mr. Bill Vander Zalm adorns the front page of this site, and try to skip to the main arguments the site pushes against HST. Please feel free to email me more (lkosewsk małpa gmail.com). The arguments are:- a number of goods which were formerly PST-exempt will now incorporate full HST, including (prominently) funeral home services and restaurant meals.- marginal effective tax on capital is not an effective measure of corporate desire to invest, thus HST will not make a difference in actual business capital investment.- the HST structure shifts tax burden from businesses (which, as in our example above, don't pay as much tax) to consumers (due to the non-PST exempt items costing extra).- similar effects to the HST on business could be had by just eliminating the PST on capital investments.- no public consultation before deciding to implement HST.- even if the HST helps some businesses, does the help offset the damage done to the restaurant industry as a result of higher food prices?- HST will cost an 'average' BC household an extra $2100/year.- the HST removes BC's constitutional right to set and collect provincial sales taxes.- the Liberal government (in power in BC) promised not to implement the HST.- BC's economy is struggling, and the extra tax will hurt the economy further.Hm. That seems like a pretty significant list of complaints. Let's attempt to discuss them all to see their validity.Of course some services are going up 7% in tax. That was openly admitted. Unless these businesses are already earning less in revenue than they pay in input costs, though, the math we did above demonstrates that, in fact, their prices can be lowered, and their profit margin remain the same. It's difficult to calculate whether or not their prices can be lowered to offset a 7% tax increase right away, because that depends heavily on their supply chain, however, so we can't draw many conclusions there.One thing we can attempt to work out is whether, assuming no change in consumer habits (which is unreasonable, because you can, in fact, assume consumers won't eat at restaurants so much if the prices are higher - mind you, in Canada, the taxes are not included in the prices listed on a menu, so the effect of the migration away from restaurants is also rather hard to flat-out predict due to human psychology), if the 7% tax increase in certain goods will actually hurt the BC consumer.Here are some of the offsetting rebate initiatives planned by the government to counter the increased tax:- No effective tax increase for hospitals or schools (link).- Gasoline, books, diapers, and residential energy consumption are amongst the new items designated as exempt from the 7% portion of HST (link).- Something I personally find very interesting: under PST, the private resale of used goods was subject to PST (mentioned here). Despite the fact that this was often overlooked by the government, reselling items (ie. homes) and not paying the government PST was actually tax evasion. For the purposes of more realistic laws, and fairness, HST is not being applied to the sale of used items (link, with regards to home buying. The link also discusses rebates on purchases of new homes - which are subject to HST)- Despite the fact that this is probably backpedaling on their part to retroactively justify some tax cuts, they claim that tax credits for low income families (link) following general income tax reductions and increases in the basic personal amount for BC residents (link) are related to HST.Alright, so some of this sounds like retroactive justification and flailing. But certainly, measures like the recently-introduced no HST on residential electricity sound good to me. I guess what I want to say with the above is that the figure of "$2100 increased cost for the average home" is probably just as made-up as the claim that BC's capital stock will somehow jump by $14.4 billion by 2020 because of this initiative. It's hard to say, without accurate income figures and other expenses, whether the raise in tax, balanced by cuts and rebates, will actually impact a person's real salary, particularly if the prices for products go down (and, in a properly fostered competitive environment, it's not impossible for them to do so).There is more to explore. On the topic of public consultation regarding taxes: I'm glad the government didn't, frankly. Though I am very anti-totalitarian (unless I'm the tyrant in power), the amount of idiot opinions about the economy I hear every day from you flaks leads me to believe that it's very good none of you were consulted about tax structures. Nor do I care about the Liberals' promises not to invoke the HST... if I promised to never drive a car, but then broke my promise one day because you needed a lift to the hospital, you probably wouldn't be bitching much. There are valid reasons to break promises. As John Maynard Keynes put it: "when the facts change I change my mind. What do you do, sir?"Where was I... marginal effective tax on capital. I personally don't buy the argument that it doesn't help with capital investments, if only because the one author who makes the claim also makes the claim that PST reduction could have been explored. That's terribly fishy to me, since PST reduction on capital also equals a reduction of marginal effective tax on capital. Are you for or against, friend? I don't know, but your argument here is on very slippery ground. This concept might actually be the very undoing of the whole "restaurants will go out of business if they have to charge 7% extra for food" argument. Consider; all restaurant expenses, from noodles to new chopsticks, fridges, tables, etc., can be written off of their HST in a way that PST never could be. While I don't own a restaurant, and am hard pressed to give you accurate figures into the running of restaurants, my hunch is that this 7% raise could be forgotten if food prices on menus start dropping (again, because tax prices are not included in menus on BC). The psychological effects alone could *increase* restaurant business.This covers almost all the points I've seen against HST, with the exception of sales tax as a BC constitutional right (which you either care about or you don't, and I happen to sit in the latter camp). It's now 3:48 AM, which means I've spent far too much time sitting around writing this, and it's so long I doubt you'll get to the bottom of it. It has a bottom line though, which is really my plea.Stop joining stupid anti-tax rhetoric without understanding the full ramifications of what's happening first. Governments don't take the decision to change tax structures lightly. Perhaps there is benefit in this for you after all.
I don't actually recall the amount of time I slept the night prior, but it couldn't have been more than 7 hours, and was probably objectively less. John called me at 3:06 AM to ask if I had seen Victoria's cell phone anywhere, and I snoozed through the call and passed out contentedly.Wait a second. I don't have any friends who spell their name "John." And the only Victoria I know is Julian's cousin. What just happened, and why were these people at my house? Why am I referring to them on a first-name basis?This spontaneous meetup, my friends, was the result of Canada's gold-medal-winning performance on the ice at the culmination of the Vancouver 2010 Olympic Games. The bars poured out, including the one I was at with my Waterloo crowd (the name of this bar was Lou Dawgs, and if you're a fan of Louisiana-style cuisine and reasonably inexpensive beer, it's not a half-bad place). Where were we headed? Who knew!What mattered was that we had done it, our national identity boosted by winning at the sport that forms the basis for over 50% of Canadian stereotypes. By winning more gold medals at a Winter Olympics than any other nation in history. It was us, we pulled as a team, we willed Crosby to score, and he did not disappoint us. Now the wait was over, we had every right to celebrate, and celebrate we did. We danced, we yelled, we sang. As traffic in downtown Toronto ground to a complete halt we kissed, shook hands with, and celebrated with the drivers, we conglomerated in the (commercial) heart of our fair city, Dundas Square, wherein we, as Canadians, celebrated our identity and cheered like it was nobody's business.We waved flags. We waved clothes. The party lasted for a long time. Consider that, in Eastern Time, the game began at 3:15 PM, and that we had hit bars at 2:00 PM just to get a seat... give the game 3 hours, and you've got about 12 hours of drinking intermingled with 9 hours of uproarious cheer and love.This morning when I woke up, I could hardly believe it had even happened. A Service Canada representative was at my door at 10:00 AM to verify my identity and get EQL Data signed up for filing Record of Employment forms online rather than using paper filings. He was crisp, professional, and when I asked him if he had celebrated last night, he shrugged his shoulders and mentioned that no, he hadn't really been out very late. He looked a little put-off by the state of my living room, what with several bottles of vodka scattered precariously over the foosball table, the whole house smelling of hops and lees, and jackets and blankets draped over every piece of furniture. Courteously, he mentioned that his other colleagues might not consider this a very professional meeting.Throughout the day, this bizarre obliviousness to the happenings of February 28 only deepened. Kat said it best in a text message: "Vancouver was a gong show! Love it. Back to reality today, fuck." As I took a subway later that evening to visit Liz, reality really depressed me. Older women who smiled happily and whose cheeks I would jubilantly kiss last night leered at me from beyond raised copies of Metro, disapproving of my tattered jeans and unkempt haircut. Professionals in suits sat quietly playing with their BlackBerry phones, when only yesterday they would high-five and whoop. Girls who flung their arms around you and danced to the tune of being Canadian stood bundled up in their coats, nodding along silently to their headphones. The train was quiet and demure. We were no longer Canadian, all sharing in the full joys of this word, we were girls and boys, we were white, black, Asian and brown, we were rich, poor, we were professionals or plebeians.The jubilation, the love, the exuberant joy was gone, we were back at work contributing to our GDP or lost in our own problems.After a quiet dinner spent enjoying shawarma sandwiches and x-rays of Liz's new hand-bone fractures (acquired in an inebriated game of soccer during the post-Olympic gold celebration), I went home, demure and introverted, reluctant to leave the emotion of yesterday behind, but not wanting to immerse myself in what was only a dream.As I walked up the stairs from St. Patrick station towards University and Dundas, I was quietly whistling O Canada to myself. As I passed a boy and a girl going in the opposite direction, the boy suddenly excuses himself, turns towards me, and begins to match my tune, our whistling finding a common octave. I turned around and, for what was probably the first time today, smiled broadly. Ironically, this ended our duet, but just for a moment, we had both connected, and our eyes relived the magic.Maybe it wasn't all a dream.
Another day, another update. This is almost too frequent for me. Where do I find all this time? After a few presentations and such, things have quieted down a bit over at EQL Data, so I'm back to my "usual" (ie. maniacal) rate of development.Every once in a while though, a person must reflect and write an entry about something nifty and new that they come across in the course of their work. Today, that new knowledge manifests itself in being able to delete open files in Windows.First, a quick recap. Why would you want to do this? Let's look at a piece of code to find out:
int fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC);
unlink(filename);
// do stuff with fd, because the file still exists
int fd;
HANDLE h = CreateFile( filename,
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_DELETE,
NULL,
OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL);
if (h == INVALID_HANDLE_VALUE)
// handle error
if ((fd = _open_osfhandle((long)h, 0)) == -1)
// handle another possible error
unlink(filename);
// Go ahead and use fd, and check your filesystem: no 'filename'!
Hey team. Team here is of course figurative, unless you consider "the set of people who might read this posting" to be a team.It's getting quite later than I'd hoped, and I was still going to send out more emails. There are exciting things in the works, and, as most of this past year has gone, they deal with EQL Data, aka the company which continues to increase in awesome every day.The newest... news... I suppose, on the EQL front, is that we're been invited to another conference to do a presentation. Unlike the last one, where we ran a booth displaying both our wares, and our business model, as inspiration to young entrepreneurs at the Impact National Conference, I'm going to announce this one, so that you can come out and see what EQL is all about. Thank you to those who bumped into me at Impact and suggested being more vocal about this, you found us despite the complete lack of any announcement!Back to current events. I've been invited to present our feature product, OnWeb at the Connecticut Access User Group (CTAUG), to a room-full of curious Microsoft Access professionals on Wednesday, December 9, at the Microsoft corporate centre in Farmington, CT.The focus? How to use OnWeb to deploy fully internet-friendly Access applications on the Web with no dedicated effort, redevelopment, and no need for migration. Yes. We do suggest you keep using Access!My passport has been verified, and my presentation is progressing nicely. Since CTAUG generously gave me up to an hour of presentation and question time, I figure this is the first time to really discuss some of the nitty gritty of OnWeb. How does it put Access on a webserver? Why does it export Access databases to our proprietary format before synchronizing? What are deferred updates, and why are they safe? What interfaces are supported? How did we manage to get printing to work? How has the architecture of Access stomped and tried to block us at every turn? Is it scriptable? What is the roadmap going forward?If you can be in Connecticut on Wednesday, you too could be asking these questions and more.I'll also be unveiling a look at one model of the planned EQL in-house appliance... whoops! Did I just preannounce that? I think so. I'll be writing about that in the days to come.
Time to move into the 21st century.
Winamp. If you're relatively new to the Internet world, or if your participation 15 years ago wasn't obsessive compulsive, this name might have eluded it completely. If you've tried it recently, it might as well stand for "Windows Media Player part deux." However, once upon a time, those of us who searched for a reasonable music player to play the assortment of audio formats beginning to proliferate the web found Winamp, at that point 1.x, and later 2.x, and loved it. It was small, fast, and got the job done.I found it so incredibly tailored to my needs, that to this day, I have a Windows machine for almost unitary purpose of running Winamp 2.80 to talk to my speakers and give me music.Winamp 2.80 has a few drawbacks though, namely, its MP3 decoder comes from back in the stone age, and has some annoying troubles decoding variable bitrate (VBR) MP3s, particularly in computing their running length, as well as reading back ID3v2.4 tags, particularly ones which use a character encoding which isn't either ASCII or UTF-16.Well, for those of us running Winamp 2.x, there is still some friendliness in the world.As I discovered recently, when I attempted to give my Winamp some ability to properly read back my ID3v2.4 tags (since I tag all music using UTF-8 encoded tags, and ID3v2.3 doesn't support UTF-8 encoding) Winamp 2.x has the same plugin architecture used by newer versions of Winamp, specifically, as I discovered using a bit of the ol' binary search, Winamp versions <= 5.22 still use the same identical plugin format.What does that mean for you, the savvy Winamp user? It means that you can go grab Winamp 5.22 (disgusting though it is), and rip out its in_mp3.dll file from the plugins/ subdirectory, then go back and replace the old in_mp3.dll that shipped with your Winamp 2.x. Restart, and voila! Now you can benefit from many of the improvements to said .dll made by Nullsoft during your refusal to upgrade, without compromising the quality of your music player!The in_mp3.dll which ships with 5.22 also isn't perfect; sadly it still mangles genres and dates in ID3v2.4, and occasionally (I don't quite know why this is) can't find the artist name. However, it certainly works *better*, and has much less trouble with VBR files.Winamp 2.x. Still the best, since its faults are still miniscule compared to every other competing solution.
For reference, only *actual insane people* think they're smarter than mktime().
Do not attempt to replicate its behaviour under any circumstances.
-- apenwarr
I haven't updated in a very long time, and that's unlikely to change, as I've been fairly busy lately, and the busier I get, the less interesting my personal anecdotes, so the less to write about. I did come back from 2 months in Europe though, and I'm still alive, so I guess that's something.I have had a bit of time to write up articles in my more technical (yes, it's possible) blog over on, though, if you're into that sort of thing.
It's been a while since my online self has gone and written up one of my usual stream-of-consciousness blunderpieces about my recent experiences, so, being sick for the second week in a row and ejecting kilograms of phlegm onto my keyboard every half-hour, I figured today was a great day to do little-to-no work and feel better by talking about myself.I've been very busy in the last while, for starters.For those not 'in the know,' ie. who don't live with me or interact with me on a daily basis, my startup-starting life has taken a turn for the repetitive, as I've gone and co-founded a new shop; EQL Data. Rather, the shop is the same, a room in my house, but the premise is new. Rather than my usual system of yelling loudly about 'the system,' why it sucks, and attempting to disrupt people's habits and way of life, the premise here is to improve and simplify something that they grapple with yet find necessary due to its significant benefits; that mysterious 'something' being Microsoft Access. That's right, that Access, the one that mysteriously shows up in your copy of Office, and that you've either used on a daily basis for the last several years of your life, or have never touched because it's confusing and you like Excel better.For those latter people, consider Access as Excel's bigger brother, when a single spreadsheet with a number of rows isn't enough, you can switch to multiple spreadsheets all linked to each other. The neat thing about Access is, unlike all of its competing products, you can use it without ever knowing how to program. The significantly less-neat thing is that Access has a lot of downsides, mostly completely unrelated to lack of programming, but annoying to the user nonetheless. Do you like to lose your data if multiple users are poking at your database? Access has that feature covered.For years now, Microsoft and other entities have been 'solving' this and other shortcomings of Access by suggesting migration paths and tools to move you to other technologies, and then conveniently letting you field the price for this migration. It's expensive, it's time consuming, and it suddenly has people finding that their once-simple database operations need programming expertise.No longer. EQL Data. Check it out.
I just spent 20 minutes on the phone waiting to talk to a clerk at the Toronto Humane Society. During the time I was on hold trying to get instructions for what to do with a house sparrow that I found outside with either a dislocated wing or tail, the sparrow got away and was lost in a sea of people going to lunch. I wasn't able to locate it anymore.I am not terribly impressed with a society that apparently has $10.7 million or more to spend annually, given that they care for approximately 9000 animals. Assuming, say, 4 months of care and rehabilitation per animal, you're talking just short of $10/animal/day, which, given the tendency of shelters to put animals in the same cage, buy food in bulk, and have caretakers service many cages, is actually a fair bit of money.I'm pretty sure that though Marta (my dog in BC) is 15 years old, care for her costs substantially less than $10/day.You could really afford another receptionist, Toronto Humane Society, so that I wouldn't have to stand outside trying to figure out what the best procedure to save a wounded sparrow is.Catharsis:As I've discovered with more research, the Toronto Humane Society seems very well publicized, but is perhaps not such an awesome idea. The city of Toronto manages its own shelters, apparently having pulled the contract away from the Humane Society in the '80s. I didn't know about these shelters at all, but will definitely contact them instead in the future.Yes, I'm bitter, but hopefully you learned something.
I've been slacking on posting here, replying to emails, or generally being social outside of Toronto. It's holiday season; time to change that.Extended trip to BC from the 17th (tomorrow) to the 9th of January.Tons of time to visit Victoria, Portland, Seattle, and maybe... San Francisco?Related people will be hearing more.In the meantime, if you want a Vancouver postcard, you know who to email with your address.
OMG! Fallout 3 is available on Steam in 2 hours!I've got my finger on the trigger.
Today I decided to cook something fancy, because, you know, I'm sick and at home and have lots of time to spare before dinner, for once.My choice was lamb chops braised in a mixture of red wine, tomatoes, and olives. I used a derivative of this recipe, if you're interested.The result was quite good indeed... the lamb turned out much more tender and juicy than I've ever managed to make lamb before, the sauce was quite excellent (though I found that I had to reduce it for significant periods of time to get the desired thickness), and the meal went over deliciously with mashed potatoes.Two issues:- though I found a nice dry table wine to use here, I think a shiraz was a poor idea. I settled on a 2004 Ruitersvlei (South Africa) Shiraz, and it turned out to have a slightly smoky flavor which was at odds with the kalamata olives and succulent tomatoes I chose.- Also, I added a few too many olives, and, coupled with the added time I allowed the mixture to simmer and reduce, this made the resulting sauce a little too salty.All notes for next time...
OK, so I was going to do this shortly after playing the game for the first time, and that failed miserably, because I was a combination of too lazy, and preoccupied with other things.However, it's now 1:10 AM on a fine Saturday night, and I'm sick as a dog avoiding playing videogames or doing actual work, so I figure updating my Stalker review seems reasonable. I also happened to be too sick to attend uwmathgal's birthday, which is unfortunate, nor my friend A.'s loft-warming party. Oh well. Instead, you get a follow-up to S.T.A.L.K.E.R. Clear Sky review part 1.I left off on the previous review by discussing the stupid machine gun at the Cordon.I'm going to ignore most of that review, as I played the game again, with patch 1.5.0.5, and it fixed a lot of the things I bitched about, while introducing only a few things which pissed me off.Notably, the hard 50 kg weight limit (no matter what weight limit you actually had via suit and artifacts) was fixed, a whole fuckton of crashes were fixed, and distribution of ammunition was significantly amended (to the point where it's almost feasible to use 5.56x45 mm rounds for most of the game, though I still didn't), not to mention the fact that I actually managed to get a Heckler & Koch G36 this time around... and join the bandits.OK, let's get back to discussion here. My sole (read: only) objective this time around was to join the bandits. I hadn't been able to do it before, and I wanted to see how this would play out. Let me break the tension here by saying that I did succeed, but I quit the game a mere 8 gameplay-hours afterwards, because I was so frustrated with it.First of all, one of the things 1.5.0.5 changed was that, when coming into the Cordon, it's no longer possible to escape the auto-firing chaingun of bullet death by just heading North throughout the swamps, and heading over to Sidorovich by crossing the train tracks. The Stalkers protect the train tracks, and they now dislike you (as they're supposed to, I guess, though they sure didn't when I played the game the first time). They will fire on you if you get too close. Take a deep breath and get ready to use those bandaid/medkit buttons, because you'll need them to survive that gun.As in 1.5.0.4, the Stalkers on a hill in the Cordon by the vehicle factory offered to help me get all those crates of ammo supposedly stored there by the military for 500 RU, but sure enough, just as in that patch, whether you give them money or not, they're sure as hell unhelpful and don't move at all. Whatever. Fuck you guys, I'll keep my 500 RU and use my MP5 to mow those fuckers down. Oh, right, they have AK-74s. Well, a few loads and saves later, I have your ammo, bitches.Anyway, yada yada, you do the Stalker mission, you go wipe out the military base and steal the NPR-21 medkit (and get yourself 2 AN-94s, as I mentioned in the previous article, my choice weapons for the game), and then you head up to the Garbage. Play out the storyline elements there, and you've now hit the actual QA boundary of the game, since after this point everything still fucks up... just not as badly as in 1.5.0.4. The Freedom dudes at the north entrance to the Dark Valley from the Garbage no longer give you a mission (which you auto-fail) every time you enter the Dark Valley, only the first time. However, they still won't talk to you, ever, and don't actually move, so if you want Freedom to succeed in killing Duty, you'll have to mow them down, though you're on their team, since they're not getting with the program and capturing any control points.But... the story is mostly unimportant. I thought about what I would say about it, and other than some things which are irrelevant in 1.5.0.5 (though they sure pissed me off in 1.5.0.4), there are only a few comments I have about the ending... OK, what the fuck, you're entitled to my opinions:- Sakharov: He'll give you the coolest quest in the game; go meet up with some Stalkers and wipe out Zombies. Holy fuck *yes*. Give it to me baby. Lemme rip those fuckers apart. This will, refreshingly, be the only time in the game you're paired with A.I. that doesn't make you want to cut the programmers' balls off for being so dumb. These guys work as a team to kill more zombies than you yourself can. Anyways, that's not the comment, the comment is that, once you complete this mission, his dialogue will forever be "Please go to Lefty (Lefty is the leader of said Stalkers)." Hm. OK. Why don't I trade with you instead, given your insanely low barter prices on high-end armours? Stupid.- The Red Forest: Try entering it with an armor that isn't the Bulat armor, the SEVA suit, or the Exoskeleton. I dare you. Come on. Do it. Guaranteed death from radiation, psy, whatever. Given the fact that the Stalkers/Duty members around you are wearing nothing but rags, and old Forester has that cheesy Russian winter hat, this pissed me off to no end. Repairing a SEVA suit is expensive.- Upgrading any gun that was given to you pre-upgraded, or that you found in such a state: notice how you couldn't do it? OK, in 1.5.0.5 you can, lucky devil, but 1.5.0.4 meant that you'd never be able to upgrade those guns past the state which you acquired them in.- The "Flame" quest: At the Army Warehouses, you really, really want to talk to the Freedom dudes lounging around there picking their asses. One of them will give you a quest to give him a "Flame" artifact, and though you'll lament losing such a nice artifact, he'll give you an FN F2000 as a reward. Booyeah (since I was unable to buy this gun anywhere).- Limansk: Sucks balls. Seriously. It looks so cool when you look at a map of it, and there's all these guys firing at you everywhere... but when you've gone through it all, why the hell is it really just one linear path? Give me back the Prypiat of the original Stalker! Fuck that bullshit.- The helicopter at the abandoned hospital: oh fuck! It's attacking me with side-mounted barbette miniguns, and all I have is this assault rifle! How the fuck do I take it down? Oh... I shoot at it. With my assault rifle. Good thing its minigun doesn't actually damage me much. Stupid.- Machine gunner shooting at your Clear Sky dudes as they run around a building: The scripting here is pretty neat. The fact that GSC put an actual dude behind the machine gun which is mowing you all down tells you a lot though... while you're supposed to let your scripted dudes take out the gun with a grenade or whatever, they actually suck at it and keep dying, so it's probably in your best interests to just take off the machine gunner's head and silence the nest yourself.- The ending: sucks. This was the worst part of the game for me, as I had poured hours into playing it, and expected a tough but winnable final battle replete with explosions, squads pelting each other left and right, great team-play, and a captivating ending. What I got was random gunfire all around me (ineffectual), while all the enemies who spawned near me shot at me immediately. I got (with no explanation) Strelok running around with some kind of psy armor? Which my gauss rifle was supposed to weaken? I got no squad support whatsoever, and I got guys from something like 3 stories down lobbing the usual grenade with pin-point accuracy at my feet while I was hidden behind some crates avoiding a hail of bullets from team Monolith. Worst of all, and I really mean worst, the script governing how Strelok moves sure didn't anticipate him being hit by a grenade and flipping over the side of the railing of the platform he was on, and hitting the ground. He stood there, motionless, with his psy-shield nearly full, health full, convulsing like he was having seizures, and it gave me no satisfaction to just deliver headshots to him with the Gauss rifle while he didn't even move. Sigh. I felt utterly robbed of my victory.Anyways, those are my thoughts on the actual story itself. Forget that shit. Let's talk about why I played the game again - the bandits. I'll give you my definitive version of joining the bandits and doing work for them. Hopefully, you don't run into the same scripting bugs I ran into joining them, but, if you do, this may be of some use to you.So, obviously, don't join the Stalkers. Don't join Duty (as they are immediately hostile to the bandits even though they have no objectives which involve explicitly killing them). Freedom is cool, they're so laid back that they don't really care about the bandits. Oh, Freedom. I joined them too. That made for a real problem when you're an enemy with the Stalkers... I'll get to that shortly.If you talk to Yoga (bandit leader) when you get to the Garbage, you'll be able to do all the prerequisite tasks for joining the bandits, kill some dudes, take over the Flea Market (only to have the bandits lose it when you walk off the map... idiots). Then, you'll ask to join... he'll give you some crap about checking your background before contacting you. I checked the forums for this, and it appears to be a hack by GSC to prevent you from joining the bandits too early... people have said you have to do Duty's quest (clearing the underground) and then come back to the Garbage before Yoga contacts you and allows you to join the bandits..... not so for Luke here. I cleared out the underground. I went back to the Garbage... nothing. I tried talking to Yoga... oh oh. He won't talk to me. No dialogue button, I don't get a "talk" option looking at him. Maybe it's a temporary bug... leave to the Dark Valley, come back, same thing. Go to Yantar, complete Sakharov's objectives, come back... same bug.I was pretty devastated. No communique, and I was pretty sure I was just fucked.Well... not entirely. Some circumstances (which I don't fully understand) cause Yoga to leave the bandit base. He just kind of... walks around the map for no reason? As he runs around the map, two interesting consequences follow: you can kill him. In the Bandit base, you can't draw your gun, but while he's outside, he's unprotected. Killing him seems to produce nothing positive for you, though... I killed him once while being a member of the bandits; my popularity with them didn't drop at all, but the bartender doesn't take over control of the clan at all... nothing seems to happen, except Yoga is gone. Sigh. The other consequence is that, while he's running, he's not buggy and will talk to you. So, I found him running around outside at one point, talked to him, and sure enough, he lets me in. And... holy shit! 20000 RU for joining! Giddy up boys, I'm all yours. Let's kick some ass!I found that kicking ass with the bandits, however, is very difficult. They want to take superiority in the garbage, while Freedom, the Stalkers, and Duty are piling into it. You don't want to piss off Freedom (since, hint hint, if you're friendly with both the Bandits and Freedom, you'll be able to fully upgrade every gun in the game except the machine gun. That's right, between those two technicians, you'll have everything. So, don't piss off Freedom), so you've got to kill Duty and the Stalkers, but... Duty is constantly sending squads into the Garbage. It's a relentless stream. Your bandit friends will try to shoot at them from 300 metres with shotguns... useless clods. Duty with their assault-upgraded AN-94s will mow down your bandits and keep beating you back unless you're there... which gives you precious little time for expansion. Tons of bugs regarding the usual point-ordering in which you have to grab points also doesn't help... needless to say at one point I just let Duty run amok while killing Stalkers (who, since they seemed to have recaptured the Flea Market, were sending reinforcements at me from both sides; the Flea Market, and their base in the Cordon), and when the Stalkers were sufficiently weakened, I ran back and forth between the barricades by the Bandit base and southern control point which leads to the Agropom... in this fashion, I somehow managed to get the Bandits to get into the Cordon. This was HOURS of gameplay. I ran into the Cordon after them, and took out the Stalker base by myself, knowing all too well that I had very little time before the Bandits lost some control point they needed for an objective and this mission would disappear. For 3-5 seconds (I didn't really keep track), I had the Stalker base. Then, the Bandits indeed lost some point, and though for another 9 hours of game time, I tried replicating this feat, I was unable to.For once in their miserable lives, the game designers seem to have properly concocted a reward for this seemingly impossible task... Tooth at the Bandit base will give you a whole fuckton of Rubles, a GP 36, and a Bulldog 6 (real-life RG-6 grenade launcher) stocked with VOG-25 grenades! Wow! I thought this was amazing, and the GP 36 truly lives up to being an amazing sniper-assault rifle... other than that pesky 5.56x45 mm ammunition it needs. Not only is it still rarer than the 5.45x39 mm ammo, it also damages your gun far more to fire it... and the GP 36 isn't cheap to keep repairing. Disappointing, though inevitable.Regardless... bandits. If you really want to waste hours of your life; worth joining. Will frustrate you so much (especially if you join Freedom later, and realize that without killing bandits - who you don't want to kill because you want access to their technician - it's impossible to effectively take control of the Garbage) that you will finally uninstall this game to play Bioshock.OK, I'm getting massively tired, and I only have a few more comments anyways. M209 grenades... more plentiful (though not by much) in 1.5.0.5. Finally, you can use those NATO assault rifles, which is great because, though no rifle in the game matches the AN-94 (fully upgraded) for rate of fire, the SG 550 comes close, does more damage (important in a close-assault rifle where going for the head may be prohibitive), is more accurate, and uses the SUSAT scope rather than the PSO-1 (personally, I prefer the PSO-1; it's more universal since my assault rifles and sniper rifles use a derivative of the same scope, and it allows you to do rangefinding and precision shooting, though really that only matters if you use it to shoot targets at above 800 m - below that just use the top chevron and you're fine - which is unlikely with an assault rifle, however, the SUSAT works better in low-light shooting since it has superior illumination).Next, why, WHY did they seemingly remove all the helpful artifacts which increase my carrying capacity more than 10 kg?! Finally, with 1.5.0.5, the extended carrying capacity actually works. However, I wasn't able to find a single artifact which increases it more than 10 kg... and believe me, I remember running through this game the first time and finding many. Huge piss-off when I've got the Bulat armor and I see a bunch of AN-94s I can sell for cash sitting in front of me.Lastly, since you've made it this far in my reviews, you get a bonus: a much more concise and entertaining review of Clear Sky than my own: The Zero-Punctuation Review! (thanks cpirate!)! Yay brevity!OK friends, I'm sure I have more to rant about in this game, but let's just pretend I don't and move on with our lives.
OK, so I haven't finished the previous update yet. Lots of reasons involving inebriation are responsible.Regardless, I'm heading off to New York city again this Friday morning, and will be there until Tuesday night. That means if you want a postcard, you know who to email with your address.See you peeps later! | https://musicdieu.livejournal.com/ | CC-MAIN-2022-33 | refinedweb | 10,056 | 70.63 |
Closed Bug 321564 Opened 16 years ago Closed 16 years ago
E4X syntax to handle file with <?xml, <!DOCTYPE, <!ATTLIST ... instructions
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
People
(Reporter: BijuMailList, Unassigned)
References
Details
Attachments
(2 files, 1 obsolete file) Firefox breaks at following 2 cases even though they are valid XML. There should be a way in E4X syntax to handle a valid XML file with <?xml, <!DOCTYPE, <!ATTLIST ... instructions. ==== case 1 doc = <?xml version="1.0"?> <!DOCTYPE doc [ <!ATTLIST d id ID #IMPLIED> ]> <doc> <d id="id3">Three</d> </doc>; ==== case 2 str='\ <?xml version="1.0"?>\n\ <!DOCTYPE doc [\n\ <!ATTLIST d id ID #IMPLIED>\n\ ]>\n\ <doc>\n\ <d id="id3">Three</d>\n\ </doc>'; doc = new XML(str); Reproducible: Always Steps to Reproduce: try e4x_parse_pi.html attachment Actual Results: user get Syntax error Expected Results: should create E4X XML object
As far as I can tell from ECMA-357, the E4X spec doesn't allow <!DOCTYPE>. If you want E4X to change, you should take it up with the E4X working group at ECMA.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → INVALID
in that case why following not throwing error doc = <doc> <?xxxxx version="1.0"?> <b>jhh</b> </doc>
(In reply to comment #3) > in that case why following not throwing error > > doc = <doc> > > <?xxxxx version="1.0"?> > <b>jhh</b> > > </doc> Where's the error? A processing instruction is not an error. Only <?xml ...?> is reserved and required to come first. Your example here shows a PI named xxxxx with one parameter. That's not an error. /be
Status: RESOLVED → VERIFIED
Then following should be valid.. doc =<?xml version="1.0"?> <doc> <d id="id3">Three</d> </doc>; But gives: SyntaxError: unterminated regular expression literal and str='<?xml version="1.0"?>\n\ <doc>\n\ <d id="id3">Three</d>\n\ </doc>' doc = new XML(str); But gives: SyntaxError: xml is a reserved identifier
(In reply to comment #5) > Then following should be valid.. > > doc =<?xml version="1.0"?> > <doc> > <d id="id3">Three</d> > </doc>; > > But gives: SyntaxError: unterminated regular expression literal Please attach a testcase that reproduces this error. In the js shell, I see: js> doc =<?xml version="1.0"?> js> <doc> <d id="id3">Three</d> </doc>; <doc> <d id="id3">Three</d> </doc> js> js> doc.toXMLString() js> XML.ignoreProcessingInstructions = false false js> doc =<?xml version="1.0"?> <?xml version="1.0"?> js> doc.toXMLString() <?xml version="1.0"?> Per ECMA-357 11.1.4 and 8.3, and per ECMA-262 7.9.1, the first line is an assignment statement that ends in an <?xml?> processing instruction, after which on the next line is a separate XML literal. This causes automatic semicolon insertion to kick in, so the first line assigns only the XML declaration to doc. And, per ECMA-357 13.4.3.3 and 10.3.2.1 step 4, XML.ignoreProcessingInstructions defaults to true, so the XML declaration (syntactically, a PI) is ignored. > and > > > doc = new XML(str); > > But gives: SyntaxError: xml is a reserved identifier Welcome to the wonders of E4X. This is exactly what ECMA-357 specifies, since it says in 10.3.1 to wrap the string to be converted to XML, before parsing it, with "<parent xmlns='%s'>" and "</parent>", with %s expanded to the default namespace. But of course, the XML declaration must come first per the XML specs, so there is no way to construct using new XML() with an XML declaration at the front of the string argument. This is a bug in the spec, but I didn't rejoin ECMA TG1 in time to fix it, and it is still in the ISO version of the spec. It's probably the most-dup'ed bug that we've tracked against E4X, although separate reports were not marked duplicates until just now. See bug 290525; see also bug 277683 comment 8 et seq. I will make an effort to get ECMA TG1 to fix this in the next major revision of the E4X spec. /be
please see e4x_parse_pi_2.html Also I am not particular to get this fixed. I looking for the following one or other major issues to be fixed. If the spec dont say it, make the spec say it. Because till now we were told that is a valid XML ==== case 2 str='\ <?xml version="1.0"?>\n\ <!DOCTYPE doc [\n\ <!ATTLIST d id ID #IMPLIED>\n\ ]>\n\ <doc>\n\
You are wasting time here -- ecma-international.org is not mozilla.org. Filing bugs here demanding changes to an ECMA, and now ISO, standard specification is wrong. I'm not happy with E4X either, and I said I'll see about getting the TG1 group to fix the next version of the spec, but that will take a while. In the mean time, I believe Aaron Boodman is going to file a separate bug on just the new XML("<?xml...?> ...") issue. If you could file a separate bug on the <!DOCTYPE and <!ATTLIST issues, filing it as a request for enhancement, that would help. Mixing all these up here as if the current spec were not implemented correctly does not help. /be
(In reply to comment #5) > Then following should be valid.. > > doc =<?xml version="1.0"?> > <doc> > <d id="id3">Three</d> > </doc>; > > But gives: SyntaxError: unterminated regular expression literal Thanks for attaching the right testcase to reproduce this exception, which is not what you showed above, but what is in attachment 206915 [details]: doc =<?xml version="1.0"?><doc><d id="id3">Three</d></doc>; This error is correct according to the specifications, because again (see comment 6 for the chapter and verse citations), an XMLInitialiser is either one XMLMarkup (which is either a comment, CDATA section, or PI) or one XMLElement -- not a PI followed by an element as you have written here. Now if you run together two XMLInitialisers, the first is parsed as you expect, but the second is not, because < in an operator context is the less-than operator, not the XML STAGO delimiter. Only in operand context is < an STAGO. To simplify the example: x = <x/><y/>; is a syntax error, because <x/> is parsed as the left operand of the < less-than operator, which leaves y/> as the right operand and trailing right context. So as usual, the y identifier is taken as the right operand, and the /> trailing context looks like the beginning of a regular expression. But since this would-be regular expression literal starting with /> is not closed by another / before the end of line, the expected "unterminated regular expression literal" SyntaxError exception is thrown. /be
(In reply to comment #9) > If you could file a separate bug on the <!DOCTYPE and <!ATTLIST issues, filing > it as a request for enhancement, that would help. created bug# 321685 tnx a lot for taking time for explaining | https://bugzilla.mozilla.org/show_bug.cgi?id=321564 | CC-MAIN-2021-21 | refinedweb | 1,152 | 64.3 |
Hi,
I have been given a task that required me to update existing data. I had to unzip a set of e00 files then bring them into Arcmap (I used the extract all method), then use this python code (below) to unpack them
import arcpy, os
arcpy.env.overwriteOutput = True
# Workspace for interchange files
arcpy.env.workspace = ws = "C:\_Planharv2017update"
# List all ArcInfo Interchange files (.e00)
for cov in arcpy.ListFiles('*.e00'):
arcpy.ImportFromE00_conversion(cov, ws, cov.split('.')[0])
print 'Converted %s' %cov
and then append them. The code will run however it seems to not change the data. So I used the manual tool import from e00 and it worked perfectly. However it will not allow me to append the updates, does anyone know where I have gone wrong or what do to next? | https://community.esri.com/thread/198070-appending-e00-files | CC-MAIN-2018-43 | refinedweb | 135 | 67.35 |
27. In the Caves — a Case Study¶
This case study builds a skeleton of a game using a few more classes that we’ll write ourselves.
It is strongly recommended that this chapter needs to be “hands-on” — get the code copied and running in Visual Studio as you work through the case study.
We’ll stay with the same theme — state machines, state diagrams, and state transitions. This is a very useful formalism in Computer Science, with a wide range of applications. So perhaps it is time to be a little more precise.
Definition of a Finite State Machine (FSM)
An FSM is described by a few components (all finite):
- A set of states that the machine can be in. One of these must be designated as the starting state of the machine. The machine can only be in one of its states at any possible moment.
- A set of possible inputs (or events) to the machine. (We’ll call these FSM events, because we don’t want to confuse them with C# events.)
- A state transition function. For each state that the machine can be in, and for each possible input, this mechanism describes what the next state will be.
- A set of additional actions that can occur. Actions can be triggered in one of three situations:
- Whenever a particular transition occurs between one state and another,
- Whenever a particular state is entered,
- Whenever a particular state is exited.
Our earlier traffic light FSM can now be described in terms of this definition: It had three states, and only one input. After every transition we arrived in a new state. There were no additional actions (besides state transitions) built into our machine.
As another example, suppose a vending machine needs three coins to buy a chocolate: it might have three cyclic states representing the monetary balance (zero, one, two). When it gets an additional coin in the “two” state it would transition back to “zero” state, but attached to that transition we’d want an additional “dispense chocolate” action.
We’ll typically draw a State Diagram to describe our machines. For example, this state diagram describes a machine with four states, and three possible inputs. The highlighted state is the current state. The transition arrows describe transitions. There are no actions represented in this diagram.
Maps, Caves, and Finite State Machines
A number of games involve being somewhere (i.e. in some state) in a cave that is part of a bigger system of caves, or on an island in a bigger system of islands. We have a limited number of choices (these are the inputs to the FSM) — perhaps doors that we can exit from, or passages in the caves, or directions that we can go, or ships that we can catch — to trigger the transition to the next cave, or the next island.
The four states in our diagram could represent four caves, or four islands, or four stations in an underground tube system. The R/G/B triggers could represent Red, Green, or Blue ships that we could catch to the next island, or exit passages from one cave to another, or platforms where we could catch the next tube train.
For a game, some of the states can contain some treasure, some reward, or some danger. But we don’t want the user to know the “map” of the machine. That would make finding the treasure too easy. So the user needs to explore the possible states and transitions and find the treasure without going around in circles forever.
See where the finite state machine is presented as a hunt for pirate treasure on some islands.
Our task now: write an “engine” for games like this, and then use our engine to build one or two cave or island games.
The game was inspired by Will Crowther’s original “Colossal Cave Adventure” game — possibly the first ever dungeon game done on a computer. It has a fascinating history, and you can download the original code (or an executable that runs on a PC), or play the game on-line. Prepare to devote a good number of hours to this!. Also read the really fascinating page.
In the spirit of the original game, we’ll do this as a Console Application rather than use WPF. In the original game everything was in upper-case too, (that is all computers could manage then), so take a peek at the very retro-looking screen shot on Wikipedia. We won’t go that far! (Refresher: Section 4.3 shows how to create and use a Console Application.)
Here is a short interaction, showing what we aim to achieve:
When we create our Console Application we’ll get a class called
Program that contains the starting point — a static
Main
method. We’ll add just two statements to that class, and write
everything else in our own classes. So let’s begin by changing
the skeleton program like this:
Lines 5 and 6 instantiate a new game, and call its
RunGameLoop method.
So we now need to add a
Game class to our project.
Designing classes is a huge topic in its own right. So we’re not really going to spend too much time here arguing the merits of what classes we need and what responsibilities each should have. Instead, we’ll just present and implement a design. Our approach is based on the advice given earlier: write down a few user stories, identify the nouns, and these often make good candidates to turn into classes of their own.
We’ll introduce four additional classes:
- A
Playerclass. The only responsibility (and state) at this time will be to keep an inventory of things that they are carrying (like the torch, or the keys).
- A
Stateclass. This will correspond to a state in our FSM, and will represent a Cave or an Island in the game. It needs a description, and also needs to keep an inventory of things that are in the room.
- An
FSMclass, as we had in the last chapter. It implements the map of the game, and is responsible for moving from one state to another.
- The
Gameclass, which controls the game. It will do all the interaction with the user via the Console, and will instantiate and “own” the finite state machine object, and the player object. It must “understand” what the user types in, and be the controller for the game. After each change to the state, it must update the view — i.e. give feedback to the user about the new situation.
The one other obvious noun that might qualify for its own class would be the “thing” — torch, iPad, knife, etc. At this stage, things don’t have any behaviour of their own (for example, the torch cannot run out of battery power, and we cannot turn on the iPad), so we will just represent each “thing”” as a string.
27.1. The
Player class¶
The class diagram here shows the members that we’ll want
for a player. These diagrams show private and public
members. We are only interested in the public members when
we’re figuring out how this component will interact with other components.
We’re interested in the private members because they tell us about
the state that an object can be in, or private operations it can do.
Recall that the tiny padlock icon next to
inventory means “private”.
You’ll also notice that the class diagrams have collapsible sections for the Fields, Properties, Methods and all the detail of the Class. This allows us to choose to view the level of detail and the “mental chunking” that is appropriate for our task.
Let’s implement the player class (we haven’t shown the
using directives and
the namespace sections of the code:)
There are some noteworthy aspects here:
- Because we need to dynamically add and remove items from the player’s inventory, a
List<string>is a good choice of data structure.
- The inventory needs to get initialized. The collaborator that instantiates the class must pass in the things. At line 7 we turn the array into a list, because we need it to be dynamic. Building our own list also means that the list really is private and encapsulated in the class. If we got our collaborator to create the list for us, and we just saved a reference, they’d have a “back-door” way of modifying the player’s inventory.
- On line 14 we throw an exception on trying to remove a thing that we don’t have. So the caller will need to catch that exception and pass a message back to our user.
- On line 26 we used
string.Jointo join all our inventory items into a single description string, with commas between each of the items. It works, but may not be the ultimately satisfying way to do it.
- Our boss is going to complain that we haven’t documented any of our methods decently. We’ll cover that in the next chapter.
27.2. The
State class¶
Here we need to deal with each cave or island in our game. It too needs an inventory (and we’ve chosen the same method names and representation as we used for the player class).
The
GetDescription method returns the description of the cave, and its
inventory. But it takes a bit of extra care not to report an empty inventory.
27.3. The
FSM class¶
The key ideas here are as they were in the previous chapter with the Traffic Lights finite state machine, but we’ve made a few improvements.
The machine keeps a list of the state objects, and exposes a
CurrentState
property (on line 8) that only it can set, but the collaborators can get.
It sets the property initially at line 14, and changes it at line 31.
Looking back to our previous finite state machine examples (the traffic light example
done twice, once in Chapter 12 and again with a separate class in the previous chapter),
we had a very simple state diagram with only one event that caused transitions. Now we
have a more complex FSM: at each state there are many possible events.
transitionTable is an array of an array of integers because the first array specifies
which cave you are in and the second is an array of integers which represent all the
possible exits and where they lead to for the cave you are in.
So there are two important generalization built into this example.
- Firstly the transition table is not hard-coded in the FSM class. So each time we create a new FSM instance, we can provide a different transition table specific to that FSM.
- The set of event words are also not hard-coded as part of the FSM logic. The verbs that trigger the transitions are also set up in the constructor. So the
DoTransitionmethod now takes the FSM event verb as a string, and it looks up the corresponding index to get to the correct element in the transition array.
These generalizations serve us well. We could re-use the same FSM class to have a version of the caves game in another language, or we could use this FSM class to build a controller for our Traffic Lights.
Finally, in lines 39-54 we go to quite a lot of trouble to build up a description of the
possible exits from each room. The way we use the
separator variable is a bit
tricky: we put separators before each new possibility, but we get around the fact that
the first item doesn’t need a comma before it. Then on top of that complication, we
also use the variable at line 52 to determine whether we found any exits at all.
(Of course, this part of the code is pretty specific for the caves game!)
And if you want to understand why we chose that specific text for the exception at line 35, it is a quote from Boris the Animal.
27.4. Tying it all together — the
Game class¶
When we create the Game instance it must set up the caves (States), create the FSM for the transitions and create the player object.
We also need a method to output the current view, and we’ll call that too.
As already mentioned, the FSM now understands what event verbs should cause transitions, so on line 32 we set this up. Our cave system consists of just four rooms. One of them is initialized with two things, the others have nothing in them. The player is initialized with a few things in their inventory too.
If we look back at the
Main method right at the top of this chapter,
getting the game to play was a two-step process: instantiate the game
(and we now have the code completed for that step), and then call
RunGameLoop to enter the play loop.
Many games have a game loop, and it is worthwhile thinking in larger abstractions about what it needs to do. Each iteration of the loop needs two main steps:
- Get some input from the user and break it up (parse it) into its words,
- Respond to the user’s command.
The game loop will run continuously until the user types quit.
It will be a good idea to use a
switch statement with one
case to cater for each of the possible actions that a user can do.
So we could start with a skeleton like this:
The game loop at line 3 runs “forever”, but the return at line 22 overrides that, leaves the method, and the game will end.
Lines 10-17 parse the user’s input and do a bit of error checking. We now need to expand that logic so that we check that the user does supply an object word for the verbs like “go” and “drop” that require one, and that they don’t supply an argument if the verb doesn’t require one.
We keep a list of
words that need object words. Lines 7-16 check and give errors for
the two “invalid” cases: the user types “read” or the user types “help east”.
At line 17, if an object is required (and is present) we can safely
access the
words array at index position 1 and extract the object word.
That completes our simple parser for the user input.
Now we can incrementally add cases to our
switch statement for the
rest of the verbs. But before we can do that, we need to remember that
some of our methods can throw exceptions. So let’s also wrap the
whole
switch statement in a
`try ... catch: (Notice that
this is all still inside the game loop, so an exception won’t
end the game!)
Lines 5-8 handle our movement between the caves. Lines 10-14 transfer an item from the player’s inventory to the room’s inventory. We haven’t yet written the logic for picking up things, but it should be quite similar. When asked to “read”, we make sure that the thing we’re asked to read is either in the player’s inventory, or the room’s inventory. And we currently only allow the user to read the book. But allowing them to read the iPad should be an easy change.
27.5. Summary¶
We’ve constructed an application with five different classes. The object-based approach has allowed us to break a fairly complicated application into manageable chunks. Together they collaborate to make a non-trivial application.
27.6. Exercises¶
- Create your Console Application, add the classes you need, and cut and paste all the code from this chapter into the respective classes to make the game play.
- The game class we presented here didn’t implement all the verbs. Complete it.
- You’re lazy. Change the game so that we can just type “go n”, “go e”, “go s”, “go w” instead of “go north”, “go east”, “go south”, “go west”.
- You’re even lazier. Change the game so that you can also just type “n”, “e”, “s”, “w” instead of “go n”, “go e”, “go s”, “go w”.
- Change the player class so that a player can only carry a maximum of four items at any one time. (“Your hands are full!”)
- Extend the cave system so that you can also go “up” or “down” and add a few more passages, rooms, and treasures.
- Put some food in one of the caves. Allow the user to take, drop, or eat the food, (“Yummy!”). Don’t let the user eat inappropriate things (use your imagination). And make sure that once something is eaten, it is gone.
- As the game stands, we use short strings like “food” so that the user can easily refer to the item when typing input at the console. But perhaps having a key word “food” that maps to a more elaborate description like “a steaming hot chilli pizza” would add some spice to the game!
- The Colossal Cave adventure game has a few magic spell words that transport you to another part of the cave. This requires “breaking” the rules of an FSM — you have to create a way to get the machine into a specific state without following the transitions that are available. Implement a magic word “plugh” that always takes you back to a fixed cave.
- The Colossal Cave adventure game has some situations in which a rockfall might close down some passages, or open new passages. In our system, this would require “rewiring” the transition table a bit. Create a new state in the cave system — a treasure room — but make it initially unreachable from any other state. Then, on some trigger (maybe when the user tries to eat the book, or you may want to provide some dynamite that the user can light) you should provide an unexpected side effect that reconfigures the caves and opens a passageway to the treasure room.
- The Colossal Cave adventure game has a torch with batteries that run out after a while. But in one of the caves there is a vending machine that dispenses new batteries. But the vending machine needs coins that have to be collected in other parts of the cave system. To implement features like this we would need to allow interactions between the “things” in our system. Presently, things don’t react or interact with one another — they’re just represented as simple strings that we can take, drop, throw, or eat. What changes would you have to make to the program to represent a thing as an object with its own internal behaviour and state?
- The Colossal Cave adventure game has a dangerous troll that wanders about the caves in an unpredictable fashion. How could you add a troll to your game? | http://7-fountains.com/7FD/ThinkSharply/ThinkSharply/in_the_caves.html | CC-MAIN-2018-51 | refinedweb | 3,155 | 69.82 |
ncl_pcdlsc man page
PCDLSC — Defines the default list of "special colors" used by PCHIQU in drawing certain characters from the filled fonts. Calling PCDLSC with the argument IFCI will define color indices IFCI, IFCI+1, IFCI+2, ..., IFCI+15 and it will set all elements of the internal parameter array ´CC´ corresponding to indices 1 through 16. At the moment, although such a call does define a set of sixteen colors (ranging from blue to red) and set the elements of ´CC´, it´s a bit pointless, since there are no characters for which the special colors are used. In the future, there will be a few such (like the state highway symbol, which is normally drawn in a particular pair of colors); at that time, the routine will be of more use.
Synopsis
CALL PCDLSC (IFCI)
C-Binding Synopsis
#include <ncarg/ncargC.h>
void c_pcdlsc (int ifci)
Description
- IFCI
(an input expression of type INTEGER) specifies the first of a set of sixteen color indices that may be defined by PCDLSC. Make sure that these color indices are not already used.
C-Binding Description
The C-binding argument descriptions are the same as the FORTRAN argument descriptions.
Usage
This routine allows you to set the current value of Plotchar parameters. For a complete list of parameters available in this utility, see the plotchar_params man page.
Access
To use PCDLSC or c_pcdlsc, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order.
Messages
See the plotchar man page for a description of all Plotchar error messages and/or informational messages.
See Also
Online: plotchar, plotchar_params, pcgetc, pcgeti, pcgetr, pchiqu, pcloqu, pcmequ, pcmpxy, pcpnwi, pcrset, pcsetc, pcseti, pcsetr, ncarg_cbind.
Hardcopy: NCAR Graphics Fundamentals, UNIX Version
University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement. | https://www.mankier.com/3/ncl_pcdlsc | CC-MAIN-2017-26 | refinedweb | 303 | 60.14 |
I really need some help...basically, I just wanted to read a text file in Java using Eclipse. Here's my code:
import java.io.*; class FileRead { public static void main(String args[]) { try{ // Open the file that is the first // command line parameter //checks where the path is going ????????????????????? System.out.println(System.getProperty("user.dir")); // FileInputStream fstream = new FileInputStream(System.getProperty("user.dir") + "\\sample()); } } // end of } //end of FileRead class
I am using Java 1.6; after clicking 'Run as Application', here's the error I get:
----------------------------------------------------------------------------------
C:\Program Files\Eclipse SDK 3.4\workspace\SampleRun
Error: C:\Program Files\Eclipse SDK 3.4\workspace\SampleRun\sample.txt (The system cannot find the file specified)
----------------------------------------------------------------------------------
Here's how my files are organized:
sample.txt file is located at C:\Program Files\Eclipse SDK 3.4\workspace\SampleRun\sample.txt
SampleRun project contains
src (with FileRead.java in it)
bin (with compiled java files)
sample.txt (I moved this under src but still no luck)
PLEASE, PLEASE help...I appreciate it a lot in advance.
Dor
This post has been edited by esmm1969: 05 February 2009 - 06:07 PM | http://www.dreamincode.net/forums/topic/84941-read-a-text-file-in-java-using-eclipse/ | CC-MAIN-2016-30 | refinedweb | 190 | 61.43 |
For Day 7, the challenge is to build a graph of running programs and dependencies and then adjust the weighting. My Python code is below:
import Queue from collections import Counter class Program: def __init__(self, line): self.parent = None line = line.split(" -> ") if len(line) > 1: self.children = [l.strip() for l in line[1].split(",")] else: self.children = [] self.name, self.weight = line[0].split(" ") self.weight = int(self.weight.strip()[1:-1]) @property def total_weight(self): self.total_weight = self.weight + sum(programs[c].total_weight for c in self.children) return self.total_weight programs = {} with open("input.txt", "r") as i: for line in i: program = Program(line.strip()) programs[program.name] = program # Set up parents for key, program in programs.items(): for child in program.children: programs[child].parent = program program = programs.values()[0] while program.parent: program = program.parent print program.name def find_incorrect_weight_parent(program): child_weights = [programs[c].total_weight for c in program.children] child_weights_counter = Counter(child_weights) if len(child_weights_counter.keys()) > 1: lst = child_weights_counter.most_common(2) weight_difference = lst[0][0] - lst[1][0] for c in program.children: if not programs[c].total_weight == lst[0][0]: return programs[c].weight + weight_difference return None lst = [] queue = Queue.Queue() queue.put(program) while not queue.empty(): program = queue.get() lst.append(program) for c in program.children: queue.put(programs[c]) lst.reverse() for program in lst: weight = find_incorrect_weight_parent(program) if weight: print weight break
For the first part, I create a graph - loop through every program once to set up references to parents, and then just pick the first program and continue finding the parent until I find the root.
For the second part, the only tricky bit is that we need to start searching from the bottom. For this I use a breadth first search to build a list of programs ordered from top to bottom. I then reverse the list, and loop through until I find the first one with the incorrect weight.
Advent of Code runs every day up to Christmas, you should join in!.
Get the latest posts delivered right to your inbox. | https://blog.jscott.me/untitled-2/ | CC-MAIN-2018-43 | refinedweb | 350 | 54.79 |
The QAsciiDict class is a template class that provides a dictionary based on char* keys. More...
#include <qasciidict.h>
Inherits QPtrCollection.
List of all member functions.
QAsciiDict is implemented as a template class. Define a template instance QAsciiDict<X> to create a dictionary that operates on pointers to X (X*).
A dictionary is a collection of key-value pairs. The key is a char* used for insertion, removal and lookup. The value is a pointer. Dictionaries provide very fast insertion and lookup.
QAsciiDict cannot handle Unicode keys; use the QDict template instead, which uses QString keys. A QDict has the same performace as a QAsciiDict.
Example:
QAsciiDict<QLineEdit> fields; // char* keys, QLineEdit* values fields.insert( "forename", new QLineEdit( this ) ); fields.insert( "surname", new QLineEdit( this ) ); fields["forename"]->setText( "Homer" ); fields["surname"]->setText( "Simpson" ); QAsciiDictIterator<QLineEdit> it( fields ); // See QAsciiDict;In this example we use a dictionary to keep track of the line edits we're using. We insert each line edit into the dictionary with a unique name and then access the line edits via the dictionary. See QPtrDict, QIntDict and QDict.
See QDict for full details, including the choice of dictionary size, and how deletions are handled.
See also QAsciiDictIterator, QDict, QIntDict, QPtrDict, Collection Classes, Collection Classes, and Non-GUI Classes.
Constructs a dictionary optimized for less than size entries.
We recommend setting size to a suitably large prime number (a bit larger than the expected number of entries). This makes the hash distribution better and will improve lookup performance.
When caseSensitive is TRUE (the default) QAsciiDict treats "abc" and "Abc" as different keys; when it is FALSE "abc" and "Abc" are the same. Case-insensitive comparison only considers the 26 letters in US-ASCII.
If copyKeys is TRUE (the default), the dictionary copies keys using strcpy(); if it is FALSE, the dictionary just copies the pointers.
Constructs a copy of dict.
Each item in dict is inserted into this dictionary. Only the pointers are copied (shallow copy).
Removes all items from the dictionary and destroys it.
The items are deleted if auto-delete is enabled. operate on dictionary are reset.
See also remove(), take(), and setAutoDelete().
Reimplemented from QPtrCollection.
Returns the number of items in the dictionary.
See also isEmpty().
Reimplemented from QPtrCollection. [] operator.
See also operator[]().
Inserts the key with the item into the dictionary.
Multiple items can have the same key, in which case only the last item will be accessible using operator[]().
item may not be 0.
See also replace().
Returns TRUE if the dictionary is empty, i.e. count() == 0; otherwise it returns FALSE.
See also count().
Assigns dict to this dictionary and returns a reference to this dictionary.
This dictionary is first cleared and then each item in dict is inserted into this dictionary. Only the pointers are copied (shallow copy) unless newItem() has been reimplemented(). find() function.
See also find().
Reads a dictionary item from the stream s and returns a reference to the stream.
The default implementation sets item to 0.
See also write().
Removes the item associated with key from the dictionary. Returns TRUE if successful, i.e. if the key existed().
Replaces an item that has a key equal to key with item.
If the item does not already exist, it will be inserted.
item may not be 0.
Equivalent to:
QAsciiDict<char> dict; ... if ( dict.find(key) ) dict.remove( key ); dict.insert( key, item );
If there are two or more items with equal keys, then the most recently inserted item will be replaced.
See also insert().
Changes the size of the hashtable most recently inserted item().
Writes a dictionary item to the stream s and returns a reference to the stream.
See also read().
This file is part of the Qt toolkit. Copyright © 1995-2005 Trolltech. All Rights Reserved. | http://doc.trolltech.com/3.3/qasciidict.html | crawl-002 | refinedweb | 631 | 62.14 |
Porting Qt Quick Application to Meego Harmattan Qt Quick Application
Revision as of 09:40, 22 November 2011
This article explains how to port your Qt Quick application to MeeGo Harmattan Qt Quick application using Qt SDK Qt SDK 1.1.3.
Introduction
This wiki article demonstrates how to port your Qt Quick application to MeeGo Harmattan Qt Quick application using Qt SDK Qt SDK 1.1.3.
Preconditions
You have installed Qt SDK 1.1.3 in your workstation to create any MeeGo Harmattan application. You can download it from this link
How to
To port you application you just need to follow below step using Qt SDK 1.1.3. Its very easy with Qt SDK 1.1.3. In this article, I will port my WaterBubble Qt Quick Game to MeeGo. You can get more details about my game Water Bubble on this [[1]].
1. Create New Qt Quick Application Project
- Go to File > New File or Project > Qt Quick Project Template > Qt Quick Application.
2. Select Qt Quick Application Type
- Select Qt Quick Application type "Built in Elements Only (For all Platform)"
3. Select Target Harmattan
- Select Target Harmattan as in screenshot.
4. Select Application Icon
- Select appropriate application icon having size 80x80.
5. Replace your QML file
- Now you can see the Qt Quick application created with sample main.qml in it.
- Replace your Qt Quick application's QML file as it was in your old Qt Quick application. Delete the sample main QML file.
But dont forget to change the starting qml file name in Source >> Main.cpp file.
#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QmlApplicationViewer viewer;
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
viewer.setMainQmlFile(QLatin1String("qml/waterbubble/Waterbubble.qml"));
viewer.showExpanded();
return app.exec();
}
6. Start MeeGo Emulator
- To start MeeGo Emulator on Qt SDK 1.1.3 , click on Left Bottom Button as seen on Screenshot. Before start it is look like in screenshot with small green start button on it.
After click on it, you can see the MeeGo Emulator is starting as seen in screenshot below.
Once it fully start you can see the MeeGo various application icon.
7. Run the Project
- Run your project, by click on Run button. You can see your application running on MeeGo Emulator and you can see your application icon after kill the running process or exit the application as below.
8. Application running on Emulator
- You can see your Qt Quick application running on MeeGo Emulator.
9. Find Package .deb file
- Get the package .deb file with version number in name (in my case waterbubble_0.0.1_armel.deb) in Application Folder. That will use as setup file for MeeGo Harmattan Platform.
Qt Quick Application Running on Nokia N950
You can see the Qt Quick application running on N950 MeeGo developer device after installing waterbubble_0.0.1_armel.deb file in screenshot below.
Summary
Porting Qt quick app to MeeGo is very easy using Qt SDK 1.1.3. | http://developer.nokia.com/community/wiki/index.php?title=Porting_Qt_Quick_Application_to_Meego_Harmattan_Qt_Quick_Application&diff=118347&oldid=112925 | CC-MAIN-2014-23 | refinedweb | 502 | 58.08 |
Constructing my first Point Class
So I was showing someone how to build a Point Class today, and realized that this is actually the first time I’ve ever built one.
As a quick sidenote, in programming, the Point Class is the quintiseential example class representing a single point in cartesian space. The Point Class is usually used to teach Objects and Classes in an introductory Object Oriented Programming course in computer science.
However, not ever having taken a computer science course, and this also being my birthday, I felt that it is refreshing to share something simple and archetypal.
So here it is!
import math class PointError(Exception): pass class Point: def __init__(self, x, y): self.x = x self.y = y def __repr__(self): return 'Point(%s, %s)' % (self.x, self.y) @classmethod def distance(cls, p1, p2): if not isinstance(p1, cls): raise PointError('%s is not of class %s' % (p1, cls)) if not isinstance(p2, cls): raise PointError('%s is not of class %s' % (p2, cls)) return math.sqrt((p1.x - p2.x)**2 + (p1.y - p2.y)**2)
Using the point class should be pretty trivial.
We also utilize inheritence in order to build a simple PointError class. This means that passing anything other than an instance of our Point class into the distance() function will raise the following error.
>>> Point.distance(p1, 10) --------------------------------------------------------------------------- PointError Traceback (most recent call last) ---->01 Point.distance(p1, 10) 19 if not isinstance(p2, cls): ---->20 raise PointError('%s is not of class %s' % (p2, cls)) 21 return math.sqrt((p1.x - p2.x)**2 + (p1.y - p2.y)**2) PointError: 10 is not of class Point
As well we also build a method bound to the Point Big P class rather than a normal method bound to an instance little p. This may seem slightly esoteric but it makes sense, because it allows us to use the isinstance() function to properly check if a point is an instance of the class without needing us to awkwardly pass in the name of the class like so.
class Point: .. def distance(self, p2): if not isinstance(p2, Point): ..
And there you have it!
Pretty simpel right?
P.S Here’s the code to generate the plot in a Jupyter/IPython notebook. Be sure that you have the Humor Sans fontface and to clear your fontcache to get it to render correctly :)
# Set Output Type %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns # Default Styling sns.set_style('whitegrid') sns.set_context('notebook', font_scale=1.5, rc={'lines.linewidth': 2.5}) # Pythagorean Theorem Anyone? plt.plot([1,2], [2,2], 'ro-') # a^2 plt.plot([2,2], [2,4], 'ro-') # b^2 plt.plot([1,2], [2,4], 'o-') # c^2 # Annotations plt.title('Point Classes') # Title plt.xlabel('X Axis') # X Axis plt.ylabel('Y Axis') # Y Axis plt.axis([0,3,0,5]) # Axis Ranges plt.annotate( 'Point.distance(p1, p2)', # Arrow xy=(1.5, 3.2), xytext=(0.5, 4), arrowprops=dict(facecolor='black', shrink=0.1), ) # Text Labels plt.text(0.8, 2, 'p1') plt.text(1.8, 4, 'p2') plt.text(1.3, 1.6, 'p2.x - p1.x') plt.text(2.1, 3.0, 'p2.y - p1.y') plt.xkcd() plt.tight_layout() plt.show()
Cheers! | https://sanghan.xyz/blog/2015/07/point_class/ | CC-MAIN-2018-43 | refinedweb | 551 | 67.15 |
WAIT(2) BSD System Calls Manual WAIT(2)
NAME
wait, waitpid, wait4, wait3 -- wait for process termination
SYNOPSIS
#include <<sys/wait.h>>
pid_t
wait(int *status);
pid_t
waitpid(pid_t wpid, int *status, int options);
#include <<sys/resource.h>>
#include <<sys/wait argument is the bit-
wise OR of zero or more of the following values:
WCONTINUED Causes status to be reported for stopped child processes that
have been continued by receipt of a SIGCONT signal.
WNOHANG Indicates that the call should not block if there are no pro-
cesses
argument.
SEE ALSO
_exit(2), sigaction(2), exit(3)
STANDARDS
The wait() and waitpid() functions conform to IEEE Std 1003.1-2008
(``POSIX.1'').
wait4() and wait3() are not specified by POSIX. The WCOREDUMP() macro
and the ability to restart a pending wait() call are extensions to that
specification.
HISTORY
A wait() system call first appeared in Version 1 AT&T UNIX. The status
argument is accepted since Version 2 AT&T UNIX. A wait3() system call
first appeared in 4BSD, but the final calling convention was only estab-
lished in 4.2BSD. The wait4() and waitpid() function calls first
appeared in 4.3BSD-Reno.
BSD September 9, 2014 BSD | http://modman.unixdev.net/?sektion=2&page=WIFSTOPPED&manpath=OpenBSD-5.7 | CC-MAIN-2017-34 | refinedweb | 199 | 64.81 |
Duncan Smith wrote: > I have a tree structure with unique node labels and a (possibly not unique) > cost associated with each node. I need to permute the tree as follows. > > I need to take a node with minimum cost, make a local change to the tree, > update the costs of some local nodes, and repeat until there exists no node > with a negative associated cost. If I use a dictionary with node labels as > keys the updating of costs is easy, but I don't know how to efficiently > extract a node label with lowest cost. If I use a list of [cost, label] > lists I can use the sort method to identify the node with lowest cost, but > updating the costs is less efficient. It seems like what you need is a priority queue. There are lots of good data structures for that purpose, and it wouldn't be hard to implement them in Python. (I think it's already been done. Something in the back of my brain is saying "kjbuckets" at me.) A word of warning: complicated data structures with good asymptotic performance don't always pay off. Sometimes mediocre asymptotics and small constants of proportionality work better. In your case, that would probably mean using "sort" and taking advantage of the fact that it runs nice and quickly and doesn't involve interpreting lots of nasty slow Python code....) class Heap: def __init__(self, elements=[]): self.array = elements self.n = len(elements) self.repair_all() def parent(self, i): return (i-1)/2 def children(self, i): return 2*i+1, 2*i+2 def move_down(self, i): """This is a heap, except that element i may be larger than its "children" 2*i+1 and 2*i+2. Adjust things to fix this, by letting the renegade element "settle down" to a good place. This doesn't do anything to resolve problems that may occur "above" i -- if, e.g., after the operation i's "parent" is larger than i. If you take a valid heap and increase one element, then a "move_down" is all that's needed to fix the heap. Time: O(log n).""" a,n = self.array, self.n element = a[i] while 1: left,right = self.children(i) smallest = i if left<n and a[left] < element: smallest = left if right<n and a[right] < a[smallest]: smallest = right if smallest == i: break # Done! a[i] = a[smallest] i = smallest a[i] = element def repair_all(self): """This is a random array of values; none of the defining relations need hold. Turn it into a heap by "move_down"ing everything in a suitable order. Time: O(n log n).""" for i in range(self.n/2-1, -1, -1): # n/2-1 .. 0. self.move_down(i) def move_up(self, i): """This is a heap, except that element i may be smaller than its "parent" (i-2)/2. Adjust things to fix this, by letting the renegade element "bubble up" to a good place. This doesn't do anything to resolve problems that may occur "below" i -- if, e.g., after the operation i's "children" are smaller than i. If you take a valid heap and decrease one element, then a "move_up" is all that's needed to fix the heap. Time: O(log n).""" element = self.array[i] a = self.array p = self.parent(i) while p>=0 and a[p]>element: a[i] = a[p] i,p = p,self.parent(p) a[i] = element def smallest(self): """Return the smallest element. Time: O(1).""" return self.array[0] def add(self, element): """Add a new element to the heap by placing it at the bottom and letting it "bubble up". Time: O(log n).""" self.array.append(element) self.n = self.n+1 self.move_up(self.n-1) def remove(self, i): """Remove the element with index i from the heap by replacing it with the last element and repairing. Time: O(log n).""" self.n = self.n-1 self.array[i] = self.array[self.n] self.move_down(i) If you need to be able to get from elements to indices easily (which you probably do, so that you can call "move_up" or "move_down" on all the elements whose costs you've changed), you can either put indices inside the elements (and update them in "repair" and "add") or just work with indices everywhere. To do the former, you need to hack "move_up" and "move_down" so that where they move an element they also adjust its stored index. Then, when you make your local changes, just re-assign the costs and call "move_up" or "move_down" on each node whose cost has changed (depending on which way the cost has changed). -- Gareth McCaughan Gareth.McCaughan at pobox.com sig under construction | https://mail.python.org/pipermail/python-list/2000-September/030517.html | CC-MAIN-2016-36 | refinedweb | 799 | 65.32 |
direct.showutil.TexMemWatcher¶
from direct.showutil.TexMemWatcher import TexMemWatcher, TexPlacement, TexRecord
Inheritance diagram
- class
TexMemWatcher(gsg=None, limit=None)[source]¶
Bases:
direct.showbase.DirectObject.DirectObject
This class creates a separate graphics window that displays an approximation of the current texture memory, showing the textures that are resident and/or active, and an approximation of the amount of texture memory consumed by each one. It’s intended as a useful tool to help determine where texture memory is being spent.
Although it represents the textures visually in a 2-d space, it doesn’t actually have any idea how textures are physically laid out in memory–but it has to lay them out somehow, so it makes something up. It occasionally rearranges the texture display when it feels it needs to, without regard to what the graphics card is actually doing. This tool can’t be used to research texture memory fragmentation issues.
findAvailableHoles(self, area, w=None, h=None)[source]¶
Finds a list of available holes, of at least the indicated area. Returns a list of tuples, where each tuple is of the form (area, tp).
If w and h are non-None, this will short-circuit on the first hole it finds that fits w x h, and return just that hole in a singleton list.
findEmptyRuns(self, bm)[source]¶
Separates a bitmask into a list of (l, r) tuples, corresponding to the empty regions in the row between 0 and self.w.
findHole(self, area, w, h)[source]¶
Searches for a rectangular hole that is at least area square units big, regardless of its shape, but attempt to find one that comes close to the right shape, at least. If one is found, returns an appropriate TexPlacement; otherwise, returns None.
findHolePieces(self, area)[source]¶
Returns a list of holes whose net area sums to the given area, or None if there are not enough holes.
findOverflowHole(self, area, w, h)[source]¶
Searches for a hole large enough for (w, h), in the overflow space. Since the overflow space is infinite, this will always succeed.
isolateTexture(self, tr)[source]¶
Isolates the indicated texture onscreen, or None to restore normal mode.
mouseClick(self)[source]¶
Received a mouse-click within the window. This isolates the currently-highlighted texture into a full-window presentation.
setLimit(self, limit=None)[source]¶
Indicates the texture memory limit. If limit is None or unspecified, the limit is taken from the GSG, if any; or there is no limit.
setRollover(self, tr, pi)[source]¶
Sets the highlighted texture (due to mouse rollover) to the indicated texture, or None to clear it.
setupCanvas(self)[source]¶
Creates the “canvas”, which is the checkerboard area where texture memory is laid out. The canvas has its own DisplayRegion.
updateTextures(self, task)[source]¶
Gets the current list of resident textures and adds new textures or removes old ones from the onscreen display, as necessary.
- class
TexPlacement(l, r, b, t)[source]¶
Bases:
object
clearBitmasks(self, bitmasks)[source]¶
Clears all of the appropriate bits to indicate this region is available.
hasOverlap(self, bitmasks)[source]¶
Returns true if there is an overlap with this region and any other region, false otherwise. | https://docs.panda3d.org/1.10/python/reference/direct.showutil.TexMemWatcher | CC-MAIN-2020-05 | refinedweb | 527 | 53.71 |
importing premade 3d objects(Maya,etc) into FX Shapes????KonradZuse Apr 4, 2013 10:54 PM
So I cannot seem to find anything in the API, or on the web, but says this
This content has been marked as final. Show 11 replies
1. Re: importing premade 3d objects(Maya,etc) into FX Shapes????jsmith Apr 4, 2013 11:07 PM (in response to KonradZuse)Try an early access importer available here =>
2. Re: importing premade 3d objects(Maya,etc) into FX Shapes????KonradZuse Apr 5, 2013 12:21 AM (in response to jsmith)Thanks! Have you looked at them yet? Any idea how to exactly implement them? I'm using the corkscrew sample, not too sure if there's a specific way of doing it.
3. Re: importing premade 3d objects(Maya,etc) into FX Shapes????jsmith Apr 5, 2013 12:36 AM (in response to KonradZuse)
Thanks! Have you looked at them yet? Any idea how to exactly implement them?Nope.
Ask any questions regarding the model importer directly to interactivemesh, that will easily be your best and quickest source of info =>
I think the JavaFX team also plan to release some sample code for a 3D model importer but I don't think they have released one yet, so the interactivemesh one is your best starting point at the moment.
4. Re: importing premade 3d objects(Maya,etc) into FX Shapes????InteractiveMesh Apr 5, 2013 7:38 AM (in response to KonradZuse)Is your corkscrew sample as '.obj' or '.stl' export available?
Assuming that the 'corkscrew.obj' file and its associated material file 'corkscrew.mtl' are located in the project's sub-folder 'resources' following code should import your model:
August
import java.net.URL; import javafx.scene.shape.MeshView; import com.interactivemesh.jfx.importer.ImportException; import com.interactivemesh.jfx.importer.obj.ObjModelImporter; ObjModelImporter objImporter = new ObjModelImporter(); try { URL corkscrewUrl = this.getClass().getResource("resources/corkscrew.obj"); objImporter.read(corkscrewUrl); } catch (ImportException e) { e.printStackTrace(); return; } MeshView[] corkscrewShape3Ds = objImporter.getImport(); objImporter.close();
5. Re: importing premade 3d objects(Maya,etc) into FX Shapes????KonradZuse Apr 5, 2013 3:53 PM (in response to InteractiveMesh)So you're the man who we should thank for this huh? :).
Also I meant to say i'm using this "STL : CylinderHead
CylinderHead-ascii.stl, 14.6 MB
CylinderHead-binary.stl, 3.3 MB"
Sorry about that....
I'm assuming it's the same way to get and use both the same?
Also would you say it's hard to create your own importer/format?
I was noticing that you brought it in as a resource, but according to the STL api you don't use resources, but for obj it seems thast you do hmm, weird...
Seems as if both are different, but my question is answered for how to display it(as a mesh)? so I guess it should take the STl file, but I don't think I use a resource????
Originally I tried to grab it using the getClass().getResource().
Edited by: KonradZuse on Apr 5, 2013 8:47 AM
6. Re: importing premade 3d objects(Maya,etc) into FX Shapes????InteractiveMesh Apr 5, 2013 5:28 PM (in response to KonradZuse)The multiple use of the word 'resources' might be confusing. A 'resources' named sub-directory in a Java project is typically used to collect image, sound, and model files which are associated with the classes:
.../myProject/MyClass.java
.../myProject/resources/CylinderHead-binary.stl
=> this.getClass().getResource("resources/CylinderHead-binary.stl");
A model file itself can also have associated image, material, and shader files. These are the resources of the model file. Their location is typically relative to the location of the model file. If not, then a model-resource-location base is to be set for the importer.
August
import java.net.URL; import javafx.scene.paint.Color; import javafx.scene.paint.PhongMaterial; import javafx.scene.shape.MeshView; import javafx.scene.shape.TriangleMesh; import com.interactivemesh.jfx.importer.stl.StlImportOption; import com.interactivemesh.jfx.importer.stl.StlMeshImporter; StlMeshImporter stlImporter = new StlMeshImporter(); // Generated vertex normals result in a smoothly shaded surface stlImporter.setCreaseAngle(24); try { URL cylinderHeadUrl = this.getClass().getResource("resources/CylinderHead-binary.stl"); stlImporter.read(cylinderHeadUrl); } catch (ImportException e) { e.printStackTrace();; return; } // STL includes only geometry data TriangleMesh cylinderHeadMesh = stlImporter.getImport(); stlImporter.close(); // Create Shape3D MeshView cylinderHeadMeshView = new MeshView(); cylinderHeadMeshView.setMaterial(new PhongMaterial(Color.GRAY)); cylinderHeadMeshView.setMesh(cylinderHeadMesh);
7. Re: importing premade 3d objects(Maya,etc) into FX Shapes????KonradZuse Apr 7, 2013 12:10 AM (in response to InteractiveMesh)I'm sorry, I made my "resources" post a bit vague in what I was referring to, but I appreciate the recap in how getResource works :)
Now i'm curious about a few things.
1. Using Ambient Light on the images causes it to look really POOR quality, but a pointlight shows it all in amazing glory. It seems as if it goes by which color setting is used(even though it seems specular is > diffuse???) (maybe the other way around), but it is 1 SOLID color. No shading, or anything like in the pointlight.
2. Both OBJ and STL contain 2 files, it seems as if both work, so why include both files?
Also since you said there can be image, material, and shader files, how will the importer work with multiple files?
Thanks again for everything, and all the best on your project!
Edited by: KonradZuse on Apr 6, 2013 5:09 PM
8. Re: importing premade 3d objects(Maya,etc) into FX Shapes????InteractiveMesh Apr 8, 2013 9:04 AM (in response to KonradZuse)"1. Using Ambient Light ..."
Please, search the web for '3D Lighting' to get more details about interdependencies of light types and material colors.
"2. Both OBJ and STL contain 2 files ..."
OBJ defines smoothly shaded faces either by smoothing groups or by normals. ObjModelImporterJFX supports both approaches and converts them into TriangleMesh compliant smoothing groups.
STL geometry data can be provided in ASCII or binary format. StlModelImporterJFX supports both data representations.
"... image, material, and shader files, how will the importer work with multiple files?"
Almost all 3D model formats can reference files for texture images, shader source code, or other resources. The 3D model importer handles these references and loads all these resources while reading the 3D model file. To read several model files just recall 'importer.read(modelUrl)'.
August
9. Re: importing premade 3d objects(Maya,etc) into FX Shapes????KonradZuse Apr 13, 2013 2:18 AM (in response to InteractiveMesh)I tried to use the obj importer, but for some reason it's not working for me? I used your exact code have both files together, and returned it as a "MeshView[]" and put it into a group as that MeshView[] and nothing appears?
Edited by: KonradZuse on Apr 9, 2013 12:53 PM
I also have been trying to get more stls, and the sites I've been finding like turbosquid and such all give really tiny, or different shape/model than I was supposed to. I'm not too sure if that has to do with "creaseAngle"(as changing the creaseAngle for this Cylinder didn't produce anything that I saw different). I found a program called "MeshView" and I had this AUD.stl that when imported into MeshLab it was as big as the cylinder, and I could manipulate it in any way. For some reason it wouldn't save the file's axis different(even when I moved it) nor it's translation. when I scale is 10x it looks much better though, so it seems it's just an issue of scaling.
I just think these files are poor, and the only 3D software I have is Photoshop...
Also for the obj file it specifies a bunch of MeshViews, TriangleMesh's, and PhongMaterials, using codes like u, g, etc... How does that work? I can make obj's in Photoshop, but are we supposed to name each file according to it's "letter." There was a Coffee Cup that I tried and I got an error for 'g' so I'm curious how exactly it works.
Edited by: KonradZuse on Apr 12, 2013 6:35 PM
Another thing I notice is that I cannot find "sizes" on these models. It's always measured in Triangles, polygons, or Vertices, and other information is given. Is it possible in the future for us to possibly import pictures at a specific size? I don't know too much about how the 3D programs work, so any insight would be appreciated.
Edited by: KonradZuse on Apr 12, 2013 6:48 PM
Also when trying to import 100(lowest I've tried that does it) or more the area around the importing mesh's is extremely slow and choppy. When I try to drag and move a mesh it will take a couple of seconds to drag over, but after it's out of the "area" it moves fine; however putting it back into the area causes it to lag and be slow again. For some reason even when I was rotating a mesh far outside the area, if I moved inside the area, my object outside would freeze for a second.
Thanks again for putting out this wonderful importer.
Edited by: KonradZuse on Apr 12, 2013 7:15 PM
10. Re: importing premade 3d objects(Maya,etc) into FX Shapes????InteractiveMesh Apr 13, 2013 10:20 AM (in response to KonradZuse)To "see" imported models you have to identify and adjust following attributes:
MeshView's size and position
- boundsInLocal: the 3D BoundingBox of the MeshView in untransformed local coordinates
- boundsInParent: the 3D BoundingBox of the MeshView after all transformations have been applied
PerspectiveCamera's
- position and orientation (after transformations have been applied)
- near and far clipping planes
- field of view angle
While composing your 3D scene take into account that JavaFX might not behave as it should due to its early stage.
JavaFX repainting of complex 3D scene seems not to work properly yet.
I can't respond to Photoshop related issues because I don't have access to it.
August
11. Re: importing premade 3d objects(Maya,etc) into FX Shapes????KonradZuse Apr 16, 2013 6:06 PM (in response to InteractiveMesh)Yeah, sorry, I posted a lot of things at once, and edited it so many times I forgot what I fixed and what I still had questions for :p.
Thanks for the insight into the cam and such, it seemed that for the AUD I just needed to scale, but the main issue was these models I've been getting are extremely poor. They say it's one thing, and it's not :P. That's why I'm happy I got this MeshLab program to help me view them first.
Yeah I understand how early it is, that's why I want to give into this project as much as I can to help you with making this into a super amazing package(which i don't doubt since it's amazing already).
Yeah I'm not sure how many will cause it to be slow, but it just seems to happen when dragging the mouse into that area(normally when you drag the object into that area, bt like I said also when I was rotating an object away and my mouse happened to go through the origin of all 100 mesh's).
no worries on Photoshop, I was using that to try and import models to see, but MeshLab does that for me. Photoshop doesn't really have much in the way of 3D either. Only Maya, 3ds, obj, and max? I want to say.
Also I'm still having trouble with trying to import this OBJ file. I used the code provided above, and used it in a method in my "importer class."
the stl is set up the same way
so I would do
public MeshView[] objImporter(String s) { ObjModelImporter objImporter = new ObjModelImporter(); try { URL objUrl = this.getClass().getResource(s); objImporter.read(objUrl); } catch (ImportException e) { e.printStackTrace(); } meshV = objImporter.getImport(); objImporter.close(); return meshV; }
I just realized that when trying to redo some elements for the obj, I realized that I don't have a PhongMaterial set. How do we set the PhongMaterial for this?
importer i = new importer(); i.objImport("file.obj");
I tried to set each individual mesh in the MeshView, but no such luck.
public Face(MeshView[] mesh) { this.meshV = mesh; p.setDiffuseColor(Color.AQUA); this.relocate(200, 200); this.setTranslateZ(0); this.wide = 1; this.high = 1; this.deep = 1; for(int i = 0; i <meshV.length; i++) { meshV.setMaterial(p);
super.getChildren().addAll(meshV[i]);
}
public class draw extends Application
{
importer i = new importer();
double x,y,z;
Face f = new Face(i.objImporter("Scooter.obj"));
EDIT: One other thing I've been looking into is how to take 3, or more, sides of an image and create a 3D model. I know it can be done using Auto CAD, and another company I know does it for their products, but I was curious how hard it would be to do something like that in FX, or how I would go about it? Edited by: KonradZuse on Apr 16, 2013 11:06 AM | https://community.oracle.com/message/10951449 | CC-MAIN-2017-09 | refinedweb | 2,210 | 65.62 |
The core API has not changed from version 2.0 to 2.1.
NCL parses an std::istream by creating a NxsToken object around the stream (a better name for the class would be NxsTokenizer). Rather than using a low-level C++ istream operations, the NxsToken allows you to process a file by the NEXUS tokenizing rules - comments are skipped and NEXUS's quoting rules are obeyed.
A NxsReader instance is capable of reading an entire stream (usually a file) by interacting with the NxsToken until EOF is reached. The NxsReader's job is to identify the blocks in a file, and hand off the procesing of each block to an appropriate block reader (or skip the block if no reader is found).
The objects that read each block are instances of NxsBlock (perhaps a better name for this class would be NxsBlockReader). After the NxsReader chooses which block should handle a portion of NEXUS file, it will call the NxsBlock::Read function and pass in the NxsToken object which is poised to return tokens for the block that is to be read next.
Client code uses NCL by:
The main extensions to this basic structure that are new to version 2.1 are
The simplest (and admittedly least useful) NCL client that uses the version 2.1 API would be the following fragment:
#include "ncl/nxsmultiformat.h" int main(int argc, char * argv[]) { MultiFormatReader nexusReader(-1, NxsReader::WARNINGS_TO_STDERR); try { nexusReader.ReadFilepath(argv[1], MultiFormatReader::NEXUS_FORMAT); } catch(...) { nexusReader.DeleteBlocksFromFactories(); throw; } nexusReader.DeleteBlocksFromFactories(); return 0; }
If you were to save this file as "simpleNCLClient.cpp" and save this Makefile in the same directory then you could build the client. You would also need to specify the location of your NCL installation (see notes in the Makefile about NCL_INSTALL_DIR)
Despite the name "Nexus Class Library" NCL will actually read other file formats. NCL does not diagnose file format type. However, if you have data in PHYLIP, relaxed FASTA, ALN format or trees in Newick file then you can ask the MultiFormatReader to parse these files by passing in the appropriate MultiFormatReader::DataFormatType or format name (see the MultiFormatReader::getFormatNames() method).
NCL actually coerces inforamation from these sources into NxsTaxaBlock, NxsCharactersBlocks..., so the user of library does not have to change the code associated with querying NCL for information in order to support these formats.
Support for PhyloXML and nexml are planned.
Brief Directory: | http://phylo.bio.ku.edu/ncldocs/v2.1/funcdocs/basicAPI.html | CC-MAIN-2018-05 | refinedweb | 401 | 54.02 |
Originally posted by Paul Clapham: If you don't want those namespaces copied to your output, then say so in your <xsl:stylesheet> element by specifying the exclude-result-prefixes attribute.
Originally posted by Paul Clapham: You can find it here, for example, and in many other XSLT tutorial sites on the web.
Originally posted by FY Hsieh: However, as I said, I didn't define any name space in my XSLT header (see the snippet i attached in last message).
In the top of my XML I only have <xsl:stylesheet
Originally posted by FY Hsieh: well, my case is not "fo" namespace appear in the new "element". It works like this -- In the new XML file, it shows the new element <NEW_ELEMENT id="123" xmlns: | http://www.coderanch.com/t/128612/XML/XSLT-copy-attribute-element-generate | CC-MAIN-2014-15 | refinedweb | 127 | 64.04 |
In this tutorial I'll demonstrate how to send a file in Go over a TCP connection using a server that sends the file and a client that receives it, I'll try to go into detail as much as possible.
You can download the source code here.
The server will work in the following fashion
First of import the following packages
import ( "fmt" "io" "net" "os" "strconv" )
Define the following constant
const BUFFERSIZE = 1024
This constant can be anything from 1 to 65495, because the TCP package can only contain up to 65495 bytes of payload. It will define how big the chunks are of the file that we will send in bytes.
Also note that this constant should be the same on your client.
Here we will be creating a TCP listener, it will listen on the given port to incoming connections. And when a connection is made start a go routine to handle that connection.
func main() { server, err := net.Listen("tcp", "localhost:27001") if err != nil { fmt.Println("Error listetning: ", err) os.Exit(1) } defer server.Close() fmt.Println("Server started! Waiting for connections...") for { connection, err := server.Accept() if err != nil { fmt.Println("Error: ", err) os.Exit(1) } fmt.Println("Client connected") go sendFileToClient(connection) } }
It's pretty straight forward, 'net.Listen' starts listening at the the given host or ip and port. The 'defer' will make sure whenever the main function goes out of scope it will call the 'server.Close()' function.
The for loop works as following; it waits until somebody connects, that's what the 'server.Accept()' does, this function blocks the program until a client connects. When this happens it spawns a go routine that will handle the connection, in this case the function 'sendFileToClient()' will handle it and return back to the beginning of the loop.
This is the function that 'go' will call, it takes a 'net.Conn' as argument.
func sendFileToClient(connection net.Conn) { fmt.Println("A client has connected!") defer connection.Close() file, err := os.Open("dummyfile.dat") if err != nil { fmt.Println(err) return } fileInfo, err := file.Stat() if err != nil { fmt.Println(err) return } fileSize := fillString(strconv.FormatInt(fileInfo.Size(), 10), 10) fileName := fillString(fileInfo.Name(), 64) fmt.Println("Sending filename and filesize!") connection.Write([]byte(fileSize)) connection.Write([]byte(fileName)) sendBuffer := make([]byte, BUFFERSIZE) fmt.Println("Start sending file!") for { _, err = file.Read(sendBuffer) if err == io.EOF { break } connection.Write(sendBuffer) } fmt.Println("File has been sent, closing connection!") return }
It opens the file, in this case "dummyfile.dat". You can enter either a relational path to the file or an absolute path to the file. If you only enter a "file.extension" it will be treated as a relational path and look in the directory where the executable of the current program is.
It then reads out the information of the file with '.Stat()'. Create strings with a user defined function (scroll down for it). This function will fill in the rest of the bytes so it will match the fixed length of what the client want to read. This is just how TCP programming works, you define upfront how long the reader (client) should read.
For example if you do not fill up the bytes the client will keep on waiting;
Server sends the file name, "afile.dat", 9 bytes long. However since file names can differ and aren't always 9 bytes long we program the client to have a margin on this so it it reads, lets say 64 bytes.
Server sends the 9 bytes, the client receives them but keeps waiting for the other 55 bytes that it is expecting and will never move further until those are filled in.
So if you fill the file name with a filler (I used ':' here since it's an illegal character for file names under windows and linux) to become this:
afile.dat::::::::::::::::::::::::::::::::::::::::::::::::::::::: (64 bytes long)
So that's what the 'fillString()' function does, it fills it up. This should also be done on the file size. The client will strip it again after it received it. For the file size I first convert it with base ten to a string before passing it to the function.
Afterwards it will write the file size first and then the file name with the 'net.Conn.Write()' function.
Then we create a buffer where the server will read the file in chunk by chunk, the buffer will be the size of the defined constant.
The for loop will read out a chunk of the file with the 'file.Read()' function and write it in the passed buffer, the chunk is the size of the passed buffer. Send the the buffer chunk with 'net.Conn.Write()' and. This will be repeated until the end of the file is achieved and will break out of the loop afterwards. The connection and file will be closed when the function returns because of the stated defers.
func fillString(retunString string, toLength int) string { for { lengtString := len(retunString) if lengtString < toLength { retunString = retunString + ":" continue } break } return retunString }
This is the function that fills up, it just loops until enough ":" are added.
The client works like the server, only it receives the information and data.
Import the following packages
import ( "fmt" "io" "net" "os" "strconv" "strings" )
Define the constant as you did in the server part, this must have the same value as the server.
const BUFFERSIZE = 1024
func main() { connection, err := net.Dial("tcp", "localhost:27001") if err != nil { panic(err) } defer connection.Close() fmt.Println("Connected to server, start receiving the file name and file size") bufferFileName := make([]byte, 64) bufferFileSize := make([]byte, 10) connection.Read(bufferFileSize) fileSize, _ := strconv.ParseInt(strings.Trim(string(bufferFileSize), ":"), 10, 64) connection.Read(bufferFileName) fileName := strings.Trim(string(bufferFileName), ":") newFile, err := os.Create(fileName) if err != nil { panic(err) } defer newFile.Close() var receivedBytes int64 for { if (fileSize - receivedBytes) < BUFFERSIZE { io.CopyN(newFile, connection, (fileSize - receivedBytes)) connection.Read(make([]byte, (receivedBytes+BUFFERSIZE)-fileSize)) break } io.CopyN(newFile, connection, BUFFERSIZE) receivedBytes += BUFFERSIZE } fmt.Println("Received file completely!") }
First we open a connection to the server with 'net.Dial', notice that the first argument should be a lowercase string. Tell the program with defer statement it should close the connection once done.
We create two buffers, one for the name and the other one for the file size, the buffers must have the same size as the server will write them to you.
We read out the file size into it's buffer, define a variable containing the size, to achieve this we first convert the buffer to a string, then we trim the excessive ':' 'using strings.Trim()', convert it to a 64 bit integer with 'strconv.ParseInt()'.
We do the same for the file name, only we don't convert it to a integer now.
We create the file with the given file name, if you don't specify a path (absolute or relative) it will be created in the folder where the current program is running from. State the defer to close the file once done.
Initialize a 64 bit integer that will keep count of how many bytes we have received so far, so we can tell when to stop reading the chunks from the server.
The for loop starts the file reading with 'io.CopyN()' and incrementing the counter with the defined constant.
The if statement states "when the received file size minus the received bytes so far, is smaller than the constant buffer size" we do the following; only read out the remaining bytes that are smaller than the buffer size. This is because if the server only has to send 4 bytes for example, it will come in a buffer of 1024, rendering 1020 bytes being empty and added to the file. Which may lead to corruption or unwanted behavior, and a hash check to be false. So when true, only write the remaining bytes.
And as you may have noticed in the if scope we read twice, the first read with 'io.Copy()' is for the file, and the other, 'connection.Read()', is to empty the network buffer. And this has a good reason, if you were not to do this and keep on doing other reads on that connection it will first read out what's left in there.
For example, if you were to receive two files on the same connection. And you didn't clear up the network buffer from the first file that you received, and it contained over 374 empty bytes (nulls). The file size of the next read will be 0 and the name will be 64 zeros and the first 300 bytes of your new file to be zero also. | http://mrwaggel.be/post/golang-transfer-a-file-over-a-tcp-socket/ | CC-MAIN-2018-09 | refinedweb | 1,463 | 66.84 |
Hello everyone.. I know it's a very stupid question, but I can't understand what exactly is the purpose of "return"?
This is a discussion on what is return? within the C Programming forums, part of the General Programming Boards category; Hello everyone.. I know it's a very stupid question, but I can't understand what exactly is the purpose of "return"?...
Hello everyone.. I know it's a very stupid question, but I can't understand what exactly is the purpose of "return"?
It basically returns the value of a function
think of it this way:
when you get in the car and go somewhere, it's equivalent to calling a function. it would be highly unusual to never come back, so when you come home, you're returning from that function call. sometimes you leave to go buy something from the store. when you come home with your merchandise, that's like returning a value.
Code:/* a place to hang out */ void aVoidFunction() { /* we don't need to explicitly return, but just for the sake of conversation, we will */ return; } /* a place to get integer values */ int anIntFunction() { /* because our function is expected to send back a value, we have to explicitly tell it what to return */ return 0; } int main() { /* go somewhere, just to hang out */ aVoidFunction(); /* we came back */ /* go somewhere to get an integer value */ int someInt = anIntFunction(); /* we came back with our integer value in hand */ /* main() always must return an integer value 0 = success */ return 0; }
Ok, but return is not visible like printf() or usable, right?
So, we use it for typical reasons?
i dont know what exactly you mean by typical, but it is highly useful when you create functions to perform specific tasks and need a value that the function computes in another part of your program
it's also useful for stopping the execution of a function before its natural end. let's say it encounters some sort of problem halfway through, and if you continue, it will cause undesired behavior. you would then return, possibly with an error code as the return value, to avoid continuation in the face of the error.
something like this:
Code:int someFunction(int aParameter) { if (aParameter < 3) { return -1 /* aParameter must be at least 3 */ } /*continue function here*/ return 0; }
Ok.. But can we use "return", in order to store data to a variable? For example, something like:
What would happen then?What would happen then?Code:int func(int a) { if (a == 5) return (a = 2); else return a; }
Why don't you try it and look at the result?
Bye, Andreas
Nothing happened.. then I printed out "a" and it printed what I gave to it.. When I gave to the input 5, shouldn't it print 2?
input: 5input: 5Code:#include <stdio.h> int func(int a) { if (a == 5) return (a = 2); else return a; } int main(int argc, const char * argv[]) { int a; scanf("%d", &a); func(a); printf("%d", a); return 0; }
output: 5
Notice that you did not use the return value of func in main.
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
How do I do that? | http://cboard.cprogramming.com/c-programming/155228-what-return.html | CC-MAIN-2014-10 | refinedweb | 553 | 67.08 |
<img src="">
In this post, I will explain how to connect to a SQL database with TypeScript in a web application and how to get data from the database in TypeScript.Introduction
In this post, I will explain how to connect to a SQL database with TypeScript in a web application and how to get data from the database in TypeScript. First I created a database "EmpDetail". Then I created a table in the database.
CREATE TABLE[dbo]. [emp]([id][int] NULL, [name][varchar](50) NULL, [salary][int] NULL) ON[PRIMARY]
Now Insert some Data in the emp table.
aap.ts
class DataConnectivity { LoadDB() {(); } } window.onload = () => { var obj = new DataConnectivity(); var bttn = < HTMLButtonElement > document.getElementById("ShowData"); bttn.onclick = function() { obj.LoadDB(); } };
DataConnectivity_Demo.aspx
<%@ Page < head < title > < /title> < script < /script> < /head> < body > < form < div Click on button for show data < br / > < br / > < input < /div> < /form> < /body> < /html>
app.js
var DataConnectivity = (function() { function DataConnectivity() {} DataConnectivity.prototype.LoadDB = function() {(); }; return DataConnectivity; })(); window.onload = function() { var obj = new DataConnectivity(); var bttn = document.getElementById("ShowData"); bttn.onclick = function() { obj.LoadDB(); }; }; //@ sourceMappingURL=app.js.map
Output
Thank you for reading!
In this tutorial, I’ll be showing you how to use TypeScript with GraphQL using TypeGraphQL.
TypeScript is a superset of JavaScript, and its adoption has skyrocketed in recent years, as many apps are now being rewritten in it. If you have ever created a GraphQL server with TypeScript, then you would know it’s not as straightforward as in the JavaScript counterpart.
Prerequisites
This tutorial assumes the following:
TypeGraphQL is a framework building GraphQL APIs in Node.js. It makes use of TypeScript classes and decorators for defining GraphQL schema and types as well as resolvers. With TypeGraphQL, we don’t need to manually define types in SDL or create interfaces for our GraphQL schema. TypeGraphQL allows us to have only one source of truth, that way reducing field type mismatches, typos etc.
Another interesting thing about TypeGraphQL is how well it integrates with decorator-based libraries, like TypeORM, sequelize-typescript or Typegoose. This allows us to define both the GraphQL type and the entity in a single class, so we don’t need to edit multiple files to add or rename some properties.
Getting started
To get started with TypeGraphQL, we need to first install it along with its dependencies. We’ll start by creating a new project:
$ mkdir graphql-typescript $ cd graphql-typescript $ npm init -y
Then we install TypeGraphQL:
$ npm install type-graphql
Next, we need to install TypeScript as a dev-dependency as well as types for Node.js:
$ npm install typescript @types/node --save-dev
TypeGraphQL requires the
reflect-metadata shim, so we need to install that as well:
$ npm install reflect-metadata
Next, we need to define some TypeScript configurations for our project. Create a
tsconfig.json file within the project’s root directory, and paste the snippet below into it:
// tsconfig.json
{ "compilerOptions": { "target": "es2016", "module": "commonjs", "lib": ["dom", "es2016", "esnext.asynciterable"], "moduleResolution": "node", "outDir": "./dist", "strict": true, "strictPropertyInitialization": false, "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true }, "include": ["./src/**/*"] }
If you have ever worked with TypeScript before (which this tutorial assumes), then you should be familiar with some of the settings above. Since TypeGraphQL makes extensive use of decorators, which are an experimental feature of TypeScript, we need to set both
emitDecoratorMetadata and
experimentalDecorators as
true. Also, we need to add
esnext.asynciterable to the list of library files, since
graphql-subscription uses
AsyncIterator.
Defining the GraphQL schema
We can start defining the schema for our GraphQL server. Create a new
src directory, then within it, create a new
schemas directory. Inside the
schemas directory, create a
Project.ts file and add the following code in it:
// src/schemas/Project.ts
import { Field, Int, ObjectType } from "type-graphql"; import Task from "./Task"; @ObjectType() export default class Project { @Field(type => Int) id: number; @Field() name: string; @Field(type => [Task]) tasks: Task[]; }
We define a
Project class and use the
@ObjectType() decorator to define it as a GraphQL type. The
Project type has three fields:
id,
name and
tasks. We use the
@Field decorator to define these fields. The
@Field decorator can also accept optional arguments. We can pass to it the type the field should be or an object containing other options we want for the field. We explicitly set the type of the
id field to be
Int while
tasks is an array of the type
Task (which we’ll create shortly).
Next, let’s define the schema for the
Task type. Inside the
schemas directory, create a
Task.ts file and add the following code in it:
// src/schemas/Task.ts
import { Field, Int, ObjectType } from "type-graphql"; import Project from "./Project"; @ObjectType() export default class Task { @Field(type => Int) id: number; @Field() title: string; @Field(type => Project) project: Project; @Field() completed: boolean; }
This is pretty similar to the
Project schema. With our schema defined, we can move on to creating the resolvers.
Adding sample data
Before we get to the resolvers, let’s quickly define some sample data we’ll be using to test out our GraphQL server. Create a
data.ts file directly inside the
src directory, and paste the snippet below into it:
// src/data.tsCreating the resolvers
export interface ProjectData { id: number; name: string; } export interface TaskData { id: number; title: string; completed: boolean; project_id: number; } export const projects: ProjectData[] = [ { id: 1, name: "Learn React Native" }, { id: 2, name: "Workout" }, ]; export const tasks: TaskData[] = [ { id: 1, title: "Install Node", completed: true, project_id: 1 }, { id: 2, title: "Install React Native CLI:", completed: false, project_id: 1}, { id: 3, title: "Install Xcode", completed: false, project_id: 1 }, { id: 4, title: "Morning Jog", completed: true, project_id: 2 }, { id: 5, title: "Visit the gym", completed: false, project_id: 2 }, ];
Create a new
resolvers directory inside the
src directory. Inside the
resolvers directory, create a
ProjectResolver.ts file and paste the code below in it:
// src/resolvers/ProjectResolver.ts
import { Arg, FieldResolver, Query, Resolver, Root } from "type-graphql"; import { projects, tasks, ProjectData } from "../data"; import Project from "../schemas/Project"; @Resolver(of => Project) export default class { @Query(returns => Project, { nullable: true }) projectByName(@Arg("name") name: string): ProjectData | undefined { return projects.find(project => project.name === name); } @FieldResolver() tasks(@Root() projectData: ProjectData) { return tasks.filter(task => { return task.project_id === projectData.id; }); } }
We use the
@Resolver() decorator to define the class as a resolver, then pass to the decorator that we want it to be of the
Project type. Then we create our first query, which is
projectByName, using the
@Query() decorator. The
@Query decorator accepts two arguments: the return type of the query and an object containing other options which we want for the query. In our case, we want the query to return a
Project and it can return
null as well. The
projectByName query accepts a single argument (name of the project), which we can get using the
@Arg decorator. Then we use
find() on the projects array to find a project by its name and simply return it.
Since the
Project type has a
tasks field, which is a custom field, we need to tell GraphQL how to resolve the field. We can do that using the
@FieldResolver() decorator. We are getting the object that contains the result returned from the root or parent field (which will be the project in this case) using the
@Root() decorator.
In the same vein, let’s create the resolvers for the
Task type. Inside the
resolvers directory, create a
TaskResolver.ts file and paste the code below in it:
// src/resolvers/TaskResolver.ts
import { Arg, FieldResolver, Mutation, Query, Resolver, Root } from "type-graphql"; import { projects, tasks, TaskData } from "../data"; import Task from "../schemas/Task"; @Resolver(of => Task) export default class { @Query(returns => [Task]) fetchTasks(): TaskData[] { return tasks; } @Query(returns => Task, { nullable: true }) getTask(@Arg("id") id: number): TaskData | undefined { return tasks.find(task => task.id === id); } @Mutation(returns => Task) markAsCompleted(@Arg("taskId") taskId: number): TaskData { const task = tasks.find(task => { return task.id === taskId; }); if (!task) { throw new Error(`Couldn't find the task with id ${taskId}`); } if (task.completed === true) { throw new Error(`Task with id ${taskId} is already completed`); } task.completed = true; return task; } @FieldResolver() project(@Root() taskData: TaskData) { return projects.find(project => { return project.id === taskData.project_id; }); } }
We define two queries:
fetchTasks and
getTask. The
fetchTasks simply returns an array of all the tasks that have been created. The
getTask query is pretty similar to the
projectByName query. Then we define a mutation for marking a task as completed, using the
@Mutation. This mutation will also return a
Task. Firstly, we get the task that matches the supplied
taskId. If we can’t find a match, we simply throw an appropriate error. If the task has already been marked as completed, again, we throw an appropriate error. Otherwise, we set the task
completed value to
true and lastly return the task.
Just as we did with the
Project type, we define how we want to resolve the
project field.
Building the GraphQL server
With everything in place, all that is left now is to tie them together by building a GraphQL server. We will be using graphql-yoga for building our GraphQL server. First, let’s install it:
$ npm install graphql-yoga
With that installed, create an
index.ts file directly inside the
src directory, and paste the code below in it:
// src/index.ts
import { GraphQLServer } from "graphql-yoga"; import "reflect-metadata"; import { buildSchema } from "type-graphql"; import ProjectResolver from "./resolvers/ProjectResolver"; import TaskResolver from "./resolvers/TaskResolver"; async function bootstrap() { const schema = await buildSchema({ resolvers: [ProjectResolver, TaskResolver], emitSchemaFile: true, }); const server = new GraphQLServer({ schema, }); server.start(() => console.log("Server is running on")); } bootstrap();
Since we need to build our schema first before making use of it in our GraphQL server, we create an
async function, which we call
bootstrap() (you can name it however you like). Using the
buildSchema() from
type-graphql, we pass to it our resolvers and we set
emitSchemaFile to
true (more on this shortly). Once the schema has been built, we instantiate a new GraphQL server and pass to it the schema. Then we start the server. Lastly, we call
bootstrap().
Sometimes, we might need to see or inspect the schema in SDL (Schema Definition Language) that TypeGraphQL will generate for us. One way we can achieve that is setting
emitSchemaFile to
true at the point of building the schema. This will generate a
schema.gql file directly in project’s root directory. Of course, we can customize the path however we want.
Note: make sure to importTesting it out
reflect-metadataon top of your entry file (before you use/import
type-graphqlor your resolvers)
Before we start testing our GraphQL, we need to first compile our TypeScript files to JavaScript. For that, we’ll be using the TypeScript compiler. Running the command below directly from the project’s root directory:
$ tsc
The compiled JavaScript files will be inside the
dist directory, as specified in
tsconfig.json. Now we can start the GraphQL server:
$ node ./dist/index.js
The server should be running on, and we can test it out with the following query:
# fetch all tasks
{ fetchTasks { title project { name } } }
Conclusion
In this tutorial, we looked at what is TypeGraphQL and it makes it easy to work with GraphQL and TypeScript. To learn more about TypeGraphQL and other advanced features it provides, do check out their official website as well as the GitHub repo.
The complete code for this tutorial is available on GitHub.
Learn More
☞ Secure Node.js, Express.js and PostgreSQL API using Passport.js
☞ MEAN Stack Tutorial MongoDB, ExpressJS, AngularJS and NodeJS
☞ Full Stack Developers: Everything You Need to Know
☞ Machine Learning In Node.js With TensorFlow.js
☞ Build a Simple Web App with Express, Angular, and GraphQL
☞ Build a Basic App with Spring Boot and JPA using PostgreSQL
☞ The Complete Python & PostgreSQL Developer Course
☞ SQL & Database Design A-Z™: Learn MS SQL Server + PostgreSQL
☞ The Complete SQL Bootcamp
Originally published by Chimezie Enyinnaya at
In this tutorial, I will teach you how to create a GraphQL API and use Node.js and TypeScript to apply authentication and real-time responses using subscriptions.
GraphQL is a strongly typed query language, and Typescript is a typed superset of JavaScript - together they are a match made in heaven!Prerequisites.Approaching types
Unfortunately, syncing the types of both GraphQL and TypeScript is not so straight forward, and here are two ways in which we can achieve this:
Generating GraphQL from TypeScript using annotations. type-graphql is a library that does just that, but this can pose a problem when you also want to use the types on the front-end.
Generating TypeScript from a GraphQL schema. There are a lot of tools for generating types out of the schema such as graphql-schema-typescript.:
Apollo - Provides us with a server implementation for GraphQL, creates a playground where we can play with our queries and gives us different tools. Apollo can be either a standalone server or combined with Express. We will use the later.
graphql-schema-typescript & graphql cli - These two tools will allow us to convert our GraphQL API into TypeScript. They can do more, but that's mostly what we will use them for.
graphql-tag - Allows us to embed chunks of GraphQL code inside our TypeScript files. It makes it easier to separate our schemas into multiple smaller chunks.
We will also use uuid to generates id's, bcrypt to hash passwords and JWT to generate tokens, but you can ignore these parts as we will not discuss them in this article.The basics of GraphQL:
Query - defines all of our queries. As you can see we have a query called getPuppies, and it returns an array of puppies. This is the array notation in GraphQL: [Int] [String] [Cat]...
Mutation - defines all of our possible mutations. You can think of it as PUT/POST in terms of REST. As you can see we have a mutation named
createPuppy which accepts a Puppy by the name of input. The ! sign after the Puppy means it is required, and it returns a single puppy.
Subscription - defines all of the events our server can emit to the client. We can use web-sockets to subscribe to the
onPuppy subscription.Planning our application.Setting Up:
We create a schema with makeExecutableSchema. We will cover the rawSchema variable later, but this executable schema is the optimized version of our GraphQL schema with the resolvers, it matches GraphQL endpoints to functions that return the responses.
We create the configuration for our server, we pass the schema that matches requests to resolvers, a context which is a function that will authenticate the users, and pass the users as a variable to the resolvers.
We create our server with Apollo.
And that's it. With this we have web-socket support, GraphQL support, auto-generated documentation and a playground to test queries.Our first schema.Generating types:
# generate types with graphql-schema-typescript graphql-schema-typescript --namespace=GQL --global=true --typePrefix='' generate-ts --output=src/__typedefs/graphqlTypes.d.ts src/__typedefs.
SubscriptionsSubscript.Summary.
Thanks for reading !
Originally published by Liron Navon at hashnode.com | https://morioh.com/p/8a56b3db0a03 | CC-MAIN-2020-05 | refinedweb | 2,533 | 56.45 |
The Christmas holidays are a great time for pursuing ‘pet’ projects and trying out new things. This past year I’ve been watching WebAssembly evolve and wanted to create a fun project that allowed me to put it to good use. Over the past couple of weeks I created an Augmented Reality Suduko solver:
This project makes use of the WebAssembly build of OpenCV (a C++ computer vision library), Tensorflow (a machine learning library) and a solver written in Rust. It neatly demonstrates how WebAssembly allows you to write performance-critical web-based applications in a wide range of languages.
This blog post gives a brief overview of the code for this application, which can be found on GitHub. If you’re new to WebAssembly and want to know more about the problem it solves, how it works or what it is, I’d thoroughly recommend Lin Clark’s cartoon guide.
Sudoko Solver
The diagram below neatly illustrates the steps involved in locating a sudoku puzzle in an image, solving the puzzle then rendering the solution back onto the original image:
In brief, the steps applied to each video frame are as follows:
- Adaptive thresholding is used to locate edges, resulting in a black and white image
- The edges are approximated as contours; the sudoku grid should be the largest four-sided contour
- A (reversed) perspective transform is applied in order to render the grid as a square image
- The gridlines are erased
- A convolution neural network is used to identify the digits in the 9x9 grid
- The populated grid is solved via a Rust-based module
- The perspective transform from (3) is applied to project the solution back onto the image
- The solution is merged back into the original image
We’ll look at each of these steps in turn.
Adaptive thresholding
This sudoku solver makes use of various computer vision techniques, all of which rely on the OpenCV library.
OpenCV was launched in 1999 and has grown to become a popular computer vision toolkit thanks to its extensive set of features. It also has various add-on modules for a range of machine learning techniques, including neural networks. OpenCV is written in C++, with bindings for Python and Java. In 2018 the Emscripten compiler was used to add JavaScript support.
Despite having ‘official’ support for JavaScript / WebAssembly, OpenCV isn’t all that easy to work with. There are a limited set of OpenCV.js tutorials on the website, and one of the first steps involves building the library from source, not a task for the faint-hearted 😳. There is an open issue requesting they release OpenCV.js via npm which should make life much easier - but doesn’t have much traction yet. For now, I just opened up one of their demos and copied the required JS / wasm files!
The collective goal of the first few processing steps is to locate the sudoku grid within the image, the first of which is to find the outline for the various shapes within the image.
OpenCV supports various approaches to thresholding images, in this case we cannot guarantee even lighting across the sudoku grid, therefore an adaptive thresholding approach is most appropriate.
The following code demonstrates how to create an OpenCV image buffer via
matFromImageData (the buffer is an instance of the
Mat class), and apply an adaptive threshold:
const imgRead = (canvas)=> { const ctx = canvas.getContext("2d"); const imgData = ctx.getImageData(0, 0, canvas.width, canvas.height); return cv.matFromImageData(imgData) } const threshold = (src) => { // convert to grayscale cv.cvtColor(src, src, cv.COLOR_RGBA2GRAY, 0); // apply a threshold cv.adaptiveThreshold(src, src, 255, cv.ADAPTIVE_THRESH_GAUSSIAN_C, cv.THRESH_BINARY, 11, 10) }; const sourceImage = imgRead(canvasElement); threshold(sourceImage);
You can see the effect of this transformation on the source image:
It’s worth noting that these OpenCV.js operations are all implemented in C++ and compiled to WebAssembly, the various
cv.* function calls in the code shown above are very thin wrappers around their respective WebAssembly functions.
You can actually see how much time is spent within the OpenCV WebAssembly code by recording a performance profile:
The WebAssembly code is clearly visible at the bottom of the flame chart.
Contour approximation
The next step is a bit more challenging, we need to locate the largest square within the image - which should be the sudoku grid.
OpenCV has a number of methods for locating, approximating and rendering ‘contours’. A contour is a closed loop which describes the boundary of a shape within an image. You can obtain the contours from a binary image using the
findContours function:
const contours = new cv.MatVector(); const hierarchy = new cv.Mat(); cv.findContours( src, contours, hierarchy, cv.RETR_CCOMP, cv.CHAIN_APPROX_SIMPLE ); ... hierarchy.delete(); contours.delete();
The OpenCV.js certainly feels quite C-like, you first have to create the hierarchy matrix and contours matrix-vector before invoking
findContours - you also have to ensure that these objects are freed when no longer needed via their
delete method.
The hierarchy allows you to determine which contours contain others, although we don’t need it here - we’re just searching for the largest four-sided shape. However, it’s not quite as straightforward as iterating over the contours looking for one with four vertices (i.e. corners). The contours returned by
findContours are quite detailed, mapping out each pixel on the boundary of each shape.
The next step is to approximate each contour, reducing the overall number of vertices, and as a result removing some of the pixel-level details. This is achieved via
approxPolyDP:
const EPSILON = 10; const rectangles = []; for (let i = 0; i < contours.size(); ++i) { const approximatedContour = new cv.Mat(); cv.approxPolyDP(contour, approximatedContour, EPSILON, true); // is it a rectangle contour? if (approximatedContour.size().height === 4) { rectangles.push({ coord: Array.from(approximatedContour.data32S), area: cv.contourArea(approximatedContour) }); } approximatedContour.delete(); }
The above iterates over each of the contours, obtains an approximation, then determines whether it has four vertices, and if this is the case, the coordinates are stored. The
cv.Mat class has various properties for obtaining the underlying buffer - in this case we know that contours are stored as signed 32bit integers, so use the
data32S accessor. OpenCV also has various utility methods for characterising contours, in this case the
contourArea method is used to obtain the area. The largest four-sided contour is assumed to be the sudoku grid.
The
EPSILON value passed to
approxPolyDP is quite important, it details the approximation accuracy, with higher values permitting a greater deviation between the approximated contour and the original. Finding a suitable value for this parameter involves quite a bit of experimentation - which is a recurring theme when working with computer vision and machine learning!
The following image shows the approximated contours, colour coded by the number of vertices:
In the above image the contours with the dark greenish colour have four vertices - you can see that some of the squares within the sudoku grid have been approximated with more than four vertices, and as a result a higher epsilon value might be appropriate.
Reverse Perspective Transform
The next step is to use a geometric transformation in order to create an image with just the sudoku grid, transformed such that it is a square. Once again, OpenCV has the required tools!
The following code uses
getPerspectiveTransform to create a suitable transform given the 4 vertices of the sudoku grid and the desired location for each in the destination image. In this case the destination is a square buffer with dimensions of 180 x 180. The
warpPerspective method performs the transformation on the source image.
const srcCoords = ... // the vertices from the contour detection step // destination vertices const dstCoords = [0, 180, 0, 0, 180, 0, 180, 180]; // the destination buffer const dst = cv.Mat.zeros(180, 180, cv.CV_8UC3); // create the perspective transform const srcVertices = cv.matFromArray(4, 1, cv.CV_32FC2, srcCoords); const dstVertices = cv.matFromArray(4, 1, cv.CV_32FC2, dstCoords); const perspectiveTransform = cv.getPerspectiveTransform(srcVertices, dstVertices); // apply to the image cv.warpPerspective( src, dst, perspectiveTransform, new cv.Size(180, 180), cv.INTER_LINEAR, cv.BORDER_CONSTANT, new cv.Scalar() );
Here’s the result of applying this transformation:
The final processing step is gridline removal, a pretty straightforward task making use of the Region Of Interest (ROI) feature that allows you to apply operations to specific regions of image buffers. I’ll not go into the details here.
Number recognition
The next step is a fun one - the identification of numbers within the sudoku grid. I initially went down a rabbit-hole here … OpenCV has various examples that use Haar Cascades for face recognition, and my initial approach was to train a cascade to recognise digits. However, it looks like this technique is no longer supported in OpenCV 4.x, with the preferred approach being the use of convolution neural networks. However, the OpenCV.js build I’m using doesn’t include the machine learning modules, so I decided to look elsewhere, settling on TensorFlow (which I think is a much better option!).
TensorFlow is a maths library, with a machine learning focus, that is being developed by the Google Brain team. They announced JavaScript support in 2018, and WebAssembly support just a few weeks ago!
In contrast with OpenCV the TensorFlow documentation is wonderful - clear, easy to follow and up-to-date 😊
TensorFlow.js has a comprehensive worked example that covers the process of training a Convolution Neural Network (CNN) to recognise handwritten digits, which was an excellent starting point for my sudoku solver. However, in my case I need to train my network to recognise printed digits rather handwritten ones.
If you’ve not heard of CNNs before I’d recommend this article from Towards Data Science, which includes the image below:
In brief, a CNN is a deep-learning technique where a complex multi-layered neural network learns the various convolution operations to apply to an image in order to recognise objects from a given training set. Once the network has been sufficiently trained, it is then able to recognise objects in new images, i.e. ones that it hasn’t been trained with.
I modified the example from the TensorFlow documentation, which uses a database of handwritten digits, replacing the training data with randomly generated digits. These were rendered to a 20 x 20 canvas using a variety of fonts, font-weight and applying minor (randomised) variations in font size, location and rotation.
Here are some examples:
the training process involves presenting 1000s of these digits to the CNN, alongside the expected output, which is a set of ten weights that indicate the probability that the image contains a specific digit. The training process makes small adjustments to the various weightings deep within the network, with the whole process repeated 1000s of times until the network provides a sufficient recognition accuracy.
One important aspect I learnt through trial-and-error is that as well as training the network to recognise each of the ten digits, I should also train it to recognise empty squares. Hence my CNN provides 11 output probabilities.
Once trained, the network, including the resulting weightings, can be saved. The whole process was really quite quick - taking about one minute on my machine.
The TensorFlow API allows you to perform multiple predictions in one go. The process of creating the model, and feeding it with the same data in a suitable format is really straightforward:
const model = await tf.loadLayersModel("./training/my-model-3.json"); const TOTAL_CELLS = 81; // extract the image data for each cell const testDataArray = new Float32Array(src.cols * src.rows); for (let i = 0; i < TOTAL_CELLS; i++) { // a bit of buffer mangling to obtain the image data for each cell // [ ... ] } // create a tensor that contains the data for all our cells const testTensor = tf.tensor2d(testDataArray, [TOTAL_CELLS, cellSize]); const reshaped = testTensor.reshape([TOTAL_CELLS, cellWidth, cellWidth, 1]); // make our prediction const prediction = model.predict(reshaped).dataSync();
The prediction for each cell is an array of 11 values, giving the probability of each digit, or an empty cell.
The following code creates a string representation of the Sudoku grid based on the prediction for each cell:
let result = ""; for (let i = 0; i < TOTAL_CELLS; i++) { // obtain the 11 predicted states of this cell const cellPrediction = Array.from(prediction).slice(i * 11, i * 11 + 11); // what is the most likely digit for this cell? const digit = indexOfMaxValue(cellPrediction); result += digit < 10 ? digit : "."; } return result;
A typical output is as follows (I’ve manually line-wrapped to make it clear this is a grid):
...2...63 3....54.1 ..1..398. .......9. ...538... .3....... .263..5.. 5.37....8 47...1...
I was hoping to use the WebAssembly build of TensorFlow, however I hit a snag. The current release is in alpha and doesn’t support all of the TensorFlow features - when using the alpha build it complained that the
fusedBatchMatMul operation was absent from the kernel. Looks like I’ll have to wait a little longer before I can use it!
Solving the puzzle
As both OpenCV and TensorFlow are C++ libraries I thought it would be fun to mix things up a bit, and use Rust for the next step.
Sudoko Solvers are like the Game of Life, both are popular programming challenges and it didn’t take long to find a decent looking solver written in Rust.
The Rust tooling for WebAssembly is really top-notch, considering that my Rust knowledge is (very) limited, I was able to get up and with a fully functional solver in under an hour. I used the wasm-pack template, following the instructions in the Rust 🦀 and WebAssembly 🕸 book to create my skeletal project. I then added the Sudoku crate, and updated the generated code as follows:
mod utils; use sudoku::Sudoku; use wasm_bindgen::prelude::*; // When the `wee_alloc` feature is enabled, use `wee_alloc` as the global // allocator. #[cfg(feature = "wee_alloc")] #[global_allocator] static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; #[wasm_bindgen] pub fn solve(sudoku_line: String) -> String { let sudoku = Sudoku::from_str_line(&sudoku_line).unwrap(); if let Some(solution) = sudoku.solve_unique() { let line = solution.to_str_line(); let line_str: &str = &line; return line_str.to_string(); } else { return String::from(""); } }
The
#[wasm_bindgen] directive (if that is what they are called in Rust!) indicates that this function is exposed by the module, in this case it is a
solve function that takes a sudoku grid as a string, then returns the solution (also as a string).
The following command builds the project, with the
web target indicating that this module will be consumed by a browser (i.e. the wasm module need to be obtained via HTTP rather than the node filesystem APIs):
$ wasm-pack build --target web
The output of this build is a small (70KByte) wasm module and an accompanying JavaScript file which fetches the wasm module and adapts the functions, performing various type conversions. This is where much of the value is added, WebAssembly only supports numeric types, however the code above exports a function with a string argument and return value. The wasm-bindgen project, automatically generates bindings to simplify communication between JavaScript and Rust (compiled to WebAssembly), in this case it handles the encoding and decoding of strings to linear memory, which significantly reduces the effort involved in using Rust code on the web.
Using this WebAssembly module couldn’t be easier:
import initWasmModule, { solve } from "../../rust-solver/pkg/sudoku_wasm.js"; await initWasmModule(); const puzzle = "...2...63....." // etc ... const solution = solve(puzzle);
Rendering the solution and merging
The final few steps are really quite straightforward, I’m not going to delve into the details, you’ve already seen the techniques in practice.
The solution is rendered to a new 180 x 180 image, using the Canvas API to render each digit. The OpenCV
getPerspectiveTransform and
warpPerspective method are used to project this back onto the original image, only this time the source and destination coordinates are reversed. Finally, this image is merged with the original to give the solution.
Here’s the final merged image:
I’m sure I should look happier with the end result!
If you want to try it out for yourself the project is hosted on GitHub pages, and the sourcecode is available also. Please note, as this was a fun project I didn’t want to waste time (and depress myself) by rollifying, transputing or polyfudging. If your browser doesn’t support ES modules, async / await and various other modern features it will not work for you!
Conclusions
This was a fun hobby project and a neat demonstration of how WebAssembly allows you to use a range of different libraries written in various different languages (even if I couldn’t actually use the wasm TensorFlow build).
The final applications performs pretty well, recognising sudoku grids at various different orientations with a variety of different fonts and rendering styles. One thing it does struggle with is motion-blur, I found that if I move the grid quite quickly the blurring of the image hampers the initial adaptive threshold edge-detection.
Regarding speed of processing, it takes approximately 70ms on my computer to perform the full pipeline (threshold, contour, solver, merge, …) which is sufficient. On my iPhone it is noticeably slower and the frame rate isn’t really good enough to achieve the illusion AR tries to present. I’m sure there is room for improvement, as an example, I didn’t spend much time experimenting with the image size, reducing the resolution of the grid (which is currently 180 x 180) would significantly improve performance. Also, a pool of Web Workers could be used to process this pipeline in parallel.
More radical changes could be made, folding some of the processing steps into the CNN, it might be possible to train the network to recognise the grid in the unmodified source image. However, this would require considerable investment in the collection of training data and may not yield better accuracy.
One final note, while the bulk of the work is currently performed in various WebAssembly modules written in C++ and Rust, there is still quite a lot of JavaScript glue code required to coordinate the application. The recently announced interface types proposals should eventually remove the need to write JavaScript code in order to communicate between wasm modules written in different languages. In a few years time I could perhaps write my solver pipeline in Go, communicating directly with my C++ machine vision library and my Rust solver! | https://blog.scottlogic.com/2020/01/03/webassembly-sudoku-solver.html | CC-MAIN-2021-43 | refinedweb | 3,068 | 51.78 |
I need to make an ArrayList of ArrayLists thread safe. I also cannot have the client making changes to the collection. Will the unmodifiable wrapper make it thread safe or do ...
I have a java object that implements Runnable. here is the code.
public class Obj implements Runnable {
boolean shouldRun;
private int stuff
...
If all attributes (or items fields, or data members) of a java collection are thread-safe (CopyOnWriteArraySet,ConcurrentHashMap, BlockingQueue, ...), can we say that this collection is thread-safe ?
an exemple :
CopyOnWriteArraySet
ConcurrentHashMap
BlockingQueue
public class AmIThreadSafe ...
If I create a single instance of a Comparator, can that instance be used across multiple threads to sort collections using Collections.sort()? Or, do I need to create a new ...
Like the title says, i would like to get a thread-safe HashSet using Guava Collections.
Can you help me?
Thanks!
If I have the following declaration:
Map<String, Map<String, Person>> families =
Collections.synchronizedMap(new HashMap<String, Map<String, Person>>());
families.get(lastName).put(firstName, new Person());
I'm doing an webcrawler, and I want to not overload the servers with requests, so I will limit the access to the servers by time.
I will have an object/collection that is ...
Hello, Does a way exist for multiple threads to iterate over the same collection without interfering with one another and without using indexes or toArray()? As I understand it, each collection object only has one instance of an iterator, so two threads can't use it to independently iterate through the collection. Thank you, Yuriy | http://www.java2s.com/Questions_And_Answers/Java-Thread/Thread-Safe/collection.htm | CC-MAIN-2013-20 | refinedweb | 257 | 59.3 |
Overview
Atlassian SourceTree is a free Git and Mercurial client for Windows.
Atlassian SourceTree is a free Git and Mercurial client for Mac.
FsQuass, file system querying library
Much more info on Read the Docs.
About
This library is a syntactic sugar of os.path and fnmatch, and can do smart searches of files, using such techniques as
- space-separated ancestor & descendant like in CSS, /home fsquass/fsquass
- bash-like subpatterns, /{home,tmp}/user
- CSS-like pseudo-classes, :file, :dir, :ignorecase
Usage
Command line interface:
$ fsquass ". *.py" /home/siberiano/Work/fsquass/fsquass/tests.py /home/siberiano/Work/fsquass/fsquass/__init__.py /home/siberiano/Work/fsquass/fsquass/version.py /home/siberiano/Work/fsquass/setup.py /home/siberiano/Work/fsquass/docs/source/conf.py $ fsquass "/home/*/.bashrc" /home/siberiano/.bashrc
This is similar to unix find. What new does FsQuass offer? Here are cool things hard to do with find: find all folders that are legitimate Pytohn packages, i.e. have a __init__.py in them:
$ fsquass ". *:dir/__init__.py/.."
Now if I want to do something with them, I use xargs. I can list those directories:
$ fsquass ". *:dir/__init__.py/.." | xargs ls
Or copy them:
$ fsquass ". *:dir/__init__.py/.." | xargs -I '{}' cp -R {} /tmp
You can import fsquass and use it in Python:
from fsquass import Fs repair_photos = Fs('~/Pictures/{2010,2011}/*repair *.jp?g:ignorecase:file') packages_with_setup = Fs('. setup.py').parents() # and so on
Installation
Install the package with setup.py or with your python package manager:
python setup.py install | https://bitbucket.org/siberiano/fsquass | CC-MAIN-2015-35 | refinedweb | 251 | 52.26 |
9.4. Finding the equilibrium state of a physical system by minimizing its potential energy give an application example of the function minimization algorithms described earlier. We will try to numerically find the equilibrium state of a physical system by minimizing its potential energy.
More specifically, we'll consider a structure made of masses and springs, attached to a vertical wall and subject to gravity. Starting from an initial position, we'll search for the equilibrium configuration where the gravity and elastic forces compensate.
How to do it...
1. Let's import NumPy, SciPy, and matplotlib:
import numpy as np import scipy.optimize as opt import matplotlib.pyplot as plt %matplotlib inline
2. We define a few constants in the International System of Units:
g = 9.81 # gravity of Earth m = .1 # mass, in kg n = 20 # number of masses e = .1 # initial distance between the masses l = e # relaxed length of the springs k = 10000 # spring stiffness
3. We define the initial positions of the masses. They are arranged on a two-dimensional grid with two lines and \(n/2\) columns:
P0 = np.zeros((n, 2)) P0[:, 0] = np.repeat(e * np.arange(n // 2), 2) P0[:, 1] = np.tile((0, -e), n // 2)
4. Now, let's define the connectivity matrix between the masses. Coefficient \((i,j)\) is 1 if masses \(i\) and \(j\) are connected by a spring, 0 otherwise:
A = np.eye(n, n, 1) + np.eye(n, n, 2) # We display a graphic representation of # the matrix. f, ax = plt.subplots(1, 1) ax.imshow(A) ax.set_axis_off()
5. We also specify the spring stiffness of each spring. It is \(l\), except for diagonal springs where it is \(l \sqrt{2}\) :
L = l * (np.eye(n, n, 1) + np.eye(n, n, 2)) for i in range(n // 2 - 1): L[2 * i + 1, 2 * i + 2] *= np.sqrt(2)
6. We get the indices of the spring connections:
I, J = np.nonzero(A)
7. This
dist() function computes the distance matrix (distance between any pair of masses):
def dist(P): return np.sqrt((P[:,0]-P[:,0][:,np.newaxis])**2 + (P[:,1]-P[:,1][:,np.newaxis])**2)
8. We define a function that displays the system. The springs are colored according to their tension:
def show_bar(P): fig, ax = plt.subplots(1, 1, figsize=(5, 4)) # Wall. ax.axvline(0, color='k', lw=3) # Distance matrix. D = dist(P) # Get normalized elongation in [-1, 1]. elong = np.array([D[i, j] - L[i, j] for i, j in zip(I, J)]) elong_max = np.abs(elong).max() # The color depends on the spring tension, which # is proportional to the spring elongation. colors = np.zeros((len(elong), 4)) colors[:, -1] = 1 # alpha channel is 1 # Use two different sequentials colormaps for # positive and negative elongations, to show # compression and extension in different colors. if elong_max > 1e-10: # We don't use colors if all elongations are # zero. elong /= elong_max pos, neg = elong > 0, elong < 0 colors[pos] = plt.cm.copper(elong[pos]) colors[neg] = plt.cm.bone(-elong[neg]) # We plot the springs. for i, j, c in zip(I, J, colors): ax.plot(P[[i, j], 0], P[[i, j], 1], lw=2, color=c, ) # We plot the masses. ax.plot(P[[I, J], 0], P[[I, J], 1], 'ok',) # We configure the axes. ax.axis('equal') ax.set_xlim(P[:, 0].min() - e / 2, P[:, 0].max() + e / 2) ax.set_ylim(P[:, 1].min() - e / 2, P[:, 1].max() + e / 2) ax.set_axis_off() return ax
9. Here is the system in its initial configuration:
ax = show_bar(P0) ax.set_title("Initial configuration")
10. To find the equilibrium state, we need to minimize the total potential energy of the system. The following function computes the energy of the system given the positions of the masses. This function is explained in the How it works... section:
def energy(P): # The argument P is a vector (flattened matrix). # We convert it to a matrix here. P = P.reshape((-1, 2)) # We compute the distance matrix. D = dist(P) # The potential energy is the sum of the # gravitational and elastic potential energies. return (g * m * P[:, 1].sum() + .5 * (k * A * (D - L)**2).sum())
11. Let's compute the potential energy of the initial configuration:
energy(P0.ravel())
-0.981
12. Now, let's minimize the potential energy with a function minimization method. We need a constrained optimization algorithm, because we make the assumption that the first two masses are fixed to the wall. Therefore, their positions cannot change. The L-BFGS-B algorithm, a variant of the BFGS algorithm, accepts bound constraints. Here, we force the first two points to stay at their initial positions, whereas there are no constraints on the other points. The
minimize() function accepts a
bounds list containing, for each dimension, a pair of
[min, max] values:
bounds = np.c_[P0[:2, :].ravel(), P0[:2, :].ravel()].tolist() + \ [[None, None]] * (2 * (n - 2))
P1 = opt.minimize(energy, P0.ravel(), method='L-BFGS-B', bounds=bounds).x.reshape((-1, 2))
13. Let's display the stable configuration:
ax = show_bar(P1) ax.set_title("Equilibrium configuration")
The springs near the wall are maximally extended (top) or compressed (bottom).
How it works...
This example is conceptually simple. The state of the system is only described by the positions of the masses. If we can write a Python function that returns the total energy of the system, finding the equilibrium is just a matter of minimizing this function. This is the principle of minimum total potential energy, due to the second law of thermodynamics.
Here, we give an expression of the total energy of the system. Since we are only interested in the equilibrium, we omit any kinetic aspect and we only consider potential energy due to gravity (gravitational force) and spring forces (elastic potential energy).
Letting \(U\) be the total potential energy of the system, \(U\) can be expressed as the sum of the gravitational potential energies of the masses and the elastic potential energies of the springs. Therefore:
Here:
- \(m\) is the mass
- \(g\) is the gravity of Earth
- \(k\) is the stiffness of the springs
- \(p_i = (x_i, y_i)\) is the position of mass \(i\),
- \(a_{ij}\) is 1 if masses \(i\) and \(j\) are attached by a spring, \(0\) otherwise,
- \(l_{ij}\) is the relaxed length of spring \((i,j)\), or \(0\) if masses \(i\) and \(j\) are not attached.
The
energy() function implements this formula using vectorized computations on NumPy arrays.
There's more...
The following references contain details about the physics behind this formula:
- Potential energy on Wikipedia, available at
- Elastic potential energy on Wikipedia, available at
- Hooke's law, which is the linear approximation of the springs' response, described at
- Principle of minimum energy on Wikipedia, available at
Here is a reference about the optimization algorithm:
- L-BFGS-B algorithm on Wikipedia, available at
See also
- Minimizing a mathematical function | https://ipython-books.github.io/94-finding-the-equilibrium-state-of-a-physical-system-by-minimizing-its-potential-energy/ | CC-MAIN-2019-09 | refinedweb | 1,156 | 59.19 |
About three years ago, I was telling somebody about an article I had read that described a project to extend (GNU) C++. The article mentioned a new concept: signatures. When I had to explain the project in detail, I began to stutter because I realized I hadn't fully understood the article.:
- Significant increase in package sizes
- No version migration path
- Name scoping
- No default implementation
Increase in package sizes.
Future extensibility().
Name scoping.
For example, recently I had a Service interface for which
start() and
stop() were the logical names to use. I changed the names to
startService() and
stopService() to allow services that inherit from the class
Thread to implement this interface. The
Thread class has two methods named:
start() and
stop(). These methods control the state of the thread. Any interface that will use the method names
start and
stop can never be implemented by a subclass of the
Thread class. Java has no scoping operator like C++ (the ::) to tell the compiler exactly what should be done in the case of overlapping method names from different interfaces or the superclass.
Lack of default implementation
The final problem is the lack of default implementation. When a class extends another class, this other class can provide default implementations for all the methods. Sometimes a subclass can be created simply by extending a superclass and using the entire implementation of the superclass. Some interfaces are quite extensive, and implementing all methods can be a lot of work. This is especially irritating when only one or two methods are useful to implement in a certain situation. The interface concept forces the user of the interface to implement every method in the definition. For example, the Swing
ButtonModel interface has 21 (!) methods defined. Quite often, an implementation wants to implement only a part of this interface, and it should be possible to do this.
Solving the problems
How can these problems be solved? Any operation in this area should be implemented with care. Fortunately, Sun is extremely careful in making any language changes to prevent the kind of disaster that hit the C++ standardization process. Doing the mental exercise to formulate a solution to the sketched problems, however, can't do any harm.
So, what's one solution to many of the problems discussed above? Just add to the language a new keyword: "like," which you then use in place of "extends" and "interface":
public class C like A { }
You should interpret the code above as follows: C should implement the same interface as A. If C does not implement a required method, however, the implementation is copied from A. The keyword "like" basically means: Treat a class as an interface definition and copy the code of that class when no implementation is supplied (if not abstract).
Using this keyword will solve the problem of duplication of classes and interfaces, as well as the issues of default implementation and extension discussed above. It seems feasible to implement this change in the current language version without requiring changes in the current virtual machines.
Conclusion
These are just first thoughts on the matter of interfaces. In my opinion, continued effort should be made to provide solutions to these problems -- of course, always with the caveat that changing the Java language should be done with extreme caution.
Even with the problems listed above, believe me when I say I am still in love with interfaces! | https://www.javaworld.com/article/2076599/a-perspective-on-interfaces.html | CC-MAIN-2018-22 | refinedweb | 571 | 52.9 |
I was person #100 to solve Project Euler problem 451 a while back. The problem and solution are detailed in the source code below. The solution was found in 28 seconds on a 20-core Xeon machine. As noted in the code, using the Chinese Remainder Theorem could help efficiency, but I don’t have that coded currently and so I iterated over potential C.R.T. candidates instead, which provided a quickly coded and self-contained solution.
/* * Jason B. Hill / jason@jasonbhill.com * pe451.c / solves Project Euler problem 451 * build: gcc pe451.c -fopenmp -O3 -o pe451 * execute: ./pe451 * * I logged in to see that problem 451 had around 90 solutions, and decided to * attempt to be one of the first 100 solvers to enter the proper solution. As * such, I coded this a bit quickly. A "clean" solution would make use of the * Chinese Remainder Theorem, and the timing could probably be brought down * a tiny bit. But, all things considered, this runs very fast itself. * * Problem: Consider the number 15. There are eight positive integers less than * 15 which are coprime to 15: 1, 2, 4, 7, 8, 11, 13, 14. The modular inverses * of these numbers modulo 15 are: 1, 8, 4, 13, 2, 11, 7, 14 because * 1*1 mod 15=1 * 2*8=16 mod 15=1 * 4*4=16 mod 15=1 * 7*13=91 mod 15=1 * 11*11=121 mod 15=1 * 14*14=196 mod 15=1 * Let I(n) be the largest positive number m smaller than n-1 such that the * modular inverse of m modulo n equals m itself. So I(15)=11. Also I(100)=51 * and I(7)=1. Find the sum of I(n) for 3<=n<=2·10**7. * * The solution is documented in the code below. The code is in C with OpenMP. * * The result is found in 28 seconds on a 20-core Xeon and and 2:48 on a 2-core * core i7. Here is some of the output: * prime sieve created - 0.110000 seconds * list of 1270607 primes created - 0.050000 seconds * list of prime factors created for integers <= 20000000 - 5.350000 seconds * prime factor exponents computed for all integers - 0.980000 seconds */ #include <omp.h> #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <time.h> /*****************************************************************************/ /* The following structs and routines are for integer factorization */ /*****************************************************************************/ /* * Notes on factoring: * * We need to consider the prime factorization of positive integers less than * 2*10^7. How many distinct prime factors can such numbers have? That's easy. * Since the product of the 8 smallest primes (2*3*5*7*11*13*17*19 = 9,699,690) * is less than 2*10^7 and the 9 smallest primes (9,699,690*23 = 223,092,870) * is greater than 2*10^7, we know that each positive integer less than 2*10^7 * can only have 8 distinct prime factors. Let's create a C-struct that can * keep track of this data for each factored integer. */ /* * A struct to hold factor information for an integer. * p holds a list of distinct prime factors. (at most 8) * e holds a list of exponents for the prime factors in p. * num_factors says how long the lists p and e are. */ struct factors_t { uint64_t p[8]; // list of distinct primes uint8_t e[8]; // list of exponents for the primes p[] uint64_t pp[8]; // prime power factor (p[i]**e[i]) uint8_t num_factors; // how many distinct prime factors }; /* * More notes on factoring: * * Every positive integer n has a prime factor <= sqrt(n). We use this fact to * build a prime sieve. First, we construct a function to return the square * root of a uint64_t. Then, we'll use that function to create a sieve (which * is returned as a pointer/list of uint8_ts... effectively Booleans). */ /* * Return the square root of a uint64_t */ uint64_t sqrt_uint64(uint64_t n) { uint8_t shift = 1; uint64_t res, s; while ((1<<shift) < n) shift += 1; res = (1<<((shift>>1) + 1)); while (1) { s = (n/res + res)/2; if (s >= res) return res; res = s; } } /* * Return a prime sieve identifying all primes <= limit. * This is just a list of uint8_t's where 0 means the index is composite and * 1 means the index is prime. */ uint8_t * prime_sieve(uint64_t limit) { uint8_t *sieve; // this will be the pointer that is returned uint64_t i,j; uint64_t s = sqrt_uint64(limit); // allocate memory for sieve sieve = malloc((limit + 1) * sizeof(uint8_t)); // set initial values in the sieve sieve[0] = 0; sieve[1] = 0; sieve[2] = 1; // set other initial odd values in sieve to 1, even values to 0. for (i=3;i<=limit;i++) { if (i%2==0) sieve[i] = 0; else sieve[i] = 1; } // unset composite numbers (evens are already unset) for (i=3;i<=(s+1);i=i+2) { if (sieve[i]==1) { j = i*3; // sieve[i] prime, sieve[2*i] already 0 while (j<=limit) { sieve[j] = 0; j += 2*i; } } } return sieve; } /* * Determine if a value is prime using a provided sieve. */ _Bool is_prime(uint64_t n, uint8_t * sieve) { if ((1 & sieve[n]) == 1) return 1; else return 0; } /*****************************************************************************/ /* The following functions are specific to Project Euler problem 451 */ /*****************************************************************************/ /* * Notes: * * Given a number n, we're looking for the largest m < n-1 such that m^2 is 1 * modulo n. That's a mouthful. First, field theory tells us that we're only * interested in integers that are relatively prime with n (which is why the * problem asks for m < n-1 ... otherwise it would be a lot easier). * * Now, if n=p^k is a prime power and we have x^2 = 1 mod p^k, we consider: * a) 1 is a solution for x since 1*1=1 mod p^k = 1. * b) p^k-1 is a solution since (p^k-1)^2=p^(2k)-2p^k+1 (mod p^k) = 1. But, * that's too big since we need m < n=p^k-1. :-( * c) Any other solutions? Well... that's sort of complicated. Ugh. Let's first * consider the case when p=2. For n=p^1=2^1, we only have x=1 as a * solution. When n=p^2=2^2, we only have x=1 and x=3. For n=p^k=2^k, we * also find that 2^(k-1)+1 and 2^(k-1)-1 square to 1 modulo 2^k. For other * primes, this doesn't happen and we only have 1 and p^k-1 as solutions. * * Thus, what we're going to do is as follows: * 1) Factor each integer within the given range (factoring a range of numbers * is much faster than factoring each one individually). We'll store that * factorization information using the struct defined above. * 2) Because of step 1, determining if a number is prime or a power of a prime * is easy. In case of primes and prime powers, we consider if the prime is * even or odd, returning the appropriate maximum square root of 1 directly. * 3) When the integer is composite having more than a single distinct prime * factor, we use the Chinese Remainder Theorem "in spirit" and iterate * over potential candidates (instead of computing the C.R.T. result * directly). We're only considering possible m that are both relatively * prime with n AND such that m^2 is +1 or -1 modulo the prime power * factors of n. When a candidate does not satisfy these properties, we * simply move to the next candidate. */ /* * Compute the next candidate (the next largest number that may satisfy the * given equivalence relations). This is done relative to the largest non-2 * prime power in the factorization of n. * * n is the integer for which we're computing the largest square root. * m is the largest odd prime power factor of n. * c is the current candidate (assume uninitialized when set to 0). */ uint64_t next_candidate(uint64_t n, uint64_t m, uint64_t c) { uint64_t r; // check if c is initialized if (c==0) c = n-1; // we can only consider values of \pm1 mod m r = c % m; if (r==m-1) return c-(m-2); else return c-2; } /* * Determine if the current candidate is (1) relatively prime to n and, if it * is, (2) a square root of unity modulo n. We can tweak this later for timing * as the test for being relatively prime may cut performance a bit. We'll see. * * n is the integer for which we're computing the largest square root. * cnd is the current candidate. * factors is a list of factors_t structs (prime, exponent info) */ _Bool verify_candidate(uint64_t n, uint64_t cnd, struct factors_t * factors) { uint8_t i,j; uint64_t pp; // verify that cnd is not divisible by any prime in factors[n].p[] for (i=0;i<factors[n].num_factors;i++) { if (cnd % factors[n].p[i] == 0) return 0; } // verify cnd modulo 2 when exponent of 2 in n is > 2 if (factors[n].p[0] == 2 && factors[n].e[0] > 2) { pp = factors[n].pp[0]>>1; if (cnd % pp != 1 && cnd % pp != pp-1) return 0; } // verify other primes for (i=0;i<factors[n].num_factors;i++) { if (factors[n].p[i] == 2) continue; pp = factors[n].pp[i]; if (cnd % pp != 1 && cnd % pp != pp-1) return 0; } return 1; } /* * Given a positive integer n, find the largest positive m < n-1 such that * gcd(n,m)=1 and m**2 (mod n) = 1. */ uint64_t largest_sqrt(uint64_t n, struct factors_t * factors) { uint8_t i; uint32_t j; // if n is an odd prime, or a power of an odd prime, return 1 if (factors[n].num_factors == 1 && factors[n].p[0] != 2) return 1; // if n is a power of 2 if (factors[n].num_factors == 1) { // if n is 2 or 4 if (factors[n].e[0] < 3) return 1; // if n is 2**e for e >= 3 return (factors[n].pp[0]>>1)+1; } // find the maximum odd prime power factor of n uint64_t pp = 1; uint64_t cnd; for (i=0;i<factors[n].num_factors;i++) { if (factors[n].p[i] != 2 && factors[n].pp[i] > pp) { pp = factors[n].pp[i]; } } // get the first candidate w.r.t. moppf cnd = next_candidate(n, pp, 0); while (!verify_candidate(n, cnd, factors)) cnd = next_candidate(n, pp, cnd); return cnd; } /*****************************************************************************/ /* Execute */ /*****************************************************************************/ int main() { uint64_t s = 0; // final output value uint64_t i,j,k; // iterators uint64_t limit = 20000000; // upper bound for computations uint64_t num_primes = 0; // count for primes <= limit uint8_t e; // exponents for prime factoring int tid; // thread id for openmp double time_count; // timer clock_t start, start_w; // time variables uint8_t *sieve; // prime sieve uint64_t *primes; // list of primes struct factors_t *factors; // prime factors and exponents /* start outer timer */ start_w = clock(); /* make the prime sieve */ start = clock(); sieve = prime_sieve(limit); time_count = (double)(clock() - start) / CLOCKS_PER_SEC; printf("prime sieve created - %f seconds\n", time_count); /* form list of primes from sieve */ start = clock(); // compute the number of primes in sieve for (i=2;i<=limit;i++) { if (is_prime(i, sieve)) { num_primes = num_primes + 1; } } primes = malloc(num_primes * sizeof(uint64_t)); j=0; for (i=2;i<=limit;i++) { if (is_prime(i, sieve)) { primes[j] = i; j++; } } time_count = (double)(clock() - start) / CLOCKS_PER_SEC; printf("list of %llu primes created - %f seconds\n", num_primes, time_count); /* fill out a factors_t struct for each integer below limit */ start = clock(); // allocate memory for factors_t factors = malloc(sizeof(struct factors_t) * (limit + 1)); // set the initial number of factors for each number to 0 for (i=1;i<=limit;i++) factors[i].num_factors=0; // for each prime, add that prime as a factor to each of its multiples for (i=0;i<num_primes;i++) { j = 1; // start at 1*p for each prime p while (j*primes[i]<=limit) { k = factors[j*primes[i]].num_factors; // get proper index for p factors[j*primes[i]].p[k] = primes[i]; // add prime to p factors[j*primes[i]].num_factors++; // increase index j++; // increase multiple of prime } } time_count = (double)(clock() - start) / CLOCKS_PER_SEC; printf("list of prime factors created for integers <= %llu - %f seconds\n", limit, time_count); /* compute exponents for each prime in factor lists */ start = clock(); for (i=2;i<=limit;i++) { for (j=0;j<factors[i].num_factors;j++) { e=1; k=factors[i].p[j]; while (i % (k*factors[i].p[j]) == 0) { e++; k*=factors[i].p[j]; } factors[i].e[j] = e; factors[i].pp[j] = k; } } time_count = (double)(clock() - start) / CLOCKS_PER_SEC; printf("prime factor exponents computed for all integers - %f seconds\n", time_count); /* find largest square root of unity for each integer under limit; add to s */ #pragma omp parallel for reduction(+:s) shared(factors) schedule(dynamic,1000) for (i=3;i<=limit;i++) { s = s+largest_sqrt(i, factors); } time_count = (double)(clock() - start) / CLOCKS_PER_SEC; printf("result for 3<=i<=%llu: %llu - %f seconds\n", limit, s, time_count); time_count = (double)(clock() - start_w) / CLOCKS_PER_SEC; printf("\ntotal time: %f seconds\n\n", time_count); free(sieve); free(primes); free(factors); return 0; } | http://code.jasonbhill.com/category/c/ | CC-MAIN-2017-13 | refinedweb | 2,158 | 63.29 |
Hey there. I am taking a programming class using C++ and my assignment is to create "Tictactoe" using ObjectOrientedProgramming... The problem is I have no idea what I am doing...
I need to have a "tictactoe" class file and a "player" class file - each with their own header files and one driver file.
"You will need to have two classes: a TicTacToe class and a Player class. The TicTacToe class should contain the above mentioned 2D array for representing the game board, i.e., this class should have a 2D array of characters as its data member. You should have a zero-argument constructor in the TicTacToe class that will generate the initial game state (all the 2D array elements initialized to '\0'). You should overload the << operator to display the game board at any point. The game board should be displayed along with the grid as shown in the sample executions. There should also be a member function called SetValue that will have three arguments (a row index, a column index, and an integer representing the player index) and a boolean return type. This function will set the specified cell of the 2D array to an appropriate character depending on the player index. This function should also make sure that a player makes its move to a blank and valid (inside the array bounds) position. In case a player wants to make a move to an invalid or already occupied position, it should return false. In case of a valid move, it should return true. There should be another member function called GetStatus that will return an integer (0-3) representing the game status; 0 representing a tie, 1 representing a win by Player1, 2 representing a win by Player2, and 3 otherwise.
The Player class will be relatively simple and will have information such as the player’s name and an integer representing whether he/she is Player1 or Player2. It should have a two-argument constructor to initialize the data members, a member function called GetIndex to return an integer value (1 or 2) depending on whether it’s Player1 or Player2, and a member function called GetName to return the name of the player. There should be a member function called NextMove that will allow a Player object to make a move. This function should accept a TicTacToe object by reference, prompt the player to enter his move, accept the move in the form of the row and column numbers of the position where he wants to make the move (look at the sample execution), and make changes to the 2D array of the TicTacToe object. Note that this function will be calling the SetValue function of the TicTacToe class and will keep on re-prompting the player (as shown in the sample executions) to make another move as long as the SetValue function returns false. Note that the Player class should not have the TicTacToe object as its data member."
So far, all I have is:
tictactoe.cpp
#include <iostream> using namespace std; #include "tictactoe.h" Tictactoe::Tictactoe() { } void Tictactoe::displayBoard() { cout << endl << endl; cout << " " << s[1] << " | " << s[2] << " | " << s[3] << endl; cout << " -----------" << endl; cout << " " << s[4] << " | " << s[5] << " | " << s[6] << endl; cout << " -----------" << endl; cout << " " << s[7] << " | " << s[8] << " | " << s[9] << endl << endl; } void Tictactoe::placement() { cout << "Which row please? " << endl; cin >> row; cout << "Which column please? " << endl; cin >> col; if (row == 1) { if (col == 1) { s[1] = 'X'; } else if (col == 2) { s[2] = 'X'; } else if (col == 3) { s[3] = 'X'; } } else if (row == 2) { if (col == 1) { s[4] = 'X'; } else if (col == 2) { s[5] = 'X'; } else if (col == 3) { s[6] = 'X'; } } else if (row == 3) { if (col == 1) { s[7] = 'X'; } else if (col == 2) { s[8] = 'X'; } else if (col == 3) { s[9] = 'X'; } } }
tictactoe.h
class Tictactoe { private: int s[9]; int row, col; public: Tictactoe(); void displayBoard(); void placement(); };
player.cpp
#include <iostream> using namespace std; #include "player.h" void Player::getName(string name) { playerName = name; } int Player::choose(int player) { int random_integer = rand(); if (random_integer%2) { cout << playerName << " goes first." << endl; } else { cout << playerName << " goes first." << endl; } }
player.h
class Player { private: string playerName; public: void getName(string name); int choose(int player); };
and the driver file
#include <iostream> using namespace std; #include "tictactoe.h" int main() { Tictactoe game; return 0; }
Any help is greatly appreciated -- mainly I'm not quite sure what is it I need to add to make this work: not looking for code but description of what I'm missing.
Thanks | https://www.daniweb.com/programming/software-development/threads/174403/tic-tac-toe-using-2-classes | CC-MAIN-2016-50 | refinedweb | 760 | 57.3 |
This sensor is one of the first sensors you learn to use because everyone has a good application for it: building an indoor or outdoor thermometer.
Here you can see it mounted on a breakout board:
Note that the sensor has 4 output pins, although the breakout board I got only has 3 (the reason being the pin 3 of DHT11 is not connected to anything - don’t ask me why).
From the left, keeping our pins at the bottom, we have:
Vdd, the positive input (
+)
Vss, the negative input (
-)
- the output signal
The output is a 40-bit serialized signal that lasts 4ms.
This means that every 4ms the sensor sends the temperature information and to read it we must get the value and unserialize it.
In the Arduino program we use the DHT Sensor Library maintained by Adafruit (here’s the link to the repository) that makes it very simple for us to read the temperature:
You include it with
#include <DHT.h>, then you initialize an object of class
DHT by passing the sensor signal pin and the type, in this case using the constant
DHT11.
The library can also work with other sensors like the more precise
DHT22and
DHT21
Then you can call the
readHumidity() and
readTemperature() methods to get values as a
float variable.
readTemperature() gets the value as Celsius, but the library also provides a
convertCtoF() method to get the Fahrenheit value.
The library also provide other methods, like
computeHeatIndex(). I recommend you to checkout the
DHT.h header file source code on GitHub.
This simple Arduino program reads the data from a DHT11 connected with the signal pin on digital pin #2 and prints it to the serial monitor:
#include <DHT.h> DHT dht(2, DHT11); void setup() { Serial.begin(9600); dht.begin(); } void loop() { delay(2000); float h = dht.readHumidity(); float t = dht.readTemperature(); if (isnan(h) || isnan(t)) { Serial.println("Cannot read values"); return; } Serial.println((String)"Humidity: " + h + "%, temperature: " + t + "C"); }
Humidity: 56.00%, temperature: 20.20C Humidity: 56.00%, temperature: 20.20C Humidity: 56.00%, temperature: 20.10C Humidity: 56.00%, temperature: 20.20C
More electronics tutorials:
- Electronic components: Diodes
- Electronic components: Analog Joystick
- Arduino project: control a servo motor with a potentiometer
- How to connect to a WiFi network using an Arduino
- Electronic Project: Build a LED dimmer with a potentiometer
- Electronics Basics: Vcc, ground, ...
- Electronics Basics: Prototyping using breadboards
- Powering an Arduino with a power bank
- Electronics Basics: Voltage | https://flaviocopes.com/electronics-components-dht11-temperature-sensor/ | CC-MAIN-2021-17 | refinedweb | 412 | 57.06 |
Writing code that runs in the terminal or in your web browser is good fun. Writing code that affects the real world, however, can be satisfying on a whole other level. Writing this sort of code is called embedded development, and Python is making it more accessible than ever!
In this tutorial, you’ll learn:
- What embedded development is and why you would use Python to do it
- What your hardware and software options are for running Python on an embedded system
- When Python is a good fit for an embedded system and when it’s not
- How to write a basic game on the BBC micro:bit with MicroPython
This tutorial contains code snippets that allow you to build a simple game on the BBC micro:bit. To access the full code and get a sneak preview on what you’ll be building, click the link below:
Get Sample Code: Click here to get the sample code you’ll use to learn about embedded development with Python in this tutorial.
What Is Embedded Development?
Embedded development is writing code for any device that isn’t a general-purpose computer. This definition is a little bit ambiguous, so some examples might help:
- General-purpose computers include laptops, desktop PCs, smartphones, and so on.
- Embedded systems include washing machines, digital machines, robots, and so on.
As a general rule of thumb, if you wouldn’t call something a computer, but it still has code running on it, then it’s probably an embedded system. The name comes from the idea of embedding a computer into a physical system to perform some task.
Embedded systems tend to be designed to do a single task, which is why we refer to regular computers as “general purpose”: they are designed to do more than one task.
In the same way that you need a computer to run regular code, to run embedded code, you need some kind of hardware. These pieces of hardware are usually referred to as development boards, and this tutorial will introduce you to a few designed to run Python.
Python for Embedded Development
One of the best things about learning Python is that it’s applicable in so many places. You can write code that runs anywhere, even on embedded systems. In this section, you’ll learn about the trade-offs that come with using Python for your embedded project and some things to be aware of when starting out.
Benefits of Using Python
The core benefit that Python brings when building an embedded system is development speed. Python has libraries available for most tasks, and this still mostly holds true for its embedded implementations. You can focus on building your system since many of the problems you’d encounter have been solved already.
Since Python is higher level than other common embedded languages, the code you’ll write will be more concise. This helps development speed, meaning you’ll write code faster, but it also helps keep your code understandable.
Python is memory managed. C++, a common choice for embedded development, is not. In C++, you are responsible for freeing up memory when you’re done with it, something that is very easy to forget, leading to your program running out of memory. Python does this for you.
Disadvantages of Using Python
While Python’s memory management is a big help, it does incur a minor speed and memory cost. The MicroPython docs have a good discussion on memory issues.
Another thing to consider is that the Python interpreter itself takes up space. With a compiled language, the size of your program depends just on your program, but Python programs need the interpreter that runs them. The Python interpreter also takes up RAM. On the micro:bit, you can’t write Bluetooth code with Python since there’s not enough room for Python and Bluetooth at the same time.
Since Python is interpreted, it can never be quite as fast as a compiled language. An interpreted language needs to decode each instruction before running it, but a compiled language can just run. In practice, though, this rarely matters as Python programs still run fast enough for most use cases.
Things to Watch Out for When New to Embedded Development
Modern computers have lots of memory to work with. When you’re programming them, you don’t have to worry too much about the size of lists you create or loading a whole file at once. Embedded systems, however, have limited memory. You have to be careful when writing your programs not to have too many things in memory at once.
Similarly, processor speeds on embedded systems are much slower than on desktop computers. The processor speed determines how quickly your code gets executed, so running a program on an embedded computer will take longer than running it on a desktop computer. It’s more important to think about the efficiency of embedded code—you don’t want it to take forever to run!
Perhaps the biggest change when programming embedded systems is power requirements. Laptops, phones and desktop computers either plug into the wall or have large batteries. Embedded systems often have tiny batteries and have to last for a really long time, sometimes even years. Every line of code that you run costs a little bit of battery life, and it all adds up.
Here are some other things that you should be aware of when you start out:
- If you have a network connection on your device, then it’s likely to be slow or unreliable.
- You have a much smaller selection of libraries to choose from.
- Embedded systems don’t usually have a large amount of persistent storage.
Embedded development is a large field, with a lot for newcomers to learn. For now, though, just remember that it’s more important to write lean code on embedded systems. This makes embedded systems great for learning efficiency in your code!
Hardware Options for Running Embedded Python
Before writing any embedded code, you have to choose what hardware your code will run on. There is a huge selection of development boards available, even within those that run Python. Your choice will come down to the project that you use them for. In this section, you’ll go over some of the available options.
BBC micro:bit
The BBC micro:bit is an embedded system designed for educational use. On board a micro:bit, there are lots of components, including buttons, a 5x5 LED screen, a speaker and microphone, an accelerometer, and a Bluetooth module. Unfortunately, the Bluetooth module is unusable with Python, but you can still use the radio directly. It’s programmable in Scratch, JavaScript, and most importantly, Python.
Here’s a photo of one from the back showing some of the cool components that are available:
The micro:bit has a lot of great resources online to help you get started and come up with project ideas.
Raspberry Pi
Most Raspberry Pis are technically single-board computers instead of embedded systems, but they all still allow access to external hardware through their GPIO pins. One exception to the rule is the Raspberry Pi Pico, which is a microcontroller development board. Other Raspberry Pis run Linux, meaning that you can use them as a full computer, and all Pis support Python right out of the box.
There are a few different models of Raspberry Pi available, but all of them are able to run Python and work with electronics. Which model you should pick depends on your project needs. Here’s one of the latest models:
You can find out more about the different models of the Raspberry Pi on the official site. For an example of a project you can make with a Raspberry Pi and Python, check out Build Physical Projects With Python on the Raspberry Pi.
pyboard
The pyboard is an electronics development board that is designed to run MicroPython. It’s a lot more powerful than a micro:bit but comes without any extra goodies like the on-board screen and sensors of the micro:bit. Here’s the pyboard 1.0:
You may notice lots of golden circles on the board. These are called pins and are used to connect the pyboard to other electronic components. For example, if you were building a remote-controlled car, you might connect some motors to them.
Others
There are lots of Python-compatible boards and kits out there, far too many to list here. However, there are a few interesting ones that are good to call out:
- The LoPy from Pycom connects to specialist Internet of Things networks such as LoRa and Sigfox.
- ESP8266-based boards all run MicroPython. The ESP8266 is a cheap Wi-Fi-enabled microcontroller. Its successors, the ESP32 family of chips, also all run MicroPython.
- Python also runs on the Nintendo DS. The setup looks a little bit complicated for beginners, but this project is too fun to not mention.
There are many more MicroPython-compatible boards than this tutorial has space for. You should do some research to find the right one for your projects. A good place to start could be Adafruit’s MicroPython store.
Software Options for Writing Embedded Python
When you install Python on your computer, you’re usually installing a specific implementation of Python called CPython. An implementation of Python is the program that runs your Python code.
You could call CPython the default Python implementation since it’s written by the people who define the language itself. However, CPython isn’t the only implementation of Python. In this section, you’ll learn about some implementations that are specifically aimed at writing embedded code.
MicroPython
MicroPython is the de facto standard embedded Python implementation. It is a Python 3.x implementation designed to run on microcontrollers. It is not 100 percent CPython-compatible, but it is very close. This means that if you have written code to run on versions up to Python 3.4, then there’s a good chance you can get it to run in MicroPython.
CircuitPython
CircuitPython is a fork of MicroPython that supports a slightly different list of boards and has some changes to make it more friendly to beginners. For the most part, your experience will be very similar when using CircuitPython as it will when using MicroPython. You might choose to use CircuitPython if your board only supported it and not other implementations.
Project: A Simon Says Game on the BBC micro:bit
Nothing compares to practical experience, so in this section you’re going to build a Simon Says game on the BBC micro:bit. Don’t worry if you don’t have one! There are simulators available online to get you started.
Simon Says is a children’s game where one person gives instructions to a group. If they prefix their instructions with “Simon says,” then the group has to do it. If they give the instruction without saying “Simon says” first, then the group has to ignore the instruction. To make our game simpler, we’ll focus just on the instruction-giving part.
The game will work as follows:
- The micro:bit will think of a direction and tell it to the player.
- The player will try to tilt the micro:bit in that direction.
- If the player manages to correctly tilt the micro:bit in time, then they get a point!
- If the player doesn’t make the correct tilt in time, then the micro:bit displays their score and the game starts again.
Before you start coding, you’ll need to set up your environment.
Setting Up Your Environment
Whether or not you have a physical micro:bit, the quickest path to get started coding is to use the available online editors. For this tutorial, you will be using the create.withcode editor. When you open up the editor, you’ll see the following screen:
Most of the screen is taken up with the text buffer where you can enter your code. On the bottom right, you’ll see a play button. This will let you run your code once you’ve written it.
Displaying Instructions on the Screen
The first thing that your game needs to do is to come up with a direction and tell it to the player. For the purposes of this game, you can use three directions:
left,
right, and
stay still. Your code will need to pick one of these directions and display it to the player. This will be wrapped in an infinite
while loop so that it can run multiple times.
Note: Infinite
while loops are more common in embedded programming than in other types of programming. This is because embedded systems tend to do only one job, so there’s no risk of hanging up the system and preventing other programs from running.
Here’s what your code may look like:
from microbit import * from random import randrange # Define left, stay still, and right directions = ["L", "O", "R"] # While the micro:bit is on while True: # Pick a random direction direction = directions[randrange(3)] display.show(direction) # Sleep for a second (1000ms) sleep(1000)
This code will display a different random direction every second. The first two lines import the necessary functions:
- The
microbitmodule contains all the code necessary to interface with the micro:bit. For example, the
displayand
accelerometermodules are in here. The
microbitmodule comes pre-loaded with MicroPython on the micro:bit, so you may encounter an error if you try to import it when running code on your computer.
- The
randommodule allows you to pick a random number.
After the imports, the code defines the
directions list. This contains three characters that represent the available directions. The advantage of defining this list with characters is that they can be displayed directly since the micro:bit screen only has space for one character at a time.
The
while True: loop tells the micro:bit to run the code inside it forever. In reality, this means it will run while the micro:bit is powered. Inside, the code first picks a random direction with
randrange() and shows it. Afterward, it sleeps for a second. This forces the micro:bit to do nothing for a second, which makes sure that the player has time to see the instruction.
Running Your Code
Now that you have some code, you can run it! Thankfully, you don’t need a micro:bit to run your code as your editor comes with a built-in simulator. You can access it and run your code by clicking the play button in the bottom-right corner.
When you click the play button, you’ll see the following overlay pop-up in your editor:
In it, you’ll see a micro:bit, and the screen should display random characters from the directions list. If not, then try copying the code from above into the editor and click the play button again.
Note: The create.withcode simulator is a wonderful resource, but it can be a little buggy at times. The following may help if you run into problems:
- Sometimes, when you paste code into the editor, it can look like half of the editor screen has disappeared. Click anywhere inside the editor to get it to come back.
- If you don’t stop your code by pressing the red button before running it again, it can sometimes run both instances of the code at once, causing strange output. Pressing the red stop button before running your code again fixes this issue.
If you are a more advanced coder, you can set up Visual Studio Code as a micro:bit development environment using the Device Simulator Express extension and pseudo-microbit module for code auto-completion.
This is the general development flow that you’ll be following for the rest of the tutorial.
Optional: Run Your Code on a Physical micro:bit
If you have a physical micro:bit, then there are a couple of extra steps to run your code. You’ll need to download a
.hex file and then copy it onto your micro:bit.
To download the
.hex file, look for the following button in your editor:
This will ask you to save the file to your computer. Save it and then grab your micro:bit. Connect your micro:bit to your computer using a USB cable. You should see it appear in the same way that USB drives do.
To program the micro:bit, drag the downloaded
.hex file onto your micro:bit. A red LED on the back of your micro:bit should flash. Once it stops, your program is loaded onto the device and will start executing straight away!
Tips: Here are some tips that may help if you get stuck:
- If you need to restart the program from the beginning, there’s a reset button on the back of the micro:bit, next to the USB connector.
- Errors in your code will scroll across the screen. If you’re patient and watch them, they can give you good clues as to how to fix your scripts.
You’ll have to try very hard to break your micro:bit! If something goes wrong, check your code carefully and don’t be afraid to try things, even if you’re not sure it will work.
Now that you’ve got your micro:bit set up for development, you’re ready to move on to some coding.
Getting Player Input
Now that the micro:bit can tell the player what to do, it’s time to get the player’s input. To do this, you’ll be using the accelerometer. An accelerometer is a device that measures movement. It can tell if the micro:bit is moving in a specific direction, and importantly for the game, whether the micro:bit is tilting in a specific direction. Take a look at the following diagram:
In the diagram, you’ll see three axes: X, Y, and Z. These are just like the axes that you might have seen in graphs at school. The X-axis represents side-to-side motion, the Y-axis represents up-and-down motion, and the Z-axis represents motion toward or away from you.
The accelerometer on the micro:bit returns the values from these three axes. Since your game only cares about tilting to the left and right, all you’ll need is the X-axis for now.
accelerometer.get_x() returns values in the range
(-2000, 2000), where
-2000 is tilted all the way to the left and
2000 is tilted all the way to the right.
Your code to get the player’s input will need to take three steps:
- Read the accelerometer’s X value.
- Decide whether that X value represents a left, right, or staying still movement.
- Decide if that was the correct direction to move.
Here’s the code to accomplish those steps:
# Previous code... while True: # Previous code... # Get the X-axis (left-right) tilt acc_x = accelerometer.get_x() # Determine direction if acc_x < -200: player_in = "L" elif abs(acc_x) < 200: player_in = "O" elif acc_x > 200: player_in = "R" # Check win condition if player_in == direction: # Player input correctly display.show(Image.HAPPY) else: display.show(Image.SAD) sleep(1000)
This code is a little bit longer since you have to check a lot of different conditions. The first thing you do is get the X-axis value from the accelerometer with
accelerometer.get_x(). Remember, this will be in the range
(-2000, 2000).
After getting the X value, you run through a series of checks to figure out which movement it represents. Anything greater than
200 in either direction is considered tilting, and anything less than
200 is considered staying still.
abs() helps shorten the code by stripping the negative sign from the accelerometer value. This means that numbers in the range
(-200, 200) will be considered staying still. You may want to play with that threshold to make the game more or less challenging.
After getting the directional input from the player, you check if it was correct or not. If it was the correct direction, then the code displays a happy face. Otherwise, it displays a sad face. The code then sleeps for a second to allow the player to see the result without it disappearing very quickly.
Testing Accelerometer Code in the Simulator
Since the accelerometer is a sensor that detects physical movement, you may be wondering how to interact with it in the simulator. Thankfully, the simulator provides a virtual accelerometer that you can control with your mouse.
Run your code in the same way as you did before, by clicking the play button in the bottom-right corner. You will see the micro:bit overlay appear. The overlay has some tabs along the top that control the various components of the micro:bit. Click the tab labeled Accelerometer.
In this tab, you will see three sliders, one for each axis. You will be using the X-axis slider to test your game.
As you move the slider to the right, the X value of the accelerometer will increase. Similarly, as you move the slider to the left, the X value will decrease. This is equivalent to tilting the micro:bit left and right and allows you to play your game in the browser.
Points and Losing
Now that the base game is in place, it’s time to think about adding in points and losing to complete the game. Remember the behavior described in the specification was that when the player lost, the micro:bit would display the points total that the player had gotten up to that point. If the player gets it right, the micro:bit should not display anything:
# Previous code... points = 0 while True: # Previous code... if player_in == direction: # Player's input is correct points += 1 else: display.scroll(points) display.show(Image.SAD) points = 0 sleep(1000)
Thankfully this is a smaller change than the previous step. Outside of the
while loop, you define a variable
points that will track the player’s points.
Further down, you’ve changed the check for whether the player’s input was in the correct direction. If the player moved the correct direction, you increase their points total by
1. Otherwise, you make the points total scroll across the screen with
display.scroll(), show a sad face, and reset the points total.
You also move
sleep() into the loss code since no image is displayed for getting it correct. This makes the game slightly more challenging!
To help you check your code and to cement what you’ve learned, here’s the full code for the game:
from microbit import display, Image, accelerometer, sleep from random import randrange # Define left, stay still, and right directions = ["L", "O", "R"] points = 0 # While the micro:bit is on while True: # Pick a random direction direction = directions[randrange(3)] display.show(direction) # Sleep for a second (1000ms) sleep(1000) # Get the X-axis (left-right) tilt acc_x = accelerometer.get_x() # Determine direction if acc_x < -200: player_in = "L" elif abs(acc_x) < 200: player_in = "O" elif acc_x > 200: player_in = "R" # Check win condition if player_in == direction: # Player's input is correct points += 1 else: display.scroll(points) display.show(Image.SAD) points = 0 sleep(1000)
Congratulations on building your very own game! You’ll notice this code takes up just over thirty lines including comments, which is much shorter than an equivalent program in a traditional embedded language.
Take It a Step Further
There you have it—you’ve built a complete game on an embedded system! If you want some extra challenges, here are some ideas:
- Incorporate the other accelerometer axes and turn this into a micro:bit version of Bop It!
- Shorten the time the player has to move the micro:bit if they get a certain number correct. What’s the shortest time you can do? Why do you think that is?
- Include accelerometer gestures. Out of the box, the micro:bit can detect shaking, being face down or face up, and even going into freefall.
- Add in multiplayer functionality so you can play with friends. The micro:bit has a radio module that allows communication between micro:bits.
This list is not definitive but instead should get you thinking. If you come up with a cool way to extend the game, then please share it in the comments!
Further Reading
Embedded development is a huge field, with a lot to learn. If you’re looking to learn more about embedded development with Python, then thankfully there are lots of great resources out there. Here are some links to get you started.
micro:bit Resources
One of the best things about the micro:bit is the huge collection of educational resources out there:
- microbit.org: The official micro:bit site with projects, lessons and more code editors
- micro:bit MicroPython docs: Highly readable documentation for Python on the micro:bit
- Build a snake game on the BBC micro:bit: A tutorial for a more complex game that walks you through the process slowly
The Micro:bit Educational Foundation recently released a second version of the micro:bit which will hopefully encourage a whole new wave of resources.
Other Boards That Run Python
The micro:bit isn’t the only board out there. It’s definitely worth exploring to find the right one for your project:
- MicroPython board tutorials: MicroPython has some official tutorials for some of the boards it supports. For example, here’s the one for the ESP8266.
- Hackaday projects tagged MicroPython: This site features writeups of projects that people have built and could give you some inspiration!
- Pycom tutorials: Pycom make MicroPython-compatible boards that have the ability to connect to various networks. These tutorials are a good way to get an idea of what’s possible.
There are many more interesting devices that run Python. You’ll be sure to find one that fits your project.
Conclusion
Python can be a great choice to write code for embedded systems. It enables you to develop your code faster and comes with safety guarantees that you won’t find with lower-level languages. You now have the knowledge to begin your embedded development journey with Python and are familiar with some of the options available to you.
In this tutorial, you learned:
- What embedded development is and why you would use Python to do it
- What the differences are between programming embedded systems and general-purpose computers
- Which options are available for writing Python code for embedded systems
- How to write a basic game on the BBC micro:bit with MicroPython
Embedded development is a wide and exciting field, filled with interesting things to discover. Keep learning, and be sure to share your discoveries in the comments below!
If you want to download the code from this tutorial to refer to offline, then click the link below:
Get Sample Code: Click here to get the sample code you’ll use to learn about embedded development with Python in this tutorial. | https://realpython.com/embedded-python/ | CC-MAIN-2021-49 | refinedweb | 4,520 | 62.88 |
, I ran it using this Java file:
public class hello { public static void main(String[] args) { System.out.println("To Objective C we go!"); } }
After running the above code using j2objc, I received two files (as expected): the header file, hello.h, and the source file, hello.m. The source file looks like this:
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: hello.java // // Created by Isaac on 10/18/12. // #import "IOSObjectArray.h" #import "hello.h" @implementation hello @end int main( int argc, const char *argv[] ) { int exitCode = 0; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; IOSObjectArray *args = J reEmulationMainArguments(argc, argv); NSLog(@"%@", @"To Objective C we go!"); [pool release]; return exitCode; }
J2Objc certainly has to make a few decisions when converting between the two languages. One is seen above, as System.out.printLn is converted to NSLog. Currently J2Objc can convert much of Java, including things like reflection and anonymous classes in Java. I imagine these kinds of decisions are made through the program.
Although the library can’t touch any specific Java code related to the Android APIs, it can handle anything written in pure Java. The tool certainly has potential, especially for converting standard java classes directly to their Objective C equivalent.
Reference: A Reason to Write Android Apps First from our JCG partner Isaac Taylor at the Programming Mobile blog.
Hi! i just want to know how to start with this. PLS PLS PLS help me.
I am having a completed java projet. and i downloaded j2objc also. i has some folders like include, lib, man and two j2objc file. I just wan to know how to start? I know objective c xcode. so pls help me to start. where i should put my xxx.java file.
This seems to only be able to translate Very generic java classes. have you been successful in translating more complicating java code? for example java code that uses jar file dependancies.
I guess it only convert the java code u write, but it cant convert the android API. still need a little bit touching up manually to fully convert to Obj-C. But better than nothing for the moment. | https://www.javacodegeeks.com/2012/10/java-to-ios-objective-c-translation-tool-and-runtime.html/comment-page-1/ | CC-MAIN-2017-22 | refinedweb | 360 | 60.61 |
Introduction:
In our daily development,some times we may need to store data and access it for later use.So as developer choice we need to decide "which way is best to store data?" and this decision making would be change based on amount of data to be store.However windowsphone is very good at this case . Because windowsphone is provided following ways to store our application data.
1)IsolatedStorageSettings:It is very very useful for storing some basic application settings like user profile settings,and especially in login application after login successfully app need to be home screen when user again launch the app.
2)IsolatedStorageFile: It is available from "System.IO.IsolatedStorage" namespace to access files.And i am really addicted with this uses ,because it is very handy and simple way to store data.It is enough for most of applications.And no limit to data store but of course you'll get an exception if you run out of space when writing new data, so you have to handle that properly.
3)SQLite:It is very useful to store data in database with structured way, Mmm this concept is covered by this post.And this article covers windowsphone 8 sqlite database.So if you want to implement database application for windowsphone 7,you may helped from this link Sqlite client for Windows Phone 7 and for sample see this post.
Requirements:
Table of Contents:
Unfortunately SQLite is directly not available in windowsphone devices.And in previously it included lot of hard steps to setup sqlite in windowsphone application.But now we are very happy ,because three steps only (i.e Installing SQLite for Windows Phone SDK,Installing sqlite-net-wp8 package,Installing sqlite-net package)
1.1)Installing SQLite for Windows Phone SDK:
The first step is installing the SQLite for Windows Phone SDK in the Visual Studio that you are using. To do that, click on TOOLS -> Extensions and Updates -> Online -> Then search for "sqlite for windows phone". It should look like the following picture.
You will be redirected this link .It may not useful for you,but best to read this document.And we need to add this extension to our project like this.
Open Solution explorer,Right click on 'References'=>Choose WindowsPhone=>Extensions =>select 'SQlite for WindowsPhone'=>Press 'Ok'
1.2)Installing sqlite-net-wp8 package:
Now one good news is "sqlite-net-wp8 package" is available on Nuget which is previously not available and i say very thankful to creator "Peter Huene".This is a c++ project can works like mediator between SQLite and our source code. So to install it right click on your project (i.e in my case project name is SQLiteWp8) =>Click on "Manage NuGet Packages" and search for "sqlite-net-wp8" => Click on "Install" button.
Note:if the sqlite-net-wp8 does not use the same version of SQLite for windows phone you will not be able to open the app
1.3)Installing sqlite-net package:
Now we are almost completed SQLite setup.But in addition we need to add sqlite-net package which is available from nuget. Because this package provides two helper classes (SQLite.cs and SQLiteAsync.cs) which are play vital role to perform all SQLite operations.So to install it right click on your project (i.e in my case project name is SQLiteWp8)=> Click on "Manage NuGet Packages" and search for "sqlite-net" => Click on "Install" button.
Remembering Notes:
1)Before you compile you will need to add some conditional compilation constants in the application,otherwise You'll probably get this error message: The type or namespace name 'Community' could not be found.To fix this issue right click on your project =>Choose properties =>Build and set value USE_WP8_NATIVE_SQLITE like this
2)You receive an error cannot find a type or namespace SQLite.Verify you have the conditional constants set. Verify you have added a reference to SQLite.
3)f the sqlite-net-wp8 does not use the same version of SQLite for windows phone you will not be able to open the app).
***Wow now whole SQLite set up process is completed,so now we are going to work with all CRUD operations***
2)How to perform all SQLite CRUD operations ?));// NavigationService.Navigate(new Uri("/Views/ReadContactList.xaml", UriKind.Relative));//after add contact redirect to contact listbox page } else { MessageBox.Show("Please fill two fields");//Text should not be empty } }
-
. <TextBlock Grid. <TextBlock HorizontalAlignment="Right" Margin="0,0,35,0" Grid. </Grid> </Border> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox>
So when page is loaded ,i done like this
C#.
C#
private void AddContact_Click(object sender, RoutedEventArgs e) { NavigationService.Navigate(new Uri("/Views/AddConatct.xaml", UriKind.Relative)); }
When "DeleteAll" button is clicked ,i done like this
C#
private void DeleteAll_Click(object sender, RoutedEventArgs e) { DatabaseHelperClass Db_Helper = new DatabaseHelperClass(); Db_Helper.DeleteAllContact();//delete all DB contacts DB_ContactList.Clear();//Clear collections listBoxobj.ItemsSource = DB_ContactList; }
When selected listbox item ,i navigate to "Delete_UpdateContacts.xaml" page for delete/update corresponding contact details on listbox SelectionChanged event like this.
C#
private void listBoxobj_SelectionChanged(object sender, SelectionChangedEventArgs e) {if (listBoxobj.SelectedIndex!= -1) { Contacts listitem = listBoxobj.SelectedItem as Contacts;//Get slected listbox item contact ID NavigationService.Navigate(new Uri("/Views/Delete_UpdateContacts.xaml?SelectedContactID=" + listitem.Id, UriKind.Relative));} }
- Delete_UpdateContacts.xaml:This page is for updating/delete selected contact details
C#
protected override void OnNavigatedTo(NavigationEventArgs e) { Selected_ContactId = int.Parse(NavigationContext.QueryString["SelectedContactID"]);.
C#
private void DeleteContact_Click(object sender, RoutedEventArgs e) { Db_Helper.DeleteContact(Selected_ContactId);//Delete selected DB contact Id. NavigationService.Navigate(new Uri("/Views/ReadContactList.xaml", UriKind.Relative)); }
When "Update" button is pressed i done like this.
C#
private void UpdateContact_Click(object sender, RoutedEventArgs e) { currentcontact.Name = NametxtBx.Text; currentcontact.PhoneNumber = PhonetxtBx.Text; Db_Helper.UpdateContact(currentcontact);//Update selected DB contact Id NavigationService.Navigate(new Uri("/Views/ReadContactList.xaml", UriKind.Relative)); }
4)How to explore my SQLite database data?
Isolated Storage Explorer tool to get the database file.This tool is installed under folder path is Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0.0\Tools\IsolatedStorageExplorerTool
2)Get Product Id from project WMAppManifest.xml file Packaging Tab under ProductId attribute (i.e 9748984e-2779-41fb-991f-f99c72414203)
3)if your app is run on emulator excute this command: ISETool.exe ts xd 9748984e-2779-41fb-991f-f99c72414203 c:\data\myfiles
4)if your app is run on device excute this command: ISETool.exe ts de 9748984e-2779-41fb-991f-f99c72414203 c:\data\myfiles
Now we will be found DB content in your computer at c:\data\myfiles like this.
Final Step:
After downloaded from the Store you app may not be create database file.So copy your existing database file and paste it into your project root folder by right click your project=> Add Existing Item=>Browse to c:\data\myfiles\ContactsManager.sqlite. In your Application_Launching event of App.xaml check whether database is existing or not.If not exist,then copy the your database file from installed folder to local folder.Thats it will fix the app store issue.
Note:Make sure to change the Copy to Output Directory property of ContactsManager.sqlite file to Copy if newer.
C#
public partial class App : Application { private async void Application_Launching(object sender, LaunchingEventArgs e) { StorageFile MyDBFile = null; try { // Read the db file from DB path MyDBFile = await StorageFile.GetFileFromPathAsync(DB_PATH); } catch (FileNotFoundException) { if (MyDBFile == null) { // Copy file from installation folder to local folder. IsolatedStorageFile iso = IsolatedStorageFile.GetUserStoreForApplication(); // Create a stream for the file in the installation folder. using (Stream input = Application.GetResourceStream(new Uri("ContactsManager.sqlite", UriKind.Relative)).Stream) { // Create a stream for the new file in the local folder. using (IsolatedStorageFileStream output = iso.CreateFile(DB_PATH)) { // Initialize the buffer. byte[] readBuffer = new byte[4096]; int bytesRead = -1; // Copy the file from the installation folder to the local folder. while ((bytesRead = input.Read(readBuffer, 0, readBuffer.Length)) > 0) { output.Write(readBuffer, 0, bytesRead); } } } } } } }
Visitors Note:This content may be change in future.if you are looking for SQlite sample for windowsphone store 8.1.You may visit this link :) :)
Thanks for Your Great Job in SQLITE FOR WP8
Thanks prem :)
amazing ... I wish you could also add android tuts ... wonderful .This site crazily helped me so much.Be blessed
Please start your blog for Android and iPhone development also we have work in all Mobile platform developments it's my request ... We can do Subbu ....
HI prem presently i am only concentrate on WindowsPhone tutorials..Because I am big fan of windowsphone even i am android developer.And now i am full satisfactions with this blog ,I am really thanks to my dear visitors,Because they makes me with lot of encouragement with active role in my blog by asking/requesting sample to be post.However as per your request i was planned to post articles on three platforms(WindowsPhone,Iphone adn Android ).Please see my future blog look like this .But it will be take time to construct that blog.
Your Upcoming Blog is Fantastic, am proud to be your Follower and as well as Friend and ....... it is very useful to every body who entering into Mobile Technologies ....
How to get files from isolated storage.
After performing all the steps and configuring the platform.
you need to do this :
Right-click References and select add reference.Go to Windows Phone -> Extensions and check the option SQlite for Windows Phone
Hi,
It is a great tutorial. But can you please tell me one thing, how to read the blob data stored in a sqlite table?. I have kept the column as byte array in the class. But looks like it does not returning the correct value.
Class:
public class TableDetails
{
public byte[] blob_field { get; set; }
}
I have executed like this:
var sqlResult = await db.QueryAsync("SELECT blob_field FROM table_name");
Is there any way to resolve this by reading database as stream, or something?.
I am very new at windows phone app.
Thanks.
Hi it's really nice tutorial, but I have one error I have red line under DB_ContactList why is that happing how can I solve this problem. many thanks.
Hi pls put the code for ReadAllContacts.cs file. Its shown in screenshot, but not code is not provided. the following code is throwing error. pls let me know the reason..
}
Hi,
Are you sure about inserting alt-east one contact item to database before reading contactlist from database.And you may check source code by downloading this sample.
Hi,
Yes i have one entry in DB for sure. I inserted using SQLite Manager Client of Firefox. Pls. let me know where i could find code for as suggested by you.
Thanks a lot.. Avi
There is add button for inserting contact into db "AddConatct.xaml" page .Have you found it?
Where is the source code to download for this project?
Download from here
thanks
Hi subbu,
can you please provide the tutorial on using sql lite for windows phone 8.1.
I need to understand the basic before implementing the same
Thanks
richa
Ya sure,very soon i will be post it :)
Hi please check this WindowsPhone 8.1 SQLite: How to Store Data in DataBase for Beginners Tutorial(C#-XAML)
How did you created ContactManager.sqlite...
Download source code and check 'ContactManager.sqlite' file name in App.xaml.cs.
how did you create the file ContactManager.sqlite?
when I run it I get this exception: System.IO.FileNotFoundException.
could someone help me?
Download source code and check 'ContactManager.sqlite' file name in App.xaml.cs,And also please check STEP 1.1 ,we need to add sqlite extension to our project like this.
Open Solution explorer,Right click on 'References'=>Choose WindowsPhone=>Extensions =>select 'SQlite for WindowsPhone'=>Press 'Ok'.
Generally in this sample 'System.IO.FileNotFoundException.' error occurs when we did not reference the sqlite extension to our project.
thank alot man
put your code in this blog that write plez>>
Hi,
How to encrypt and decrypt sqlite database in windows phone 8.1
Thanks,
Alok
Where is source code?
Please click on 'Download Code' from bottom of the post,have you seen that...It will be redirect to source code page.
Very useful Tutorial..
Database Agency list
How to do database update for new versions , without effecting the old users. please tell me.
Nice work...How to do Select count and then i have to insert values depends on count..Any suggestions..
Great artical Subbu...Thank you.
I had a small doubt.... I am developing a app that needs more data (Tables) predefined and I need to retrieve data from them.... Is there any solution like sqlserver where we can create tables and insert data and we can use that tables in our app directly by the DB connection.... Plz help me ... I am so confused.... :(
Exellent article! Thanx
kdpgroup.co.in
indaiclassified8
Best Hidden Android Secret Codes 2015 =>
Can you show me how to store(insert, select update) XML file to(from) SD Card, Please!
So, Is this code helps me to create an application library (books) ?!
Useful one but can you make it with best practice coding standard. Please..please
How can I read the contacts and edit the phone numbers?In Brazil it is adding another digit in phone numbers.I would like to develop this feature. Thank you.
can anyone please elaborate on the part for downloading database file from emulator to computer I dint got it.
Awesome windows phone post
Hae Subbub, I have used your tutorial and it has helped me so much. However, after submitting my app to the windows phone store, it never passed certification. They are giving me this issue, the application is exiting on launch. I copied the database to the root folder of my project aand copied if newer. My question was, how can I test whether my database on the root folder is working or not?
Hello Subramanyam Raju,
This is fantastic tutorial. But i have one issue. Please Help me.
I am begginer in windows phone technology. I have one issue found on sqllite integration
Error: Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
I am waiting your response.
thanks a lot bosss............
really nice article !!! I had learned so many things reading this article, thanks a lot for sharing the information. Our site also provides an innovative and interactive Mobile App Services and if you want more ideas to refer our site: | http://bsubramanyamraju.blogspot.com/2014/08/windowsphone-8-sqlite-storing-data-in.html | CC-MAIN-2018-17 | refinedweb | 2,406 | 59.5 |
Thread Abort Error In C#
Hello,
I am receiving the following error in my C# Ice Server:
!! 8/07/2020 19:09:37:480 error: exception in endpoint host resolver thread Ice.HostResolver:
System.Threading.ThreadAbortException: Thread was being aborted.
at System.Threading.Monitor.ObjWait(Boolean exitContext, Int32 millisecondsTimeout, Object obj)
at System.Threading.Monitor.Wait(Object obj, Int32 millisecondsTimeout, Boolean exitContext)
at IceInternal.EndpointHostResolver.run() in C:\Users\vagrant\workspace\ice-dist\3.7\dist-utils\build\ice\builds\ice-v142\csharp\src\Ice\EndpointHostResolver.cs:line 102
at IceInternal.EndpointHostResolver.HelperThread.Run() in C:\Users\vagrant\workspace\ice-dist\3.7\dist-utils\build\ice\builds\ice-v142\csharp\src\Ice\EndpointHostResolver.cs:line 253
!! 8/07/2020 19:09:37:488 error: exception in `Ice.ThreadPool.Client' thread Ice.ThreadPool.Client-0:
I searched the forums and found this:
However I do not know what 'abort a thread while it is inside the run time' means. I guessed that it means aborting a thread inside an 'I' class or something that it calls.
Therefore as a debugging step I simplified my 'I' class to be:
public class ScummWebServerI : ScummWebServerDisp_ { ... public override void Init(string gameName, string gameId, string signalRConnectionId, Dictionary<string, byte[]> saveStorage, Current current = null) { int x = 4; } ... }
My logic here that that the simple setting of x to 4 will not abort any threads.
I called 'Init' from two different clients and got the same behaviour. The client call to 'Init' returned after a LONG time, but 'Init' was never called and the above error was logged.
I feel that because calling from either of the clients, a JS client and a C# client, cause the same behaviour then it it probably an issue with the server.
Please let me know what else you need.
Hi Andrew,
Can you try running your server with the debugger attached and get the stack of all threads, this will give us a clue to figure this why Abort is being called.
Cheers,
Jose
I am now withdrawing this question and apologise for wasting you're time.
The issue was caused by a simple 'port is already is use error' which was hidden somewhere else.
Please resolve or remove this question.
Thanks | https://forums.zeroc.com/discussion/46739/thread-abort-error-in-c | CC-MAIN-2022-05 | refinedweb | 373 | 58.28 |
Printing EMF from a Windows service
I have some code that prints a document using the System.Drawing.Printing namespace. This now needs to be moved into a windows service. The documentation states that this is not possible, which would support my findings so far (in that it doesn't work). I'm working under the assumption that I can get this to work by using the System.Printing namespace instead.
Here is the code that I have so far:
private Metafile myDoc; myDoc = GetEmfDoc(); PrintServer ps = new PrintServer("\\server1\printer1"); EnumeratedPrintQueueTypes[] flags = { EnumeratedPrintQueueTypes.Local }; PrintQueueCollection queues = ps.GetPrintQueues(flags); PrintQueue pq = queues.First<PrintQueue>(); pq.AddJob("JobName", ?);
So I want to pass myDoc to pq.AddJob(), but this doesn't seem to be possible. Using System.Drawing.Printing it was possible to simply render this on a page by page basis in the PrintDocument.PrintPage event.
Is what I'm trying to do possible, and if so, could someone point me in the right direction?
Answers
Classes within the System.Drawing.Printing namespace are not supported for use within a Windows service or ASP.NET application or service. Attempting to use these classes from within one of these application types may produce unexpected problems, such as diminished service performance and run-time exceptions.
It is important to understand what "not supported" means in this context. It literally means what it says, it you try to print from a service and discover a problem then you cannot call Microsoft Support and ask for help.
This is not a problem that's induced by System.Drawing, it is a generic problem with printer drivers. Chunks of code that are supplied by the printer manufacturer, not Microsoft. A significant problem with them is that they are invariably designed to be used from a desktop program. Word, Acrobat, etcetera. They readily take advantage of that, they often pop up a window to let you know that they are Working On It. Not in the least to spam the manufacturer name and reminding you that the toner cartridge is half empty. These drivers are likely to misbehave in a service. The "runtime exceptions" phrase mentioned in the note.
The worst problem with them is that they use a popup window to let you know that there's a problem. These windows are not visible when you use the printer driver from a service. So you'll have to deal with print jobs that for no discernible reason refuse to print. The "diminished service performance" phrase in the note. That's very difficult to deal with, IT staff is just powerless to have a shot at fixing the problem when they can't see any diagnostic.
Your approach doesn't solve that fundamental problem. If you really want to pursue this then contact the printer manufacturer and ask for specific advise. Don't get your hopes up, getting good answers out of hardware companies is pretty difficult.
Need Your Help
Drop all tables whose names begin with a certain string
sql sql-server scripting dynamic-sqlI'd like a script to drop all tables whose name begins with a given string. I'm sure this can be done with some dynamic sql and the INFORMATION_SCHEMA tables.
Using jQuery Plug-in (jquery-autosave) to an MVC 3 controller method via ajax
jquery ajax asp.net-mvc-3 callback autosaveMy javascript/ajax inexperience is probably preventing me from bridging a gap here. I have implemented a jQuery plugin called jQuery-autosave. The change event on my form control fires the method... | http://unixresources.net/faq/10106791.shtml | CC-MAIN-2019-04 | refinedweb | 594 | 66.33 |
Adding an inset to the figure
To plot an inset figure inside another larger figure, we can use the
pygmt.Figure.inset method. After a large figure has been created,
call
inset using a
with statement, and new plot elements will be
added to the inset figure instead of the larger figure.
import pygmt
Prior to creating an inset figure, a larger figure must first be plotted. In
the example below,
pygmt.Figure.coast is used to create a map of the
US state of Massachusetts.
fig = pygmt.Figure() fig.coast( region=[-74, -69.5, 41, 43], # Set bounding box of the large figure borders="2/thin", # Plot state boundaries with thin lines shorelines="thin", # Plot coastline with thin lines projection="M15c", # Set Mercator projection and size of 15 centimeter land="lightyellow", # Color land areas light yellow water="lightblue", # Color water areas light blue frame="a", # Set frame with annotation and major tick spacing ) fig.show()
Out:
<IPython.core.display.Image object>
The
pygmt.Figure.inset method uses a context manager, and is called
using a
with statement. The
position parameter, including the inset
width, is required to plot the inset. Using the j argument, the location
of the inset is set to one of the 9 anchors (bottom-middle-top and
left-center-right). In the example below,
BL sets the inset to the bottom
left. The
box parameter can set the fill and border of the inset. In the
example below,
+pblack sets the border color to black and
+gred sets
the fill to red.
fig = pygmt.Figure() fig.coast( region=[-74, -69.5, 41, 43], borders="2/thin", shorelines="thin", projection="M15c", land="lightyellow", water="lightblue", frame="a", ) with fig.inset(position="jBL+w3c", box="+pblack+glightred"): # pass is used to exit the with statement as no plotting functions are # called pass fig.show()
Out:
<IPython.core.display.Image object>
When using j to set the anchor of the inset, the default location is in contact with the nearby axis or axes. The offset of the inset can be set with +o, followed by the offsets along the x- and y-axis. If only one offset is passed, it is applied to both axes. Each offset can have its own unit. In the example below, the inset is shifted 0.5 centimeters on the x-axis and 0.2 centimeters on the y-axis.
fig = pygmt.Figure() fig.coast( region=[-74, -69.5, 41, 43], borders="2/thin", shorelines="thin", projection="M15c", land="lightyellow", water="lightblue", frame="a", ) with fig.inset(position="jBL+w3c+o0.5c/0.2c", box="+pblack+glightred"): pass fig.show()
Out:
<IPython.core.display.Image object>
Standard plotting functions can be called from within the
inset context
manager. The example below uses
pygmt.Figure.coast to plot a zoomed
out map that selectively paints the state of Massachusetts to shows its
location relative to other states.
fig = pygmt.Figure() fig.coast( region=[-74, -69.5, 41, 43], borders="2/thin", shorelines="thin", projection="M15c", land="lightyellow", water="lightblue", frame="a", ) # This does not include an inset fill as it is covered by the inset figure with fig.inset(position="jBL+w3c+o0.5c/0.2c", box="+pblack"): # Use a plotting function to create a figure inside the inset fig.coast( region=[-80, -65, 35, 50], projection="M3c", land="gray", borders=[1, 2], shorelines="1/thin", water="white", # Use dcw to selectively highlight an area dcw="US.MA+gred", ) fig.show()
Out:
<IPython.core.display.Image object>
Total running time of the script: ( 0 minutes 5.594 seconds)
Gallery generated by Sphinx-Gallery | https://www.pygmt.org/latest/tutorials/advanced/insets.html | CC-MAIN-2022-27 | refinedweb | 599 | 50.73 |
Hello all,
Here I intend to reverse a line of text ending in a newline, but only the individual words will be reversed, not every character. For example, "This is just a test." would output ".test a just is This". The code as stands prints a space for every character in the word, as I cannot think of a way to recapture the previously read characters.
I think my professor is a sadist... we have to process the input one character at a time, recursively and cannot use any extraneous structures such as an array.
<disclaimer> This is just for bonus, and I intend to let him know that I received outside help on it. The actual assignment was to reverse a string of text, one character at a time, recursively.</disclaimer>
#include <stdio.h> int reverseWords(int); int main() { char ch; while ( (ch = getc(stdin)) != EOF ) { ungetc(ch,stdin); reverseWords(1); putc('\n', stdout); } return 0; } int reverseWords(int count) { char ch; ch = getc(stdin); if (ch == '\n') return; else if (ch == ' ') { for (count; count > 0; count--) { putc(ch, stdout); } } reverseWords(count+1); }
Just for kicks, here is the (working) code to reverse a single line of text, preserving the newline at the end.
#include <stdio.h> void reverseLine(void); int main() { char ch; while ( (ch = getc(stdin)) != EOF ) { ungetc(ch,stdin); reverseLine(); putc('\n', stdout); } return 0; } void reverseLine(void) { char ch; if ( (ch = getc(stdin)) == '\n') return; reverseLine(); putc(ch, stdout); } | https://www.daniweb.com/programming/software-development/threads/259174/reverse-a-line-of-words | CC-MAIN-2017-26 | refinedweb | 244 | 62.58 |
I’ve been talking about container things a bunch on this blog, mostly because I’ve been looking at them at work.
One of the hardest things to understand about all this newfangled container stuff is – what is even going on with the networking?!
There are a lot of different ways you can network containers together, and the documentation on the internet about how it works is often pretty bad. I got really confused about all of this, so I’m going to try to explain what it all is in laymen’s terms.
(I don’t like to rant here, but I really have been frustrated with the state of the documentation on this networking stuff.)
what even is container networking?
When you run a program in a container, you have two main options:
- run the program in the host network namespace. This is normal networking – if you run a program on port 8282, it will run on port 8282 on the computer. No surprises.
- run the program in its own network namespace
If you have a program running in its own network namespace (let’s say on port 9382), other programs on other computers need to be able to make network connections to that program.
At first I thought “how complicated can that be? connecting programs together is simple, right?” Like, there’s probably only one way to do it? It turns out that this problem of how to connect two programs in containers together has a ton of different solutions. Let’s learn what those solutions are!
“every container gets an IP”
If you are a container nerd these days, you have probably heard of Kubernetes. Kubernetes is a system that will take a container and automatically decide which computer your container should run on. (among other things)
One of Kubernetes’ core requirements (for you to even start using it) is that every container has to have an IP address, and that any other program inside you cluster can talk to your container just using that IP address. So this might mean that on one computer you might have containers with hundreds or thousands of IP addresses (instead of just one IP address and many ports).
When I first heard of this “every container gets an IP” concept I was really confused and kind of concerned. How would this even work?! My computer only has one IP address! This sounds like weird confusing magic! Luckily it turns out that, as with most computer things, this is actually totally possible to understand.
This “every container gets an IP” problem is what I’m going to explain in this blog post. There are other ways to network containers, but it’s going to take long enough already to just explain this one :)
I’m also going to restrict myself to mostly talking about how to make this work on AWS. If you have your own physical datacenter there are more options.
Our goal
You have a computer (AWS instance). That computer has an IP address (like 172.9.9.9).
You want your container to also have an IP address (like 10.4.4.4).
We’re going to learn how to get a packet sent to 10.4.4.4 on the computer 172.9.9.9.
On AWS this can actually be super easy – there are these things called “VPC Route Tables”, and you can just say “send packets for 10.4.4.* to 172.9.9.9 please” and AWS will make it work for you. The catch is you can only have 50 of these rules, so if you want to have a cluster of more than 50 instances, you need to go back to being confused about networking.
some networking basics: IP addresses, MAC addresses, local networks
In order to understand how you can have hundreds of IP addresses on one single machine, we need to understand a few basic things about networking.
I’m going to take for granted that you know:
- In computer networking, programs send packets to each other
- Every packet (for the most part) has an IP address on it
- On Linux, the kernel is responsible for implementing most networking protocols
- a little bit about subnets: the subnet 10.4.4.0/24 means “every IP from 10.4.4.0 to 10.4.4.255”. I’ll sometimes write 10.4.4.* to mean this.
I’ll do my best to explain the rest.
Thing 0: parts of a network packet
A network packet has a bunch of different parts (often called “layers”). There
are a lot of different kinds of network packets, but let’s just talk about a
normal HTTP request (like
GET /). The parts are:
- the MAC address this packet should go to (“Layer 2”)
- the source IP and destination IP (“Layer 3”)
- the port and other TCP/UDP information (“Layer 4”)
- the contents of your HTTP packet like
GET /(“Layer 7”)
Thing 1: local networking vs far-away networking
When you send a packet directly to a computer (on the same local network), here’s how it works.
Packets are addressed by MAC address. My MAC address is
3c:97:ae:44:b3:7f; I found it by running
ifconfig.
So to send a packet to me, any computer on my local network can write
3c:97:ae:44:b3:7f on it, and it gets to my computer. In AWS, “local network”
basically means “availability zone”. If two instances are in the same AWS
availability zone, they can just put the MAC address of the target computer
on it, and then the packet will get to the right place. It doesn’t matter what
IP address is on the packet!
Okay, what if my computer isn’t in the same local network / availability zone as the target computer? What then? Then routers in the middle need to look at the IP address on the packet and get it to the right place.
There is a lot to know about how routers work, and we do not have time to learn it all right now. Luckily, in AWS you have basically no way to configure the routers, so it doesn’t matter if we don’t know how they work! To send a packet to an instance outside your availability zone, you need to put that instance’s IP address on it. Full stop. Otherwise it ain’t gonna get there.
If you manage your own datacenter, you can do clever stuff to set up your routers.
So! Here’s what we’ve learned, for AWS:
- if you’re in the same AZ as your target, you can just send a packet with any random IP address on it, and as long as the MAC address is right it’ll get there.
- if you are in a different AZ, to send a packet to a computer, it has to have the IP address of that instance on it.
The route table
You may be wondering “julia, but how can I control the MAC address my packet gets sent to! I have never done that ever! That is very confusing!”
When you send a packet to
172.23.2.1 on your local network, your operating
system (Linux, for our purposes) looks up the MAC address for that IP address
in a table it maintains (called the ARP table). Then it puts that MAC address on the packet and sends it off.
So! What if I had a packet for the container
10.4.4.4 but I actually wanted it
to go to the computer
172.23.1.1? It turns out this actually easy peasy! You
just add an entry to another table. It’s all tables.
Here’s command you could run to do this manually:
sudo ip route add 10.4.4.0/24 via 172.23.1.1 dev eth0
ip route add adds an entry to the route table on your computer. This
route table entry says “Linux, whenever you see a packet for
10.4.4.*, just
send it to the MAC address for
172.23.2.1, would ya darling?”
we can give containers IPs!
It is time celebrate our first victory! We now know all the basic tools for one main way to route container IP addresses!
The steps are:
- pick a different subnet for every computer on your network (like 10.4.4.0/24 – that’s 10.4.4.*). That subnet will let you have 256 containers per machine.
- On every computer, add routes for every other computer. So you’d add a route for 10.4.1.0/24, 10.4.2.0/24, 10.4.3.0/24, etc.
- You’re done! Packets to 10.4.4.4 will now get routed to the right computer. There’s still the question of what they will do when they get to that computer, but we’ll get there in a bit.
So our first tool for doing container networking is the route table.
what if the two computers are in different availability zones?
We said earlier that this route table trick will only work if the computers are connected directly. If the two computers are far apart (in different local networks) we’ll need to do something more complicated.
We want to send a packet to the container IP 10.4.4.4, and it is on the computer 172.9.9.9. But because the computer is far away, we have to address the packet to the IP address 172.9.9.9. Woe is us! All is lost! Where are we going to put the IP address 10.4.4.4?
Encapsulation
All is not lost. We can do a thing called “encapsulation”. This is where you take a network packet and put it inside ANOTHER network packet.
So instead of sending
IP: 10.4.4.4 TCP stuff HTTP stuff
we will send
IP: 172.9.9.9 (extra wrapper stuff) IP: 10.4.4.4 TCP stuff HTTP stuff
There are at least 2 different ways of doing encapsulation: there’s “ip-in-ip” and “vxlan” encapsulation.
vxlan encapsulation takes your whole packet (including the MAC address) and wraps it inside a UDP packet. That looks like this:
MAC address: 11:11:11:11:11:11 IP: 172.9.9.9 UDP port 8472 (the "vxlan port") MAC address: ab:cd:ef:12:34:56 IP: 10.4.4.4 TCP port 80 HTTP stuff
ip-in-ip encapsulation just slaps on an extra IP header on top of your old IP header. This means you don’t get to keep the MAC address you wanted to send it to but I’m not sure why you would care about that anyway.
MAC: 11:11:11:11:11:11 IP: 172.9.9.9 IP: 10.4.4.4 TCP stuff HTTP stuff
How to set up encapsulation
Like before, you might be thinking “how can I get my kernel to do this weird encapsulation thing to my packets”? This turns out to be not all that hard. Basically all you do is set up a new network interface with encapsulation configured.
On my laptop, I can do this using: (taken from these instructions)
sudo ip tunnel add mytun mode ipip remote 172.9.9.9 local 10.4.4.4 ttl 255 sudo ifconfig mytun 10.42.1.1
Then you set up a route table, but you tell Linux to route the packet with your new magical encapsulation network interface. Here’s what that looks like:
sudo route add -net 10.42.2.0/24 dev mytun sudo route list
I’m mostly giving you these commands to get an idea of the kinds of commands
you can use to create / inspect these tunnels (
ip route list ,
ip tunnel,
ifconfig) – I’ve almost certainly gotten a couple of the specifics wrong,
but this is about how it works.
How do routes get distributed?
We’ve talked a lot about adding routes to your route table (“10.4.4.4 should go via 172.9.9.9”), but I haven’t explained at all how those routes should actually get in your route table. Ideally you’d like them to configured automatically.
Every container networking thing to runs some kind of daemon program on every box which is in charge of adding routes to the route table.
There are two main ways they do it:
- the routes are in an etcd cluster, and the program talks to the etcd cluster to figure out which routes to set
- use the BGP protocol to gossip to each other about routes, and a daemon (
BIRD) listens for BGP messages on every box
What happens when packets get to your box?
So, you’re running Docker, and a packet comes in on the IP address 10.4.4.4. How does that packet actually end up getting to your program?
I’m going to try to explain bridge networking here. I’m a bit fuzzy on this so some of this is probably wrong.
My understanding right now is:
- every packet on your computer goes out through a real interface (like
eth0)
- Docker will create fake (virtual) network interfaces for every single one of your containers. These have IP addresses like 10.4.4.4
- Those virtual network interfaces are bridged to your real network interface. This means that the packets get copied (?) to the network interface corresponding to the real network card, and then sent out to the internet
This seems important but I don’t totally get it yet.
finale: how all these container networking things work
Okay! Now we we have all the fundamental concepts you need to know to navigate this container networking landscape.
Flannel
Flannel supports a few different ways of doing networking:
- vxlan (encapsulate all packets)
- host-gw (just set route table entries, no encapsulation)
The daemon that sets the routes gets them from an etcd cluster.
Calico
Calico supports 2 different ways of doing networking:
- ip-in-ip encapsulation
- “regular” mode, (just set route table entries, no encapsulation)
The daemon that sets the routes gets them using BGP messages from other hosts. There’s still an etcd cluster with Calico but it’s not used for distributing routes.
The most exciting thing about Calico is that it has the option to not use encapsulation. If you look carefully though you’ll notice that Flannel also has an option to not use encapsulation! If you’re on AWS, I can’t actually tell which of these is better. They have the same limitations: they’ll both only work between instances in the same availability zone.
Most of these container networking things will set up all these routes and tunnels and stuff for you, but I think it’s important to understand what’s going on behind the scenes, so that if something goes wrong I can debug it and fix it.
is this software defined networking?
I don’t know what software defined networking. All of this helps you do networking differently, and it’s all software, so maybe it’s software defined networking?
that’s all
That’s all I have for now! Hopefully this was helpful. It turns out this stuff
isn’t so bad, and spending some time with the
ip command,
ifconfig and
tcpdump can help you understand the basics of what’s going on in your
Kubernetes installation. You don’t need to be an expert network engineer! My
awesome coworker Doug helped me understand a lot of this.
Thanks to Sophie Haskins for encouraging me to publish this :) | https://jvns.ca/blog/2016/12/22/container-networking/ | CC-MAIN-2021-10 | refinedweb | 2,617 | 72.76 |
Open module Popup
This action will allow you to manually trigger an open popup action for the specified module(Form/TabsPro)..
- Select Module. Select the module that you wish to open in popup (Form or TabsPro based on the action selected: Open Action Form Popup, Open TabsPro Popup).
- QueryString Parameters. Optionally you can pass parameters through querystrings that can then be used in the module that is currently being opened in popup; their values can be referenced as tokens with ‘QueryString:’ namespace.
Using the javascript API you can open Action Form in popup by calling the next javascript method
dnnsf.api.actionForm.openPopupById(‘1234’, {‘param’:’valueofparam’,’param2’:’valueofparam2’},true)
First parameter is required and is the module id of the Action Form
The second parameter is optional and it is a JS object. After the Action Form init the values can be used by calling the QueryString token (eg. [QueryString:param]).
The third parameter is optional and tells Action Form if the module should be reinitialized (refreshed). This can be used when you want to refresh the form so it can use the values from the second parameters. Show Condition and Enable Condition are refreshed as well. Default is false. | https://docs.dnnsharp.com/actions/dnn-sharp/open-module-popup.html | CC-MAIN-2020-05 | refinedweb | 200 | 52.29 |
We can create Marketing Lead standard/Custom fields Mandatory with error message .
In this Scenario we are going to make Email and Phone fields Mandatory and it shows error message if try to save with null values .
Step 1 : To create Marketing Lead , we have create extension of “Lead” Business Object .
Step 2: Create a solution ex: “MarketingFldMandt” by click right on “My Solution” .
Step 3: Now go to Solution Explorer and and right click and select “Add” -> “New Item”
Give Any name ex: [MarketingLead].xbo and press “Add” button
Step 4: A new Window get Opened then select following data and press “OK”
Step 5:Now double Click on “MarketingLead.xbo” and xbo screen get opened , there add the following code then Save and Activate
Step 7: Now we need to Enhance the screen . For that right click on “MarketingLead.xbo” and select “Enhance Screen”
Step 8: A new window Get open there Select : COD_Mkt_Prospect_QC , COD_Mkt_Prospect_QV and COD_Mkt_Prospect_TI
Step 9: Now A new window get open after few min and there Check for “Extensibility Explorer” there select “New Marketing Lead” and click on it and Check for “Adjust Property” . So click on Adjust Property then new window get opened and there check for Email and Phone . There you would have to select “”Email
and Phone fields Mandatory drop down field = “True”.
Step 10 : Click on apply -> then save and activate by going to “file” button and select save and Activate .
—-<< Now “*” sign will get appeared on UI for Email and Phone————————————————————->>—
–<< Now we would have to display message if try to create new marketing lead with Email and Phone —- >>—
Step 6:Now right Click on “MarketingLead.xbo” and select “CreateScripitFile”
Step 7 : A new window get opened there Select Root -> “Validation On save” and press ok
Step 8:
“Validation-OnSave.absl” file will get created .
Step 9: Now add the following code in absl
import ABSL;
import AP.Common.GDT;
var llead = this.LeanLeadIndicator.ToString();
var leanleadobj = LeanLead.Retrieve(this.UUID);
if (this.LeanLeadIndicator == true)
{
if (leanleadobj.IsSet())
{
if (leanleadobj.Address.TelephoneFormattedNumberDescription.IsInitial())
{
raise Mand_Fld_Phone.Create(“E”);
return false;
}
else if (leanleadobj.Address.EmailURI.IsInitial())
{
raise Mand_Fld_email.Create(“E”);
return false;
}
}
}
return true;
Save and Activate your Solution and refresh your UI screen to see changes :
Note :Now if you try to save New Marketing Lead with Email and Phone then it will display error message and not allow to save data .
I hope it will be helpful .
Thanks ,
Rishi Verma | https://blogs.sap.com/2014/01/23/how-to-create-marketing-lead-fields-mandatory-with-error-message/ | CC-MAIN-2017-22 | refinedweb | 412 | 65.52 |
Answered by:
LogonUser returns ERROR_PASSWORD_MUST_CHANGE
Hello
I use Logon user to get logon token and run some code with specified user rights (impersonate).
If account password is expired, LogonUser returns flase and GetLastError returns ERROR_PASSWORD_MUST_CHANGE.
Help me please - is it possible to change Windows user password from my code using some Windows API functions?
Thank you.
Question
Answers
All replies
Hello.
I should add some more words to make my problem clear.
My programm works in domain A. User wants make some action in domain B. So I'd wrote some code that will work impersonated as user from domain B. It looks like:
1. run programm (with rights of user from domain A)
2. type user name, password from domain B
3. logon to domain B
4. impersonate as user from domain B
5. connect to computer in domain B and run some task
6. Unimpersonate
As you could see I don't have any username and password from domain B. It only is typed by user.
And If I run NetUserChangePassword (my programm works with user rights from domain A) it will return "Access denied" because it looks like user from domain A changes password for user from domain B.
I would like to impersonate as user from domain B before changing password but couldn't logon since its password has expired :(
Help me please - is there any workaround? Please note that I wil never get administrator password from domain B.
PS If I first impersonate as user from domain B and than change password for the impersonated user with NetUserChangePassword it works fine. It works only if password hasn't been expired.
Hello, Michael
I would agree with you if I hadn't seen how expired passwords could be changed from Windows GUI:
When user turns computer on and log into domain, domain controller could say that password is expired. And Windows shows dialog that ask for a new password. Situation is the same - password expired and user doesnt't have administrative rights in the domain. But somehow user could change own expired password via Windows GUI. I mean that user is not actually logged in domain since password is expired but can change own password. And, one more - domain controller knows expired password so it can verify that password is correct.
So I think it should be possible and via API. May be only gina.dll contain such functionality or only from ginal.dll it is possible change expired Windows password, I don't now.
I'm not sure I see the problem.
Your code is calling LogonUser with a user name and password from domain B, so your code does have a user name and password from domain B. It should use the user name in the call to NetUserChangePassword, along with the password it tried as the old password. The new password, obviously, should come from a prompt you issue to the user to say "your password has expired".
Hello Alun.
As I said before there is a little problem with NetUserChangePassword when password is expired. You could refer to my detailed explanation above.
The problem is that my code is running in domain A. So when password has been expired LogonUser fails and I couldn't get token to impersonate as a user from domain B. So NetUserChangePassword will be called with login name of user from domain B old password and new one. But it will be called from code that is running from domain A :-( since impersonation has been not impossible. And for domain controller B it will be look that someone from domain A whants to change password for user from domain B. And I got security exception that has not enough rights :-( when trying to change expired password.
But I wonder how Windows could change expired password when logging in.
Here is simple code that shows the problem. This code should be run under user from domain A for user from domain B. User from domain A shouldn't have any rights in domain B. Unfortunately I could test it only with "User must change password at first logon" because it is too long to wait while password will expire. But I think in generally it is the same and I need to handle both errors as well.
#include <windows.h>
#include <lm.h>
#include <iostream>
using std::cout;
LPWSTR c2w(char *source)
{
size_t convertedChars;
int bufferSize = strlen(source) + 1;
LPWSTR result = new WCHAR[bufferSize];
mbstowcs_s(&convertedChars, result, bufferSize, source, _TRUNCATE);
return result;
}
void ChangePassword(char *domain, char *login, char *oldPassword, char *newPassword)
{
const int bufferSize = 255;
NET_API_STATUS status = NetUserChangePassword(c2w(domain), c2w(login), c2w(oldPassword), c2w(newPassword));
if (status == NERR_Success)
cout << "\r\npassword has been changed";
else
// 2245 The password does not meet the password policy requirements
cout << "\r\nerror " << status << " when changing password";
}
int _tmain(int argc, _TCHAR* argv[])
{
HANDLE token;
char *login = "dummy2";
char *oldPassword = "zzzxxxcccvvv";
char *newPassword = "qqqwwweeerrrtttyyy";
char *domain = "DEVELOPMENT";
bool result = LogonUser(c2w(login), c2w(domain), c2w(oldPassword), LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, &token);
if (result)
{
cout << "\r\nlogged in";
if (ImpersonateLoggedOnUser(token))
{
ChangePassword(domain, login, oldPassword, newPassword);
}
}
else
{
int lastError = GetLastError();
cout << "\r\nerror " << lastError;
//1331 - account disabled
//1907 - user should change password
//1326 - ERROR_LOGON_FAILURE
//1398 - ERROR_TIME_SKEW
if (lastError == 1907)
{
/* since impersonation is not possible here domain controller will not allow change password for user from user from another domain */
ChangePassword(domain, login, oldPassword, newPassword);
}
}
return 0;
}
Best regards. | https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/8ea67fc7-4d8a-4f68-8b5d-6230d7477a7d/logonuser-returns-errorpasswordmustchange?forum=windowssdk | CC-MAIN-2016-44 | refinedweb | 904 | 54.22 |
Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
You can subscribe to this list here.
Showing
1
results of 1
Transaction has the following method:
def setErrorOccurred(self, flag):
''' Invoked by the application if an exception is raised to the
application level. '''
self._errorOccurred = flag
self._servlet = None
I'm made a subtle change which is to remove the:
self._servlet = None
Which was added by Jay way back when under the cvs log msg "general
cleanup".
I need the transaction to know it's servlet, because in my current
application, I am implementing a custom exception handler to do some
additional application specific logging and the information comes from
the servlet.
An FYI in case this causes weirdness for anyone. But as far as I know,
it works fine.
-Chuck | http://sourceforge.net/p/webware/mailman/webware-devel/?viewmonth=200202&viewday=5 | CC-MAIN-2015-14 | refinedweb | 143 | 64.51 |
First note: this blog post is very much tongue in cheek. I’m not actually planning on using the idea. But it was too fun not to share.
As anyone following my activity on GitHub may be aware, I’ve been quite a lot of work on Protocol Buffers recently – in particular, a mostly-new port for proto3. I’ve recently been looking at JSON support, and thinking about how to implement “overriding”
ToString() for a few well-known types. I generate partial classes, so that gives me a hook to provide extra functionality. Indeed, I’m planning on using this to provide conversion methods for
Timestamp and
Duration, for example. However, you can’t really override anything in partial methods.
Refresher on partial methods
While partial classes were introduced in C# 2, partial methods were introduced in C# 3. The idea is that one source file (usually the generated one) can provide a partial method signature, and another source file (usually the manually-written one) can provide an implementation if it wants to. Any part of the source can call the method, and the call will be removed at compile-time if nothing provides an implementation. The fact that the method may not be there leads to some limitations:
- Partial methods are implicitly private, but you can’t specify an access modifier explicitly
- Partial methods are always
void– they can’t return any values
- Partial methods cannot have
outparameters
(Interestingly, a partial method implementation can be an async method – but with a return type of
void, which is never a nice situation to be in.)
There’s more in the spec, but the last two bullets are the important part.
So, suppose I want to override
ToString() in the generated code, but provide a mechanism for that override to be “further overridden” effectively, in the manual code for the same class? How do I get the value from an “extra override”? How do I even detect whether or not it’s there?
Side effects to the rescue!
(Now there’s a phrase you never thought you’d hear from me.)
I mentioned before that if a partial method is called but no implementation is provided, the call is removed. That includes all aspects of the call – including the evaluation of the arguments. So if evaluating the argument has a side-effect… we can spot that side effect.
Next, we have to work out how to get a value back from a method. We can’t use the return value, and we can’t use an
out parameter. There are two options here: we could either pass a wrapper (e.g. an array with a single element) and allow the “extra override” to populate the wrapper… or we can use a
ref parameter. The latter feels ever-so-slightly cleaner to me.
And so the ugly hack is born. The code generator can always generate code like this:
partial void ToStringOverride(bool ignored, ref string value); public override string ToString() { string value = null; bool overridden = false; ToStringOverride(overridden = true, ref value); return overridden ? value : "Original"; }
For any partial class where the
ToStringOverride method isn’t implemented,
overridden will still be false, so we’ll fall back to returning
"Original". (I would hope that any decent JIT would remove the
overridden and
value local variables entirely at that point.) Otherwise, we’ll return whatever the method has changed
value to.
Here’s a short but complete example:
using System; // Generated code partial class UglyHack1 { partial void ToStringOverride(bool ignored, ref string value); public override string ToString() { string value = null; bool overridden = false; ToStringOverride(overridden = true, ref value); return overridden ? value : "Original"; } } // Generated code partial class UglyHack2 { partial void ToStringOverride(bool ignored, ref string value); public override string ToString() { string value = null; bool overridden = false; ToStringOverride(overridden = true, ref value); return overridden ? value : "Original"; } } // Manual code partial class UglyHack2 { partial void ToStringOverride(bool ignored, ref string value) { value = "Different!"; } } class Test { static void Main() { var g1 = new UglyHack1(); var g2 = new UglyHack2(); Console.WriteLine(g1); Console.WriteLine(g2); } }
Horribly ugly, but it works…
Alternatives?
Obviously this isn’t really pleasant. Some alternatives:
- Derive from the generated class in order to override
ToStringagain. Doesn’t work with sealed classes, and will only work if clients create instances of the derived class.
- Introduce a new interface, and allow manual code to implement it on the partial class. The
ToStringmethod can then check
this is IMyOtherToStringor whatever, and call it appropriately. This introduces another virtual call for no great reason, and exposes the interface to the outside world, which we may not want to do.
- Don’t override
ToStringin the generated code at all. Not good if you normally want to override it.
- Introduce an abstract base class which the generated class derives from. Override
ToString()in that base class, possibly calling an abstract member which is then provided in the generated class – but allowing the manual code to override
ToString()again.
Conclusion
Ugly hacks are fun. But it’s much better to keep them where it belongs: in a blog post, not in production code.
13 thoughts on ““Sideways overriding” with partial methods”
I’d be more inclined to make the method ToStringOverride(ref bool override, ref string value) and set the bool in the method. Feels less dirty than the side effect.
But that means the “overrider” has more work to do. We don’t want to put them in control of that – we just want to detect the method presence.
LikeLiked by 1 person
Could you do something like:
Yes, if you don’t need to know whether or not the method was actually implemented… Which admittedly in .y example I don’t :)
This looks cleaner IMO:
That means the “overriding” method can’t decide it wants to return null though.
(Admittedly making ToString() return null is evil, but…)
Yes, precisely. So this approach prevents the “overriding” method from doing something evil ;)
LikeLiked by 1 person
I hope you figure something along these lines out for proto3. Currently I have to use my own json serialization and deserialization implementation for proto2 in c#. I do this because I want to send efficient binary date/time for the proto case but a text string for the json case. The substitution has to happen at the class/message level, not the field level.
I do the same for a couple other cases such as GUIDs.
I’m not anticipating making the conversion customizable – proto3 has a fixed JSON format, with some particular well-known types (such as Timestamp), but I wouldn’t want to allow arbitrary users to change the JSON sent… that wouldn’t interoperate with other proto3 JSON platforms.
The GUID case is an interesting one which I don’t think has been picked up yet – I’ll mention that internally.
If both ends were proto3, wouldn’t it be better to send the binary message? I use the JSON output to interface exclusively with a web front-end. All other messages stay binary.
I have custom JSON conversions for several standard C# type classes.
* DateTime (timezone unknown, UTC only, or don’t care because it’s a date with no time)
* DateTimeOffset (for timezone per RFC 3339)
* Guid
* TimeSpan
* Object or Variant (the .proto is a union of the types and the json is serialized as native as possible: e.g. “true” vs true and “342” vs 342). It can guess in the reverse direction as well.
I also have some custom conversions for union types specific to our system–where having having a single field in the JSON with different types matches the database use of Variant and made the web front-end easier.
I see that proto3 has a timestamp.proto with an epoc from the year 0001 and no timezone information. I prefer to use separate fields for each of year, month, day, hour, minute, second, and so-on. Each field is optional, so the specificity can be determined by what is set.
In the proto2 code I was able to switch out the JsonFormatReader and JsonFormatWriter easy enough. I never did try Rogers suggestion of AggregateInputStream (). I hope you at least leave one of those option open for proto3. Idealy allow what I call a list of IJsonConverter’s be injected or configured on the reader/writer to and the converters can be polled if there is a custom conversion. They each implement this:
If you are open to a pull request, I can put one together.
Thanks.
Yes, if both sides end up being proto3 then binary is preferrable – although there are probably cases where JSON would be used. (In particular, imagine a storage layer in between which insists on JSON…) But my point is that I’d rather not end up with people having their own “flavours” of proto3 JSON… it sounds like a road to killing interoperability. I’ll talk with the team about JSON customization, but I don’t expect it to be there from the first release…
Another option could be something like TypeConverter, delegate the string representation to another type, then associate that type on the partial class via an attribute? If the attribute isn’t present use the default implementation, otherwise get the type from the attribute and call the appropriate method for the “overridden” implementation.
Maybe another option is making ToStringOverride a property whose type is a delegate (in this case, Func). If the property is null use the default implementation, otherwise call the delegate for the “overridden” implementation? | https://codeblog.jonskeet.uk/2015/07/27/sideways-overriding-with-partial-methods/ | CC-MAIN-2022-33 | refinedweb | 1,590 | 61.97 |
Needing to reload Pythonista to get pytest to update code.
I'm trying the get pytest working and I keep getting a no module named py error. I'm guessing there is a py.test but I can't seem to find it in the package.
Scratch that, needed the py module.
I've been playing around with pytest and it's great. However I have to reload pythonista whenever I make a change to the test or my module. I've tried reloading pytest, my test module and my module without any luck. Any ideas?
@briarfox, Ole said that in the new update (1.5), user-created scripts will be automatically reloaded. I think it will solve your problem :)
@ShadowSlayer Just updated and kept the modules out of site-packages (to enable reloading) and I still need to reload pythonista for pytest to register changes to the code. I'd really like to start using pytest but it gets tiring having to remember to reload pythonista.
Have you tried:
import my_module reload(my_module) | https://forum.omz-software.com/topic/780/needing-to-reload-pythonista-to-get-pytest-to-update-code/5 | CC-MAIN-2022-33 | refinedweb | 174 | 75.71 |
Hello and welcome back to the channel. In this video you will learn how to create custom hooks on the most useful example. We will create a useFetch hook to fetch data from any API. are custom hooks? It's just a javascript function which we start with the word use and it can call other hooks inside. Previously I said that we can use hooks only inside React components. But custom hooks is the second place where we can call hooks.
Let's create a hooks folder and our useFetch hook inside.
src/hooks/useFetch.js
Now let's just create a function
const useFetch = () => { const doSomething = () => {}; return ["somedata", doSomething]; }; export default useFetch;
So here is our first custom hook. It's just a function and we returned whatever we want. But here are 2 important things. First of all we name all hooks with use prefix. It is highly recommended because eslint rules can show us warning only when we put this prefix there. The second important thing is that we returned here an array with 2 argument: first is some data and second is a function. We are doing this to maintain the same response that we are getting normally from react hooks.
Now let's plan what we want to get back from our hook. Here is how I want to use it.
const [{response, isLoading, error}, doFetch] = useFetch('')
So we are using useFetch as a normal react hook as you can see we are getting back an array with 2 parameters: first is an object with data and a doFetch function. We also passed a url that we want to fetch as an argument to useFetch. Now we can call doFetch function from any place of our compoonent and it will trigger from of this specific url. In the first argument we are getting response, isLoading and errors. This are 3 things that are interesting for us from the request. So response is null by default and when we get the result back we will get data there. isLoading is a boolean property so we can know that we are doing the request and show loader in our UI. And error is null by default and if we get an error it should be there.
So that's a plan. Now let's start to implement it.
import { useState } from "react"; const useFetch = (url) => { const [response, setResponse] = useState(null); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(null); const doFetch = () => {}; return [{ response, error, isLoading }, doFetch]; }; export default useFetch;
So here we created 3 states for response, isLoading and error. If you didn't watch my video about useState hook then pause this video and go watch that one first. I will link it down in the description.
We also created a doFetch function and returned everything in format that we want.
Now let's try to use our empty custom hooks.
const [{ response, error, isLoading }, doFetch] = useFetch( "" );
As you can see in browser we already get all our states from our hooks.
The next question is how our doFetch function will look like and what we will pass inside. So first of all about usage. I see 2 usages here: 1 when we do something, like "User filled the form and clicked on register button". In this case we want to just call doFetch function to start the API call. The second usecase is when we want to fetch some data on initialize of the component. In this case we can call doFetch inside the effect with empty brackets as a dependency. If you didn't watch my useEffect video go watch it first.
useEffect(() => { doFetch() }, [])
Now the question is what we want to pass inside doFetch. I prefer to use axios for fetching data. This is actually the most popular library for making API requests. This is why I want to pass inside doFetch the same stuff that I pass as options inside axios. So it looks like this.
useEffect(() => { doFetch({ method: 'post', data: { user: {} } }) }, [])
So we are passing a method and some data if needed. Obviously by default for get request we don't want to pass anything.
So with this ideas lets install axios library and try to implement such logic.
npm install axios
Now here is a tricky part because fetching data is a side effect and we want to write it inside useEffect.
const [options, setOptions] = useState({}); const doFetch = (options = {}) => { setOptions(options); setIsLoading(true); };
So first of all we set options in doFetch as an empty object. So now if we don't pass anything it won't break. Next we are setting options to a new state property. Why? Because we want to access them later inside useEffect and we can do this only with state. Also we are setting isLoading to true because we are starting the process of loading data.
useEffect(() => { const fetchData = async () => { try { if (!isLoading) { return; } console.log("real fetching Data", url, isLoading); const res = await axios(url, options); setResponse(res.data); } catch (err) { setError(err.response.data); } setIsLoading(false); }; fetchData(); }, [isLoading, url, options]);
As you can see we wrote in useEffect that we react on isLoading property to start our call. Now inside we do a axios request and wrap it inside try catch because we are using await. If we get a response we set our response state if and error then error. Also it's worth mentioning that you can't pass async function inside useEffect. This is why we need to create additional function inside and trigger it afterwards.
Also we are adding url and options to the array of dependencies just because we should not lie to React and we need to list all properties that we are using inside useEffect in the dependencies array.
If we look now in browser we get an error data of undefined because we have a network error
We can fix that by changing our error handler.
const data = err.response ? err.response.data : "Server error"; setError(data);
As you can see now our code is working and we are getting back an error.
Actually our code is almost ready but to test a real request we need to setup an API. I always recommend to use json-server as a simple fake server.
npm i -g json-server
Now we need to create a db.json file with some data inside.
{ "posts": [ { "id": "1", "title": "Use state hooks" }, { "id": "2", "title": "Use effect hooks" } ] }
Now we can start our fake API
json-server --watch db.json --port=3004
As you can see in localhost:3004/posts we are getting a list of posts back. Now if we reload an application we are getting back our correct data.
Our custom hook is almost ready but we get I problem. As you can see we have a warning that we need to add doFetch as a dependency to useEffect. It's a valid point because a function is also a variable so it should be also listed in the dependencies
But if we do it we will get an infinite loop. Because with every rerender our doFetch function is a new function. This is why useEffect will be triggered after every render. To avoid this we can wrap doFetch in useCallback hook. Again if you didn't watch my useCallback video pause here and go check that first.
const doFetch = useCallback((options = {}) => { setOptions(options); setIsLoading(true); }, []);
Here we wrapped doFetch function in useCallback and this will memoize it forever as we passed an empty array as a dependency list. As you can see now we don't get an infinite loop because React uses previously created memorized version of a function.
So we successfully created quite big and complete custom hook and now we can use it everywhere in any application. I used this hook in quite big projects already so it's fully real.
If "React hooks for beginners" is too easy for you I have a full hooks course which is going 8 hours where we are creating real application from scratch. I will link it down in the description below. | https://monsterlessons-academy.com/posts/making-a-custom-hook-use-fetch-hook-in-react | CC-MAIN-2022-40 | refinedweb | 1,359 | 73.17 |
Consider by many ways to select a representative, a simple one is to select with the biggest index.
- Check if 2 persons are in the same group ? If representatives of two individuals are same, then they’ll become friends..
Find : Can be implemented by recursively traversing the parent array until we hit a node who is parent of itself.
// Finds the representative of the set that // i is an element of public public the result tree’s // rank by 1 Rank[jrep]++; } }
// A Java program to implement Disjoint Set Data // Structure. import java.io.*; import java.util.*; class DisjointUnionSets { int[] rank, parent; int n; // Constructor public DisjointUnionSets(int n) { rank = new int[n]; parent = new int[n]; this.n = n; makeSet(); } // Creates n sets with single item in each void makeSet() { for (int i=0; i<n; i++) { // Initially, all elements are in // their own set. parent[i] = i; } } // Returns representative of x's set int find(int x) { // Finds the representative of the set // that x is an element of if (parent[x]!=x) { // if x is not the parent of itself // Then x is not the representative of // his set, parent[x] = find(parent[x]); // so we recursively call Find on its parent // and move i's node directly under the // representative of this set } return parent[x]; } // Unites the set that includes x and the set // that includes x void union(int x, int y) { // Find representatives of two sets int xRoot = find(x), yRoot = find(y); // Elements are in the same set, no need // to unite anything. if (xRoot == yRoot) return; // If x's rank is less than y's rank if (rank[xRoot] < rank[yRoot]) // Then move x under y so that depth // of tree remains less parent[xRoot] = yRoot; // Else if y's rank is less than x's rank else if (rank[yRoot] < rank[xRoot]) // Then move y under x so that depth of // tree remains less parent[yRoot] = xRoot; else // if ranks are the same { // Then move y under x (doesn't matter // which one goes where) parent[yRoot] = xRoot; // And increment the the result tree's // rank by 1 rank[xRoot] = rank[xRoot] + 1; } } } // Driver code public class Main { public static void main(String[] args) { // Let there be 5 persons with ids as // 0, 1, 2, 3 and 4 int n = 5; DisjointUnionSets dus = new DisjointUnionSets(n); // 0 is a friend of 2 dus.union(0, 2); // 4 is a friend of 2 dus.union(4, 2); // 3 is a friend of 1 dus.union(3, 1); // Check if 4 is a friend of 0 if (dus.find(4) == dus.find(0)) System.out.println("Yes"); else System.out.println("No"); // Check if 1 is a friend of 0 if (dus.find(1) == dus.find(0)) System.out.println("Yes"); else System.out.println("No"); } }
Output:
Yes No | https://www.geeksforgeeks.org/disjoint-set-data-structures-java-implementation/ | CC-MAIN-2018-09 | refinedweb | 477 | 55.47 |
Results 1 to 4 of 4
- Join Date
- Jul 2013
- 2
- Thanks
- 1
- Thanked 0 Times in 0 Posts
Beginner Ruby: How to actually start
Ok !
- Join Date
- Sep 2002
- Location
- Saskatoon, Saskatchewan
- 16,994
- Thanks
- 4
- Thanked 2,662 Times in 2,631 Posts
Command line execute
You can use a shebang as well, and execute the ruby script. Assuming /usr/bin/env contains the ruby:
PHP Code:
#!/usr/bin/env ruby
def PrintMaName(name)
puts "Ruby sez: hello #{name}"
end
PrintMaName("Fou-Lu")
I'll be starting to use ruby more often as well; just gotta get beyond the re-learn curve.PHP Code:
header('HTTP/1.1 420 Enhance Your Calm');
- Join Date
- Jul 2013
- 2
- Thanks
- 1
- Thanked 0 Times in 0 Posts
Not sure about how to do what you're saying.
You might have to walk me through the steps... is the usr/bin etc. in the text doc. or is it the directory for terminal?
- Join Date
- Sep 2013
- 1
- Thanks
- 0
- Thanked 0 Times in 0 Posts
You can start on
or you could read this free book online
or maybe this guide (which is pretty fun to read)
Last edited by VIPStephan; 09-02-2013 at 04:20 PM. Reason: Removed fake signature
AdSlot6 | http://www.codingforums.com/ruby-and-ruby-on-rails/298861-beginner-ruby-how-actually-start.html?s=9b100d645dc1665c70f6c60e4365edb1 | CC-MAIN-2015-40 | refinedweb | 213 | 80.62 |
JUnit4, JUnit5, and Spock: A Comparison
JUnit4, JUnit5, and Spock: A Comparison
This summary of a JUG meeting on unit testing compares JUnit 4, JUnit 5, and the Spock framework to see what features they offer.
Join the DZone community and get the full member experience.Join For Free
Recently, I gave a talk in my local Java User Group about unit testing. Some of the content of the talk was about some popular libraries you can use in your Java project. I’ve reviewed JUnit4, JUnit5, and the Spock framework. Many of the attendees were quite surprised with the differences. In this post, I will summarize asserts, parametrized tests, and mocking.
I always like to demonstrate the concepts with examples and live coding, so I chose a simple algorithm: a Fibonacci number calculator. If you don’t know it, it’s just to generate numbers that are the sum of the two previous ones in the series:
1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377.
I used the typical (and very badly performing) implementation:
private static int fibonacci(int n) { if (n <= 1) return n; else return fibonacci(n-1) + fibonacci(n-2); }
JUnit4
I started by explaining JUnit4 because it’s the most popular library and the base for many others. I started explaining
assertTrue and then more advances usages, including
assertEquals.
@Test public void improvedFibonacciTestSimple() { FibonacciWithJUnit4 f = new FibonacciWithJUnit4(); assertEquals(f.fibonacci(4), 3); }
If it’s false, it would give you an error like:
java.lang.AssertionError: Expected :3 Actual :2
Not very spectacular, but quite useful.
The next thing was to show how to write a parameterized test a nice, very useful feature for test algorithms. In JUnit4, that is quite tricky. You need to create a Collection with the annotation
@Parameters.
@Parameters public static Collection < Object[] > data() { return Arrays.asList(new Object[][] { { 0, 0 }, { 1, 1 }, { 2, 1 }, { 3, 2 }, { 4, 3 }, { 5, 5 }, { 6, 8 } }); }
Then we create some local variables and a constructor:
private int fInput; private int fExpected; public ParametrizedFibonacciJUnit4(int input, int expected) { fInput = input; fExpected = expected; }
And finally, we can use
assertEquals:
@Test public void test() { FibonacciWithJUnit4 f = new FibonacciWithJUnit4(); assertEquals(fExpected, f.fibonacci(fInput)); }
It’s quite verbose, and if the test fails, you would get a message that doesn’t clearly indicate the order or the parameters used (but your IDE will probably help on that):
java.lang.AssertionError: Expected :0 Actual :1
I didn’t explain mocking here because an external library like Mockito is usually required when you want to use mocking with JUnit4. Mockito is great, but I didn’t have enough time to explain it.
JUnit5
JUnit5 was considered stable in September 2017, and it should be your choice over JUnit4 for several reasons. It has better support for Java 8 and lambdas, it’s compatible with JUnit4 (you can have both, which is great to migrate in a progressive way), and it provides new runners and better integrations.
I repeated the same process. First, show an
assertEquals:
@Test public void bestFibonacciTestSimple() { FibonacciWithJUnit5 f = new FibonacciWithJUnit5(); Assertions.assertEquals(f.fibonacci(4), 3); }
There are important advances in other
asserts, for instance the timeout, but for
assertEqual with integers, it’s practically the same. Also, the message is similar if there is an error:
org.opentest4j.AssertionFailedError: Expected :3 Actual :2
We can find important changes in parametrized tests. First, we need to use the
@ParametrizedTest annotation, and we can specify a name using
{ and
} to indicate important parameters like
index with
arguments.
@ParameterizedTest(name = "run #{index} with [{arguments}]")
Now we can define our test. We start defining the entries to test function with the annotation
@CsvSource. Each item will replace the parameters in the test function, in this case,
input and
expected.
@CsvSource({"1, 1", "4, 3"}) public void test2(int input , int expected) { FibonacciWithJUnit5 f = new FibonacciWithJUnit5(); Assertions.assertEquals(f.fibonacci(input), expected); }
This is a lot better than the JUnit4 implementation. Also, if there is a failure in the test, we obtain a better message indicating the difference, the index causing the failure, and the used parameters.
Finally, it’s the same for mocking as JUnit4: You normally use an external library, so I didn’t explain it.
Spock
The last topic was the Spock framework. It’s based on Apache Groovy. It allows you to write less code in a clearer way. It’s very powerful. Some years ago, we started to use it for "non-critical" development: tests, dependency management, Continuous Integration, load testing, and in any place where we needed some configuration file avoiding XML, JSON, or any format like that. We continue to develop the core of our software in Java, and it isn’t a problem because both languages play very well together. If you know Java, you know Groovy… so we have the best of both worlds.
Writing a test in Spock is quite different. It would be like this:
def "Simple test"() { setup: BadFibonacci f = new BadFibonacci() expect: f.fibonacci(1) == 1 assert f.fibonacci(4) == 3 }
Basically, we can use
def where we don’t care about the type. The name of the function can be defined between quotation marks, which allows us to use better naming for our tests. We have some special words such as
setup,
when,
expect,
and, etc. to define our tests in a more descriptive and structured way. And we have a power assert, which is part of the language itself:
Condition not satisfied: f.fibonacci(4) == 2 | | | | 3 false BadFibonacci@23c30a20 Expected :2 Actual :3
It provides all the information: the returned value (actual), the expected value, the function, the parameter, etc. Using
assert in Groovy is really handy.
Now for the parametrized tests. One would look something like this:
def "parametrized test"() { setup: BadFibonacci f = new BadFibonacci() expect: f.fibonacci(index) == fibonacciNumber where: index | fibonacciNumber 1 | 1 2 | 1 3 | 2 }
After I showed this, I heard some 'oooh's in the audience. The magic of this code is that you don’t need to explain it! There is a table in the
where: section, and the values in
expect: are automagically replace it in each iteration. If there is a failure, the message is crystal clear:
Condition not satisfied: f.fibonacci(index) == fibonacciNumber | | | | | | 2 3 | 4 | false BadFibonacci@437da279 Expected :4 Actual :2
Then I very quickly introduced mocks and stubs. A mock is an object you create in your test to avoid using a real object. For example, you don’t want to do real web requests or print a page in your tests, so you can use a mock from an interface or another object.
Subscriber subscriber = Mock() def "mock example"() { when: publisher.send("hello") then: 1 * subscriber.receive("hello")
Basically, you create the
subscriber interface as a mock, then you can invoke the methods. The
1 * is another nice feature of Spock — it specifies how many messages you should receive. Cool, right?
On some occasions, you need to define what returns the methods of your mocks. For that, you can create a stub.
def "stub example"() { setup: subscriber.receive(_) >> "ok" when: publisher.send("message1") then: subscriber.receive("message1") == 'ok' }
In this case, with the
>> notation, we are defining that the method
receive should return
ok independently of the parameter (
_ means any value). The test passes without any problem.
Conclusions
I don’t like to recommend one library or another: All of them have their use cases. It’s pretty clear we have great options in Java, and I just gave some examples. Now it’s your turn to decide which is better for you. The only thing I can say is: Write tests and master your library of choice. It will make you a better developer!
If you want to take a deeper look at the examples, you will find them in this GitHub repository. Enjoy!
Opinions expressed by DZone contributors are their own.
{{ parent.title || parent.header.title}}
{{ parent.tldr }}
{{ parent.linkDescription }}{{ parent.urlSource.name }} | https://dzone.com/articles/junit4-junit5-and-spock-framework-comparison | CC-MAIN-2019-51 | refinedweb | 1,342 | 55.74 |
Inside this edition...
Credit Unions
Ingham County
Community News
TM
The benefits of Your very own newspaper serving Mason, Leslie and Onondaga being a member See pgs. 17-24
Vol. 145 - No. 4
City blight begone By CHRISTIE BLECK cbleck@lsj.com
State, federal money used to upgrade area homes
LJ-0100046156
MASON — Ingham County Housing Commission Executive Director Bruce Johnston said “curb appeal” is one feature that two rehabilitated homes bring to the city. Homes at 732 S. Columbia and 120 S. Barnes were shown to the public at an Oct. 12 open house. The homes were the first two high-quality, energy-efficient houses completed with grant money from the Michigan State Housing Development Authority (MSHDA) funding using Neighborhood Stabilization Program (NSP) funding. The NSP provides targeted assistance to local and state governments to acquire and redevelop foreclosed properties that might otherwise be blight in their communities. Rehabilitation costs for both Columbia and Barnes properties, Johnston said, were about $200,000.
© 2010 Lansing Community Newspapers
Road patrols a ballot focus By KEN PALMER kpalmer@lsj.com
Issue to be on Nov. 2 ballot
Photos by Christie Bleck
A white enclosed porch (above) adds to the appeal of the newly renovated home at 120 S. Barnes. The city also unveiled another energy-efficient home at 732 W. Columbia. The homes were improved through federal Neighborhood Stabilization Program funding. Electrical, plumbing and other improvements such as siding and roofing were made, plus both houses are equipped with 5-Star energyefficient appliances, according to Johnston. “There really isn’t anything left to do,” he said.
FALL FAMILY FUN NIGHT
“This house is real fine for a family,” City Administrator Marty Colburn said of the Columbia home. That home comes with what Colburn and Johnston noted was a “mother-in-law or grandmother suite” because a bedroom, a handi-
capped-accessible bathroom and kitchen adjoin each other. Mark Thompson, building commissioner of the Ingham County Housing Commission, was on hand See
Houses/page 3
A night for the entire family to have fun at the Y! Swimming, water activities, costume contest, board games and more! Bring a swimsuit and towel. Cost $5 per person. Children 2 and under are free. Children must be accompanied by a parent. Pre-registration required!
SATURDAY, OCTOBER 23 5–8 p.m.
October 17, 2010
INGHAM COUNTY — For years, officials in rural areas of the county fought to preserve their only source of regular police protection — the road patrol division of the Ingham County Sheriff’s Office. With the fight all but lost, they decided to form their own police collective in an unprecedented show of regional cooperation. “The county has cut us off, so this is the best option we thought we could put forward,” said Williamstown Township Supervisor Mickey Martin. “We have these meetings, and every one of the 13 supervisors will show up. It’s been phenomenal.” How it all works will be determined in the Nov. 2 elections, when voters in the 13 rural townships decide if they are willing to pay for police protection. Voters in all but two of the townships will be asked if they want to ap-
The issue Voters in 13 rural townships will decide next month if they want to pay for police protection through special assessments. The townships are Alaiedon, Aurelius, Bunker Hill, Ingham, Leroy, Leslie, Locke, Onondaga, Stockbridge, Vevay, Wheatfield, White Oak and Williamstown.
prove special assessments that would cost homeowners a flat rate of up to $150 a year and business owners up to $250 a year. In Alaiedon and Wheatfield townships, the assessments would be based on a millage rate of 1 and 1.56 mills, respectively. If all of them pass, the assessments would generate about $2 million a year for police services. The townships would form a police board to administer the money. “The plan is to have 18 officers available,” said See Patrols/page 8
Oak Park YMCA 900 Long Blvd., Lansing Just south of I-96 off Cedar St. 517.827.9700
How to reach us: Advertising: 517-377-1141 Circulation: 866-226-1812 News: 517-541-2504 Classifieds: 877-475-SELL or 877-391-SELL
Ingham County
Ingham County Community News
News in brief
2
Community News Kean’s to host ‘Witches’ 239 S. Cochran Ave., Charlotte, MI, 48813 Call us toll free: 800/543-9913
Your main contacts:
event on Oct. 21 Kean’s Store Company, 406 S. Jefferson St., Mason, will host a “Witches Night Out” from 7-9 p.m. Thursday, Oct. 21. Among the planned attractions are prizes for costumes and professional psychic readings for $20 each (call to reserve a spot at 517-676-5144).
CAIR Autumn Pie Fest to be held Oct. 23
Estate planning seminar to be held Christie Bleck
Scott Yoshonis
Editor 800/543-9913, ext. 504 cbleck@lsj.com
Sports Writer syoshonis@lsj.com
Beckie Swan Sales Specialist 517/377-1014 bswan@lsj.com
Account Relationship Specialist: Sarah Archer....................... 517/377-1242 Advertising Director: Stacia King ......................... 517/377-1120 Retail Territory Manager: Staci Holmes ...................... 517/377-1196 Circulation Operations Manager: Linda Argue ........................ 517/377-1215 Carrie Savage........................Legals Clerk 517/377-1246 ........ legals@gannett.com Cheryl Richardson ......... Assistant Human Resources Director Val Kniffen... Assistant Pre-Press Manager Kurt Madden......................... Group Editor
Things to know: LETTERS: Letters to the editor should be no more than 400 words in length, signed by the author and include a daytime phone number for
Classified: SourceAds.com 877 / 391-SELL or 877 / 475-SELL fax: 517 / 482-5476
Circulation Customer Service October 17, 2010
every participant, chip timing and fabulous prizes. Register by phone at (517) 371-5437 or online at.
866 / 226-1812
The Family Life Communications will be presenting an estate planning seminar at 7 p.m. Tuesday, Oct. 19 at the Millville United Methodist Church, 1932 N. M-52. Speaker will be Lou Crenshaw, attorney. This seminar is free; RSVP to Debi at 1-800-776-1070 ext. 7719. The church is located five miles north of Stockbridge or nine miles south of I-96 on M-52.
Van Atta’s to hold Harvest Party Oct. 23 Van Atta’s Greenhouse & Flower Shop will hold a Harvest Party from noon-5 p.m. Saturday, Oct. 23. Free cider and doughnuts will be served. There will be a kids and pets costume parade at 1 p.m. with prizes awarded for the best costumes. In honor of Van Atta’s 30th anniversary this year, a 30 percent discount sale on all merchandise will be offered on this day only. Bim Willow will hold a popular rustic furniture-making class. See or call (517) 339-1142 for more information. Van Atta’s is located 1 1/2 mile east of Marsh Road on Old M-78 in Haslett.
Van Atta’s announces October free seminars Van Atta’s Greenhouse & Flower Shop offers the following free seminars at 6 p.m. Each seminar will last from 30-45 minutes and is on a firstcome basis. There is no registration for this program. • Oct. 20: Making Autumn Wall Decorations, Dennis Banning (staff) • Oct. 27: Bow Making, Brittany Demankowski (staff) For more information, call (517) 339-1142, or visit. Van Atta’s is located on Old M-78 in Haslett, 1 1/2 mile east of Marsh Road.
Courtesy photo
Camino helps St. Vincent A check for $1,604 is given to Elyse Lee of St. Vincent Catholic Charities by The Camino of St. James 8k Run/5k Walk committee. The Camino was held in Mason on Aug. 15 and involved 204 participants and many community volunteers. Here Steven Crippen, Race Committee chairperson, presents a check to Lee, mission sustainability specialist of St. Vincent Catholic Charities. Committee members also pictured are, from left: Christopher Mumby, Cynthia Ingle, Valerie Ingle, Deb LaFleur, Dodi Smith and Kim Ferguson.
The Annual Capital Area Interfaith Respite Program (CAIR) Autumn Pie Fest will be from 5-8 p.m. Saturday, Oct. 23 at 1893 N. Every Road, Mason. Join in for food, music by the Blue County Line Band, hayrides, silent auction, a bonfire and a homemade pie contest. Tickets are $10 per person, children under 12 are free. For more information, call CAIR at (517) 887-6116.
Family Fun Day set for Oct. 24 at Tannenbaum Farms
A Family Fun Day with 67th District candidate Jeff Oesterle will take place from 2-5 p.m. Sunday, Oct. 24 at Tannenbaum Farms, 2515 Sandhill Road, Mason, just west of Okemos Road. Families are invited for a hayride, doughnuts, roasting hot dogs over a fire, seeing an oldfashioned cider press and taking ing rental property within the city at photographs among the fall color. Trick or treat at an informal meeting at City Hall, 201 For details, call (517) 449-9087 or Green Acres on Oct. 30 W. Ash St., at 6:30 p.m. Wednesday, visit Families (children) are invited to Oct. 20 in the training room on the come dressed in their Halloween cos- second floor. Light refreshments will Fundraiser set for Oct. 23 tumes and trick or treat at Green be provided. Acres of Mason from 2-4 p.m. Saturat Leslie American Legion VFW Auxiliary to host day, Oct. 30. A benefit spaghetti dinner will take breakfast on Oct. 17 place from 5-11 p.m. Saturday, Oct. Enhance Fitness The Mason VFW 7309 and the La- 23, at the American Legion in Leslie, class startson Oct. 25 dies Auxiliary is hosting a country 422 Woodworth St. Costs adult. $5; Enhance Fitness is designed for breakfast from 8:30 a.m.-12:30 p.m. children 6-14; and children under 5, seniors from fit to frail, but is also for Sunday, Oct. 17 at 1243 Hull Road, Ma- free. The event will help Christopher individuals new to exercise and in- son. The menu will include scrambled dividuals that face multiple challeng- eggs, link sausage, biscuits, sausage Brown, 28, a diabetic who has cryses with movement. Class begins Oct. gravy, potatoes, French toast, pan- talization of the blood. For details, 25 and continues through Dec. 10, cakes, applesauce, coffee and juice. call Alice Latter at (517) 589-5183. DoMondays, Wednesdays and Fridays, Cost is $7 for adults, $6 for seniors, $5 nation maybe made at the Leslie In9:30-10:30 a.m. at Jefferson Street for children 6-12 and free for children dependent Bank (account under Rev. James Brown). Square Apartments, 500 S. Jefferson 5 and under. St., Mason. Cost: $42 for seven weeks Flu shot clinic to of classes. Scholarships are available. Halloween 5K for Contact Anita Frese at (517) 827-9697 JA to be held on Oct. 23 be held on Oct. 22 for more information or to register. The Halloween 5K for Junior The Medical Care Facility of InAchievement of Mid Michigan will be gham County, 3860 Dobie Road, Rental registration held at Hawk Island County Park on Okemos, is hosting a flu shot clinic meeting to be held Oct. 23. from 10 a.m.-1 p.m. Friday, Oct. 22. No The city of Mason is currently conSpecial event activities include: appointment necessary. Cost: flu shot sidering a Rental Registration Pro- Kids “Boo Run,” local mascots, a Hal- $28 and pneumonia shot $50. Many gram. Before the city moves forward loween DJ, witch laugh contests, insurances are accepted, including with creating an ordinance, it would costume contests, slime-making, af- Medicare Part B. Call (810) 496-8755. like to hear input from landlords own- ter race refreshments, T-shirts for CommunityNews.com
PAGEby PAGE editions voiceYOUR OPINION ONLINE extras breakingNEWS
SUBMIT NEWS
onlineCALENDAR
THINGSTODO
lsj.com/events Browse online or Add your own event with the online form
3
1.50
%
Photo by Christie Bleck
APY
FLAGSTAR S.M.A.R.T. SAVINGS ACCOUNT**
Photo by Christie Bleck
This is the kitchen of the This house on West Columbia is a recently Barnes home. rehabilitated home in Mason.
Ingham County Community News
WE TAKE CARE OF YOUR MONEY.
AND WE TAKE CARE OF YOU.
Houses: Two rehabilitated Continued from page 1
been done,” Thompson said. That work includes a new kitchen, a 95-percent high-efficiency gas furnace, maat the Barnes house to talk about that struc- ple cabinets and an 8-by-10 shed in the ture to the public. yard. As with the Columbia house, a lot of Johnston said that anyone interested in work has been performed. purchasing either home should call him at “It’d be easier to tell you what hasn’t (517) 676-7227.
901 S. Cedar Street Suite 100 Mason, MI 48854
J.D. Power and Associates has ranked us: “Highest Customer Satisfaction with Retail Banking in the North Central Region”*
517-676-0788
sowerschiropracticcenter.com
October is Spinal Care Month! Did you Know? The proper function of the nervous system and the correct alignment of the spine are paramount to the body's ability to grow and develop appropriately and efficiently. Chiropractic helps to reduce the need for medications and surgeries.
And get $100 when you open a Flagstar S.M.A.R.T. checking account.†
At Sowers Chiropractic Center, we adjust babies to elderly. Everyone can benefit from chiropractic.
flagstar.com (800) 642-0039 Member FDIC *Flagstar Bank received the highest numerical score among retail banks in the North Central region in the proprietary SM
.
LJ-0100038204
Percentage Yield (APY) is accurate as of 10/13/2010 and is guaranteed for four months after account opening. Available only on new Smart Savings accounts opened in conjunction with this offer. Funds may not currently be on deposit with
Dr. Lynne E. Sowers Palmer Graduate Doctor of Chiropractic
Flagstar Bank. Customer must maintain a primary checking relationship at Flagstar Bank. Conditions and restrictions apply.
LJ-0100046783
Dr. Daniel L. Sowers Palmer Graduate Doctor of Chiropractic
It's time to take care of your spine! Call 676-0788
J.D. Power and Associates 2010 Retail Banking Satisfaction Study
Ingham County
128 Actor Kilmer 129 Compass pt. 131 Author Umberto 133 Helium or hydrogen
Sudoku
Puzzle Page
109 __ Island 110 Society miss 112 Sitka’s st. 113 Escapade 114 Perfect 115 Abrasive substance
October 17, 2010
THIS WEEKS CROSSWORD ANSWERS
To advertise in this space call Becky Swan 517-1014 or Sarah Archer 517-377-1242
Baker College The following students have been named to the Baker College of Owosso Dean’s List: Jesi Hammond-Ayles, Joey Rogers and Kristina Rogers, all of Mason. These are part-time students who have earned a 3.5 grade point average or higher during summer quarter 2010.
Bates James Bates of Mason has been named to the Baker College of Owosso Dean’s List for summer quarter 2010. To be named to the full-time Dean’s List, students must earn a 3.5 grade point average or higher.
Courtesy photo
Rotary announces new board members The Rotary Club of Mason announces new board members for the 2010-2011 year. The Mason Rotary Club hosts local projects such as the duck races each spring to raise funds for the Mason High School Scholarship Fund and the Annual Kids Day at the Fair. For the Polio Plus Project, over $2,000 as been raised this year. New officers are: President Jamie McAloon Lampman, President-elect Jared Browers, past President Mark Howe, Secretary Paul Pratt and Treasurer Shannon Lounsberry. New committee chair persons were also assigned for the 2010-2011 year. Ingrid Nova will chair the Youth Exchange and RYLA programs, Joe Carnevale heads membership, Jenny Bond chairs the Rotary International Foundation, Sergeant at Arms is Ed Threadgould and the Remembrance Co-Chairs are Ed Clarke and Rollin Dart. The Mason Rotary Club meets Thursdays from 12:10-1:30 p.m., at the Bestsellers (upstairs) at 360 S. Jefferson. Guests are welcome; guest fee is $10 and includes lunch. Contact Jamie McAloon Lampman at (517) 676-8376 for more information. Pictured are, from left: Browers, Howe, Lounsberry, Pratt and McAloon Lampman.” @
Notice of a Finding of No Significant Impact The USDA, Rural Development Utilities Program (RDUP) has received an application for financial assistant from the City of Leslie, Ingham County, Michigan. The proposal consists of: Improvements to the Leslie Waste Water Treatment Plant including the addition of secondary effluent tertiary filtration, ultraviolet disinfection, fiberglass weir covers, transient power surge suppressor, replacement of raw sewage pumps, oxidation ditch rotor replacements, and pump station. The project will include a small amount of sewer main replacement and infiltration and inflow repairs on the collection system.
5 Ingham County Community News
College news
As required by the National Environmental Policy Act, RDUP has assessed the potential environmental effects and consequences of the proposed project and has determined that the proposal will not have a significant effect on the human environment and for which an Environment Impact Statement will not be prepared. The basis of this determination is documented in the environmental assessment, and that during the 30-day public comment period, no concerns were raised. Copies of the Environmental Assessment are available for review at City of Leslie, 106 E. Bellevue, Leslie, MI 49251 517-589-8236 USDA RD Area Office, 525 Okemos, Suite B, Mason, MI 48854 517-676-1808 Infrastructure Alternatives, 7888 Chilsdale Ave., Rockford, MI 49431 616-866-1600 For further information, contact BJ Haire USDA/RDUP 517-242-5844. USDA – Rural Development is an Equal Opportunity Lender, Provider, and Employer. Complaints of discrimination should be sent to USDA, Director, Office of Civil Rights, Washington, D.C. 20250-9410, or call (800) 759-3272 (voice) or (202) 720-6382 (TDD). A general location map of the proposal is shown below.
Endorsed By:
LJ-0100046911
Accepts No PAC Money facebook.com/BillieJoOberry4Judge
Paid for by Billie Jo O’Berry for Circuit Judge: Kathleen Hengesbach, Treasurer, 1195 Clayton Ct – Mason 48854
October 17, 2010 • Mi JT Council Teamsters Drive 43
Ingham County Community News
6
School officers host candidates MASON — The Ingham School Officers Association held a special breakfast meeting for state House of Representatives and Senate candidates on Oct. 6 on the Ingham Intermediate School District’s campus to talk about local issues. The association is composed of school board members and superintendents from Dansville, East Lansing, Haslett, Holt, Ingham Intermediate, Lansing, Leslie, Mason, Okemos, Stockbridge, Waverly, Webberville and Williamston. The following candidates were on hand to respond to questions from school leaders. State Senate candidates • 22nd Senate District: Chuck Fellows (D), Joe Hune (R) • 23rd Senate District: Gretchen Whitmer (D) State House of Representative candidates • 67th House District: Barb Byrum (D), Jeff Oesterle (R) • 68th House District: Joan Bauer (D) • 69th House District: Mark Meadows (D) • 71st House District: Theresa Abed (D) As a service to the public, the association posed a series of questions to these candidates about their views related to K-12 education. Their responses have been posted at. — From the Ingham Intermediate School District
Courtesy photo
Representative Joan Bauer (center); Debra Jones, superintendent, Waverly Community Schools; and Stan Kogut, superintendent of Ingham Intermediate School District discuss issues important to public education at the legislative candidates forum.
Free refills on all sizes of pop and popcorn! Tickets and showtimes available at both
Located at US 127 @ Lake Lansing Road
Why choose Lansing Ophthalmology?
Pierce Plumbing & Heating, Inc. Residental & Commercial Plumbing Since 1984
Specializing in braces for children & adults
HAPPY BIRTHDAY! to:
• Bathroom Remodeling • Boilers
Our doctors and staff make the difference!
• Emergency Sump pumps
We’ve brought together 23 of the area’s most well-respected doctors, assisted by highly trained technicians, certified opticians and our patient-focused staff.
• Water Heaters
And we’re all working together with one goal: to provide the best in total eye care for every member of your family.
October 17, 2010
To learn more, call 800-292-1668 or visit.
• Complete Service Ph. 517-676-5120
Charlotte • Grand Ledge • Fowlerville • Howell Lake Odessa • Lansing • East Lansing • Williamston LJ-0100041312
MILES RANKE BRENDAN GOODRICH COURTNEY MASSEAU TESSA HERGENRADER WILLIAM WILSON KAYLAH CAMPBELL CALEB HADDAD JAQUEZ DUNBAR VICTORIA ANDERSON ALEXXIS VANPELT MICKENZIE LEITER COURTNEY CORBETT BRYANT MOORE JASON LYON ALEXA HARRIS EMMA HODGMAN TORY OSTRANDER MARIAH CRENSHAW ALEX BLACKWELL PAUL SCHALAU RACHEL PASCH COURTNEY SABBADIN MARISSA GONZALES JENNA WHITSON RYAN BOROWSKI
Catherine E. Novak
LJ-0100041921
KELCIE HAIZLIP SAMUEL SMITH KATHERINE DEARMAN DESTINY PACE ZOE NASH AALIYAH FOREMAN SHELBY ALLEN ALEXANDER PACE PAUL DRU MOONEY JONAH JACKETT
DDS, MDS, PC
2101 N. Aurelius Rd. Ste. 4 • Holt, Michigan 48842
517 LJ-0100040515
694-1000
LJ-0100040684 and 316-9100
7
Births Beckwith
Nichole Smith of Lansing announces the birth of her daughter Trinity Anne Amore. She was born March 19 at Ingham Regional Medical Center and weighed 6 pounds, 10 ounces. Grandparents are Christine Smith, and William Rebolloso.
Stewart
Joseph Beckwith and Constance Justice of Lansing announce the birth of their daughter Lillian Hope. She was born March 21 at Sparrow Hospital and weighed 7 pounds, 14 ounces. Grandparents are Randy and Linda Justice, Valorie Cross, and Paul and Kim Beckwith.
Dequarius and Morgane Stewart of Lan- Cotton sing announce the birth of their son Dillon Jason and Tiffany Cotton of Lansing anIsaiah. He was born March 22 at Sparrow nounce the birth of their daughter Lily. She Hospital. Grandparents are Robert and De- was born March 26 at Sparrow Hospital and lora Stewart, Jennifer and Kelly Goynes, weighed 7 pounds, 11 ounces. and Thomas Black.
REAL ESTATE Marketplace
Christie Bleck
New arrival A new rescue pumper is brought to the Mason Fire Department on Oct. 12. Pre-connected equipment is located on the front bumper to save time at the scene, plus its Jaws of LIfe can cut through stronger metal. The truck is estimated at $516,000.
Karen E. May BS, DC
Phone: 517.676.7112 801 S. Cedar St., Mason
LJ-0100046069
Business
Brigitt A. Boucha Studio Director
517-281-6550 Brigitt has been dancing for 46 years, of which she has been director of her studio, Danceworks of MI, LLC for the past 23. She founded Lansing Chamber Dance, the school’s contemporary dance company 13 ago and has owned Allegra Dancewear for 8. The school provides a large range of dance classes for ages 3-adult. Brigitt is a board certified massage therapist and opened Massage & Therapeutic Bodywork in Holt, next to her studio in 2009, bringing her expertise in movement and the body to both businesses.
LJ-0100046019
Angie Lapp, Owner/Travel Consultant
Phone: 517-676-0380 108 E. Ash St., Mason
LJ-0100045675
Your Full Service Real Estate Company: Auctioneers, REALTORS®, Appraisers
Angie has been in the travel industry for over 20yrs. First employed by Avis Rent a Car while attending Travel School and Davenport University. She came to R & R Travel in January of 1994, became the manager after a few years and then took over ownership in January of 2001. She provides friendly and personalized service. When booking a package she is FREE! R & R survives mostly on repeat client and referrals. Thank you for keeping Angie a Woman in Business.
anglerrtravel@sbcglobal.net
=
B)ll sh(#)d&n,
cai, aare
740 sou%h c(d&# s%,
LJ-0100045671
Doug sh(#)d&n,
Mason
cai, ats
D&v( t#ou%, ag(n%
sh&#on D&v)$, ag(n%
V)n'( D#&gon(%%), ag(n%
(517) 676-9800 sheridanauctionservice.com
October 17, 2010
Dr. Karen May has been a chiropractic physician for 8 years. May Family Chiropractic, PLLC was established in Mason January 2008. The mission statement of our company is simple, “Treat others as you would want to be treated”. Our office is not high pressure or high volume. We believe in good quality care with an emphasis in educating our patients to understand their health. Services provided: chiropractic medicine, nutrition, home exercise and rehabilitation and massage therapy.
in
LJ-0100045672
Women
Ingham County Community News
Smith
Ingham County Community News
8
Patrols: Out-county residents to decide road issue Continued from page 1
county Commissioner Randy Schafer, R-Williamston, who is openly supporting the ballot issue. “The best option is for these 13 townships to stick together. We’d get better services.”
Options The police board could decide to contract with the sheriff’s department or one or more local police departments or form its own police department. “We would do whatever is going to be the most cost-effective,” Martin said. “We’re hoping we won’t need to levy the whole amount every year.” Urban and rural factions spent years battling over the sheriff’s road patrol before the issue was finally decided this year. The county Board of Commissioners has steadily cut funding for the sheriff’s department and ultimately decided to eliminate the road patrol on Jan. 1. That will leave much of the out-county area with no one to respond to all but the most serious of incidents, local officials said. In emergencies, the state police, county sheriff or other police agencies will respond as they are able. But response time is a serious concern, local officials said. Counties are required to provide 911 service, said county Commissioner Laura Davis, a Democrat who represents Aurelius Township and part of Delhi Township. “How quick that response is, that’s where the discrepancy is,” Davis said. “You’re asking someone to show up from who-knows-where.” Leslie Township Supervisor Dallas Henney said he and the other township supervisors are trying to educate voters about the issue and don’t want to scare them. “If there’s a life-or-death situation, they would have to
help out if they can,” he said. (But) it’s going to be a very precarious situation. You just hate the thought that something happens and there’s nobody there to respond.” Henney said he knows that some individuals don’t believe that townships should fund this. “They think the county should do it, But the choice comes down to whether or not they want to have police coverage come Jan. 1,” Henney said. It’s not unusual for two or three local governments to band together for things like police and fire protection. But in scope, the rural police board idea in Ingham County is probably unique, said Jim Beelen, a spokesman for the Michigan Townships Association. “A special assessment is a wise choice because the information gets out the same to all of the units,” he said. “I think it’s wonderful that so many units can get together and approach it this way.” Martin said she and Henney began organizing meetings of township supervisors after it became clear they would lose road patrol service. “We felt a responsibility to at least get something together,” she said. “Individually, townships could do it. But it’s cost-prohibitive for townships to go it alone. It’s just way too expensive.”
Issue still unclear Many questions can’t be answered until after the election, officials said. Because each township is voting separately, some might approve the assessment and some might not, leaving holes in out-county police coverage. Townships that defeat the ballot proposal would be on their own. “We will work with what we have,” Martin said. Whatever happens on election day, the supervisors will
have just two months to form a police board and get the ball rolling. “We’re going to be meeting constantly,” Martin said. “We already have two meetings set up in November. We’re working very hard to get everything scheduled and in place so we can take off.” The supervisors have contacted the sheriff’s department and the police departments in Mason, Leslie, Williamston and Meridian Township about contracting for police services, Martin said. All of them have expressed some interest in the idea, she said. The new police board could decide to contract with a single agency to cover everyone or divide the area into sections and contract with several different agencies. “We’re just going to look at all the options and pick the one that makes the most sense,” Henney said. “We’re going to keep a real open mind.” Township supervisors say they’ve taken no official stance on the ballot proposals. They’ve held town-hall meetings and sent out newsletters explaining the issue. There is no election committee promoting the proposal and no organized opposition at the township level, officials said Schafer said he’s attended a number of town hall meetings and believes the ballot proposals will be successful. “It not a popular thing to talk about ballot issues or taxes, but I just go around to every group and say I’ll support it,” he said. Davis, who also fought to save the sheriff’s road patrol, said out-county residents will get much better service than they are used to if the ballot proposals pass because service levels had been cut so far. “I believe people value it enough to vote yes,” she said. “I think people want to have safe neighborhoods. People understand if they have a certain level of public safety, the economy can grow. It’s an economic investment.”
Library calendar
October 17, 2010
Aurelius Library
a velociraptor skull and a variety of amazing fossils. PaleoJoe’s high-energy program will make you feel like you are actually there with the dinosaurs, millions of years ago. Held at the Dansville Village Hall. • Nov. 1: Pizza and Pages Book Discussion Group (ages 8-13), 6 p.m. Talk about books you’ve recently read and enjoy a pizza dinner. • Movers & Readers (ages 1-3), Tuesdays, 10:30 a.m. Stories, songs and crafts. • Nov. 4: Preschool Storytime (ages 3-5), 10:30 a.m. Stories and crafts. • Nov. 6: Family Storytime, 10:30 a.m. Stories, singing, dancing and crafts, with a new theme each month. Nov. 6: Babar the Elephant. • Nov. 16: Adult Book Discussion, 6:30 p.m.”The Postmistress” by Sarah Blake.
• Oct. 28: “Monstrously Good Time” (children ages 4 and up and their families), 6-7:30 p.m. Join in for a night of special monster stories, crafts and snacks. • Nov. 4: Family Fun Night, 6-7:30 p.m. Join in for a special night of family fun, including tagteam drawings and a popcorn relay race. • Nov. 9: Reminiscers, 2 p.m. Join in for a special presentation by former head librarian Eileen Droscha. She will be sharing pictures and information from her recent Baltic Sea cruise. • Nov. 6: Friends of the Aurelius Library Euchre Tournament, 7 p.m. A donation is required to play, with proceeds benefitting the Friends. Bring finger foods to share. • Nov. 15: Pizza and Pages (grades 4-12), 5-6 p.m. Bring a favorite book that you have read and discuss it with other readers. Pizza and other snacks will be pro- Leslie Library vided. • Pumpkin Decorating Day, Thursday, Oct. 28 and Friday, • Nov. 16: Book Discussion, 3 p.m. “My Lobotomy” by Oct. 29, 3-5 p.m. Howard Dully. Decorate a pumpkin to take home. • Nov. 17: Internet Basics, 2-3 p.m. • Hugs for Hospice, Mondays, 6-8 p.m. Learn the basic components of the Internet and how Knit, sew or crochet projects for the Heartland/Hospice to perform a simple search. Experience with a mouse Group. and Windows required. Registration required; call (517) • Preschool Storytime, Tuesdays, 11 a.m. 628-3743. Stories, songs and crafts. • Nov. 10: Adult Book Discussion, 1 p.m. Dansville Library • Nov. 17: “Remember When…,” 10 a.m. • Thanksgiving Crafts, Tuesday, Nov. 23 and Wednesday, • Oct. 28: Dinosaur Day with PaleoJoe, 4 p.m. PaleoJoe will bring dinosaurs to life with a T-rex tooth, Nov. 24, 3-5:30 p.m.
Mason Library • Oct. 28: Spooky Movie Nite at the Library (grades 6-12), 6 p.m. Come to the library for a free spooky movie. Popcorn and Halloween treats provided. • Oct. 30: Singer/Songwriter Performance, 2 p.m. Enjoy a family-friendly folk concert featuring the group Gifts or Creatures. Co-sponsored by and held at Bestsellers Books & Coffee Company, 360 S. Jefferson, Mason. Seating is on a first-come basis. • Nov. 9: Mason Inklings (grades 9-12), 4 p.m. Come share your creative work and ideas with fellow teens. Refreshments provided. • Nov. 10: “Medieval Feast” (grades K-12, families welcome), noon. A potluck feast for the homeschooler community. Come dressed as a medieval character for an afternoon of food, games, and revelry. Registration required; call (517) 676-9088. • Nov. 16: “Better Internet Searching,” 6 p.m. Ready to go to the next level with your Internet searches? Let the library show you search techniques that will improve your internet skills and yield better search results in less time. Computer and Internet experience required. Registration required; call (517) 676-9088. • Nov. 17: “T-Shirt Surgery” (ages 13-18), 4:30 p.m. Bring a vintage or oversized T-shirt and learn tips and tricks to give it new life (without sewing). Registration required; call (517) 676-9088. • Nov. 18: Teen Games Club (grades 4-12), 4 p.m. Bring your favorite games to play. Refreshments, too. — From the Capital Area District Library
Letters to the editor
9
Rayner rules
A big thank you to the Mason Girl Scouts who took on the challenge of setting up and taking down all the signs and barricades for the Mason Farmer’s Market, and ran a fundraising booth for their 2012 trip to New York. It was a great success as lots of goodies were baked each week and many marketgoers appreciated an enormous variety of baked goods and crafts. This effort by girls and parents was appreciated every week. (OK: Who did make that great seven-layer bar cookie?) A big thank you to parents and girls alike, who hauled, setup, and baked their way to a great season — and have promised to do it again next year: MJ and Traci Phillips; Traci and Caitlin Bergeon; Gina and Rachel Dumont and Sierra Young; Cindy, Joe, Racheland and Hannah Hyaduck; Sarah and Makayla Rickets; Maribeth, Carrie & Katie Harger; Gwen and Shelly Bagley; Michele and Jessamy Burton, Monica and Jane Bush; Mary & Alex Croff; Forest and Madison Hill; Pam and Janae Miller; Gail and Leaha Sinnaeve; Kathy and Amber Sodman; Suzie and Shelby Wiborn; Sava Treloar; Teresa and Marlee Rapp; and Luana and Chelsey King. If you missed anything, feel free to contact MJ Phillips of Mason for their cookbook. It’s only $10 and has most of the recipes from the booth! Elaine Ferris President Mason Farmers Market Association
Rules for a relationship: 1. If you want someone to do something you have to ask. 2. The person asked can either say yes or no. 3. Once two people agree to do something, they do it. So I am asking: Will you join me moving leaves out of Rayner Park from 3-5 p.m. Wednesday, Oct. 20 and/or Saturday, Oct. 23 from 9 a.m. until the last leaf is serviced? Please bring your own rakes, leaf blowers, tarps etc. The objective is to move leaves making a pile no more than four feet deep along the road. A city crew will pick them up from there. Contact me about this and other volunteer activities if you want to take ownership of Rayner Park at papamaddix@aol.com or (517) 525-5133. E-mail is the best method of getting in touch with me. Jim Maddix Mason
Ingham County Community News
Scouts thanked
Pro-Byrum The telltale sign of election season is here, special interests are sending out misleading attack ads trying to spread misinformation about some lawmakers, including State Rep. Barb Byrum (D-67th District). Regardless of what the special interests say, Barb is a courageous reformer of whom we can be proud. Truthfully, Barb has been Continued on next page
Candie
OESTERLE for
VEVAY TOWNSHIP CLERK 38-year resident of Vevay Township
Certified Election Administrator
Committed to serving her community
Not a politician, but a public servant
Running as an Independent Candidate.
Vote November 2
Weight Management Services 2900 Hannah Blvd., Suite B107 | East Lansing
LJ-0100046697
This ad paid for with regulated funds by Friends to Elect Candie Oesterle, 868 S. Diamond Rd., Mason, MI 48854.
Start your success story today. Register to attend a FREE information session and learn how Sparrow Weight Management Services can help you on your journey toward weight loss.
LJ-0100045466
October 17, 2010
10 years experience working for Vevay Township
You CAN fit back into your life—we can help.
Ingham County Community News
10
Letters to the editor Continued from previous page
fighting to end free lifetime health care benefits for lawmakers. She also has voted to have her pay slashed by 10 percent. See Barb’s record for yourself, and you’ll know why the special interests have a reason to be afraid of her. Lavonne Pullum Holt I know that State Rep. Barb Byrum has what it takes to fight for education and the future while cutting wasteful spending out of our budget. Barb is masterful at finding ways to slash government waste, and she doesn’t believe our children should bear the burden of irresponsible government spending. Instead, Barb has voted to hold lawmakers responsible by cutting their pay and lifetime health care benefits. Rachel Beecroft Mason
Oesterle endorsed Candie Oesterle is my endorsement for Vevay Township clerk. I know firsthand that she is a person of diligence, integrity and very skilled in public relations. As a former Vevay Township deputy clerk, I witnessed Candie’s expertise and work ethic as she served as deputy treasurer. Candie always has a ready smile, a listening ear and the ability to deal with concerns in a timely fashion. Also, please note this little known fact that a person can vote a straight ticket and still vote for Candie as an independent. Janice Wheeler Mason I hope to clarify a couple of points regarding the election of clerk for Vevay Township. When Susan Kosier vacated the office, her deputy clerk was appointed to conduct the primary and the general elections that would be held during the rest of Susan’s term. Shaun Sherwood, the township treasurer, and Candie Oesterle, the deputy treasurer, have handled the other duties of that position. Conducting elections is an important aspect of the clerk’s job,
but there is more to it. The second point I want to clarify is that it doesn’t take a great deal of special knowledge to handle the job of township clerk. Candie Oesterle has worked for Vevay Township for 10 years altogether, and during that time, has helped in several capacities, including running elections. Whatever the clerk does that Candie doesn’t already know, she could easily learn. She would do the job as she has done everything else in the township office — competently and graciously. Yes, Candie Oesterle is a very good friend of mine. She’s also a very good friend of Vevay Township. Annette Haines Vevay Township As a lifelong resident of Vevay Township, I have pledged my vote for Candie Oesterle for Vevay Township Clerk. Having worked at the town hall office for 10 years and living in the township for nearly 38 years, Candie has the skill and experience to do this job and do it very well. Candie is very adept at working with people which is a huge part of township government. Please consider Candie Oesterle as our new clerk. Mary Stid Vevay Township
Kean endorsed On Nov. 2, Vevay Township voters will elect a clerk to fill the remainder of my term that will expire on Nov. 20, 2012. The two candidates are both popular, committed, honest people, so the choice for many may be difficult. For me, while choosing the best qualified candidate is not difficult. It is difficult to choose one over the other, as I have affection and respect for both of them. Because of some ongoing health issues, I felt I could not finish my term and retired on June 1 and as the township board could not agree on the appointment of a new clerk, the law gave the responsibility for nominating candidates to the executive committees of the county political parties. Both candidates requested the Republican nomination. Since most of the committee members did not know either candidate, their choice had to be based on overall qualifications and experience. The Republicans overwhelmingly se-
lected JoAnne Kean. When the Democratic Party chose not to submit a nominee, JoAnne’s opponent, Candie Oesterle, then opted to appear on the ballot under “no party affiliation.” Township clerks and treasurers are required by state statute to have deputies, so an additional burden on those officials is to have a well-trained, knowledgeable deputy who can assume the duties of the office in the event that the official cannot. JoAnne served as my deputy clerk from 2007 until June 1 and has acquired the necessary knowledge and skills to do just that. Having been employed by the township prior to 2008, JoAnne welcomed and embraced both the current township treasurer Shaun Sherwood and office secretary/deputy treasurer Candie Oesterle when they joined the office at that time. Other than myself, JoAnne Kean is the only actual accredited elections administrator in the jurisdiction and as such, and was appointed by the township board to conduct this year’s primary and general elections. JoAnne’s experience, education and training in the many technical and legal responsibilities and duties assigned to the clerk’s office make her most qualified to assume the clerk’s position. She is committed, organized and meticulous in the execution of her work, has a good understanding of the issues before the township and is professional and respectful to the public. JoAnne’s candidacy is further supported by senior township board members, Supervisor Ron Weesies and trustee Dale Ruttan, as well as various members of the planning commission and zoning board of appeals with whom she has worked. JoAnne is a fair-minded, forward-thinking person of integrity who I know will always stand for local control, the balance between property rights and community concerns and make lawful, educated and equitable decisions on behalf of the citizens of Vevay Township. I was proud to have JoAnne as my deputy clerk and would be proud to have her finish my term. I hope you will join me in giving her your vote on Nov. 2. Susan Kosier Mason
Brad Hart Pump Repair 517-206-4876
LJ-0100041371
State License # 33-0608
BANKRUPTCY October 17, 2010
517.694.7920 866.337.4670
as low as $500
BARRETT LAW, PLLC Attorney & Counselor at Law
4205 Charlar Drive Suite 3, Holt, MI 48842 Barrettlaw2@sbcglobal.net
DEBTOR’S RIGHTS
LJ-0100040128
a member of
• AntennAs • towers • rotors • Accessories
Greg Stewart, Au.D.
Lisa Holcomb, LauraAu.D. Stevenson, Au.D.
EXPERIENCED & CERTIFIED AUDIOLOGISTS
WE MAKE DIGITAL TV WORK
EXPERIENCED & CERTIFIED AUDIOLOGISTS
8am-8pm - M - Sat Email: antennamen@gmail.com
• Custom Hearing Protection • Assistive Listening Devices
Insured • Guaranteed • Over 40 Years Experience
• Professional Patient Care • Professional Patient Care • Digital Hearing Instruments • Trial Periods • Digital Hearing Instruments • Trial Periods • Custom Hearing Protection • Assistive Listening Devices
Call today to schedule your appointment
LANSING
MASON
ST JOHNS
517.364.5678 517.889.1921 517.244.8905 989.224.1575
517.646.0439 CALL ANY TIME
LJ-0100040113
Watch our educational video on hearing at
LJ-0100041711
Residential & Commercial Water Well Pump & Tank Service & Replacement Well Chlorination - Water Sampling
Courtesy photo
Canine comfort Gary and Beth Spanski, owners of For Better Independence (FBI) Assistance Dogs, have donated a trained facility dog to Angel House, a children’s advocacy center and a foster care teen mother-baby facility in Mason. Pictured are, from left: Liz Gonzalez (human resources director of Child & Family Services), Leisa Fuller (Child & Family Services therapist), Beth Spanski (trainer/owner of FBI), Rorie Dodge (director of Angel House), Lynne Smith (Angel House management staff) and Gary Spanski (trainer/owner of FBI). The dog will provide comfort to abused and neglected children.
MASON — More than 80 walkers raised more than $6,500 for the 28th Annual Mason 5K CROP Walk on Oct. 10. The purpose of the event was to help fight hunger locally and globally. Last year 21 walkers raised $2,800. Twenty-five percent of money raised stays in the Mason community and goes to Meals on Wheels and Capital Area Community Services Food Bank. Thanks go to the community for its support and to Pizano’s Pizza and Meijer for donations made to encourage youth to participate in the walk. Jenny Bond of the Mason Rotary Club raised the most money among walkers. The church with the most money raised was the First Presbyterian Church. Other participating churches and organizations
Ingham County Community News
CROP Walk a success
11
Courtesy photo
Local walkers participate in the 28th Annual CROP Hunger Walk on Oct. 10. were: St. James Catholic Church, All Saints Lutheran Church, Eden United Brethren in Christ Church, First United Methodist
Church, First Church of the Nazarene, Mason Optimists and Dart Bank. — From Earl Threadgould
Breathe Better & Live Better
BOARD CERTIFIED IN ALLERGY & IMMUNOLOGY
FALL SERVICE SPECIALS
5 OFF
$
Kerr Hardware 222 S. Cedar, Mason
3232 South Washington Ave, Lansing • 517-887-0152
Mon. – Fri. 8am-8pm Saturday: 8am-6pm Sunday: 10am-5pm
Most vehicles. Must provide a coupon. Valid through 11/30/10.
35 OFF
$
Front or Rear
• Resurface Rotors • Install New Pads • Inspect Brake Components
SPARTAN TIRE & SERVICE
3232 South Washington Ave, Lansing • 517-887-0152 Most vehicles. Must provide a coupon. Valid through 11/30/10.
SPARTAN TIRE & SERVICE LJ-0100047221
LJ-0100041329
Standard Brake Service
3232 South Washington Ave, Lansing
517-887-0152
• CHRONIC COUGH • FOOD ALLERGY • ECZEMA • CHRONIC ITCHING
CALL FOR APPOINTMENT 517.324.7020 VV. CUUNEYT NEYT KA ALFA LFA, M MD D Toll free 888.517.0077 LJ-0100040890 17, 2010
Any Rental Special
expires 9/30/10
Complete Oil Change
SPARTAN TIRE & SERVICE
676-5040
10% off
• HEADACHES • SINUS PROBLEMS • ASTHMA • IMMUNE DEFICIENCY
ELECTION 2010: Vevay Township Clerk eran clerk. Previous employment with Ingham County. w Party: Republican What are the three most important issues w Age: 50 facing Vevay Township and how would you w City of residence: Mason address them? w Occupation: Vevay Township 1. Maintaining the current level of services despite Elections Clerk declining revenues without raising taxes. Cut all w Education: Mason High School unnecessary expenditures and freeze wages. Graduate 2. Whether the Township residents are willing to Secretarial Science Certificate - IISD support a special assessment for police protection Some College despite the feeling by many that tax payers are Accredited Elections Administrator - State of Michigan already funding it through the existing County levy. By w Political experience: Vevay Township Deputy Clerk doing exactly what the Township is now doing; placing the question before the people on the November Precinct Delegate, Ingham County Republican Party ballot. w Family: married, two children 3. Getting the Clerk’s Office back up and running w Campaign website: KeanforClerk.com after being without a clerk for five months. I will What makes you most qualified to hold this commit to what ever time and effort it takes to office? restore the organization and lawful administration of Experience as the Deputy Clerk of Vevay Township. the Clerk’s duties and responsibilities. Extensive experience in hands-on election adminisWhat services do you consider vital and least tration. eligible for cuts? Worked along side and trained by the 26-year vetFire Protection.
JoAnne Kean
Chain Saw Sharpening
LJ-0100041041
676-4900
October 17, 2010
3
$ 99 each
Every Wednesday No Limit
sBARYAMES LJ-0100042012
w Age: 63 w City of residence: Mason w Occupation: Secretary/Deputy Treasurer of Vevay
Township w Education: High School Diploma - Leslie, Michigan w Political experience: None w Family: Married - 3 children and 4 grandchildren w Campaign website: none
What makes you most qualified to hold this office? I have been Secretary/Deputy Treasurer for a total of 10 years. During these 10 years I have assisted with many of the clerk’s duties. Since June 2010 I have done most of the accounts payable and payroll along with filing necessary reports. I have the “hands on” experience of the day to day office procedures.I have completed and passed the Election Officials’ Accreditation Program mandated under Michigan election law.
# &.)* '44'8 2+ 0246,',* 236.215 62 0**6 8274 1**)5 # %24 374(-'5*5 24 4*"1'1(*5 # $*).('6*) /2'1 2+"(*4
New Ad • New Ad • New Ad • New Ad • New Ad
Wooden Nickel Furniture Restoration Quality Hand Stripping and refinishing Repair Caning Veneering LJ-0100035664
989-224-8711 • 1-800-528-8779 Honeysuckle04@hotmail.com M-F 9 a.m. - 5 p.m.
2
$ 09
Each. No Limit. All You Can Carry.
Shirts Laundered No Limit
BARYAMES
Coupon must accompany your incoming order. Offer not applicable with other offers! Offer expires 10/23/10
30% OFF
I have been a resident of Vevay Township for 38 years and my children also own property and reside in the township. Community involvement is very important to me and I have been very active in many areas. What are the three most important issues facing Vevay Township and how would you address them? 1. Police protection: I feel it is vital for the township to protect its residents. I will explore any and all possibilities to see this is accomplished. 2. Zoning enforcement: If a zoning ordinance is important enough to be passed, I will encourage enforcement. If it isn’t in the best interest of the residents, I would recommend it be amended. 3. Fairness to its residents: I believe everyone should be treated with fairness and respect. I want every resident to feel they can get the assistance they need and I would encourage them to become more involved in township policies. What services do you consider vital and least eligible for cuts? I consider police and fire protection to be vital and would oppose cuts in those two areas.
Don’t Wait - Mortgage Rates are Great!
Restoration
Baryames Loves Your Clothes SLACKS SPECIAL
w Party: No party
LJ-0100046245
802 N. Lansing St., St. Johns
340 S. Cedar, Mason
Candie Oesterle
Furniture New Ad • New Ad • New Ad • New Ad • New Ad • New Ad • New Ad •
All this week, remind your children of the wonder and delight of reading. Teach them that reading can give them a lifetime of information and amazement.
New Ad • New Ad • New Ad • New Ad • New Ad • New Ad • New Ad •
Ingham County Community News
12
Call or contact Dan Lynch our Mortgage Lending Specialist today. 517.367.1064 - 1.888.393.7716 x1064 - .<@= >
$%%$&'(#"')
Everyone in Ingham, Eaton, Clinton, Ionia, Livingston & Shiawassee counties can be a CASE Member. LJ-0100047291
Breakfast Special
Coney Dog
6AM - 11AM DAILY
2 Eggs Any Style, Hash Browns, Sausage or Bacon,Toast
TUESDAYS
Add Coffee for $100 extra
3.99
$
A&W Restaurant
99¢
SERVING BREAKFAST AT THESE TWO LOCATIONS
All Incoming Dry Cleaning*
BARYAMES
A&W Grand Ledge 525 W. Saginaw 517-627-7800
(shirts, leathers, suedes, wedding gowns, major repairs excluded, *regular priced garments only) Discount excluded at 2423 S. Cedar and 1122 W. Holmes locations. Coupon must accompany your incoming order. Offer not applicable with other offers! Offer expires 10/23/10 LJ-0100045181
A&W Mason 628 N. Cedar 517-676-4344
Mason police report
Tree tentative Oct. 5: The code enforcement officer opened an investigation for a dead tree hazard on private property on North Rogers Street. The tree, hanging over Consumers Energy lines, might be a violation of the City’s Nuisance Trees Ordinance; Article III, Section 86, and has been referred to Consumers Energy for inspection and the city’s Parks Department for follow-up action.
Telephone tangle Oct. 5: A resident came in to document that an unidentified white truck drove southbound on Barnes Street, got hung up on the telephone line to his house and pulled it down. He was advised to contact his phone carrier and have the line repaired.
Million-dollar scam Oct. 5: An officer was dispatched to a residence for an attempted fraud complaint. The complainant stated he had received a telephone call from someone calling himself “James Cooper” and claiming to be from Leslie. Supposedly the complainant had won a Mercedes Benz and a million dollars.
Easily recognizing this as a scam, the complainant provided no money or personal information, but did say he “toyed with” the caller a little while before hanging up on him. The officer advised him to contact the Mason Police Department should he get another call.
Kipp Road larceny Oct. 5: An officer responded to a larceny report on Kipp Road. The victim stated that when he went to his vehicle, he found the front hood slightly ajar and his car battery missing. The vehicle was unlocked at the time. The complaint remains open and leads are requested from the public.
Treatment rendered
open, and anyone having information regard- male leave the building, but contact with him ing the whereabouts of the barrels is asked to produced no evidence of drug use. Apartment management will be notified of the contact Mason police. complaint for their determination of action.
Person missing
Oct. 6: An officer received a missing person report from a residential facility in Mason. The complainant reported a resident of the facility left on her own accord with her boyfriend and had not returned. The complainant added the missing person did not pick up her child from day care, and staff members were on their way to take custody. Investigation uncovered the missing person left town with the boyfriend by taxi cab. A facility staff member made contact with the boyfriend by cell phone, but was hung up on. An endangered missing person alert has been entered into the statewide data base, and a referral filed with Child Protective Services regarding the abandonment. The investigation remains open.
Oct. 5: Officers responded to a “man down” report at Cedar and South streets. It was determined the victim had been running and possibly tripped, resulting in a fall during which he struck his head on the pavement and was knocked unconsciousness. Family Scent, scurrying clues Oct. 6: Officers were dispatched to a Maand medical assistance were summoned, and the victim was taken to an area medical facil- son apartment complex where the complainant reported marijuana was being used. The ity for treatment. officers arrived and, once inside the building, Barrels stolen were able to locate the point of origin by folOct. 6: An officer took a larceny complaint lowing the scent. After knocking on the door from the representative of an area church. to make contact with the resident, the offiThe complainant advised five large orange cers could hear scurrying around inside and barrels were stolen from a construction area smell a sudden waft of strong air freshener. in front of the church. The case remains After waiting awhile, they observed a lone
Double-sided deal fails Oct. 7: A Mason business owner reported an attempted fraud by someone putting a 10-inch double-sided length of packaging tape at the end of a $5 bill, running it through a change machine in order to get the change, and then trying to pull the bill back out of the machine. In this case, the machine didn’t cooperate and retained the evidence, which was discovered by the owner in the course of business. One officer recalled seeing this stunt performed on the television show “Cops.”
Ingham County Community News
Between Oct. 5-Oct. 11, Mason police investigated 53 reported incidents involving a variety of activities, both criminal and noncriminal. These are some of those incidents worth noting and intended to keep citizens informed of department activities.
13
Passenger loses ride Oct. 8: An officer stopped a car with three occupants for a traffic violation on Kipp Road. Initial contact with the driver determined his only identification was a state ID card from Kentucky, and the interior of the car smelled of burnt marijuana. Investigation uncovered the driver was suspended in Michigan and was wanted in Iosco County for failure to pay child support. Further investigation found a bag of marijuana stuffed between the passenger door and the passenger seat where a female was sitContinued on next page
Family Fun Day Jeff Oesterle %#$"
(-9/4/->0 1:< ,>->0 +0;<0=09>->4@0" %&
>3
)4=><4.>
Sunday, October 24, 2010 2:00 - 5:00 p.m. Tannenbaum Farms 2515 Sandhill Road, Mason (Just west of Okemos Road)
'<492 A:?< 1-847A >: 095:A
=00 -9 :7/#1-=34:90/ .4/0< ;<0==" -9/ >-60 A:?< 1-847A ;4.>?<0 -8:92=> >30 .:7:<=*
517-449-9087 •
Paid for with Regulated Funds by Friends of Jeff Oesterle, PO Box 433, Mason, MI 48854
LJ-0100047080
LJ-0100041026
October 17, 2010
- 3-A<4/0 -9/ /:9?>=" <:-=> 3:>/:2= :@0< >30 $<0"
Mason police report ting. Also found were open bottles of vodka on the floor of the front passenger’s seat and another bag of marijuana in the female passenger’s purse. The back seat passenger reported just having been picked up and not being privy to the duo’s activities prior to getting into the car. The driver was arrested for the warrant, driving while suspended, transporting open intoxicants and possession of marijuana. The female passenger was arrested for possession of open intoxicants, minor in possession by consumption and possession of marijuana. The back seat passenger was given a ride to a safe location where he could wait for a ride. The car was impounded.
Disappearing dwarfs Oct. 9: An officer received a larceny complaint on Ash Ridge. The victim reported lawn ornaments depicting the Seven Dwarfs and a pixie pushing a wheelbarrow were stolen from the front lawn between 11 p.m. Friday and 7:30 a.m. Saturday. The victim suspected juveniles might be responsible, and officers checking the area found no sign of the missing property. Anyone having information on this theft is asked to contact Mason police.
Domestic/drug problem Oct. 9: Officer’s responded to a domestic complaint where the caller reported arguing with her boyfriend and trying to keep him from leaving to buy drugs. The complainant alleged the boy-
friend left because he was desperate but no assault occurred. She later recanted and reported they shoved each other, during which time she hurt her toe. The boyfriend could not be located. A copy of the report will be forwarded to the Ingham County prosecutor for review.
East Cherry unleashed Oct. 10: A Mason resident reported being accosted by two loose dogs while out walking his own dogs — both on a leash — on East Cherry Street. The complainant stated both dogs growled at and threatened his dogs but ran off without attacking. The residence from which the complainant believes the dogs came was checked, but no dogs were located. The officer referred the complaint to Ingham County Animal Control for follow-up.
Sex offender arrested Oct. 10: Officers were dispatched to a residential burglary complaint after a caller notified dispatch that someone had entered her friend’s apartment and was currently inside. The suspect was an acquaintance of the apartment owner, and she had been helping him out, but when he had arrived at her apartment around 2 a.m. that morning, the resident had told him to leave. At the time of this complaint, the resident was out of state, and the suspect had broken into her apartment and taken up residence. Officers made contact with the suspect through a closed window but he refused to come out and talk with them, so while one distracted him by telling him he was under arrest, two oth-
Paula S. Gregory McCroskey Law
er officers managed to enter the front door with a pass key and surprise the suspect from behind. He was arrested and taken to the Ingham County Jail. Further investigation revealed the sus722 N. Creyts Rd. Ste C, Lansing, MI pect was a registered sex offender who had committed five violations of the Sex Offender Statute. On Oct. 11, the IngSpecializing in Worker’s Compensation & Social Security Disability ham County prosecutor issued a twoFormer Workers’ Compensation Magistrate count felony charge for home invasion Ph: 517.323.3645 and repeat offender. Review of and charges for the Sex Offender Registry violations are pending. The suspect is mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm also wanted by the Westland Police DeCentral Michigan’s 45th Annual Gem, partment, but they will not pick him Mineral, Fossil, Lapidary & Jewelry Show up because he is outside their pick-up Friday, October 22, 2010 • 6:00 to 9:00 p.m. range.Westland police were notified the Saturday, October 23, 2010 • 10:00 a.m. to 7:00 p.m. suspect was going to be unavailable for Sunday, October 24, 2010 • 11:00 a.m. to 5:00 p.m. some time, anyway. “Main Arena” Ingham County Fairgrounds • 700 E. Ash St. • Mason. Ml
Lansing Location
LJ-0100045512
Vehicle impounded
LJ-0100044239
flows through local government. In Michigan the townships receive their authority to do this through the Planning Enabling Act and the Zoning Enabling Act. A township sets its long range development plans with the Master Plan which is reviewed every 5 years. This plan is carried out by the Zoning Ordinance.
October 14-16 | 21-23 | 28-30
7 - 11 PM
October 17, 2010
THURSDAY NIGHT FAMILY NIGHT (SAVE $2) Haunted Hayride: Haunted House: Admission: $10 Admission: $7 3 & Under: free281
ACTIVITIES
• Club & Guest • Raffle Displays Oct. 10: An officer stopped a car for Displays • Petoskey Stone • Silent Auctions Polishing an equipment violation and soon found • Hourly Door Prizes • “Touch & Feel” • Fluorescent Booth Table the plates to the car were improper. • Working • Refreshments Demonstrations • Free Parking When asked, the driver stated the plates • Supervised • Much More Swap Table were transferred earlier in the day at the • “Children’s” Table Secretary of State, but when the officer ADMISSION: Adults $3.00 • Teens $1.00 pointed out it was Sunday, the driver Children Under 12 - FREE with Paying Adult was at a loss for further explanation. Directions to Show: Sponsored by: He was released with a citation FROM I-96 South on Okemos Rd. To Mason, CENTRAL MICHIGAN for driving an unregistered vehicle, the Left on Rogers St. Left on Ash St. LAPIDARY AND MINERAL SOCIETY FROM LANSING South on Cedar St. To plates were seized, and the car was imInfo: (517) 641-6125 Mason, Left at 2nd Stoplight (Ash St.) pounded. facetman60@yahoo.com US-127 South to Kipp Rd. Exit, Left (East) to FOUND PROPERTY: A woman’s South Entrance to Fairgrounds michrocks.org mountain bike. If anyone has any ques- mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm tions or comments regarding this report or any other police matter, contact Township Control vs. Your Rights the Mason Police Department at (517) 676-2458 between 8 a.m. and 5 p.m. Most folks do not have an understanding for how township weekdays, or e-mail the department at government has an impact on their lives. Actually it is very MASON_PD@Ingham.org. significant as the taxation and development of your property — From Chief John Stressman
HAUNTED HOUSE AND HAUNTED HAYRIDE
Hayride & Haunted House Admission: $15 12 & Under: $12
DEALERS • Archy’s Rock Shop • Bj’s • D. Demerly’s Rocks & Artwork • M & W Minerals • Moorehead Enterprises • Red Metal Mineral Co. • Russell’s Trees & Treasurers • Janda Gems • The Agate Lady • The Mineral House • Fantasy Gem Design
mmmmmmmmmmmmmmmmmmmmmmmmmmmm
Continued from previous page
mmmmmmmmmmmmmmmmmmmmmmmmmmmm
Ingham County Community News
14
In the United States we value the concept of “government by the people, for the people, and of the people.” When a township sets out to either develop or rewrite their master plan the more public input that is sought and received the better it will represent all of the residents in the township. The same thing applies to the zoning ordinance. The job of administering and enforcing the zoning ordinance falls to the Zoning Administrator. The Zoning Board of Appeals insures fairness and the due process rights of the residents of the township. This board is the “appeals court” for Zoning Administrator decisions. The final piece to this puzzle is the formation of zoning districts. The Master Plan defines the general areas and types of development foreseen in the township. The Zoning Ordinance and the Zoning Map outlines specific areas in the township for specific uses. There is another key right of the citizenry that is affected by township government. Our right to vote is administered and safeguarded by the Township Clerk who is also a member of the Township Board. The Board is the legislative body of the township and gives final approval of the Master Plan and the Zoning Ordinance. Make sure you exercise your right to vote on November 2. Paid for by the Concerned Citizens for Vevay Township, 1547 W. Dexter Trail, Mason, MI 48854.
LJ-0100047306
15
HEADS
Art show scheduled for Wheaton’s
OR
An art exhibit, “The Intricate Beauty of Invertebrate Animals,” will run from Oct. 23-Nov. 6 at Wheaton’s Framing & Art Gallery, 427 S. Jefferson St. The exhibit is a collection of works by James (Jas.) W. Atkinson. A reception will take place opening day from 11 a.m.-3 p.m.
TAILS? There’s a better way to choose auto insurance.
As your local independent agent, I’ll help find the car insurance policy that’s right for you. I often recommend Progressive Insurance because you receive:
Local eye-care office opens
Attic fire controlled Mason firefighters extinguish an attic fire that broke out shortly before midnight Oct. 10 at a duplex at 142 Okemos St. The electrical fire caused minor damage.
what’s for
LUNCH? THIS WEEK’S MENU IS BROUGHT TO YOU BY
Wendy’s
claims service
› Multi-vehicle › Competitive
discounts
Rates
Make the right choice. Contact me today!
#&&+e,&e). $i)%)&i%l
103" 244" 44// %.y)e,5,i'(%+ep-&*(
©2008 Progressive Casualty Insurance Company and its affiliates, Mayfield Village, Ohio. Sold everywhere but MA. 08A00501 (06/08)
MASON ELEMENTARY SCHOOL
18
Ravioli OR Corn Dog
•Sliced Green Beans •Chilled Cinnamon Apples •Bread/Butter
19
Oven Roasted Drum Sticks OR Cheese Quesadilla
•Golden Potato Smiles •Chilled Peach Slices •Bread/Butter
20
Taco Salad OR Hot Chicken Sandwich
•Frozen Mixed Sandwich •Fresh Sliced Apples •Oyster Crackers
21
Turkey and Gravy OR Pork Barbecue on Bun
•Whipped Potatoes •Chilled Pineapple/ Mandarin Oranges •Biscuit, Honey
Pepperoni Pizza Square OR Crispy Cod Nuggets, tarter sauce
•Niblet Corn •Chilled Sliced Pears •Sherbet Cup
22
OCT. 18 – OCT. 22, 2010
› Outstanding
LJ-0100047460
Michael Keith
Lansing Ophthalmology announced the opening of Lansing Ophthalmology Williamston. On Oct. 4, Lansing Ophthalmology affiliated with Dr. Lee Lemon’s Williamston office, located at 425 W. Grand River Ave., Williamston.
Post these School lunch menus in a handy place MASON HIGH SCHOOL
18 19
LJ-0100045719
•Oven Fries •Baby Carrots •Fresh Fruit •Asst. Chilled Fruit Cup •Bread/Butter
Italian Spaghetti, Meat Sauce OR Cheeseburger Deluxe OR Round Pizza OR Cold Sandwich Selection
•Broccoli Cuts •Oven Baked Beans •Fresh Fruit •Asst. Chilled Fruit Cup •Garlic Toast
Chicken Pot Pies OR Chili Cheese Fries OR French Bread Pizza OR Cold Sandwich Selection
•Pasta Blend Vegetables •Green Beans •Fresh Fruit •Asst. Chilled Fruit Cup •Bread/Butter
21 22
Oven Baked Chicken OR Hot Ham & Cheese Sandwich OR Pepperoni Pizza Wedge OR Cold Sandwich Selection Barbecued Rib Sandwich OR Scalloped Potatoes/Ham OR Cold Sandwich Selection
Bring this coupon in
FREE
for a value size fry with any purchase
MASON MIDDLE SCHOOL •Whipped Potatoes •Frozen Mixed Vegetables •Fresh Fruit •Asst. Chilled Fruit Cup •Roll/Butter •Corn •Tender Peas •Fresh Fruit •Asst. Chilled Fruit Cup •Bread/Butter
Build-Your-Own Bar Offered Daily Taco, Deli, Salad and Specialty Bar Milk and Juice Served Daily Menu subject to change due to availability of product.
18
Ravioli in Meat Sauce, Bread/Butter OR Corn Dog
•Sliced Green Beans •Golden Onion Rings •Chilled Sliced Peaches •Fun Fruits
19
Oven Roasted Drum Sticks OR Cheese Quesadilla
•Whipped Potatoes •Veggies/Dip •Chilled Mixed Fruit •Bread/Butter
Taco Salad OR Hot Chicken Sandwich
•Frozen Mixed Vegetables •Broccoli Cuts •Chilled Pear Slices
Turkey and Gravy OR Pork Barbecue on Bun
•Whipped Potatoes •Veggie Sticks/Dip •Chilled Pineapple/ Mandarin Oranges •Biscuit, Honey
Pepperoni Pizza Square OR Crispy Cod Nuggets, tarter sauce
•Niblet Corn •Frozen Peas •Fresh Apple Slices •Sherbet Cup
20 21 22
Good at Wendy’s 439 N. Cedar Mason, MI Expires 6/30/11
Limit one coupon per visit LJ-0100045721
October 17, 2010
20
Chicken Fingers OR Pork Barbecue on Bun OR Stuffed Crust Pizza OR Cold Sandwich Selection
Ingham County Community News
News in brief
Ingham County Community News
16
Anniversary Smith
Hey Moms!
Duane and Jean Smith of Laingsburg, formerly of Mason, are proud to have celebrated 60 years of marriage. They were married Oct. 4, 1950 in Augusta, Mich. The couple have two children and five grandchildren. Please join their family in celebration from 2-5 p.m. Sunday, Oct. 24, for an open house at Laingsburg United Methodist Church, 214 North Crum, Laingsburg. Please, no gifts.
Bring the kids to our Jean and Duane Smith
All this week, remind your children of the wonder and delight of reading. Teach them that reading can give them a lifetime of information and amazement.
Family Day Out
Birthday Bash! MomsLikeMe.com is two years old! Help us celebrate by joining us at Peacock Road Tree Farm.
Our party will feature: • • • • • •
Hayrides Pig Races Bonfire Food Pumpkins more!
October 17, 2010
For more information or to RSVP, log on to
LJ-0100044079
LJ-0100045801
OCTOBER 2010
CREDIT UNION WEEK
17
18
CREDIT UNION WEEK
OCTOBER 2010
OCTOBER 2010
CREDIT UNION WEEK
19
20
CREDIT UNION WEEK
OCTOBER 2010
OCTOBER 2010
CREDIT UNION WEEK
21
22
CREDIT UNION WEEK
OCTOBER 2010
OCTOBER 2010
CREDIT UNION WEEK
23
24
CREDIT UNION WEEK
OCTOBER 2010
By CHRISTIE BLECK cbleck@lsj.com
MASON — The Mason school district is working on creating customized calendars for parents. Superintendent Mark Dillingham told the school board on Oct. 12 that the district wants to improve its pa-
rental communications, and special online calendars are a way to accomplish this. “This way, parents can find where and when events are happening,” Dillingham said. Bruce Barbour, executive director of curriculum, said parents eventually will be able to access dates via the Mason Public Schools’
Web site at and through Google calendars. There are advantages to both methods, according to Barbour. Using the school Web site, he said, is quick and easy, and no Google account is needed. Although the calendar
link at the top left of the school Web site is not “live” yet, Barbour said that eventually parents will be able to click on a particular school to access that calendar. Eventually Google calendars, which require a free Google account, will be made public and use weekly, monthly and yearly views.
All that’s required, Barbour noted, is Internet access, with mobile access also available. “Anyone anywhere can pull up their calendar,” he said. Changes to calendars will be made immediately and are automatic, Barbour said.
Dillingham, who pointed out that 85-90 percent of the district’s parents have web access, said more information will be available to them through the district’s newsletter “Keynotes” in early December. “I think it’s going to serve the district well,” Barbour said.
Leslie’s Harkness has entries in exposition LESLIE — Steven Harkness of Leslie has entered four head of market hogs in the swine division of the 37th Annual North American International Livestock Exposition (NAILE). The NAILE is recognized as the world’s largest purebred livestock show with more than 22,000 entries and nearly $700,000 in prizes and awards. Scheduled for Nov. 6-19, the event takes place at the Kentucky Exposition Center in Louisville. Purebred farms from nearly every state and Canada bring livestock to compete in one of 10 expo divisions: dairy cattle, dairy goats, boer goats, beef cattle, quarter horses, draft horses, mules and donkeys, sheep, swine, llamas and alpacas. national recognized for both the quality of competition and prestige of winning. Champions
Ingham County Community News
Customized local school calendars on the way
25
from these shows are sold at the Sale of Champions at 6 p.m. Nov. 18. The Professional Rodeo Cowboys Association Great Lakes Circuit Rodeo Finals takes place at 7:30 p.m. Nov. 11-13 at 7:30 p.m. ]Tickets for the invitational finals rodeo are $20 on Thursday, $30 on Friday and $32 for Saturday’s performance. Children under 12 get in for $10 on Friday and Saturday with paid adult. Tickets are available at TicketMaster.com or by calling (502) 361-3100 or (800) 745-3000. — From the North American International Livestock Exposition
Joe’s Specials of the Week proudly welcomes …
JOE HEIKKILA to our Sales Team! With his many years of automotive sales, Joe says stop by and say hi and I’ll buy you a cup of cofee!
517-394-0330
632 American Rd., Lansing Mon.-Thurs. 8:30am - 8pm Fri. 8:30am - 6pm • Sat. 9am - 4pm
LJ-0100046700
T#JW2646
06 Chevrolet Malibu LS
07 Pontiac Torrent
$
$
Kelly Blue Book $10,785
Kelly Blue Book $17,645
St#ST2602
St#52893A
9,900
07 Cadillac CTS
38K
16,995
03 Saturn LW-200 Wagon
38K $
$
Kelly Blue Book $23,070
Kelly Blue Book $6,250
St#54283A
St#JAC2547
18,995
07 Chevrolet Silverado 2500HD
5,995
07 Chevrolet Silverado 2500HD
H Crew DuraMax w/plow $
LTZ 4x4 $
Kelly Blue Book $36,145
Kelly Blue Book $29,060
31,695
27,995
jheikkila@shaheenchevrolet.com Call Joe at 394-0330, ext 858 or 488-4478
October 17, 2010
St#JW2299
Ingham County Community News
26
Shelter offering cat spay/neuter program MASON — The Ingham County Animal Control (ICAC) is offering spay and neuter help to cat owners who can not afford the surgery on Oct. 26- 27. According to Director of Ingham County Animal Control Jamie McAloon Lampman, “We can pay now, or pay later. And by paying later, I mean having to deal with thousands of unwanted cats that will be brought to our shelter or become abandoned.” To date, the shelter has taken in more than 1,900 unwanted cats, she said. By helping cat owners who could not afford to have
the surgery done, McAloon believes this program will prevent the death of thousands of cats that would have been euthanized. According to shelter staff, 55 to 60 percent of the staff’s workload is caring for thousands of cats and handling close to 4,000 cat complaints annually. The cost to the pet owner is $20 for a male or $25 for a female cat and a rabies and distemper vaccination is included in that cost. Due to limited space, only 80 cats can be accepted for the event. Pet owners are limited to three cats
per household and feral cats are welcome. The fee must be paid in advance of Oct. 26 to reserve an appointment. Call (517) 676-8373 and leave a message or come by the shelter at 600 Curtis St. during business hours. The Feline Fix-It program is made possible through donations to the shelter’s spay neuter fund. To donate to the Spay/Neuter Fund send a donation to ICAC Spay/Neuter Fund, 600 Curtis St., Mason, MI 48854, or go to.. — From Ingham County Animal Control
LAW FIRM OF
KAECHELE and WILENSKY, P.C.
SERIOUS PERSONAL INJURY • WORKERS’ COMPENSATION SOCIAL SECURITY DISABILITY • MEDICAL MALPRACTICE Personal Injury Settlements Include
• 4 Registered Pharmacists • Free Delivery • Senior Citizen Discount • 24 Hour Answering Service 304 S.Jefferson, Mason • Beautiful Downtown Mason •
676-9199 LJ-0100041067
LUTHERAN A residential and campus ministry
1000 E. Columbia Rd. (Next to Mason Middle School.)
Everyone is WELCOME!
(Between Breslin Center and Trowbridge Rd.)
332-2559
Childcare Sun/Wed evenings
October 17, 2010
ALL ARE WELCOME
LJ-0000862297-01
Sunday Worship 8:30 and 10:45 a.m. Education Hour for all ages 9:40-10:30 a.m. Wednesday Evening Worship 7:00 p.m.
9:30 & 11:00 a.m. every Sunday 6:30 p.m. every Saturday Worship Service and Sonquest (Children 3 yrs. & older) Nursery available too Steve Malson, Pastor
LJ-0000862295-01
Worship with Holy Communion:
6500 Centurion Drive, Suite 230 • Lansing, MI 48917
Worship DANSVILLE UNITED METHODIST CHURCH
EDEN UNITED BRETHREN IN CHRIST CHURCH
MASON FIRST UNITED METHODIST CHURCH
1938 Eden Rd, Mason (1/4 mi north of Barnes Rd.)
Sunday Service
201 E. Ash St., • Mason, MI 48854 • (517) 676-9449 Email: info@masonfirst.org Web site:
1030 W. South St, Mason, 676-4415
1317 Mason St., P.O. Box 175 Dansville, MI 48819
Sunday Morning:
Praise & Teaching Service: 10 am
Worship: 9:20 am Christian Education (for all ages from September through May) 11:00 am
Children’s Church during message
MASON COMMUNITY CHURCH
1020 South Harrison Road, E. L.
517-853-1940
and
Phone: (517) 676-5322
Sunday Worship: 9:15 am LJ-0000862294-01
UNIVERSITY LUTHERAN CHURCH (ELCA)
PHONE for consultation - NO CHARGE
Rev. Donald Fry 623-6591 Church 623-6594 Parsonage
Sunday school - ages 2 yrs thru adults - 9:30 am Nursery available infants thru 2 yrs during Sunday School and Worship Service
Half Time Fellowship - 10:30 am Worship Service - 11:00 am Children’s Church - 11:00 am Wednesday Activities Prayer Gathering - 6:30pm, Choir Practice - 7:30pm
Youth Ministries Opportunities Available for 6-12 grades Pastoral Staff: Lead Pastor, Dan Bentz • Mark Anderson, Youth LJ-0000862292-01 Phone: 676-1376
5:45 pm Dinner, 6:30 pm Classes 7:00 pm Bell Choir Rehearsal 8:00 pm Chancel Choir Rehearsal
Mason Christian Child Care Center Monday – Friday 7:00 a.m. – 6:00 p.m. 517-676-6588
Sunday Morning:
(Primary, Intermediate, & Juniors) Nursery provided
Wednesday Night:
Dwayne Bagley, Pastor Erin Guthrie, Children’s Ministries Ruben Droscha, Music Ministries
FELLOWSHIP BIBLE CHURCH
(Expository teaching of God’s Word)
Sunday Evening: LJ-000086229101
COME
Staff represented by UAW Local 2256 LJ-0100040193
The “24 Hour Pharmacy”
• $2.6 Million Auto Negligence Case • $2.2 Million Brain Injury Auto Accident Case • $1.0 Million Birth Trauma Medical Malpractice Case • $1.3 Million Auto Death Case
Senior/Jr. High Youth Group Word of Life Club Donn Kenyon Pastor 676-9886 Jeff Haynes Associate Pastor 610-1978 LJ-0000862290-01
To have your Church Listed, Call Suzi Smith at 517-377-1172
27
LJ-0100045668
517-394-3006 Lansing, MI I do consignments & pickup I do auctions all Winter long
Ingham County Community News
Auctioneer* Appraiser 39 yrs
Sports
Ingham County Community News
28
Sports briefs Laingsburg 33, Dansville 14 DANSVILLE -- Senior fullback Joe Arthur ran for 157 yards and two touchdowns to lead Laingsburg to the CMAC win over Dansville on Oct. 8. Senior Casey Czerwinski ran back a kickoff 80 yards for a score for the Wolfpack (4-3). Senior wide receiver Forest Graham had 84 yards receiving and ran for 90 yards and two touchdowns. Jacob Hause added 102 rushing yards for the Aggies (2-5).
Leslie 61, Albion 32 LESLIE -- Leslie gained 580 yards of total offense, including 348 on the ground, in its Southern Michigan Activities Association victory over Albion (0-7, 0-4) on Oct. 8. The junior trio of Brendon Smith, Chrishawn Smith and Andrew Arras each ran for more than 100 yards, while Arras also had nine tackles, an interception and a safety on defense for the Blackhawks (5-2, 3-2).
Girls asked to try out for hoops team
October 17, 2010
All girls in sixth grade or 11 years of age are invited to try out for the 11U Michigan’s Finest Girls Basketball Team. A tryout will be held from 11 a.m.-1 p.m. Nov. 14 at Aim High Sports. Aim High is located at 7977 Centerline Drive in Dimondale. For more information, contact Coach Norris at jnorris@finestbasketball.com.
YOUR NEWS
ONLINE click COMMUNITIES
Mason makes title game By SCOTT YOSHONIS syoshonis@lsj.com
MASON — The Mason boys soccer team booked a place in the CAAC Cup Group 1 championship game, and handed Lansing Catholic their first defeat of the season, with a 2-0 semifinal win on Oct. 12. Previously, the Bulldogs advanced to the semifinal with a 1-0 win over Lansing Everett on Oct. 7. Nick McNeilly scored the only goal against Everett with 11:54 left in the first half of their quarterfinal clash, off of a long free kick by goalkeeper Jacob Derby. Derby sent the kick from just inside the Viking half in front of their bench to the far side of the Everett box, where Zach Rogers blasted a volley across the face of the goal and McNeilly turned it in past helpless Viking keeper Brett Dawsey. Injuries have taken their toll on Mason’s attack, which has severely reduced its scoring from the run of play, but head coach Nick Binder was happy that his team found the back of the net anyway. “It was a set piece. Again,” Binder said. “We keep living and dying by them, fortunately living more than dying lately.” With districts coming up, Binder said that the temptation to take it easy during the Cup to rest and heal and test new players and tactics goes out the window when it comes time to play the games. “It’s easy, two days before the game, to say that we’re going to take it as a learning experience,” he said. “But our guys love to compete, in practice, on the bus and all that kind of stuff, so it’s a good win for us.”
Both No. 4 So was the semifinal over the previously unde-
feated Cougars. The two teams went into the game each ranked fourth in the state, Mason in Division 2 and Lansing Catholic in Division 3. Zach Rogers and Tim Lyons scored the Mason goals, both on rebounds, a few minutes on either side of halftime, to send the Bulldogs to the tournament final for the second consecutive year. That CAAC Cup Final was played at DeWitt on Oct. 14 after this paper went to press. The loss ended a brutal stretch for the Cougars, who defeated Okemos and DeWitt before falling short against the Bulldogs in their third tough game in the span of five days. Lansing Catholic coach Gus Flores was happy with his team’s effort in their first defeat, and only the second time they had trailed, this season. “It was inevitably going to happen,” Flores said. “We kept fighting through, so the boys can hold their heads up high. Mason is another quality team around here, and we wanted to see if we could match up with them. I think we did. We gave them a battle.” Mason opened the scoring from a long free kick from the left wing by Peter Brandenburg. Cougar goalkeeper Nick Davis saved the initial shot, but the rebound fell to Rogers, who tucked it inside the far post with exactly four minutes left in the first half. Binder said that his team’s 1-0 lead at the break was a fortunate one. “(We played) much better in the second half than in the first half,” Binder said. “We had trouble matching Lansing Catholic’s intensity in the first half, we lost a few marks in the midfield and we didn’t deserve to be winning in the first half by any stretch.” Tyler Raab started the
Prep schedule Tuesday, Oct. 19 Girls Volleyball Mason @ St. Johns 6 p.m. Leslie @ Hillsdale 5 p.m.
Thursday, Oct. 21 Girls Volleyball Mason vs Northwest 6 p.m. Leslie vs. Parma Western 5 p.m. Girls Swimming Mason @ Waverly 6 p.m.
Friday, Oct. 22 Football 7 p.m. Mason @ Eaton Rapids Leslie vs. Sacred Heart Academy
Saturday, Oct. 23 Kevin W. Fowler/LSJ Media
Nick McNeilly (12) of Mason celebrates with teammates after scoring the only goal of the game in the first half of the Bulldogs’ CAAC Cup quarterfinal game with Everett on Oct. 7. play that led to the second goal, sending Rogers through on the left-wing side of the Lansing Catholic box. Rogers’s first-time shot forced a diving save from Davis, but Lyon was right there to make the score 2-0 just over three minutes after the break. The Cougars had their chances in the game, the best and last of which when Eric Watson’s free kick from outside the left side of the Mason penalty area was headed inches wide of the near post by Aaron Wilson with 11:20 left in the game. Binder said that he liked what he saw after the break. “We were much, much better in the second half,” he said. “We located, we put pressure on every touch, and I thought that was the difference.” After the Cup Final comes the start of the Divi-
sion 2 district tournament, which Mason will open at Marshall on Tuesday, Oct. 19, which may be the most valuable part of having a successful CAAC Cup tournament. “The biggest thing is that we get to play a meaningful game in preparation for a really meaningful game on Tuesday,” Binder said. “We’ve been pointing at that one for a while now.” After the district openers, the rest of the tournament will be played at Eaton Rapids. The winner of the Mason/Marshall game will play Coldwater there on Thursday, Oct. 21 for the right to face either Battle Creek Harper Creek, Battle Creek Pennfield, Charlotte or Eaton Rapids for the district title on Saturday, Oct. 23. Mason will host the Division 2 regional tournament beginning on Oct. 27.
Cross Country Mason vs Red Jamboree 11 a.m. Leslie @ League Meet at Western 10 a.m.
Tuesday, Oct. 26 Girls Volleyball Mason @ Lumen Christi Catholic 6 p.m. Leslie @ Lansing Christian 5 p.m.
Thursday, Oct. 28 Girls Volleyball Mason @ Sexton 6 p.m.
Saturday, Oct. 30 Cross Country Mason @ Regionals at Ella Sharp Park TBA Leslie @ Regionals TBA Girls Volleyball Leslie @ Hudson Invite
Keep up with breaking area high school sports news and more by following us on Twitter —@lsj_hssports.
PREP SPORTS ROUNDUP REGIONALS DIVISION 1 at Belmont’s Blythefield Country Club Team scores–Holt 343, Hudsonville 384, Holland West Ottawa 395, Grandville 396, Grand Ledge 399, Rockford 402,Traverse City West 421, Jenison 422, Battle Creek Central 422, Grand Haven 442, East Kentwood DNF. Holt–1. Mariah Massa 75, T-3. Pader Her 87, 7. Lauren Strong 90, T-8. Casey Harkema 91, *T-10. Haley Bandt 92. Grand Ledge–Beth Boman 96, Heather Promer 99, Alexis Mrozinski 101, Stephanie Benson 103. *Score did not count toward team total, but did place among individual top 10. DIVISION 2 at Eldorado Team scores–East Lansing 350, Battle Creek Lakeview 362, Okemos 388, Portage Central 392, Portage Northern 405, Waverly 414, Mason 443, Kalamazoo Loy Norrix 449, Owosso 450, Lowell 478, St. Johns 483, Mattawan DNF. East Lansing–*T-1. Emily Koryto 81, T-3. Maggie Campbell 82,T-8. Kristyn Crippen 93, Marie Fata 94. Okemos–5. Elle Nichols 84, Emily Wesley 100, Katy Hollis 100, Abby King 104, Ashley Naghtin 104. Waverly–Allison Goodman 98, Kara Politi 99, Rachael Rienstra 104, Hanna Holmi 113. Mason–T-8. Paige Winkler 93, Nikki McDermott 106, Cassie Williams 117, Casey Heckaman 127, Lauren McDermott 127. Owosso–Becca Grubb 105, Kailey Grubb 111, Courtney Carson 111, Courtney Crawford 123. St. Johns–Kaylee Gates 109, Madison LakeWickham 114, Allison Motz 129, Sarah Nodarse 131. *Koryto won playoff to claim championship.
Boys soccer OLIVET 3, DANSVILLE 2 Goals–Walker 2, Huber (O), Dahlem, Soderberg (D). Assists–Maas, Huber (O), Moon (D). In goal–Greene (O) 2 saves, Yantz 6 saves. Record–Olivet 8-7
Swimming MASON 117, LANSING LEGACY 63 200 medley relay–Mason (Hanson, Norgaard, Markiewicz, Bartlett) 2:15.43 200 freestyle–Climber (L) 2:21.31 200 ind. medley–Hanson (M) 2:40.76 50 freestyle–Johnson (M) :28.44 Diving–Getchell (M) 137.20 100 Butterfly–Peters (L) 1:12.96 100 freestyle–Johnson (M) 1:04.18 500 freestyle–Ingalls (M) 6:19.92 200 freestyle–Lansing Legacy (Fuentes, Climber, Peters, Jones) 2:00.52 100 backstroke–Peters (L) 1:08.98 100 breaststroke–Lang (M) 1:23.88 400 freestyle relay–Lansing Legacy (Climber, Jones, Fuentes, Peters) 4:33.22 Records–Mason 3-4
Boys tennis
LESLIE-LANSING CHRISTIAN 5, ITHACA 3 Singles–Stewart (I) d. Helder (L) 4-6, 6-1, 6-3,
Volleyball HASLETT D. EATON RAPIDS (25-15, 25-19, 25-5) Aces–Pringle (H) 3, Tyrer (H) 3, Darrow (ER) 3. Assists–Pringle (H) 16, Tyrer (H) 16, Coats (ER) 8. Kills– Duda (H) 14, Darrow (ER) 7.Blocks–M. Kronner (H) 1. Digs–Patterson (H) 9, Schaeffer (ER) 6. Records–Haslett 18-3-1 (4-1), Eaton Rapids 3-11-2 (0-5). FOWLERVILLE D. CHARLOTTE (25-13, 25-13, 25-9) Aces– Hudson (F) 3, Kirkham (C) 1. Assists– Williams (F) 15, Kirkham (C) 8. Kills– Shuck (F) 5, Dedman (C) 4. Blocks– Brown (F) 2, Geoman (C) 3. Digs– Roberts (F) 10, Miller (C) 9. Records– Fowlerville 9-13-2. PORTLAND D. LANSING CATHOLIC (25-15, 25-8, 25-23) Lansing Catholic Aces– Lunetta 5. Lansing Catholic Assists– Campbell 49. Lansing Catholic Kills– Brown 2, Moore 2, Jarred 2. Lansing Catholic Blocks– Jarred 8, Lansing Catholic Digs– Stoner 10. Records– Lansing Catholic 3-13-1, (1-3). MASON D. OWOSSO (25-14, 25-14, 25-11) Aces–M. Holdin (M) 4. Assists–Service (M) 26. Kills–Lound (M) 10. Blocks–Dippel (M) 1, Spalzer (M) 1. Digs–Riester (M) 5. BATH D. FOWLER 25-17, 25-18, 17-25, 26-24 Aces–Brown (B) 2, Adams (B) 2, Garrity (B) 2, Schomisch (F) 4. Assists–Micheaux (B) 27, Klein (F) 37. Kills–Garrity (B) 23, Koenigsknecht (F) 12. Digs–Micheaux (B) 18, Jandernoa (F) 21. Blocks–Garrity (B) 5, Hufnagel (F) 4.Records–Bath 18-6-1, 6-0. Fowler 7-19-3, 1-5. DANSVILLE D. CARSON CITY-CRYSTAL (25-19, 25-17, 25-22). Aces– Decker (CC-C) 2, Price (D) 3, A. Hedemark (D) 3. Assists– Duflo (CC-C) 12, E. Hedemark (D) 26. Kills– Decker (CC-C) 4, A. Hedemark (D) 9. Blocks– Coleman (CC-C) 1, Kipp (CC-C) 1, E. Hedemark (D) 5. Digs– Schneider (CC-C) 11, Molholen (D) 13. Records– Carson City-Crystal 14-14-2 (1-5), Dansville 14-7-5 (4-2). COLUMBIA CENTRAL D. LESLIE (18-25, 20-25, 16-25) Aces– Swav (L) 2. Assists– Welhusen (L) 14. Kills– Barratt (L) 11. Blocks– Barratt (L) 3. Digs– Ries (L) 14. Record– Leslie 11-11-2 (3-4). MASON D. WAVERLY 25-10, 25-13, 25-23 Aces–Rogers, Riester (M) 2, Major (W) 2. Assists–Service (M) 19, Flowers (W) 7. Kills– Riester, Gittle (M) 8, Harris (W) 6. Blocks– Dipple (M) 3, Harris, McKay, Okafor (W) 2. Digs–Foote (M) 5, Flowers (W) 5. Records– Mason 6-2, Waverly 3-5 STOCKBRIDGE D. LESLIE 25-27, 25-19, 25-14, 25-22 Aces–Stephens (S) 6, Reese (L) 5. Assists– Knepley (S) 12, Welhusen (L) 27. Kills–Knepley (S) 15, Swab (L) 10. Blocks–Knepley (S) 3, Barratt (L) 8. Digs–Gradowski (S) 11, Barratt (L) 11. Records–Stockbridge 4-17-3 (3-5), Leslie 11-12-2, 3-5.
Boys cross country HOLT 23, JACKSON 38 HOLT 20, EVERETT 43 JACKSON 20, EVERETT 43 (at Holt) Holt–3. Hodgman 19:07, 4. Middleton 19:09, 6. Batterson 19:23, 7. Ranke 19:28, 8. Eilers 19:46 Everett–1. Walker 18:28, 17. Hiner 20:58, 26. Wills 22:31, 29. Locke 22:53, 30. Young 23:01 Records–Holt 4-2, Jackson 1-5, Everett 0-6 PORTAGE INVITATIONAL Division 2 team scores–1. Ionia 110, 2. Mason 123, 3. Grand Rapids Forest Hills Northern 125, 4. Fremont 182, 5. Richland Gull Lake 184, 6. Grand Rapids Christian 233, 7. St. Joseph 262, 8. Gaylord
270, 9. Ludington 295, 10. Mattawan 311, 11. Otsego 316, 12. St. Clair 354, 13. Byron Center 392, 14. Vicksburg 446, 15. Grand Rapids Catholic Central 458, 16. Chelsea 477, 17. Ada Forest Hills Eastern 503, 18. Culver 519, 19. Whitehall 525, 20. Tecumseh 527, 21. Holland Christian 550, 22. Coopersville 567, 23. East Grand Rapids 610, 24. Grand Rapids South Christian 639, 25. Milan 677, 26. Stevensville Lakeshore 724, 27. Spring Lake 726, 28. Carleton Airport 732, 29. Remus Chippewa Hills 782, 30. Wayland 831, 31. Edwardsburg 834, 32. Grant 854, 33. Three Rivers 860, 34. Zeeland West 875, 35. Marshall 893, 36. DeWitt 917, 37. South Haven 962, 38. Hastings 1057, 39. Hudsonville Unity Christian 1143, 40. Holland 1196 Ionia–6. Connor Montgomery 16:16, 9 Nick Wharry 16:19, 10. Don Blight 16:22, 39. Brandon Winter 17:03, 46. Tyler Ellis 17:07 Mason–12. Tanner Hinkle 16:25, 13. Mason VanDyke 16:27, 20. Alex Whitmer 16:42, 36. Joe Cecil 17:00, 42. Jacob Hanson 17:05 DeWitt–65. Josh D’Haene 17:30, 182. Nate Kimble 19:05, 215. Phillip McCauley 19:42, 222. Tyler Ellsworth 19:51, 233. Patrick Donovan 20:11
Girls cross country HOLT 18, JACKSON 43 HOLT 15, EVERETT 50 JACKSON 15, EVERETT 45 (at Holt) Holt–1. Carrasco 21:47, 2. Babcock 22:06, 4. Baker 23:13, 5. Smythe 23:17, 6. Becker 23:29 PORTAGE INVITATIONAL Division 2 team scores–1. Grand Rapids Christian, 2. Ada Forest Hills Eastern, 3. Warren Regina, 4. Ionia, 5. East Grand Rapids 259, 6. DeWitt 299, 7. St. Clair 318, 8. Grand Rapids South Christian 319, 9. Gaylord 334, 10. Fremont 334, 11. Grand Rapids Forest Hills Northern 368, 12. Otsego 408, 13. Ludington 429, 14. Holland Christian 430, 15. Spring Lake 441, 16. Dearborn Divine Child 456, 17. Celina 476, 18. Culver 505, 19. Richland Gull Lake 506, 20. Mason 516, 21. Grand Rapids Catholic Central 524, 22.Three Rivers 560, 23. Remus Chippewa Hills 637, 24. St. Joseph 641, 25. Byron Center 646, 26. Zeeland West 677, 27. Carleton Airport 686, 28.Wayland 688, 29. Mattawan 711, 30. Coopersville 711, 31. Marshall 736, 32. Vicksburg 751, 33. Hastings 757, 34. Milan 857, 35. Hudsonville Unity Christian 918, 36. Whitehall 937, 37. Stevensville Lakeshore 976, 38.Tecumseh 1017, 39. South Haven 1054, 40. Holland 1057, 41. Grant 1182, 42. Edwardsburg 1263 Ionia–23. Amanda Brewer 20:06, 32. Morgan Miller 20:22, 47. Julia Kessler 20:39, 53. Brianna Wiles 20:49, 102. Emily Morlock 21:47 DeWitt–17. Kayla Hanses 19:56, 39. Emily Murdoch 20:31, 9. Jessica D’Haene 21:02, 66. Lauren Rademacher 21:06, 18. Molly Benton 22:05 Mason–13. Cassidy Hass 19:52, 28. Abbey Soule 20:14, 157. Karley Miller 22:40, 158. Nadia Riggs 22:41, 160. Ashley Yallup 22:42
Mason 45, Muskegon Hts. 12 Muskegon Hts. 0 Mason 10 First quarter
6 6 0 - 12 0 14 21 - 45
Leslie 61, Albion 32 Albion 0 Leslie 14 First quarter
18 16
8 6 - 32 8 23 - 61
L - B. Smith 2 run (run failed) L - K. Bryson 50 pass from B. Kibbey (B. Kibbey pass from B. Smith)
Second quarter A - A. Watkins 64 Yard Pass from T. Woods (Pass Failed) L - J. Kunze 6 run (J. Kunze run) L - Safety A - K. Harris 95 pass from T. Woods (run failed) L - K. Bryson 8 pass from B. Smith (pass failed) A - T. Woods 43 run (run failed)
Third quarter L - C. Carmer 40 pass from B. Smith (Z. Culver pass from B. Smith) A - A. Watkins 7 pass from T. Woods (A. Watkins run)
Fourth quarter L - C. Carmer 2 run (J. Kunze run) A - A. Watkins 18 run (pass failed) L - C. Smith 66 run (B. Smith run) L - C. Carmer 15 run (R. Armstrong kick)
Les First downs 30 Total Net Yards 580 Rushes-yards 47-348 Passing 232 Comp-Att-Int 13-22-0 Fumbles-Lost 2-1 Penalties-Yards 10-105
Alb 20 450 26-109 341 15-30-0 5-1 11-105
INDIVIDUAL STATISTICS Rushing - Albion, Anthony Watkins 8-36, Tyler Woods 11-85. Blackhawks,Andrew Arras 16-104, Chanler Carmer 4-26, Jeremy Kunze 2-10, Brendon Smith 17-103, Chrishawn Smith 8-105. Passing - Albion, Anthony Watkins 0-1-0-0, Tyler Woods 15-29-0-341. Blackhawks, Brandon Kibbey 1-1-0-50, Brendon Smith 12-21-0-182. Receiving - Albion, Kyle Harris 1-95, Anthony Watkins 6-140. Blackhawks, Andrew Arras 1-8, Kyle Bryson 4-107, Chanler Carmer 3-65, Zachary Culver 2-22, Brandon Kibbey 1-10, Jeremy Kunze 2-20.
Laingsburg 33, Dansville 14 Laingsburg 14 Dansville 0 First quarter
6 7
6 0
7 - 33 7 - 14
L - J. Arthur 11 run (C. Czerwinski kick) L - C. Domagalski 57 interception return (C. Czerwinski kick)
Second quarter D - F. Graham 6 run (H. Price kick) L - C. Czerwinski 80 kickoff return (kick failed)
Third quarter
M - J. Derby 27 field goal M - S. Lavallii 30 run (J. Derby kick)
Second quarter MH - A. Ross 5 run (kick failed)
Third quarter M - S. Wren 65 run (J. Derby kick) MH - W. Snead IV 12 run (run failed) M - S. Lavallii 65 run (J. Derby kick)
Fourth quarter M - S. Lavallii 6 run (J. Derby kick) M - B. Hinamanu 48 run (J. Derby kick) M - S. Lavallii 88 run (J. Derby kick)
Mas First downs 10 Total Net Yards 417 Rushes-yards 28-375 Passing 42 Comp-Att-Int 3-8-0 Fumbles-Lost 2-1 Penalties-Yards 11-88
17-40-0-233. Bulldogs, Thomas McNamara 3-8-0-42. Receiving - Muskegon Heights, John Hall III 4-110, Deontae Hudson 8-99. Bulldogs, Blake Cook 1-13, Sean Wren 2-29.
Mus 17 378 31-145 233 17-40-2 1-0 12-77
INDIVIDUAL STATISTICS Rushing - Muskegon Heights, Adam Ross 9-52,Willie Snead IV 18-74. Bulldogs, Benjamin Hinamanu 6-64, Saylor Lavallii 20-248, Sean Wren 2-63. Passing - Muskegon Heights, Willie Snead IV
L - J. Arthur 63 run (kick failed)
Fourth quarter L - S. Gerger 24 pass from D. McAvoy (C. Czerwinski kick) D - F. Graham 80 Yard Run (H. Price kick)
Dan First downs 16 Total Net Yards 321 Rushes-yards 39-138 Passing 183 Comp-Att-Int 17-20-3 Fumbles-Lost 1-1 Penalties-Yards 9-95
Lai 14 341 42-297 44 3-9-0 0-0 7-55
INDIVIDUAL STATISTICS Rushing - Wolfpack, Joseph Arthur 16-157, Alexander Barragan 1-11, Colin Domagalski 7-62, Trevor Marshall 4-7, Derrick McAvoy 5-23, Steven Simons 5-19, James Storey 1-12. Aggies, Forest Graham 3-90, Jacob Hause 25-102, Andy Parsons 3-14. Passing - Wolfpack, Lukas Genther 0-1-0-0, Derrick McAvoy 3-8-0-44. Aggies, Andy Parsons 17-20-0-183. Receiving - Wolfpack, Casey Czerwinski 1-16, Colin Domagalski 1-4, Stephen Gerger 1-24. Aggies, Nate Bailer 2-23, Josh Demers 1-0, Forest Graham 7-84, Jake Grice 4-52, Jacob Hause 2-20, Nick Pearce 1-7.
Courtesy photo
Award nominees sought The Kiwanis Golden K Club of Mason is seeking nominees for the Sue Parsons Community Service Award. The award is named after deceased Kiwanian Sue Parsons who spent much of her life in service to Mason. During that life she was a charter member of the Golden K service club, chaired many of the club committees, was club president, started the Aktion Club for adults living with disabilities, served as mayor of Mason and was voted as Citizen of the Year. Send the nominee name and description to gschleicher@cablespeed.com.
Mason student earns distinction EVANSTON, Ill. — Brian R. Crackel has been named a commended student in the 2011 National Merit Scholarship Program. The announcement was made by Mason High School Principal Lance Delbridge. Brian A letter of commendaCrackel tion from the school and National Merit Scholarship Corporation, which conducts the program, will be presented by the princi-
pal to this scholastically talented senior. Preliminary PSAT/National Merit Scholarship Qualifying Test. — From the National Merit Scholarship Corporation
October 17, 2010
REGIONALS DIVISION 3 at Haslett Team scores–Ionia 24, Haslett 23, DeWitt 20, Mason 9, Bay City John Glenn 8, Eaton Rapids 8, Owosso 7, Waverly 7, Corunna 5, Sexton 3, Charlotte 2, Saginaw 0. Singles–Bob Miller (I) d. Michael Sorrell (W) 6-1, 6-2. Steve Manciu (I) d. Nathan Riley (H) 7-6 (3), 6-4. Jeremy Marsh (I) d. Tyler Jeusen (B) 6-3, 6-2. Joe Voet (I) d. Jared Helmic (D) 6-2, 6-3. Doubles–Jacob Treadway-Connor Zamiara (D) d. Matt Pokryfki-Mike Pokryfki (H) 5-7, 7-6 (6) 6-4. Zach Bepler-Kyle McCrae (H) d. Luke Braun-C.J. Maynard (I) 7-6 (1), 6-4. Eric McCoy-Sam Schuster (D) d. James BaranNick Hill (H) 6-2, 7-6 (5). Kevin Dulic-Wes Holton (H) d. Nick McCoy-Wyatt Treadway (D) 6-4, 6-4.
Kim (L) d. Merchant (I) 6-4, 6-1, Hofman (L) d. Glynn (I) 6-1, 6-1, Evon (I) d. Suh (L) 6-0, 6-4. Doubles–Skromme-Riffle (L) d.Tucker-Barnes (I) 3-6, 6-2, 6-4, Moore-Vandeharr (L) d. Klein-sherman (I) 6-3, 6-1, Merchant-Lorrentz (I) d. Fields-Greydanus (L) 6-1, 1-6, 7-6, 10-7, Lim-Kim (L) d. Sanders-Cunningham (I) 6-0, 6-0. Records–Leslie-Lansing Christian 3-3, 1-2.
Ingham County Community News
Girls golf
29
Ingham County Community News
30
Library a good source for science research At the Library Thais Rousseau
Then there are eBooks. Even in the comfort of your pajamas you can learn more about dinosaurs with eBooks like “Encyclopedia of Dinosaurs” and “Eyewitness Dinosaur.” To find them, visit cadl.org and click on Research Tools, then on the Science link. More great information can be found in the database SIRS Discoverer. Click on the Animals icon and you’ll find links to lots of articles about dinosaurs and other extinct animals. Dino fans won’t want to miss a family “Dinosaur Day with PaleoJoe” at 4 p.m. Thursday, Oct. 28 at the Dansville Village Hall. “PaleoJoe” Kchodl is a paleontologist and author whose high-energy program will make you feel like you are
Soccer players honored
Scott Yoshonis
Doubles duty Mason’s Brendan Martin returns a serve in his No. 4 doubles match at the Division 3 regional tournament in Haslett on Oct. 7. Martin and doubles partner Aaron Brown lost this second-round match to eventual team champions Ionia in a third-set tiebreaker, 6-1, 3-6, 6-7. Mason finished fourth in the regional, amassing nine points.
Dolores C. Burchill Mason D olor es C. Burchil, our belov ed mother , grandmother and great- grandmother , entered eternal life on October 10, 2010. S he was born January 12, 1932 in Highla nd Park, MI to Edward and Virginia (Mitter) Rice. D olor es graduated 1949 f rom Highla nd Park High School and worked at Henry Ford Hospital wher e she met Weldon in 1955. They married in 1957 and enjoyed 52 wonderf ul years together. In 1959 they moved to Mason wher e she worked for many years as an assistant in his dental practice. D olor es was a longt ime member of A l Saints Luther an Ch urch . S he was an excellent cook and enjoyed sewing. S he was a very kind and giving individual, a true angel, and al ways put her f amily first. S he was preceded in death by her parents, and brother , Edward. S he is survived by belov ed spouse, Weldon; daugh ters, Kathleen "Katy" Burchil, Kirsten Burchil, Eliz abeth Burchil (John S uchomel); one son, Weldon (Patricia) Burchil; four grandchildr en, A lyson (AJ) Behr ens, Mary Burchil, Cl are Burchil and A lex Rau; one great-grandchild, Brooke Behr ens; brother , Robert Rice; sister-in-la w, Harriet Burchil; brother -in-la w, Kenneth Q. Burchi;l and many nieces, nephews and f riends. Funeral S ervices will be held 12 Noon Saturd ay, October 16, 2010, A l Saints Lutheran Church, 720 W. S outh S treet, Mason, MI 48854, with the Rev. Ch uck Foerster of fic iating. The f amily will receive f riends 5-8 p.m. Friday at the G orsline Runciman Funeral Homes, 621 S . Jefferson, Mason, MI and Saturd ay at the ch urch f rom 11:00-12:00 noon. In lieu of flow ers, the f amily requests contributions to the ch arity of your choic e in her name. On-line condolenc es may be made at cimanmason.com
Delmer Kramer Mason Born May 22, 1928 in Mason the son of James and Eva (McMahon) Kramer, passed away on October 9, 2010 in Lansing. D elmer was preceded in death by his wife Caroly n of nearl y 60 years and a broth er James. He is survived by two daught ers Karen (Bryan) Martin, Patti (Rick) Harper and a son Mike (S usan) Kramer, 5 grandchildr en Heather (Phil) Mallinger , A utumn (Daniel) S owders, A shley (A ndy) Bentz, Hannah Harper and Rachel Harper and his sisters D elal (Norman) Warren, Theo Wilhelm, and Tillie (Lowell) Martin. D elmer graduated f rom Mason High School in 1947, and attended the University of Michiga n and in 1975 received his degree f rom the G raduate School of Banking at the University of Wisconsin. He served in the U.S . A rmy f rom 1952 to 1954. He owned and operated the Eden G eneral S tore and Post Offic e. He was S enior Vice President of Dart National Bank wher e he was employ ed for over 40 years. D elmer was a for mer President of the Mason Hospital, and a longt ime member of Mason Kiwanis Cl ub. D elmer was an active member of Eden United Breth ren Ch urch for 75 years and an usher for 54 years. The f uneral service for Mr. Kramer was held on Th ursday, October 14, 2010, 11:00 a.m. at the Eden United Breth ren Ch urch, 1938 Eden Road, Mason, Michiga n with visitation at the Ch urch on Wednesday, October 13 f rom 2~4 and 6~8 p.m. and 1 hour prior to the service at the Ch urch with the Pastor Dan Bentz offic iating. Interment will folow at Maple G rove Cemetery, Mason. In lieu of flow ers memorial contributions may be made to the Eden United Breth ren Ch urch . On line condolenc es may be sent to: cimanmason.com
October 17, 2010
Courtesy photo
Dansville High School honored eight senior soccer players along with their parents at their last home soccer game on Oct. 7. The players honored were: Brad Hodge, middle field; Brad Butts, middle field; Nick Moon, middle field; Aaron Hoefling, goalkeeper; Jay Witchell, forward; Joe Pulling, defense; Ethan Gurecki (pictured), sweeper; and Karl Schlicker.
actually back with the dinosaurs, millions of years ago. He will bring the past to life with a T-rex tooth, velociraptor skull and other amazing fossils. PaleoJoe actually discovered a 60-foot long Camarasaurus dinosaur in the deserts of Utah! Come in to CADL Dansville soon to master the Mesozoic and lots of other science topics. For a complete list of all CADL events, visit our online calendar at cadl.org/events. The Dansville Library, a Capital Area District Library, is located at 1379 E. Mason St. For information about our hours, programs or services, call (517) 623-6511 or visit cadl.org. Thais Rousseau is the head librarian at the Dansville Library.
Ingham County Community News
Everyone seems to know they can count on the library when they’re looking for books by their favorite bestselling author, classics on their student reading lists or old favorites like Dr. Seuss. But the library also is chock-full of great science information for curious minds. Often the first topic to spark scientific curiosity in children is dinosaurs. There is something about huge, extinct, prehistoric animals that rouses wonder and imagination. A quick search of the Capital Area District Library (CADL) catalog brings up a variety of resources, from dinosaur encyclopedias, books of facts, stories, magazines (CADL Dansville has an issue of ZooBooks dedicated to the topic) to DVDs and CDs. One of my personal favorites is a music CD narrated and sung by Al Jarreau. Called “A T-Rex named Sue,” it’s based on the true story of the largest tyrannosaurus skeleton ever found.
31
Ingham County Community News
32
Bulldog harriers on track late in season By DICK HOEKSTRA dhoekstra@lsj.com
With all but one runner returning from a team that won the 2009 Greater Lansing Cross Country Championships by more than 120 points, it appeared before the season that Division 2 state champion Ionia would easily repeat. But then came the emergence of second-ranked Mason, which lost 110-123 to Ionia in the first meeting of the season against each other at the recent Portage Invitational. “I don’t think we ran our best on Saturday,” Mason coach Charles Miller said. “So we’re happy to take another crack at them.” The boys race was to take place at Ledge Meadows Golf Course on Oct. 16, after this paper went to press. This year’s final victory margin may be similar to St. Johns’ 141-144 win over Ionia in 2008, but each team might score about 100 points less than that since both Ionia and Mason will
likely place all of their first five within the top 30 runners who receive individual medals. Both team’s top runners will also compete with East Lansing senior Robbie Glew and Perry senior Justin Krauss for first place individually. Ionia junior Connor Montgomery has run the fastest time so far this fall, 15:47 while winning the Grand Rapids Catholic Cougar-Falcon Invitational on Sept. 25. Senior Don Blight and junior Nick Wharry were each the Bulldogs’ top runner in the two meets after that. “They have no qualms about who wins, and that’s neat,” Ionia boys coach Chris Young said. “Each is distinctly different. Connor has great heart, Wharry has all of the talent in the world and is still learning how to use it, and Blight runs on pure guts.” Tanner Hinkle has replaced sophomore teammate Alex Whitmer as Mason’s top runner in most
recent meets. Hinkle’s top time of 16:13 is more than a minute faster than his 2009 best of 17:29. “He has run every day since July 2009,” Miller said. “While I wouldn’t recommend that for everybody, that work ethic has made Tanner very strong.” Junior Joe Cecil, who joined other teammates on most of Hinkle’s summer workouts, also improved from a 2009 best of 17:02 to 16:18 so far this fall. The latest Bulldog showing considerable improvement is freshman Mason VanDyke. The 2009 Greater Lansing Junior Cross Country Championship winner was Mason’s second man with a 16:26, down seven seconds from his previous best. “He seems to be coming on at the right time for us after some slight injury issues early in the year,” Miller said. Six returning Ionia runners were faster in 2009 than Mason’s top returner (Whitmer), who ran 16:52
last fall. But the Bulldogs’ vast improvement from 32nd in the 2007 Greater Lansing meet to 22nd in 2008 to ninth last year should take them to first or second on Saturday. “I knew I had a good group coming, but you never know how it’s going to come together,” Miller said. “It’s been fun watching it come to fruition. To have a chance going into this meet of winning it is exciting for them, for me and for Mason.” Determining who may take third to Ionia and Mason will likely depend on the performance of their fifth runners among Division 3 fourth-ranked Lansing Catholic, Division 2 honorable mention Haslett, CAAC Blue leaders Okemos and East Lansing, and Division 3 No. 6 Perry. Other teams aiming to crack the top 10 include Holt, Division 4 secondranked Potterville, Charlotte, Grand Ledge, Alma and Williamston.
Ike Lea
Mason cross-country runners Jacob Hansen (1571) and Joe Cecil (1567) are in action earlier this season at the Spartan Invitational back on Sept. 17. The Bulldogs will compete in the Division 2 regionals at Jackson’s Sharp Park on Oct. 30.
LaSavallii leads Bulldogs to nonleague win By SCOTT YOSHONIS
October 17, 2010
syoshonis@lsj.com
MASON — Saylor LaVallii rushed for 248 yards and four touchdowns to lead Mason to a 45-12 rout of Muskegon Heights (3-4) in a non-league football game on Oct. 8. The win clinched automatic qualification for the MHSAA state playoffs, and gave the Bulldogs some momentum going into their biggest game of the year, the CAAC Red finale against Sexton on Oct. 15. That game, which was played after this paper went to press, gave Mason a chance to clinch a share of the league title with a win. Sean Wren and Ben Hinamanu scored the other touchdowns for the Bulldogs (6-1), in a game of two distinctly different halves. Mason scored just twice in the first half, both with the benefit of a short field. First, Eric Nelson recovered a Tiger fumble at the 50, but the Bulldogs had to settle for a 27-yard field goal by Jacob Derby that made the score 3-0. Then, Mason took over after a shanked Heights punt that gave the Bulldogs the ball on their own 43. LaVallii scored on a 33-yard run three plays later to give his team a 10-0 lead with 2:41 left in the first quarter. Muskegon Heights then also took advantage of good field position, as Deontae Hudson ran the ensuing kickoff back to the Mason 41 yard line, and Adam Ross scored from four yards out on the first play of the second quarter to cut the lead to 10-6.
Penalties and mistakes hampered both teams for the rest of the half, which saw the Tigers’ Division 1 college prospect Willie Snead drive his team down to the Mason one-yard line. A holding penalty drove them back, and Wren picked off a Snead pass in the end zone with 3:56 left in the second quarter to keep the contest 10-6 at the break. “We didn’t get into our rhythm in the first half,” VanHavel said. “Part of that was them (Muskegon Heights) playing well, but part of it was our not playing well in the first half. I told the kids at halftime to just settle in and get a good rhythm, and that’s what they did in the second half.” “We didn’t play our best football game tonight, but that’s a positive for us. It was a great victory, and you can’t look down on a victory.”
Second half better Mason began to find, or create, holes in the Heights defensive line in the second half that were not there in the first, starting with Wren, who ran 64 yards for a touchdown with 3:40 left in the third. Snead scored from 11 yards out on the Tigers’ next possession to make the score 17-12, but it was all Bulldogs from there. LaVallii broke free for a 65-yard TD on the next snap from center, and scored from six yards out on the fourth play of the fourth quarter to increase the lead to 31-12. Hinamanu broke several tackles on the way to a 48-yard
TD run on the first play of Mason’s next possession with 7:35 left in the game, and LaVallii provided an exclamation point to his, and Mason’s, evening with an 88-yard touchdown with 1:09 left. The Bulldogs have scored 44 points or more in all five of its wins this season. “It was a big win for us, but we have the biggest game of the year next week, so we have to prepare for that,” LaVallii said. “St. Johns was a really tough loss for us, so we have to get to work this week for Sexton.” That Sexton game, which gave the Bulldogs the chance to claim their third straight league title, was a mirror image of last year’s clash between the two. Mason went to Sexton having clinched a share of the 2009 title, looking to take it outright with a win, but the Big Reds made it a three-way tie with St. Johns with the upset win in overtime. This year, Sexton went into the game with at least a share in their pocket, and a Mason win would almost certainly cause a three-way tie with the Redwings at the top of the standings. This week, the Bulldogs travel to Eaton Rapids on Friday, Oct. 22 for the regular-season finale against the woeful, winless Greyhounds, winners of just four games in the last six seasons. Mason will begin its postseason with a pre-district game on Friday, Oct. 29, with the venue and opponent yet to be determined.
CLASSIFIEDS – CALL 1-877-391-SELL(7355) OR 1-877-475-SELL(7355) Lost Items LOST/ REWARD OFFERED Bowcase & Bow f rom back of truck. Lost Sat . Oct. 2, 8 PM on Dell or Pine Tree Road in Holt. Very sentimental. Please call. (517)230-3215
Public Notices FIBER EXPO CLAS,SE Vendors, Animals. Oct 23 & 24, 2010. Saturd ay 9am-5pm, S unda y 10am-5pm. $4 ad mission. Washtenaw Farm C ouncil Grounds , 5055 Ann Arbor Saline Road, Ann Arbor, Michigan, 48103. xpo.com 734546-0032 MC
Bulletin Board
Adoption HERNIA REPAIR? Did You Receive a C omposix Kugel Mesh Patch Between 19992007? If MM IF YOU USED TYPE 2 DIAB E T E S Drug Avandia Or Weight Loss Drug Meridia and suffer ed a heart attack or stroke, you may be entitled to compensation. Call Attorney C harles Johnson 1-800-53 5-5727 PIANO LESONS E xperienced and refer ences. Reasonable tuition. Call 321-2627
ADOPTION: Loving couple with open hearts will provide warm, secure home to a child. Help make our lives complete. E xpenses paid. Call Ben/Jodie 1-800- BEST HOME LOANS! ** Land 654-5162 C ontract and Mortgage Payoffs , HomeImprovements, DebtC onsolida tion, Property Taxes. Foreclosures. PURCHASES TOO! Includes Houses/Mobiles/Mod ulars Good/ Bad /U gly C redit ! LOST DIGITAL CAMERA at 1-800- 246-8100 Anytime! Sam ’s C lub E dgew ood U nited Mortgage S ervices. store on Oct. 5th. If fou nd. please return. S im card s MC left w/camera. It will be greatly appreciated. Plea- IT’S YOUR MONEY! Lump se mail to E . Drake, 5200 sums paid for structured Pleasant Grove Rd. Lanssettlement or fix ed annuiing MI 48911. ty payments. Rapid, high payouts. Call J.G. Wentworth. 1-866- 294LOST GOLD W/BLUE S TONE 8 772. A+ Better Business MS-U 69 ALUMNUS RING, Bureau rating MC Reward. a C ll 517-993-86 41.
Loans
Lost Items
Money to Loan
Garage Sales Rural
Garage Sales Suburb
WINTER SALE BIG ****BEST HOME New kids thru ad ult coats, LOANS ****Refina nce for boots, hats, mittens, any reason: Mortgage and sweaters, holida y dec or. Land C ontract payoffs , 9am-5pm, Fri. & Sat . Oct. deb t-consolida tion, home 22 & 23. 2450 S . Hartel, CHARLOTTE- ANTIQUE improvements, property C harlotte. SALE! 221 EAST LOVETT, taxes, for eclosures. PurOct 21-23 (Thurs-Fri 9amchases too! Includes 7pm;Sat . 9am-4pm) Houses/ Mobiles/ Modu lars. Cas h Available NUMBERS AT for good/ bad /ugly credit ! 8:30AM THURS. 1 - 8 0 0 - 2 4 6 - 8 1 0 0 Oak f ull sized bedr oom set; several oak chests of BLOOMQUIT S SERVICES MM d rawers; various des ks; ESTATE S ALE . 110 N. LOsecretaries; numerous DRDANIE LS ANDS ON.C OM GAN, DEWITT. FRIDAY & SAchairs of all types; parlor TU R DAY. Oct. 22 & 23. 9 to CASH REAL ESTATE sets; ward robes; ornate LOANS We Buy Land C on- 2 d aily. At the dow ntown piano stool; parlor tables; tracts. $10,000-$500,000 light in DeWitt go west two oak high chair; walnut tea DrDanielsAndS on.com Pri- blocks to Logan then north cart; Robbins dining table; vate Money, Fast! Deal to sale. E state of Roberta f ainting couch; round oak with Decision Maker. Reed. Packed home w/ anpedesta l dining tables; tique f urniture inc. mahoMichigan Licensed clocks (mantle & des k); gany d ropleaf dining set NMLS#13 8110 8 00-837numerous light fixture s 6166 or 248-335-6 166 w/ 3 leaves & six harp and parts; 2 newel post Allan@DrDanielsAnd S on.c back chairs, oak & walnut lamps; beds; handy man?s commode/ d resser, jenny om bed; d ressers including a lind bed, mahogany four MM walnut Eastl ake w/ slate poster bed w/ vanity & tall top; Mission & Victorian 7 d rawer d resser, oak side board s; hall trees; 1890s fiv e d rawer highboy Grinnell Bros spinet piano; d resser, Lincoln roll arm pictures; f rames; ceda r rocker, one d rawer stand, chest; oak ice box; large > Cable Nelson baby dis play case; rugs of many Grand Piano, Victorian sizes; Portland Library circhairs, marble top culation des k and much plantstands , 40s side tamore? bles, mahogany des k, footstools , curved corner Glassware & china of all credenz a, boudoir chair, kinds . Hall red teapots, nic nac shelves, cool for mipitchers, bowls, etc.; lots ca serving cart, dec o BLOOMQUIST SERVICES of art pottery (Roseville, chrome barstool, mirrors, ESTATE S ALE . FIRST OF Rookwood, Weller, Owens, fine lamps inc. onyx, hand TWO THIS WEEK. 108 7 Hull, Van Briggle); silver painted, enamel on gold & FOXHILLS, EAST LANSING. (sterling & silver plate); pottery, wall art, prints & THURSDAY & FRIDAY. Oct. Cam bridge Depression oils, newer items w/ High21 & 22. 9 to 2 d aily. Off N. glassware; ten piece servland house sofa , loveseat, Harrison j ust south of Lake ice of Manhattan with upholstered chairs, dinette Lansing Rd. take Tarleton serving pieces (no Park set, tv & more. Lots of nice west to Winchester to Ave.); Franciscan Apple old glass & china, Noritake, Foxhills. Nice sale w/ 20s dinnerwa re (all vintage); Nippon, Limoges, turkey carved dining set w/ six Royal Ruby glassware; plates, Johnson Bros. china chairs, antique shabby Georges Briard Victorian set & fine hand painted. chic hall tree with seat, Gardens china; Lenox Precious Moments, pitcher & bowl washstand ?Winter Greetings E veryRoseville vases, as-is, cut, w/ mirror, old school des k, d ay? ironstone; Pf altzgraff pressed, elegant, depr esnewer oak buffet , oak din C hristmas glasses; sion, Fenton & other glass, ing set w/ roll about Noritake Juno china; signstemware, sterling, chairs, upholstered f urn. ed Haviland platter; 2 silverplate & gold tone Vioinc. large hassock, two quilts; a e f w linens; vinla dinner ware, jew elry, piece swivel chair w/ rocktage kitchen utensils; wire some clothing, nice old ing footstool, nice oak side ice cream parlor table & linens, Necchi portable tables, wooden chairs & chairs; newly restored vinsewing mach., lots of kitchrocker, barstools, old S ingtage porch glider; porch en wares, micro, C hrister console mach., king rocker; 2 vintage lawn mas, Mary & Joseph brass bed, iced finis h ward chairs and much more. Hummels, books, games & robe d resser & long mirTerms: Cas h, Local checks. sheet music. Garage w/ rored d resser, queen bed, S orry, no credit card s. Call household supplies, lawn other d ressers, nitestands , 517-285-90 19 or E -mail & garden misc., a few comp. des k, painted f urn., newkirkmm@yahoo.com tools, Sch winn exer. bike & prints inc. Lake C harlevoix, with questions. tons more. Numbers at 8 tv’s inc. Sam sung 40" LCDFri., garage at 8:30, home HD, Pioneer tuner & speakat 9. Full det ails & pictures ers, lamps, printer, C hristDEWITT, NOT YOUR U S U AL at: mas tree, Dept. 56 snow vilGARAGE SALE!, Sat , Oct 23, lage, snow baby coll. w/ 9:30 a.m to 2:30 p.m., 401 boxes, glass & china, PORTLAND GARAGE SALE Riverview Drive (off W. Noritake set, German 5 Families! THE A S LE YOU Geneva Drive, f rom C hristmas dinnerwa re set, HAVE BEEN WAITING ALL Sch avey or Herbison silverplate table service SUMMER FOR! Household Road). S elling collectibles set in box, kitchen misc., items & dec or, flor al sofa , at redu ced prices: LOTS of mixer, breadma ker, books, matching footstool and Longaberger baskets, colrecord s, some linens, mancurtains, o f os ball table, lector plates, Beanie Baual treadmill, golf clubs & antiques, kid’s toys, boys bies, Beanie dis play cases, more. Numbers at 8 Thurs. quality clothing size 3 – , 8 and seasonal dec or. Home opens at 9. No early ad ult clothing, several YOU DON’T WANT garage. Full det ails w/ picpurses, and many items TO MISS THIS ONE! tures at: priced under $1.00! Fri. 10/22, f rom 8 – 6 and Sat . 10/23 f rom 8 – 3. 9910 EATON RAPIDS MOPS Looking Glass. Mom 2 Mom Sale! Sav e the d ate. Sat ., Oct. 23, 9am-1pm. First U nited Methodist C hurch 600 S MULTI FAMILY S ALE 12494 Main S t, Eat on Rapids . Petrie Rd., S unfield. Over 35 difer ent venThurs.-Sat . Oct. 21-23, 9-5. Selling an item dors with clothing, f urniWooden swing set, 6’ dou ture, equipment, toys, SEE SOURCEADS.COM ble sink vanity, des k, etc. Free admission. OR CALL LCN TOLL FREE couch, stove, toys, kick Call E mily at 517-663877-475-SELL boxing bag, misc. f urni6353 for more info.! ture., househhold dec or.
Garage Sales Suburb
Garage Sales East Lansing
Garage Sales Rural
Garage Sales Suburb
Animals Lost
Dogs-Cats-Pets
MASON- BASEMENT CLEAN - BLACK & WHITE DSH, 3 yr. BEAGLE MALE $300. PUPS AKC, 7 wks DACHSHUND OUT!! 1207 TUTTLE RD., Pomeranian males $250, old, good hunting stock, old, fema le cat lost in Oct. 23, 9-5p.m. Furniture, fema les $350. Maltese fegreat pets! Wormed, S toney Brook S ub., Grand computer des k, wing-back male $8 0 0. All AKC pupshots, $100. 517-651-7377. Ledge. "Kira". 517-627chairs. Lawn roller, tread pies. 231-924-5090. S t. Johns 168 6.REWARD upon return. mill, sit-up bench, collectibles, clothing and LARGE BREED DOBERMAN PUPPIES 3 red Dog lost in BICHON FRISE PUPPIES! much more!! fema les $350; 2 red males Mulliken area. Female, 9 Perfec t f amily pet! $300. Read y for good home years old. Tan with purple No shedding or odor . MASON- MULTI FAMILY 616-225-2241. collar. Family dog missing CK,C Health guaranteed. A S LE, 2205 S . Meridia n since 9/24. Please phone 517-663-2256 Rd., Barnes off 127 E . to with any infor mation ENGLISH BULLDOG PUPS Meridia n Rd. Oct. 22 & 23, (517)242-9812 AKC, 3 fema les, 1 male, 3 BICHON- POM PUPS , 1 male, 9-? Hallmark & other holimos. S hots. $1,500/obo. 1 fema le. White. Read y to d ay dec or, books, craf t 517-569-3744/517-87 9-6773. go! Pure Pom, male, $300 supplies, glassware, clothto $450. 269-763-2102 ing, and much more!! GERMAN SHEPHERD PUPS some imported, $650+. PORTLAND- 315 WEST S T. orestk9kennels.com BOSTON TERRIER PUPS GERMAN S HE PMany household items, 2 FEMALE Call 810 -631-6185 EXCELLENT Q ualit y , HE R D PU P PIE S 11 wks old , some antique dis hes, S hots, wormed. $300. ador able. MSTA. $500. Call clothes, some f urniture. 517-580 -9420 GOLDENDOODLE PUPPIES 7 1-517-541-6693. Oct. 21-22, 8:30-5 p.m. wks. old, 3 males, 2 females, shots & wormed, GOLDEN RETRIEVERPORTLAND - 628 RIVE RS IDE 7 $300. Call 517-857 -2187 . BOSTON TERRIER PUPSBLAC K LAB PUPPIES MIX, 5 DR. Oct. 21 & 22, 9-5. Boys purebred. (2) beautifu l 6 fema les, 2 males. 7 wks clothes size 5 & under , wk. old fema les. S hots, GOLDEN DOODLE PUP-S 5 old. Call 517-372-538 0. misc. boys baby items, wormed. Very social. mos., 2 fema les. $600. household and misc. $350. 517-487 -8704 inmichigan.com items, & E lliptical. ADBA BLUE NOSE PITBU LL 269-503-0636/269-489-53 18 PUPS $300-$350. Call 517- BOXER PUPPIES AKC, born 993-4648. SHED SALE: Sat ., Oct. 23. 8 9/7. Read y 10/23. 5 fe- GOLDEN RETRIEVER PUP a.m. - 4:00 p.m. Good f urmales, 4 males, f awn & PIES, $250. HURRY, 4 LEFT! niture, newer appliances, AKC GERMAN H S P E HERD brindle, $500, now taking Male & fema le. Also, loft , collector knives, huntpuppies, 3 fema les, 1 depos its. C hihuahuas. 989-235-6 566. ing items, much more! black, 2 sables, 7 wks, or 5198 Winds or Hwy. shots & wormed, parents 517-623-6859. GOLDEN RETRIEVER PUPS Potterville. on site. $450 limited. 989vet checked, 1st shots, 855-3662 wormed, e f ma les $450, BOXER PUPPIES Very large, males $400. 989-763- 7202 born 9/3, read y to go Oct. AKC GERMAN SHEPHERD 23. Vet chkd, tails & dews. pups. 1st shots & asking $500. 517-321-6562. HIMALAYAN/RAGDOLL KITdew ormer. Born 8-13 -10. TENS 13 wks., f ull shots, $500. 517-541-7297. 567 STERLING DRIVE, $125/each. Call: 517-316BOXER PUP,S AKC C hamDIMONDALE, Fri, Oct. 22, 97429 pion lines. Vet, checked, 6, Sat , Oct. 23, 9-2 House- AKC GERMAN SHEPHERD tails, dews. Read y to go. hold, f urniture, PUPS born 9/3/10, Vet $500. 517-812 -2392 KITS/ CATS; NICE RE;SCUE c o l l e c t i b l e s . chkd., parents on site, w.estatesales.net/estate$450. 517-908-0 171. etfinder .com; many deBOXE R S AKC RE G IS T R E D E sales/139137.aspx No Preclawed; incl.neuter/med. puppies, 6 fema les. $400. sales. 517-256-0695 S outh AKC $45- $135. (517)410-0074 GERMAN SHEPHERD Call 517-702-9573. of Lansing Road and Can al. PU PS Hip, health guar. 6 mo. old, good C hampion show lines. CHIHUAHUA PUPPIES U TD KITTEN!S homes only, very cuddly 2 $600. 989-205-9204. on shots, 1 male, 1 fema le, gray fema les. $5 each. Call $150. 989-307- 2444. 989-224-8777 evenings. AKC GOLDEN RETRIEVERS S hots, wormed, vet H C IHUAHUA PUPS 8 blue & checked, parents on site. & CATS All kinds . tri colored. Read y to go to KITTENS OKEMOS COMMUNITY $500. Call 989-236-513 5 Call 517-763-1803. there new homes wormed CHURCH - FALL ATTIC can be CK.C Call S arah TREASURES & RUMMAGE AKC MALAMU T S E BLAC K $350-400 (517)455-68 5 2 SALE, Oct 22 & 23, Fri 9amLABRADOR RETRIEVERS or Red, 8 weeks, males, 4pm, Sat (rummage onlyAKC Yellow & Blk, $550-750, limited registra- C H I H U A H U A / T E R R I E R bag d ay) 9am-1pm, attic dew claws removed & 1st tion. (269)275-8 7 66 treasures until 3pm. TreasPUPS 10 wks, socialized, shots, avail. Oct. 30. $350 ures include antiques, shots, wormed, health fem; $300 m. 517-468-3227. collectibles, & jew elry indi cert. $250. 517-490-6260. Field vidu ally priced. Rummage AKC REG. BEAGLES MAINE COON kittens, purechampion bloodlines , 2 fe- CHINESE has a HUGE variety of CRESTED POWbred, pedigr eed, vet males, 2 males, 1st shots, clean clothing, toys, and D E R puff, fema le. POMchecked, lg. parents. Call born 8 /5. $200. Beagles other household items at ERANIAN male. S hots & 269-28 2-1091 born 8 /10, 1st shots, $125. LOW prices. U se lower wormed.$300/e ach. 6 yr old running fema le, level entrance at 4734 989-620-4278. MALE BRITTANY W/O, 11 $200. 517-391-82 8. Okemos Rd. Call 349-4220 months, field trial bred, for more info. f amily raised $500. COCKAPOO APRICOT, PUP AKC YORKIE TERRIER PU P(989)770-4632 PY, 6 mo, AKC HousebroPIES some small, shots, ken, crate trained, knows worming & nails clipped. ’sit’, ’dow n’ and loose M A L T E S E CKC - S hots, Call 517-726-0451. leash walking and is absowormed, vet checked. lutely the sweetest tem$300-$450. Call 517-507AKITA-4 YR OLD spayed fepered loving dog you can 8 628 or 517-267-9665. male with a sweet find. S he has a microchip tempermant, needs a paand all shots are up to MALTESE PUPPIES AKC tient, sensitive home. Call d ate. Paid $500, asking shots, wormed. $350. Call 517-669-6452. $400, crate included. 517-627-6418, 517-614-9564 ( 5 1 7 ) 7 1 2 - 4 8 8 8 jhu ldin@ yahoo.com AUSTRALIAN SHEPHERD PUPPIES Reg. Parents on GOLDEN RETREIVER MALTESE PUPS AKC Tiny, site, $400. 616-891-10 58. FEMALE 1-5 yrs., spayed. COCKAPOO PUPPIES S hots, For loving home. wormed, $400 cash. 989517-974-0431 Call: 517-622-0635 236-7634 or 989-2 89-3 4 8 9. BEAGLE PUPPIES Great MINIATURE PINSCHER 1 f ehunters. $75. 517-518O C K C R E P S ANIEL PUPPIES! male left , black & rust, 1201, Fowlerville area. Good colors. 989-426- 38 66 wormed-s hots, $250/obo or 989-2 46-0658 Karen. 989-584-6 192 no S un. calls. BEAGLE PUPS 4 litters, 4 MINI DACHSHUND PUPPY wks. old & up. 1st shots & COCKER 1 YR. OLD Polyd actyl (5 SPANIEL PUPS AKC, 1 male, brindle wormed. Great hunters/ toes)fr iendly Calic o fema le males, wormed, shots, w/unique markings, 9 wks. pets. $1250-$200 Call 989lost on E . C hurch in parnets on site $200-250. 1st shot $400. 517-371-5769 560-6143. Williamston. 517-655-2598 (517)745-5689
Dogs-Cats-Pets
Household Estate Sales
Rummage Sales Flea Markets
Animals Wanted
Animals Lost
Dogs-Cats-Pets
Hay-Grain-Seed
Furniture
GunsAccessories
Concert-Sports Tickets
Automotive
Business Opport. Self Employment
ASSEMBLE MAGNETS & FOOTBALL tickets LUGERS WANTED A lso , 4 MSU PILLOWTOP PAPILLON PUPPIES AKC tri GOOD QUALITY GRASS HAY A BED QUEN CRAFTS f rom Home! YearAUTOBODY PREPPER and parking pass. Illinois holsters, clips & parts for mattress set, new in plascolored, 6 weeks old, No rain. $4/bale. Mason Round Work! E xcellent Must know how to wet, Oct. 16th; Minnesota, Nov. same. And most other old tic, $200. a C ll 517-410-4921. $650+. only 2 left CALL area. 517-285-9338. Pay! No E xperience! Top sand & polish. 5 YRS 6th; Purd ue, Nov.20th. $250 German hand guns. Top Can deliv er. ASAP(517 )626-0123 US C ompany! Glue Gun, EXP! FT. Apply in person per game or best offer . E xprices paid by a collector. Painting, Jewelry, More! only @ 5514 S Penn. Ave. cellent seats & parking Doug, anytime 517-285PEK-E A-POO PUPPIES AKC A TEMPERPADIC/ STYLE Toll Free 1-866-844-5091 No phone calls. pass. 517-202-2453. 1714. parents. Very tiny, no MEMORY FOAM MATMM Capit al C ity Auto Body shed. $295. 517-896-0302 TRES SET Q ueen, newnever used, as seen on TV, M1 GARAND Winchester acYARD LAWN ROLLER 76’’ tion re barreled to 308 win. with warranty. C ost BUIS NES FOR A S LE!! E sPEMBROKE WELH S O C RGI circ., 36’’ widt h, 24’’ side S LES A STAFF person $800/best. AR15 Rifle H $1,800, S ell $695. Can Detablished for 3 years. Will PUPPIES, AKC Reg. 8 wks. ways. Best offer . Call 517needed at f ast growing BAR match competition, 2 liver 989-832-2401. MM Train. Nets 100k. Can operold, UTD on shots & worm381-0000 Ford d e a lership. Full time stage trigger, $850/best. ate f rom anywhere. $4400 ing. Call 517-507-2094. w/ benefit package. E xpe94 Winchester 30-30, made dow n. Call Jerry 1-800-418MOVING SALE 2 twin beds rience only. Fowlerville around 1956, $375/best. 8250 $40, d resser $40, hideabed PITBULL PUPPIES 1 boy and Ford C ontact Jean Ruger #1 in 30-06 $40, sound system $40, 13 5 girls, 2tri color puppies Duquette or email w/Leupold 2-7 power, cf f reezer $95, coffee table and there’s 4 black and j d uquette@f owlervillef ord . $700/best. Winchester $45, 3 des ks $80. Total white. $75 517-574-8801. com (517)223-7777 model 70 fea therweight A1 ALL ASH, OAK & Maple $380. Please no Saturd ays. sarahg821@yahoo.com 270 Winchester cal. w/2-7 S easoned, e d liv ered, 517-323-9707. Leupold scope, $650/best. SERVICE TECHNICIAN $70/per f ace cord. POMERANIAN PUPPIES Will 517-648-6020 Growing Ford dea lership 517-525-5510 be small, asking $200-$250. needs one d riveability, die Call 517-230-7894. sel and transmission tech. RUGER M77 MARK II S tainACKERSON FIREWOOD Must be Ford and S tate less, 308, w/scope, LeoS easoned hard wood, $60 POMERANIAN PUPS AKC, 1 certified. Fowlerville Ford pold Varix II 3x9x40, per f ace cord, deliv ered. blue merle male, $400; 1 C ontact Jason C henette or BRAUN VANGATER II$750/obo. Remington 870 517-281-9383. black w/white markings, e m a i l Wheelchair lift for d rop-flr . E xpress Magnum w/deer fema le, $300. Cas h only j chenette@f owlervillf ord .c van, $1,000. You remove, & bird barrel, 12 ga., CHERRY, MAPLE, OAK please. 989-248-4124. om (517)223-7777 have manual. 810-327-6405 $350/obo. JC Higgins ModSEASONED FIREWOOD $70 el 60 12 ga auto., $250. 517f ace cord, split, deliv ered POODLES, mini. 8 wks., vet 202-1157. LITEWAY NEW power & stacked. 517-651-5214. checked, parents on site. 1 scooter f rom S parrow, apricot M, 1 cream M, 1 WANTE D: Gun reloading used less than 3 mo. $995. FIRE W OOD! T U C , N U P S LIT, black F. $300. Jackson, 517equipment, old guns, bul517-627-7714 Delivered, $60-80, 3-4 f ace 784-5225, 517-392-0608. lets, gun parts, more. DRIVER- GREAT MILE!S NO cord. 517-930-1102 leave Call 517-623-0416 TOUCH FREIGHT! No message. SPACE SAVER II 3 wheel PUGGLE PUPPIES for ced NE/ NYC! 6 months scooter, $375. 7 wks old, 1st shots & OTR experience. No Call 517-882-1319. W O O D wormed, small & loveable. F I R E felony/DUI last 5yrs. S olos DE LIVE RE D/PIC KU P$250. 989-427-3205. wanted. New team pay Lansing & surrounding packages! 877-740-6262. areas. $70/$60 (517)627- WALK IN BATHTUB As PUG PUPPIES A K C , 1st MC seen on TV. New still in 4256 shots, wormed. 18 wks. box, has j acuzzi, warranA AARDVARK ANTIQUER $250. Call 517-740-6725. ty, f ree deliv ery, paid paying cash for guns, FIREWOOD SEASONED TRAINCO TRUCK $9500; sacrific e for jew lery, f urniture, art & H A R D W O O D - Read y to $3500. 517-579-4082 unusual & bizarre items. burn in the C harlotte area. DRIVING SCHOOL 517-819-8700 $55/f ace cord, 4’x8’x16". Day-E ve-wkend C lasses PUG PUP-S SMALL $300. You pick up. PLEASE, cash Job Placement Assistance PUGGLE PUPS FAWNonly. 517-930-2153. C lass B Training $250. 517-719-1199 ANTIQUE BUYER paying Train in Lansing cash for vintage artwork, (517) 887-1600 RUBY’ S FIREWOOD 4X8X16, f urniture, lamps, clocks, Train Local Sav e Hassle RAT TERRIER PUPPIES 9 $65 f ace cord, hard wood. sterling silver items, musiENGLANDER UNVENTED wks old, 1st shots & Call 517-391-0914. cal instruments, pottery, AIRLINES ARE HIRING— ROOM heater w/logs, prowormed. $150. Call 989vintage rad i o & stereo Train for high paying Aviapane or natural gas. 30K584-6344. A ES O S NED FIREWOOD equipment. Call John 517tion Maintenance Car eer. 34,500 btu. $275. Works $40/f ace cord. Delivery ex886-9795. FAA approved program. Figood. 517-676-1327 tra. 517-543-2783 nancial aid if FOR GUNS , Art, Antiqualified—H ousing availaFORCLOSURE SALE Must CASH SEASONED HARDWOODS ques, Jewelry, musical inLOOKING FOR A JOB? ble. Call Aviation Institute sell all items: S ectional, 4X8X16, $65 f ace cord. struments, Valuables. a C ll HAVE BILLS TO PAY? of Maintenance f ridge, stackable W/D, C hunks & logs. Call 517517-204-2004/517-663-3931 Waiting 6 months to start 877-891-2281. queen mattress/box 505-1983. your new career isn’t an MM spring. Kitchen dinette set. option? New Horizons has CASH PAID DAILY Call: 517-285-2380 SEASONED SPLIT MIXED your solution. Ear n your for diabe tic test strips. AIRLINES ARE HIRING HARDWOOD - Maple, Oak , Microsoft , C isco, C ompTia, $15 per 100 strips. Train for high paying AviaSHELTIE PUPPIES AKC, Apple. $45/f ace cord + deor Virtualization certifica Ph. 517-292-0991 tion Car eer. FAA approved $350-$450. 989-681-2054 livery. 517-819-8987. tion f rom New Horizons program. Financial aid if right here in C entral MichiA C H S PAID FOR d iabetic qualified - Job placement gan in as little as 10 d ays SPECIAL DEAL on seasoned test strips. Most types up assistance.. Call Aviation of training! Private f und hard wood if r ewood $65 BACKYARD SHIH TZU PUPPY One male STORAGE to $15 per box. a C ll 517Institute of Maintenance ing and career placement f a c e cord. Guarantee born 8/12/10, tri-color, S HE DS Q uality material & 505-2726 or 888-639-6179. (877) 891-2281. MC is available! price all winter! Offer first shots, mother on site. workmanship 989-834-2028 Call 1-888-413-7876 ends Oct. 31. Jeff 517-719$400.00 Call 517-819-7479. ATTEND COLLEGE ONLINE 1281; Car ol 517-507-7093. R E C AMIC S FOR A S LE 2 f rom Home. *Med i cal, chantlands cape@gmail.com TEDDY BEAR PUPPIES 1st T S D U N E TS/ OTHER kilns, approx. 3000 molds , *Business, *Paralegal, 20th year selling fir ewood! shots, wormed, non shedglassware. $2,000 or best *Accounting, *Cr iminal GREAT PAY! ding, hypoallergenic, $350. of e f r . a C ll 989-640-5141. Justice. Job placement asFT/PT avail. in customer FREE FORECLOSURE LIST WOOD PELLETS FOR pellet Call 517-468-3986. DIABETIC TEST STRIPS sistance. C omputer availasale/service, lf ex . sched. INGS Over 400,000 properstove. $189/ton (+ tax). WANTED Most Brands $5ble. Financial Aid if qualiinternship credit available STOVE- USED 1.5 ties nationwide. Low dow n 40lb bags available. S tored PELLET 15 per box (517)712-6357 TOY/MINI AUT S RALIAN i f ed . a C ll 877-895-1828 333-1700 or A E S O S NS . Incl. 2 tons of payment. Call now. 800inside. Cas h. 517-623-6622 H S P E HERDS 6 weeks old, enturaOnline.com workforstudents. com pellets & base. $1,300. 880-2517 $500+. Raised in our WANTED TO BUY MC 517-663-3572 MM homes. CALL ASAP GOING E states, antiques, books, FAST(517 )626-0123 epheria, toys, and more. BETWEEN HIGH SCHOOL PIONEER POLE BUILD 517-623-0416. AND C ollege? Over 18? INGS Free E stimates. LiWESTHIGHLAND TERRIERS Drop that entry level posicensed and Insured. 2x6 3 males, $500, mother & PICKUP tion. Ear n what you’re YOUR PLASTIC tied Trusses. 45 Year Warrant- WANTED TO BUY older mof ather on site. 1st shot & worth!!! Travel bagged leaves for f ree. No torcycles & snowmobiles, ed Galvalume S teel. 19 coldew ormed, f amily raised. w/S uccessf ul young busisticks or stones, Grand **WHAT A FIND IN BAILEY running & non-running ASSISTANT MANAGER ors. S ince 1976 #1 in MichRead y Oct 15. 989-224-8138 ness Group. Paid Training. Ledge/ Delta. 517-627-7965. NE IGHBORHOOD!** cond i t ion. 810-394-2577. CASH ADVANCE CO. igan. Call Toda y 1-800-292Transportation, Lodging U nique 4 BR., 2 ba upda ted seeking f ull time 0679 provid e . d 1-877-646-5050 YORKIE MALE AKC 12 wks. home, 2136 overall sq. f t. employee, collections MM MC S hih Tzu Pups. Taking dein prime historic area. experience required. posits. 517-589-8025. Walk to town & university, Benefits and 401K, POLE BARNS Michigan’s best schools. A Must see! email resume to Largest Pole Barn C ompa225-281-0516. MLS# 15848 YORKIE PUPS AKC shots, workf o r cashad vance@ ny (Best Built Barns) Best GRANDFATHER NEW NORWOOD wormed, vet checked, lit- ANTIQUE yahoo.com Q uality, Best S ervice, Best CLOCK, $550. C irca, 1840. SAWMILLSLumberMateter trained $500. Price. This Week’s S pecials 989-723-2849. Pro hand l es logs 34" i d a m(517)256-5208 E rected 24’x24’x8’-$5495.00 eter, mills board s 28" 24’x40’x10’-$7995.00 wide. Automated quickYORKSHIRE TERRIER PU PS 30’x40’x10’-$8995.00 DATA ENTRY cycle-sawing increases efAKC some tiny, shots, 30’x48’x12’-$10,995.00 fic iency up to 40%! 635 JENNE S T . 2 bd rm., 1 worming & nails clipped. Licensed/ Insured 1-877Part time. Must have ex S awmills.co bath, 750 sf, 1 car garage, Call 517-726-0451. 802-9591 cellent d ata entry skills m/300N 1-800-661-7746 E xt close to all schools. Move MOM 2 MOM SALE at Scr ibMM with accuracy. High vol15 Medical Billing 300N MC in cond i t ion. Great starter bles & Giggles 609 N. ume Medical Billing of or rental home. Priced to Trainees Needed! Verlinden Ave Oct. 16th, ATTEND COLLEGE ONLINE fic e, open Monda y - FriPIONEER POLE BUILDINGS sell $39,900. 517-819-2931. 9-12. 50+ tables. f rom Home. *Medical, Hospitals & Insurance d ay 8:00 am to 5:00pm. Free E stimates-Licensed *Business, *Paralegal, C ompanies Now Hiring! Hourly rate based on exand Insured-2 x 6 Trusses(517)482-1551 *Accounting, *Cr iminal perience. E xcellent work No E xperience? 45 Year Warranted Justice. Job placement asenvironment. Galvalume S teel-19 C olorsNeed Training? sistance. C omputer availaS ince 1976#1 in Local Car eer Training ble. Financial Aid if qualiFax or mail resume to Michigan- a C ll Toda y & Job Placement fied. Call 877-895-1828 517-487-1129, 1-800-292-0679.MC FOR SALE - possible land enturaOnline.com Ad vanced Management 1-888-589-9681 contract. 3 bd rm., 2 bath, 3 MM Inc. 1031 E . a S gina w A S VE $2,000 IN tax incencar garage, 2 acres. 1967 MAGNAVOX so l i d S treet Lansing, MI tives and rebates. HUSKY $98,500. 989-277-0616 PUMPKINS - Thousand s of state stereo console. Hard 48906. EOE WANTED: UNWANTED METAL ROOFS, S tanding Jack O Lantern pumpkins. ly used, 3’1’’ w x 8’ l x 3’ h. appliances, air condit ionS eam, Metal shingles/Tile, From 50¢ to $5.00. Morgan Brown. Best offer 381-0000 ROUND LAKE - LAKE ACers, cars, trucks, vans, 18 colors, C ompany N C A’ S needed Farms, 7721 E . C linton Tr. CES. 4 BR, 4 baths, 2,000 f arm machinery, lawn installers, f ree estimates. immedia tely! (M-50) between Eat on sf, has separate apt., permowers, campers, hot S ince 1975. 800-380-2379 E xperience necessary. Rapids & C harlotte. fec t for d aycare or rental. water tanks, aluminum or MC Reliable transportation. New well. +/- 3/4 acre. steel boats, aluminum winPlease email resume to $69,900, all offers consid dows or doors, aluminum lisa@ ered. 828-226-9998 or 517Planning an Auction? toppers, any types of aluA AMISH LOG HEAD cypresshomecare.net 290-2250, Mike. Selling an item minum or steel siding, BOARD AND Q ueen Pillow See SourceAds.com 4 wheelers, go carts, trailTop Mattress S et. Brand SEE SOURCEADS.COM Email the Lansing Community Email the Lansing Community or Call LCN Toll Free ers, batteries. new-never used, sell all for ALFALFA GRASSOR CALL LCN TOLL FREE Newspapers 24/7 at: Newspapers 24/7 at: All picked up for Free. $275. 989-923-1278. EXCELLENT Hay $4 & up. 877-475-SELL lcnclassifieds@gannett.com lcnclassifieds@gannett.com 877.475.SELL Call 517-628-2818 MM Can deliv er. 517-641-6034
Lawn and Garden
Firewood
HealthcareHospital Equip.
DriversTransportation
Wanted to Buy
Household Goods
Schools and Training
General Help Wanted
Miscellaneous
Homes For Sale
ProfessionalTechnical
Absolutely Free
AntiquesCollectibles
Building Materials -Supplies
East Lansing
AdministrativeClerical-Office
CORNELL ELEMENTARY SCHOOL subdiv ision. 2300 sq. f t., 4 bd rm., 2.5 bath. 2001 construction; upda ted in 2010. Priced for immedia te sale at: $189K. Realtors welcome. For appt. call: 517-202-6886,
4 RENTAL HOUSE FOR sale Must S ell! E xcellent income opportunity! Call 517-719-4204/989-233-7063
Farm Produce
Electronics
N C A
Furniture
Hay-Grain-Seed
$100 moves you in! "0" application fee & "0" sec. depos it
Land For Sale
1 or 2 bd rms Apts. Call us toda y! 517-694-8975 condit ions apply
40 ACR-ES IN GRATIOT C ounty/C entral MI- E xcellent hunting & fis hing; border ed by 300 acres of S tate Land, 16 tillable acres. Call for det ails: 989875-2365
ONE MONTH FREE!
Great Location near I-96 Huge Walk-In C losets Laundry Rooms, Pool (517) 394-0550 C ondit ions Apply. ridgelea sing.com
Lots 8 ACRE WOODED LOT on private d rive in upscale subd. Located between Lansing & Grand Led ge . $80,000 TERMS. C all 517627-7972.
Mobile Homes For Sale DOUBLE WIDE MOBILE HOME in Bradent on, FL. Heated pool, all maintenance included. $12,500. Call 517-641-6317 for more infor mation.
Apartments MSU-LCC-Cooley HOUSING DISCRIMINATION? C ll The Fair Housing a C enter at: 1-877-979-FAIR.
LCC
NEAR - 1 bd rm available. Rent $525, $525 sec. + application fee. U tilities included. No pets. Call 517-675-5143, leave message.
HOLT 2 bd rm., $3,500. Little work needed. Financing available. 866-694-0821.
Apartments East Lansing
WORRY-FREE N ES IOR LIVING
Commercial Warehouse COMMERCIAL AUCTION 100,240 SF Industri al Warehouse S tarting Bid: $750,000Mason Online Auction S tarts: 10/18 Dozens More / View Full Details RED,C LLC RE Brkr 6505355610
Cemetery LotsMonuments CHAPEL HILL CEMETERY 2 side by side lots, in the Trinity S ection. $3000/obo with Deed. 231-898-3843.
Medical
Laingsburg
Old Orchard Apts. Holts Best Value
Investment Property
Grand Ledge
Baby & Childrens Items
Apartments For Rent
Okemos ST. JOHNS- INCOME BASED 2 BDRM. TOWNHOME.S Beautifu l Park setting. C lose to schools & shopping. Laundry hookup. SUNTREE APARTMENTS 1100 S unview Dr. 989-224-8919 EHO. AUTO OWNER/S.
DOWNTOWN 2 bd rm., 1100 sf, hard wood floors, laundry. $600+ util. 482-8771. IVAN WOODS 1 bd rm., FREE HEAT Active living for 55+. S tarting at $499 per mo. 517-323-2800 LANSING 3322 W. Michigan. 1 bd rm., 1st floor , $525 + electric. Laundry. Call 517-482-8771 wencoproperties@att.net WAVERLY AREA Large 1 bd rms. starting at $475. Garage rent $80/mo. 517-214-6798
Duplex Suburbs
Duplexes For Rent
Homes For Rent
Homes For Rent
Duplexes Townhomes
517-321-1765 Apartments Suburbs
Homes For Rent
LANSING 1803 DONORA, lease to own, 2 bd rm/ 1 bath, hard wood lf oors, appliances included. WD hookup 2 car det atched garage, $650/mo + $650 dep. No pets/d rugs. 517749-2482.
A E TON
LANSING 230 Francis, S mall 1 bedr oom, 1 bath home. S torage shed. 517-622-6059 or ncefa milyhomecenter. com
RAPIDS
6288 Nye Hwy., 3 bd rm., 1.5 bath, 1531 sq. f t. ranch style home. Propane heat. 517-622-6059 ncefa milyhomecenter. com
Floor Services
Neighborhood People. Neighborhood News.
UN SED MANUFACTURED BUILDINGS
10 to 15 to choose f rom, Various S izes, Call to Reserve S ource #1GN 866-609-4321
Computer Sales -Service COMPUTER REVIVER: U pgrades , internet repair, virus, spyware removal, d ata rec. 30 d ay wrnty. E rik 517-484-6364. Housecalls.
Drywall Gary’s Drywall Finishing "U -Hang, We-Finish" 517-927-3853 garysd rywallfinis hing.com
• Refinishing • Repairs • Installation
LJ-0000865435-01
Mr. Natural’s Wood Floors
~LANSING~ 1-4 BDRMS Available! S ection 8 OK. $450-$850. Call Mark at 517-482-6600
FREE Estimates 393-0660 or 490-8696 Since 1988
Gutters
LANSING HOME For rent. Neat & clean, 3 bd rm., 1st fl. laundry. Call 517-641-7271 or 517-214-7648.
r Fully Insured r E xperienced r Dependable
517-896 -7582. Email the Lansing Community Newspapers 24/7 at: lcnclassifieds@gannett.com
e Best Pric Around
Seamless Gutters 5” & 6” Gutters
Lawn and Tree Service NOW BOOKING for Fall cleanups. Free E stimates • Insured Call 989-884-3025
JUNK REMOVAL
Masonry
• Master Shields Gutter Protecion • Windows & Siding
Licensed • Insured Free Estimates 517-649-2344
1-800-992-9917
• Appliances • Brush • Carpet • Furniture • Metal • Wood • Concrete • Shingles
Senior Discount
327-6001
MASONRY RESTORATION Res/comm., historic. Repair brick, block & stone. Fndn/ chimney repair/new. Lic. & Ins. 517-647-5380
YOUR AD HERE SEE SOURCEADS.COM OR CALL LCN TOLL FREE
877-475-SELL
Roofing-Siding Reliable C onstruction
42 years exp. S pecializing in shingled roof replacements, . Free E st. Lic. & Insur.
517-646-9945 1-800-87 8 -1795
Stump Removel
Painting-Papering -Plastering PAINTING PERFECTIONS. Int & ext. Q uality work. Refer ences, f ree est. (517)332-3281 or 290-4187.
Roofing-Siding Hauling-Trucking
Home ImprovementRepairs
ROOFING SIDING
517-897-3317 517-646-9108 51
Tree Service
Since 1975 •
Lawn and Tree Service
Repairs
•
Replacement
•
Licensed
•
Insured
WINDS OF CHANGE Tree S ervice. Mark Beutler Lic. & Ins. Free E stimates 517-214-0364, 517-672-0785
Tree Removal Services
R. Knott Services FALL CLEANUP SPECIALISTS • Flower Clipping & Clearing • Garden Cleaning & Tiling • Landscape Beds Cleaned • Eavestrough Cleaning Call • Fall Bush Trimming (517) 993-2052 • Mulch Mowing (517) 694-7502 • Firewood • Residential Snow Removal & Salting
STUMP SERVICE • Fast Expert Service • Low Rates, FREE Quotes • Tree & Brush Removal • Gates & Backyards No Problem
&
517.322.4131 Trash removal HOME RENOVATIONS Appliances, brush, carpet, Home remodeling & Hanwood, etc. S enior dis c. d yman services. Free est. Eav estrough C leaning. Licensed. Call 517-862-6374
SeeSourceAds.com orCallLCNTollFree 877.475.SELL
’91 MOTOR HOME 28’, Gulfstre am, 65,000 mi. Asking $5,500, excellent condi tion. Call: 517-626-6989.
For more information or to reserve space call
Hauling-Trucking
GUILFORD’S
Selling an Item?
CampersTravel Trailers
(7355)
TRASH, BRUSH, APPL. haulEAVESTROUGH CLEANING ed Yard & build. clean up, & minor repair. Also Power trees & bushes trimmed. Washing. Free estimates. Low Prices! Mike 393-4664 Call (517) 322-4131
GUTTER CLEANING
Boats and Motors
1-877-475-SELL
Gutters
or
JOHNS 211 Wight S t. 3 bd rm. home. No smoking or pets. $750 mo + dep. & util. 989-224-7851
ST JOHNS – Only $340/Mo! Lease to Own! Your Own Home! Over 1,500 sq.ft . New Car pet & Paint ~ Many more to choose f rom!! THE MEADOWS (989) 224-7707
LANSING HOME 2 story 3 bd rm., o f r mal dining ,new kitchen, Call 517-641-7271 or 517214-7648.
LJ-0000867537-01
DINNING BUILDERS
Fencing
ST
CLASSIC ’55 Penn Yan Runabout, 15’6’’. Boat & ’62 80 HP E vinrude professiona lly restored. New canvas cover & seats. Trailer incl. $2750/best. 989-763-6400 WAVERLY SCHOOLS - 2+ LAN S IN G - 2 bd rm houses bd rm., AC, appliances. & 2 bd rm d uplexes and $825+ dep., util. & ref. 517apts. $600-$675. Local 525-4132. owner cell 989-550-1181.
HOMES FOR RET N !
Get The Job Done Right Barn Work
Service Directory
Duplexes For Rent
LANSING SOUTHSIDE 3 bd rm., w/ garage, large backyard. S ection 8 welcome. C lose to schools. $650+ depos it. LC avail. 517-393-5188, 616-527-2008
Office Space For Rent
LJ-0000867533-01
Lansing, MI HASLETT - 5705 Potter, HOLT-2 BDRM., 1 bath, 1 HOLT CLEA!N 3BR, 1.5BA, 733 N . JENISO,N 48915: Beautifu l 2 bd rm., near lake. Large 2 bd rm. W/D hookup, Dishwasher, car garage, f ull bsmnt. 1 bath. Hard wood lf rs. Incl. 1.5 bath, fir eplace, central Air, Private Drive, Yard, $700+ util. No smoking. f ridge & oven. Well insulatair. U tility room with S hed. No smoking or pets. 517-331-3613 ed w/new windows. C lose washer/d ryer hookup. No $750/mth includes water & to S t. Lawrence & near pets, $595/mo. incl. water. sewer. 517-507-3887 L C C / C o o l e y . Call 517-372-8000 or 517$15/application fee. 349-8345 HOLT $600/mo. 517-331-1182. Large 2 bd rm. d uplex. C ertain condit ions Nice yard . W/D hookup. BLUE WATER VILLAGE 919 S . HOLMES ST. 2 bd rm., HASLETT $650 water & sewer incluPLUMTREE Dimonda le, near GM Delta $550 per mo. + utils. 1059 GREAT VALUE ded. No pets. 517-694-1899. plant. New 2 & 3 bd rms, 2 N. LARCH ST. 2 BR, $550 2 Bd rm w/ Balcony $510 baths, starting at $700 mo. + utils. Near busline. 2 "0" Deposit! & trash incl. all applian- S .E . LANSINGBR apt., $550 mo., all utils 3 bd rm., 1.5 517-337-1133 EHO ces, bsmt., pets welcome. incld. Rooms w/private bath, kitchen appliances, Call 517-749-1714 or bath, $350 all utils. incld. central air, garage, if nis h517-372-6250 Call 484-5619. ed bsmnt., storage room, lg. laundry room w/WD HOLT: 1 BE DROOM , $450 hookup. $850+ utilities. No AFFORDABLE HOMES 1-4 + depos it. Air. Free heat, pets. 517-394-6774 GRAND LEDGE LG 2 bd rms, S ection 8 OK. water, trash pickup. C oin bd rm Townhouse, 1.5 Pets OK. Move in spelaundry. 1960 Aurelius bath, f ull bsmt, garage, 1ST MONTH FREE RENT! WEBBERVILLE2 bd rm. cial! Flexible terms Road. Busline. Applica$695+ utilities. Newly Oak Hill Apartments d uplex, 2 car garage, available. $395-$1095. tions, up f ront. remodeled. An elder ly community $725/mo. 517-521-3242 or 517-651-1374 ** 586 -292-3681 ** 517-339-2486 (elder ly is defined as 62 810-923-0910. years of age or dis abled of KIWANIS VILLAGE any age) located in Ionia, BE A HOME OWNER Rent to U pda ted lg. WILLIAMSTONA senior community 62 GRAND LEDGE: MI is currently accepting own. Owner will fina nce. 2 BDRM, 1200 sf., 2 BR., + bsmnt., years of age or dis abled of applications for 1 bedr oom Land C ontract available. NEW APPLIANCES & carlaundry hookup. 1.5 bath, 2 any age. Located in Maapartments. U nits of barriCall 517-202-3121. peting. kitchen, dining story w/garage, lg. kitchen son, MI is currently acer f ree des ign may also be room, liv. room & dec k. & bd rms,. w/balcony. cepting application for 1 available. Rent is based on C lose to dow ntown & CUTE 1 BDRM. C ountry Fresh paint, newer carpet. bedr oom apartments. income. For affor d able schools. $550/mo. 517home in DeWitt area. No big dogs . Includes U nits of barrier f ree des ign housing call (616) 527655-1743 $550/mo. + dep. & util. No trash, lawn & snow. $740 + may also be available. For 8900. This institution is an pets or smoking. 669-9455. util. 517-853-6307 affor able housing starting E qual Opportunity Provid at $417 Call 517er. E qual Housing OpportuDAKIN 1022 3 bd rm., gar., H O L T : 2 bd rm, 1.5 bath 2 676-6290 nity. TDD #(800) 649-3777 new window , bsmt., story townhome, partially TDD # (800) 649fenc ed yard, $750 + utils. fin. bsmt w/laundry hook3777 JEROME 1315 Lg 3 bd rm. 1st Month Rent FREE when up, dec k, air, newer paint 1547 ROOSEVELT T S . apt., e f nc ed yard , $700 + you sign a 12 mo. lease! & carpet, incl sewer, wa2 bd rm., 1.5 car garage, lg. heat. PERSONS CT. 1019 2 Forest View Apts, Haslett ter, trash, lawn, snow rebackyard, $650+ utilities. bd rm house, garage, big * Immedia te Occupancy moval. Cat or very small Call 517-372-8129. yard, $600 +. 517-372-4504. * C ozy 1 bd rm apts $560 dog ok. $715 + sec. dep. * PET WELCOME 517-853-6307. * S ingle level bldg w/ pri2124 PLEASANT VIEW GRAND LEDGE MASON vate entries 2 bd rm., f ull bsmt., 714 E . Maple. 3 bd rm., 1.5 2 & 3 bd rm. fir eplace, * Washer/Dryer hook ups MASON: MOVE IN garage, fenc ed yard, bath, 2 car garage, lg. central air, washer/ in utility room S P E C I A L . 2 BR, 1 bath $750+ util. (517) 482-8771 yard . $975+ util. 482-8771 d ryer. $750-$900. * Vaulted ceiling in living shared bsmt. with locked 517-282-9669 room storage/laundry, air, fen517-349-8000 * S torage access ced backyard. $610 mo. * Lovely wooded setting 517-230-3885,517-202-1781 * C lose to everything MASO-N -FREE HEAT! 1 & Call toda y for info and tour! 2 bd rms, $99 S ecurity e d - O 517-349-2250 S T U HEAT S LANIS G N 3 posit, Vouchers accepted, C ondit ions apply. bd rm., 2 baths, loft , air, S pacious 1,000 sq. f t. bsmt., dec k, great neighWater/S ewer/Trash incl. borhood. No pets. $755 + Pet-fr iendly . 517-244-0672 depos it. 517-393-8970. BEACON LAKE Q uiet community with specVERY PRItacular lake views. Move in OKEMOS- CUT,E VATE, 1 bd rm., enclosed specials. Located btwn E . garage & dec k. U pgraded Lansing & Jackson. Off USkitchen, bath & new wood 127 in Mason! flrs are brightened by sky517-676-87 8 7 AVE. 1 BE Dlight & open flr plan. Fire- COLEMAN Beaconlake-apts.com ROOM DUPLEX NEAR place & automatic garage INGHAM MEDICAL HOSPI door opener a plus. Incl. TAL $400 PER MONTH lower level storage and DEER CREK MANOR PLUS UTILITIES AND DEWD hookup. Lg. wooded IN WILLIAMSTON POSIT, LOTS OF CLOSET lot. $785. 517-899-0417. S tudio starting at $405 SPAC,E DECK. NO PET.S 1 bd rm starting at $520 (517)281-1236 48910 2 bd rm S tanda rd starting BARN ROOF PORTLAND APTS at $620 We put steel roofs on DONE RIGHT FENCE & GREAT LOCATION IN Apply tod a y... Move To2 bd rm Deluxe starting at high barns. Ask for John Groesbeck. 4 bd rm., 2 morrow! Fast Approval! SKID LOADER SERVICE $720 616-527-3635. bath. Open flr . plan, bonus a C ll 517-647-4910 for a tour 2 bd rm Luxury starting at f amily room, hard wood of your new home. LocatFence for all occasions, $790 lf rs., id s hwasher, washer/ ed j ust minutes west of light excavating, holes Hurry, they are going f ast! d ryer, fenc ed yd. Pets Builders-ContractorsLansing. augered, bucket & pallet Call C yndi 517-285-83 43 okay. $1,100/mo. for k work. We clean up Remodelers 517-420-7554 scrap metal for f ree. WAVERLY & WILLOW For Free E stimate G.L. in town, ground floor , 2 S pacious 2 bd rms. HOLT bd rm., heat incld. $450. Free heat & water. Call 517-669-8066 2 bd rm. d uplexes. 517-627-6751, 231-276-0021 RE O N VATION S Q uiet building. Nice yard. $650 & $560 517-303-6680 water & sewer includ e d . ~ Great Apartment ~ 517-694-1899. GRAND LEDGE 2 bd rm. if r eplace, HOLT- 2 LG bd rms, 1 bath, garage, central air, Interior & E xterior WILLIAMSTON 2 BDRM., 2 story, large kitchen, cenwasher & d ryer, $7501 bath, recently remod 204-7697 tral air, washer/d ryer, ex$775. 517-282-9669 or eled, 1 car garage, $675 tra clean, f ull bsmt, gas uilders. com 517-349-8000 mo. + utils. Call 517-285heat, small pets ok. 0575. 517-468-3963
N O RENT UNTIL DEC. Call Toda y
Homes For Rent
Homes For Rent
LJ-0000859335-01
Apartments Suburbs
Total Tree Care Since 1980
(517) 857-2333 LJ-0000863692-01
Apartments Lansing
517-321-8222
Expert Trimming & Removals Thinning, Elevating, *Fully Insured* Dead Limbing & Shaping *Free Advice* 60 ft. AERIAL WORK TRUCK
800-843-6561
Kyran VanSickle Owner/Certified Arborist
FREE ESTIMATES
QUALITY WORK EXCELLENT REFERENCES
Legals MORTGAGE SALE THIS FIRM IS A DEBT COL LECTOR ATTEMPTING TO COLLECT A DEBT. ANY IN FORMATION OBTAINED WILL BE USED FOR THAT PURPOSE. Notice is hereby given that Defa ult has occurred in a Mortgage given by Mark P. Allen, a married man, and S heila D. Allen, his wife, mortgagors, to Independent Mortgage C ompany, mortgagee. The Mortgage is d ated October 2, 2008, and was recorded on October 15, 2008, in B: 3322 P: 723 of the Ingham C ounty record s. The balance owing on the Mortgage as of the d ate of this Notice is $198,258.14, including interest at 6.875% per year variable. The Mortgage contains a power of sale clause and no proceedings have been instituted to recover any part of the deb t owing. The Mortgage will be for eclosed by selling the property des cribed below at a public auction to the highest bidder . The sale will be held on Thursd ay, October 28, 2010, at 10:00 a.m. local time at the main entrance to the Veterans Memorial C ourthouse, 313 W. Kalamazoo, Lansing, Michigan, that being the place of holding C ircuit C ourt for Ingham C ounty, Michigan. The property will be sold to pay the amount then d ue on the Mortgage, including interest, legal costs, attorney fees and any taxes or insurance which may be paid by the mortgagee befor e the sale. The property to be sold is located in the Township of Delhi, C ounty of Ingham, Michigan and is des cribed as: A parcel of land in the SW 1/4 of S ection 29, T3N, R2W, Delhi Township, Ingham C ounty, Michigan, the surveyed bounda ry of said parcel des cribed as: C ommencing at the SW corner of said S ection; thence N 89°55’05" E along the S line of said S ection, 485.00 f t to the point of beginning of this des cription; thence N parallel with the W line of said S ection, 399.22 f t, thence N 89°54’12" E 210.16 f t, thence S 00°06’23" E parallel with the E line of the W half of the SW 1/4 of said S ection, 399.28 f t to said S line; thence S 89°55’05" W along said S line 210.90 f t to the point of beginning. commonly known as 5950 Harper Road, Holt, Michigan tax i.d. 3325-05-29-300-023 The redempt ion period will expire six (6) months af ter the d ate of the for eclosure sale, unless the property is det ermined abandoned under MCL 600.3241a, in which case the redempt ion period will expire 30 d ays af ter the d ate of the for eclosure sale, or when the time to provide notice under MCL 600.3241a(c) expires, whichever is later. SMITH, MARTIN, POWERS KNIER, P.C . Dated:
&
S eptember 15, 2010
By: Henry L. Knier, Jr. (P46393) Attorney for Independent Mortgage C ompany, Mortgagee 900 Washington Ave., P.O. Box 219 Bay C ity, MI 48707 - (989) 892-4574 ICCN-863048 9/26/10-10/3, 10, 17/10
YOUR AD HERE SEE SOURCEADS.COM OR CALL LCN TOLL FREE
877-475-SELL
Legals
Legals
Legals
Legals
Legals
Legals
NOTICE FROM FORECLO SURE PARTY TO BORROW ER PURSUANT TO MCL 600.3205A
p dempt ion period. In that event, your d amages, if any, shall be limited to the return of your bid amount tender ed at the sale, plus interest.
p eeding: C ommencing at a point 660 feet North and 1280 feet East of the West ¼ corner; thence North 75 feet; thence East 201.6 feet to the West line of S upervisor’s Plat of Tower Farms; thence S outh 75 feet; thence West 201.6 feet to the point of beginning on the Northwest f ractional ¼ of S ection 6, Town 4 North, Range 1 West, Meridia n Township, Ingham C ounty, Michigan. C ommonly known as: 6313 Gossard Avenue, East Lansing, Michigan 488 holding: Lot No. 3, Trails at Lake Lansing S ubdiv ision No. 1, a subdiv ision of part of the S outheast ¼ of S ection 2, Town 4 North, Range 1 West, Meridia n Township, Ingham C ounty, Michigan, according to the recorded plat thereof, as recorded in Liber 40 of Plats, Pages 42, 43 and 44, Ingham C ounty Record s. C ommonly known as: 1222 Woodw ind Trails, Haslett, Michigan 488 eof, Liber 7 of Plats, Page 43, Ingham C ounty Record s. C ommonly known as: 927 E . Willoughby, Lansing, Michigan 48911..
pe ys f rom the time of such sale.
To: Benja min J E ller having occurred in Re: Property located at 1400 Defa ult condit ions of a MortW Maple, Lansing, MI 48915 the gage made by Janell D. Car woman, You have the right to re- penter, a single Green Tree quest a meeting with the ("Debtors") to LLC (f/ k/a mortgage holder , C hemical CS ervicing onseco Finance S ervicing Bank, through a housing C orp.) ("Green Tree"), d ated counselor. C hemical Bank May 10, 2000, and record ed has des ignated C urrie Ken- in the Offic e of the Register d all PLC, 6024 Eastm an Ave- of Deeds for the C ounty of nue, Midla nd, Michigan Ingham in the S tate of Mich48640, 989-839-0300, as its igan on May 23, 2000, in agent to make loan modifi Page(s) 932, et. cation agreements under Liber 2851, on which Mortgage MCL 600.3205b and 3205c. seq., there is claimed to be d ue You may contact a housing as of the d ate this Notice counselor by visiting the the sum of of $120,129.30, Michigan S tate Housing De- which amount may may velopment Authority’s web- not be the entire indeor b teds i t e owed by Debtors to a ness or by calling the Michigan Green Tree together with inS tate Housing Development terest at 8.75 percent per Authority at 517-373-8370. If annum. NOW THEREFORE, Notice is you request a meeting, for e- hereby given that the power closure proceedings will not sale contained in said commence until 90 d ays af - of Mortgage has become operter the d ate notice was and that pursuant to mailed to you. If you reach ative that power of sale and MCL an agreement to modiy f the et. seq., on Novemloan, the mortgage will not 600.3201 ber 18, 2010 at 10:00 a.m., at be for eclosed if you abide the Ingham C ounty C ourtby the terms of the agree- house in Mason, Michigan, ment. You have the right to that being place for contact an attorney. The tel- holding the the C ourt ephone number of the S tate and/ or for condC uircuit such Bar of Michigan Lawyer Re- for eclosure salescting for the ferra l S ervice is 800-968- C ounty of Ingham, there will 0738. be offer ed at public sale, the premises, or some part Dated: October 7, 2010 thereof, des cribed in said Mortgage as follows, to wit: William R Garchow P61833 LAND SITUATED IN THE C urrie Kenda ll PLC HIP OF LANSING, Attorney for C hemical Bank TOWNS COUNTY OF INGHAM, STATE OF MICHIGAN, IS DESCRIBED ICCN-86 9398 AS FOLLOWS: 10/17/10 LOT 99, SUPERVISOR’ S PLAT OF FARMINGTON NO. 1, ACCORDING TO THE RECORD NOTICE OF BORROWER’ S ED PLAT THEREOF, AS RE RIGHTS CORDED IN LIBER 7 OF PLATS, ON PAGE 45, SAID THIS NOTICE CONCERNS RECORDS. Matthew V Ash and Heshla INGHAM COUNTY The redempt ion period shall S Ash ("BORROWER" ) REGARDING be six (6) months f rom the d ate of sale unless the propPROPERTY LOCATED AT . THE BORROWER HAS THE erty is established to be pursuant to MCL RIGHT TO REQUEST A MEET - abandoned 600.3241a, in which case the ING WITH INDEPENDENT redempt ion period shall be BANK AND SHOULD CONTACT Dan K AT 517-203-3880 the later of thirty (30) d ays TO SCHEDULE A MEETING IF f rom the d ate of sale or fif DESIRED. THIS PERSON HAS teen (15) d ays f rom the d ate THE AUTHORITY TO MAKE the notice required by MCL 600.3241a(b) was posted AGREEMENTS UNDER MCL and mailed. 600.3205b AND MCL 600.3205c. THE BORROWER Dated: October 8, 2010 MAY CONTACT A HOUSING COUNSELOR BY VISITING Green Tree S ervicing LLC THE MSHDA WEBSITE C onseco Finance ( a.inf o/counselin (f/ k/a S ervicing C orp.) g_search/) OR BY CALLING DONALD A. THE MSHDA (1-866-946- By: 7432). IF THE BORROWER BRANDT(P30183) REQUESTS A MEETING WITH BRANDT, FISHER, ALWARD & ROY, P.C . THE PERSON DESIGNATED f r Green Tree ABOVE WITHIN THE STATU - Attorneys o TORY PERIOD, FORECLO - 1241 E . E ighth S treet, P.O. SURE PROCEDINGS WILL Box 5817 Traverse C ity, Michigan NOT BE COMMENCED UNTIL 90 DAYS AFTER THE DATE 49696-5817 THAT NOTICE WAS MAILED (231) 941-9660 TO THE BORROWER. IF THE BORROWER AND THE PER- File No.: 6140.0843 SON DESIGNATED ABOVE REACH AN AGREEMENT TO ICCN-86 8740 10/17, 24, 31/10-11/7/10 MODIFY THE BORROWER’ S MORTGAGE LOAN, THE MORTGAGE WILL NOT BE FORECLOSED IF THE BORNOTICE OF MORTGAGE ROWER ABIDES BY THE SALE TERMS OF THE AGREEMENT. THE BORROWER HAS THE & RIGHT TO CONTACT AN AT- FOSTER, SWIFT, COLLINS SMITH, P.C . IS ATTEMPT TORNEY. THE MICHIGAN ING TO COLLECT A DEBT STATE BAR ASSOCIATION AND ANY INFORMATION LAWYER REFERRAL SERVICE OBTAINED WILL BE USED TELEPHONE NUMBER IS 1FOR THAT PURPOSE. 800-968-0738. PLEASE CONTACT OUR OF FICE AT THE NUMBER BE ICCN-86 9092 LOW IF MORTGAGOR IS IN 10/17/10 ACTIVE MILITARY DUTY. NOTICE
OF FORECLOSURE
THIS FIRM IS A DEBT COL LECTOR ATTEMPTING TO COLLECT A DEBT; ANY IN FORMATION WE OBTAIN WILL BE USED FOR THAT PURPOS.E IF YOU ARE IN ACTIVE MILITARY SERVICE PLEASE CONTACT OUR OF FICE AT THE NUMBER BE LOW. ATTENTION POTENTIAL PURCHASERS AT FORECLO SURE SALE: In the case of resolution prior to or simultaneously with the afor ementioned for eclosure sale, Green Tree S ervicing LLC (f/ k/a C onseco Finance S ervicing C orp.) may rescind this sale at any time prior to the end of the re-
DEFAULT having been made in the condit ions of a certain Mortgage made on November 8, 2006, by Paul O. Bennett and Lisa Bennett, November 21, 2006, in the offic e of the Register of Deeds for Ingham C ounty, Michigan, in Liber 3244, Page 1123; on which Mortgage there is claimed to be d ue and unpaid, as of the d ate of this Notice, the sum of One Hundr ed E ight Thousand S ix Hundr ed Four and 60/100 Dollars ($108,604.60); and no suit or proceeding at
Dated: October 4,-867029 10/10, 17, 24, 31/10-11/7/10 NOTICE
OF MORTGAGE SALE
FOSTER, SWIFT, COLLINS & SMITH, P.C . IS ATTEMPT ING TO COLLECT A DEBT AND ANY INFORMATION OBTAINED WILL BE USED FOR THAT PURPOSE. PLEASE CONTACT OUR OF FICE AT THE NUMBER BE LOW IF MORTGAGOR IS IN ACTIVE MILITARY DUTY. DEFAULT having been made in the condit ions of a certain Mortgage made on March 25, 2003, by Rawle I. Hollingsworth and Saleela Hollingsworth, May 7, 2003, in the offic e of the Register of Deeds for Ingham C ounty, Michigan, in Liber 3026, Page 659; on which Mortgage there is claimed to be d ue and unpaid, as of the d ate of this Notice, the sum of E ighty-Nine Thousand Four Hundr ed Nine and 20/100 Dollars ($89,409.20); and no suit or proceeding at
Dated: S eptember 20,-863189 9/26/10-10/3, 10, 17, 24/10 NOTICE
OF MORTGAGE SALE
FOSTER, SWIFT, COLLINS & SMITH, P.C . IS ATTEMPT ING TO COLLECT A DEBT AND ANY INFORMATION Dated: October 4, 2010 OBTAINED WILL BE USED FOR THAT PURPOSE. MICHIGAN STATE UNIVERSI PLEASE CONTACT OUR OF TY FEDERAL CREDIT UNION BE of East Lansing, Michigan, FICE AT THE NUMBER LOW IF MORTGAGOR IS IN Mortgagee ACTIVE MILITARY DUTY. FOSTR E , SWIFT, COLLINS & DEFAULT having been made SMITH, P.C . in the condit ions of a certain Benja min J. Price Mortgage made on October Attorneys o f r Mortgagee 29, 1998, by E ugene M. 313 S . Washington S quare S tokes and Jane E . S tokes, Lansing, MI 48933 husband and wife, as Mort(517) 371-8100 gagor, given by them to Michigan S tate U niversity Fed ICCN-8669 63 eral C redit U nion, of 600 10/10, 17, 24, 31/10-11/7/10 East C rescent Road, East Lansing, Michigan 48823, as Mortgagee, and recorded on NOTICE OF MORTGAGE November 5, 1998, in the of SALE fic e of the Register of Deeds for Ingham C ounty, Michigan, in Liber 2677, Page 975; FOSTER, SWIFT, COLLINS & SMITH, P.C . IS ATTEMPT - on which Mortgage there is claimed to be d ue and unING TO COLLECT A DEBT paid, as of the d ate of this AND ANY INFORMATION Notice, the sum of S eventyOBTAINED WILL BE USED Three Thousand Five HunFOR THAT PURPOSE. S eventy-Nine and PLEASE CONTACT OUR OF - d red FICE AT THE NUMBER BE - 44/100 Dollars ($73,579.44); and no suit or proceeding at LOW IF MORTGAGOR IS IN law or in equity having been ACTIVE MILITARY DUTY. instituted to recover the DEFAULT having been made deb t or any part thereof sein the condit ions of a certain cured by said Mortgage, and Mortgage made on Decem- the power of sale in said ber 6, 2004, by Kevin Fowlks, Mortgage having become a single man, as Mortgagor, operative by reason of such f ult; given by him to Michigan dea IS HEREBY GIVEN S tate U niversity Feder al NOTICE C redit U nion, of 600 East that on Thursd ay, October C rescent Road, East Lan- 28, 2010 at 10:00 o’clock in sing, Michigan 48823, as the for enoon, at the VeterMortgagee, and recorded on ans Memorial C ourthouse, December 15, 2004, in the of - 313 W. Kalamazoo, Lansing, fic e of the Register of Deeds Michigan, that being one of for Ingham C ounty, Michi- the places for holding the gan, in Liber 3143, Page 647; C ircuit C ourt for Ingham on which Mortgage there is C ounty, there will be offer ed claimed to be d ue and un- for sale and sold to the highpaid, as of the d ate of this est bidder or bidders at pubNotice, the sum of S ixty- lic auction or venue for pursatisf ying the E ight Thousand One Hun- poses of d red Ninety-Two and 14/100 amounts d ue and unpaid on Mortgage, together Dollars ($68,192.14); and no said suit or proceeding at law or with all allowable costs of in equity having been insti- sale and includ able attorney tuted to recover the deb t or fees , the lands and premises any part thereof secured by in said Mortgage mentioned said Mortgage, and the pow- and des cribed as follows: IN THE TOWNer of sale in said Mortgage SITUATED OF having become operative by SHIP OF DELHI, COUNTY INGHAM, STATE OF MICHI reason of such dea f ult; NOTICE IS HEREBY GIVEN GAN: that on Thursd ay, October Beginning at a point 640.2 28, 2010 at 10:00 o’clock in feet S outh and 1,115.9 feet the for enoon, at the Veter- East of the Northwest corans Memorial C ourthouse, ner of the Northeast ¼ of 313 W. Kalamazoo, Lansing, S ection 36, Town 3 North, Michigan, that being one of Range 2 West, Delhi Townthe places for holding the ship, Ingham C ounty, MichiC ircuit C ourt for Ingham gan, thence East 360.01 feet C ounty, there will be offer ed to the centerline of Highway thence Northwesterfor sale and sold to the high- US-127, centerline est bidder or bidders at pub- ly along said lic auction or venue for pur- 359.6 feet , thence S outh 22 poses of satisf ying the degr ees 07 minutes West amounts d ue and unpaid on 262 feet to the place of besaid Mortgage, together ginning. with all allowable costs of C ommonly known as: 929 sale and includ able attorney North C eda r S treet, Mason, fees , the lands and premises Michigan 48854 Tax Parcel No.: 33-25-05-36in said Mortgage mentioned 201-005 and des cribed as follows: SITUATED IN THE CITY OF The period within which the LANSING, COUNTY OF above premises may be reshall expire six (6) INGHAM, STATE OF MICHI - deemed months f rom the d ate of GAN: Lot 32, Just-A-Mere Farm sale, unless det ermined in accord ance S ubdiv ision, C ity of Lansing, abandoned Ingham C ounty, Michigan, with M.C .L.A. S ec. 600.3241a, in which case the redemp according to the recorded plat thereof, as recorded in tion period shall be 30 d ays
Dated: S eptember 16, 2010
Legals NOTICE
OF MORTGAGE SALE
MICHIGAN STATE UNIVERSI - FOSTER, SWIFT, COLLINS & TY FEDERAL CREDIT UNION ITH, P.C . IS ATTEMPT of East Lansing, Michigan, SM ING TO O C LLECT A DEBT Mortgagee AND ANY INFORMATION OBTAINED WILL BE USED FOSTR E , SWIFT, COLLINS & FOR THAT PURPOSE. SMITH, P.C . PLEASE CONTACT OUR OF Benja min J. Price FICE AT THE NUMBER BE Attorneys o f r Mortgagee LOW IF A MEMBER OR 313 S . Washington S quare MANAGER OF MORTGAGOR Lansing, MI 48933 IS IN ACTIVE MILITARY DU (517) 371-8100 TY. ICCN-863187 DEFAULT having been 9/26/10-10/3, 10, 17, 24/10 made in the condit ions of a certain Mortgage made on August 7, 2008, by WHITE NOTICE OF MORTGAGE FAMILY PROPERTIES, LLC, a SALE Michigan limited liability company, as Mortgagor, given by it to MASON STATE FOSTER, SWIFT, COLLINS & BANK, whose addr ess is 322 SMITH, P.C . IS ATTEMPT - S . Jefferson, P.O. Box 130, ING TO COLLECT A DEBT Mason, Michigan 48854, as AND ANY INFORMATION Mortgagee, and recorded on OBTAINED WILL BE USED August 15, 2008, in Liber FOR THAT PURPOSE. 3316, Page 1107, Ingham PLEASE CONTACT OUR OF - C ounty Record s, on which FICE AT THE NUMBER BE - Mortgage there is claimed LOW IF MORTGAGOR IS IN to be d ue and unpaid, as of ACTIVE MILITARY DUTY. the d ate of this Notice, the sum of Two Hundr ed Twelve DEFAULT having been Thousand E ighty-S even and made in the condit ions of a 06/100 Dollars ($212,087.06); certain Mortgage made on and no suit or proceeding at S eptember 21, 2005, by Jane law or in equity having been M. Nelson, a single woman, instituted to recover the as Mortgagor, given by her deb t or any part thereof seto Michigan S tate U niversity cured by said Mortgage, and Feder al C redit U nion, of 600 the power of sale in said East C rescent Road, East Mortgage having become Lansing, Michigan 48823, as operative by reason of such Mortgagee, and recorded on dea f ult; October 3, 2005, in the offic e NOTICE IS HEREBY GIVEN of the Register of Deeds for that on Thursd ay, October Ingham C ounty, Michigan, in 21, 2010 at 10:00 o’clock in Liber 3187, Page 125; on the for enoon, at the Veterwhich Mortgage there is ans Memorial C ourthouse, claimed to be d ue and un- 313 W. Kalamazoo, Lansing, paid, as of the d ate of this Michigan, that being one of Notice, the sum of E ighty- the places for holding the Nine Thousand Two Hun- C ircuit C ourt for Ingham d red E ighty-E ight and C ounty, there will be offer ed 55/100 Dollars ($89,288.55); for sale and sold to the highand no suit or proceeding at est bidder or bidders at publaw or in equity having been lic auction or venue for purinstituted to recover the poses of satisf ying the deb t or any part thereof se- amounts d ue and unpaid on cured by said Mortgage, and said Mortgage, together the power of sale in said with all allowable costs of Mortgage having become sale and includ able attorney operative by reason of such fees , the lands and premises dea f ult; in said Mortgage mentioned NOTICE IS HEREBY GIVEN and des cribed as follows: that on Thursd ay, October LAND SITUATED IN THE 28, 2010 at 10:00 o’clock in TOWNSHIP OF MERIDIAN, the for enoon, at the Veter- COUNTY OF INGHAM, MICH ans Memorial C ourthouse, IGAN, DESCRIBED AS: 313 W. Kalamazoo, Lansing, PROPOSED WHITEHILLS Michigan, that being one of LAKES SOUTH NO. 2: a subthe places for holding the div ision of part of the S outhC ircuit C ourt for Ingham west quarter of S ection 4 C ounty, there will be offer ed and the S outheast quarter for sale and sold to the high- of S ection 5, Town 4 North, est bidder or bidders at pub- Range 1 West, Meridia n lic auction or venue for pur- Township, Ingham C ounty, poses of satisf ying the Michigan, e d s cribed as: amounts d ue and unpaid on C ommencing at the East said Mortgage, together quarter corner of said S ecwith all allowable costs of tion 5; thence S outh 00 desale and includ able attorney grees 37 minutes 36 seconds fees , the lands and premises East along the East line of in said Mortgage mentioned said S ection 5 a dista nce of and des cribed as follows: 920.35 feet to the S outh line SITUATED IN THE CITY OF of WHITEHILLS LAKES NO. 6 LANSING, COUNTY OF as recorded in Liber 53 of INGHAM, STATE OF MICHI - Plats, Pages 41 through 54, GAN: inclusive, Ingham C ounty Lot 10 and East 1 foot of Lot Record s; thence North 89 11, S onnybrook, C ity of degr ees 38 minutes 34 secLansing, Ingham C ounty, onds East (recorded as Michigan, according to the S outh 89 degr ees 39 minutes recorded plat thereof, as re- 04 seconds West) along said corded in Liber 10 of Plats, S outh line 50.00 feet to the Page 36. West line of The C ove at C ommonly known as: 2517 Whitehills Lake, as recorded East Cav anaugh, Lansing, in Ingham C ounty C ondoMichigan 48910. minium S ubdiv ision Plan No. The period within which 151, Liber 3072, Page 246, the above premises may be Ingham C ounty Record s; redeemed shall expire six thence S outh 00 degr ees 37 (6) months f rom the d ate of minutes 36 seconds East sale, unless det ermined along said West line 646.71 abandoned in accord ance feet to the Point of Beginwith M.C .L.A. S ec. 600.3241a, ning of this des cription; in which case the redemp - thence S outh 00 degr ees 37 tion period shall be 30 d ays minutes 36 seconds East f rom the time of such sale. continuing along said West line 103.29 feet; thence Dated: S eptember 9, 2010 S outh 89 degr ees 39 minutes 04 seconds West 50.00 feet MICHIGAN STATE UNIVERSI - to the East line of said S ecTY FEDERAL CREDIT UNION tion 5; thence S outh 00 deof East Lansing, Michigan, grees 37 minutes 36 seconds Mortgagee East along said East line 704.85 feet; thence S outh 89 FOSTR E , SWIFT, COLLINS & degr ees 22 minutes 24 secSMITH, P.C . onds West 128.28 feet; Benja min J. Price thence North 61 degr ees 24 Attorneys o f r Mortgagee minutes 59 seconds West 313 S . Washington S quare 141.30 feet; thence S outh 28 Lansing, MI 48933 degr ees 35 minutes 01 sec(517) 371-8100 onds West 164.79 feet; thence S outh 01 degr ees 00 ICCN-863182 minutes 33 seconds East 9/26/10-10/3, 10, 17, 24/10 192.35 feet to the S outh line of said S ection 5; thence North 89 degr ees 50 minutes 03 seconds West along said Email the Lansing Community S outh line 185.04 feet; Newspapers 24/7 at: thence North 01 degr ees 00 lcnclassifieds@gannett.com
Legals deg minutes 33 seconds West 534.69 feet; thence S outh 84 degr ees 55 minutes 25 seconds West 104.00 feet; thence North 00 degr ees 15 minutes 39 seconds East 40.45 feet; thence North 13 degr ees 23 minutes 47 seconds West 151.69 feet; thence S outh 88 degr ees 59 minutes 46 seconds West 142.45 feet; thence North 11 degr ees 09 minutes 26 seconds West 276.73 e f et to the S outh line of Whitehills Lakes S outh as recorded in Liher 57 of Plats, Pages 36 through 40, inclusive, Ingham C ounty Record s; thence along said S outh line the follow ing fiv e courses: North 88 degr ees 51 minutes 00 seconds East 155.71 feet , North 79 degr ees 46 minutes 05 seconds East 362.54 feet , S outh 73 degr ees 49 minutes 45 seconds East 141.49 feet , North 48 degr ees 27 minutes 40 seconds East 113.96 feet and S outh 87 degr ees 24 minutes 47 seconds East 164.48 feet to the Point of Beginning. AND A parcel of land in the S outheast quarter of S ection 5, and in the S outhwest quarter of S ection 4, Town 4 North, Range 1 West, Meridia n Township, Ingham C ounty, Michigan, the bound ary of said parcel des cribed as: C ommencing at the S outheast corner of said S ection 5; thence North 89 degr ees 50 minutes 03 seconds West along the S outh line of said S ection 5 a dis tance of 202.23 e f et to the Point of Beginning of this des cription; thence North 89 degr ees 50 minutes 03 seconds West continuing along said S outh line 128.55 feet; thence North 01 degr ees 00 minutes 33 seconds West 192.35 feet; thence North 28 degr ees 35 minutes 01 seconds East 164.79 feet; thence S outh 61 degr ees 24 minutes 59 seconds East 141.30 feet; thence North 89 degr ees 22 minutes 24 seconds East 128.28 feet to the East line of said S ection 5; thence S outh 00 degr ees 37 minutes 36 seconds East along said East line 151.36 feet; thence S outh 59 degrees 10 minutes 57 seconds West 233.94 feet to the Point of Beginning. Property Tax Numbers: 3302-02-05-476-005, 33-02-0205-476-006, 33-02-02-05-476007, 33-02-02-05-476-008, 3302-02-05-476-009, and 33-0202-05-426-007. The period within which the above premises may be redeemed shall expire one (1) year f rom the d ate of sale. Dated: S eptember 14, 2010CN-860774 9/19, 26/10-10/3, 10, 17/10 NOTICE
OF MORTGAGE SALE
FOSTER, SWIFT, COLLINS & SMITH, P.C . IS ATTEMPT ING TO COLLECT A DEBT AND ANY INFORMATION OBTAINED WILL BE USED FOR THAT PURPOSE. PLEASE CONTACT OUR OF FICE AT THE NUMBER BE LOW IF A PARTNER OF MORTGAGOR IS IN ACTIVE MILITARY DUTY. DEFAULT having been made in the condit ions of a certain Mortgage made on July 28, 2005, by SOUTH WHITEHILLS LIMITED PARTNERSHIP, a Michigan limited partnership, as Mortgagor, given by it to MASON STATE BANK, whose addr ess is 322 S . Jefferson, P.O. Box 130, Mason, Michigan 48854, as Mortgagee, and recorded on August 12, 2005, in Liber 3178, Page 432, Ingham C ounty Record s, as partially dis charged in Liber 3316, Page 1105, on which Mortgage there is claimed to be d ue and unpaid, as of the
Legals
Legals
np id, d ate of this N otice, the sum of One Million One Hundr ed E ighty-Three and One Hund red S eventy-S ix and 15/100 Dollars ($1,183,176.15); and no suit or proceeding at law or in equity having been instituted to recover the deb t or any part thereof secured by said Mortgage, and the power of sale in said Mortgage having become operative by reason of such def ault; NOTICE IS HEREBY GIVEN that on Thursd ay, October 21,
g ge and des cribed as follows: LAND SITUATED IN THE TOWNSHIP OF MERIDIAN, COUNTY OF INGHAM, MICH IGAN, DESCRIBED AS: Lots 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 and 13, S outh Ridge Park West and S outh Ridge Park East, all being in Whitehills Lakes S outh, as set forth in Liber 57 of Plats, Page 36. Property Tax N umbers: 3302-02-05-428-021, 33-02-0205-430-003, 33-02-02-05-478001 (Lot 1), 33-02-02-05-478002 (Lot 2), 33-02-02-05-478003 (Lot 3), 33-02-02-05-478004 (Lot 4), 33-02-02-05-478005 (Lot 5), 33-02-02-05-478006 (Lot 6), 33-02-02-05-478007 (Lot 7), 33-02-02-05-477006 (Lot 8), 33-02-02-05-477005 (Lot 9), 33-02-02-05-477004 (Lot 10), 33-02-02-05477-003 (Lot 11), 33-02-0205-477-002 (Lot 12) and 3302-02-05-477-001 (Lot 13). The period within which the above premises may be redeemed shall expire one (1) year f rom the d ate of sale. Dated: S eptember 14, 2010
Legals ep
14,-CN 860773 9/19, 26/10-10/3, 10, 17/10 NOTICE
PURSUANT TO MCL 600.3205a(4)
NOTICE is hereby provided to S hpend S hefkiu and Merrushe S hefkiu , the borrowers and/ or mortgagors (hereinaf ter "Borrower") regarding the property located at 341 E S outh S treet, S t., Mason, MI 48854. The Borrower has the right to request a meeting with the Mortgage holder or mortgage servicer. The agent des ignated by the Mortgage S ervicer and/ or Mortgage Holder to contact
Legals
Legals
g ge and that has authority to make agreements under MCL sections 600.3205b and 600.3205c is Jon K. Jenkins, 216 E Ash S treet, S uite 102, PO Box 303, Mason, MI 48854 at 517-676-1007. The Borrower may contact a housing counselor by visiting the Michigan S tate Housing Development Authority’s website or by calling the Michigan S tate Housing Development Authority at mshda or at 866-946-7432. If the Borrower requests a meeting with the agent des ignated above by contacting an approved housing counselor with 14 d ays f rom October 12, 2010, for eclosure proceedings will not be commenced until 90 d ays af ter October 12, 2010. If the Borrower and the agent des ignated above reach an agreement to modify the mortgage loan. the mortgage will not be for eclosed if the Borrower abides by the terms of the agreement.
g The Borrower has the right to contact an attorney. The Telephone number of the S tate Bar of Michigans Lawyer Referra l S ervice is 800968-0738. THIS FIRM IS A DEBT COLLECTOR ATTEMPTING TO COLLECT A DEBT. ANY INFORMATION WE OBTAIN WILL BE USED FOR THAT PURPOSE.
CITY OF LESLIE ORDINANCE N . 197 O
Legals STATE COUNTY
OF MICHIGAN OF INGHAM
NOTICE TO CREDITORS Decedent’s Trust
TO ADOPT THE NIU FORM TRAFFIC CODE FOR CITIES, TOWNSHIPS, AND VILLAGES THE IC TY OF LESLIE ORDAINS:
DEROSE LIVING TRUST TO ALL CREDITORS: NOTICE TO CREDITORS: The dec edent , Patricia DeRose, who lived at 2131 Darby Drive in Lansing, Ingham C ounty, Michigan died S epDated October 12, 2010 tember 25, 2010. redit ors of the dec edent For more infor mation, Care notified that all claims please call against the dec edent and 517-676-1007 the trust des cribed below Jon K Jenkins be for ever barred unless Attorney for S ervicer and or will presented to Joseph A. Mortgage holder and Mary J. Howard, 216 E Ash S t., S te 102, PO DeRose Trustees of the DeRose LivCASE NO Box 303 ing Trust, d ated August 26, 70551-1-NA Mason, MI 48854-0303 1999, as amended, 172 KenPETITION NO Amd #10sington C ircle, Battle C reek, 1323 IC-CN 86 9784 MI 49015, within 4 months 10/17/10 af ter the d ate of publication TO: STEVEN GREGOIRE, Faof this notice. ther IN THE MATTER OF: ALEX October 7, 2010 GRE G OIRE , MIN O R H C ILD Email the Lansing Community Newspapers 24/7 at: Bernick, Omer, Radner & A hearing regarding The lcnclassifieds@gannett.com Ouellette, P.C . Amended Petition of S . Nan cy L. Little P43113 Holmes FCW/ CDS regarding
Selling an item SEE SOURCEADS.COM OR CALL LCN TOLL FREE
877-475-SELL
Legals STATE OF MICHIGAN PROBATE COURT COUNTY OF INGHAM NOTICE TO CREDITORS Decedent’s E state FILE NO. 10-1530-DE E state of SHIRLEY E LACCHIA, Deceased Date of birth:12/05/1925 TO ALL CREDITORS: NOTICE TO CREDITORS: The dec edent , S hirley E Lacchia who lived at 2679 Cahill Drive, East Lansing, MI died 2-18-2010. C redit ors of the dec edent are notified that all claims against the estate will be for ever barred unless presented to Thomas L Pennell, named personal representative or proposed personal representative, or to both the probate court at 10841 Bond Road, DeWitt, MI 48820 and the named/ proposed personal representative within 4 months af ter the d ate of publication of this
AN ORDINANCE
TO ADOPT THE MOTOR VEHICLE CODE FOR IC TIE,S TOWNSHIPS, AND VILLAGES THE CITY OF LESLIE ORDAINS:
SECTION ON:E C ode and Amendments and Revisions adopt ed The U nifor m Traffic C ode for C ities, Townships, and Villages as promulgated by the dir ector of the Michigan Department of S tate Police pursuant to the Administra tive Procedure s Act of 1969, 1969 PA 306, MCL 24.201 to 24.328 and made ef fec tive October 30, 2002, and all f uture amendments and revisions to the U nifor m Traffic C ode when they are promulgated and effec tive in this state are hereby adopt ed and incorporated by refer ence. SECTION TWO: Refer ences in C ode Refer ences in the U nifor m Traffic C ode for C ities, Townships, and Villages to a "governmental unit" U nifor m Traffic C ode for C ities, Townships, and Villages U nifor m Traffic C ode for C ities, Townships, and Villages are adopt ed by refer ence. SECTION FIVE: CONFLICTING ORDINANCES REPEALED. The sections of title Traffic and Vehicles, C hapter 82 of the C ode of Ordina nces for the C ity of Leslie inconsistent with the provisions of the U nifor m Traffic.
SECTION ON:E C ode and Amendments and Revisions adopt ed The Michigan Vehicle C ode Public Act N o. 300 of 1949 (MCL 257.1--257.923), including all amendments effec tive as of the d ate of publication of notice of adopt ion of the ordina nce codified in this article, and including all amendments thereaf ter made to the Michigan Vehicle C ode, is hereby adopt ed by refer ence as a traffic code of the C ity of Leslie. Amend ments made to the Michigan Vehicle C ode shall become ef fec tive as adopt ed by refer ence herein effec tive the same d ate they become efe f c tive in the Michigan Vehicle C ode. SECTION TWO: Refer ences in C ode Refer ences in the Michigan Vehicle C ode to "local authorities" Michigan Vehicle C ode Michigan Vehicle C ode are adopt ed by refer ence. SECTION FIVE: CONFLICTING ORDINANCES REPEALED. The sections of title Traffic and Vehicles, C hapter 82 of the C ode of Ordina nces for the C ity of Leslie inconsistent with the provisions of the Michigan Vehicle.
Denae Davenport Leslie C ity C lerk
Denae Davenport Leslie C ity C lerk
9024
eg ding Alex Gregoire, C hild will be condu cted by the court on Monda y, N ovember 1, 2010 at 1:30 p.m. in COURTROOM 3, VETERANS MEMORIAL 313 W KalaJoseph A. DeRose and Mary COURTHOUSE, mazoo S treet, 2nd floor , J. Howard Lansing, MI 48933 befor e 172 Kensington C ircle JUDGE LAURA BAIRD. Battle C reek, MI 49015 IT IS THEREFORE ORDERED (269) 719-6220) that STEVEN GREGOIRE personally appear befor e the IC-CN 86 9404 court at the time and place 10/17/10 stated above. This hearing may result in STATE OF MICHIGAN the termination of your paJUDICIAL CIRCUIT rental rights. FAMILY DIVISION INGHAM COUNTY HC/N IC-NC 86 9380 10/17/10 PUBLICATION OF HEARING
CITY OF LESLIE ORDINANCE N . 196 O
AN ORDINANCE
ICCN-86
Legals
Legals y 2400 Lake Lansing Road, S uite F Lansing, MI 48912 (517)371-5361
10/17/10
IC-CN 86
9020
10/17/10
Lansing
C
ommunity Newspapers
Legals notice.
p
Dated: Nan cy L Little P43113 2400 Lake Lansing Road S uite F Lansing, Michigan 48912 (517) 371-5361 Thomas L Pennell 10841 Bond Road DeWitt, MI 48820 517-669-3632 IC-NC 86 9794 10/17/10 STATE OF MICHIGAN PROBATE COURT COUNTY OF INGHAM NOTICE TO CREDITORS Decedent’s E state FILE NO. 10-1340-DE E state of Margie Mead Date of birth:12/20/1922 TO ALL CREDITORS: * NOTICE TO CREDITORS: The dec edent , Margie Mead, who lived at 2052 S Washington, Arcadia , MI 48842
Legals
Legals
ing on, , Michigan died 5/21/2002. STATE OF MICHIGAN C redit ors of the dec edent PROBATE COURT are notified that all claims COUNTY OF INGHAM against the estate will be for ever barred unless preNOTICE TO CREDITORS sented to Joyce Woodw ard, Decedent’s E state named personal representative or proposed personal FILE NO. representative or to both 10-1358-DE the probate court at 313 W Kalamazoo S treet, Lansing, E state of Thomas S MI 48933 and the named Gunnings Date of birth: proposed personal repre- 2/8/1935 sentative within 4 months TO ALL CRD E ITORS: * af ter the d ate of publication NOTICE TO CREDITORS: of this notice. The dec edent , Thomas S Gunnings who lived at 2614 Melissa K. Allen P-51908 C ochise Lane, Okemos, 12800 E scanaba Drive, S te F Michigan died 8/20/2010. DeWitt, MI 48820 C redit ors of the dec edent 517-669-1078 are notified that all claims against the estate will be Joyce Woodw ard for ever barred unless pre1118 Vail C ourt sented to Barbara Gunnings Lansing, MI 48917 named personal representa517-321-9821 tive or representative, or to both the probate court at IC-CN 86 9463 2614 C ochise Lane, Okemos, 10/17/10 MI 48864 and the named/ proposed personal representative within 4 months af ter the d ate of Email the Lansing Community publication of this notice. Newspapers 24/7 at: lcnclassifieds@gannett.com
DELHI CHARTER TOWNSHIP C ommunity S ervices C enter, 2074 Aurelius Road, Holt, MI SYNOPSIS COMMITTEE
OF PROPOSED TOWNSHIP OF THE WHOLE AND BOARD OF TRUSTES MINUTES REGULAR MEETING HELD ON OCTOBER 5, 2010 EVAN HOPE, TOWNSHIP CLERK
Legals p Dated: S eptember 14, 2010 S teven D Dunnings P36086 530 S outh Pine S t Lansing, MI 48933-2239 517-487-8222 Barbara Gunnings 2614 C ochrise Lane Okemos, MI 48864 517-351-4174 ICCN-86 9415 10/17/10 STATE OF MICHIGAN PROBATE COURT COUNTY OF INGHAM NOTICE TO CREDITORS Decedent’s E state FILE NO. 10-1413-DE E state of RICKY PAUL HOUCK Date of Birth: S eptember 17, 1963 TO ALL CREDITORS: NOTICE TO CREDITORS: The dec edent , RICKY PAUL HOUCK, who lived at 1660 S SHORE DR #82, EAST LANS ING, Michigan died August 2,
Legals , hig g , 2010 C redit ors of the dec edent are notified that all claims against the estate will be for ever barred unless presented to MARLENE WITHHAM, named personal representative or proposed personal representative or to both the probate court at 313 W Kalamazoo S t., Lansing, MI 48933 and the named proposed personal representative within 4 months af ter the d ate of publication of this notice. Date: October 8, 2010 William L. Ferrigan, P.C . William L. Ferrigan P26084 11973 S weetwater Dr., S uite A-1 Grand Ledge, MI 48837 (517) 627-8431 MARLENE WITHAM 11973 SWETWATER DR STE A1 GRAND LEDGE, MI 48837 517-627-8431 IC-CN 86 9843 10/17/10
When you need repairs around the home - and you need them fast- check the service directory in the Source
IC-CN 86
9128
There will be a Public Accuracy Test of the voting equipment in Ononda ga Township on Tuesd ay, October 19th at 11 am. This testing will be done at the Township hall located at 4756 Baldw in S t., The public is invited to attend. The public Accuracy Test is condu cted to det ermine that the program and the computer being used to tabulate the results of the election counts the votes in the manner prescribed by law. Diane Johnson Ononda ga Township C lerk IC-CN 86
9750
10/17/10
SEE SOURCEADS.COM OR CALL LCN TOLL FREE
877-475-SELL Monday - Friday, 8am – 5pm Classified Section
Thorburn Sanit ary S ewer Replacement 4. U pgrade of Genesis Rescue E quipment (Jaws of Life) - Fire Department 5. FY 2010 Lansing Economic Area Partnership, Inc. Dues 6. Amendment N o. 2 to Resolution N o. 2009-040 - FY 2010 General Fund Budget 7. Amendment N o. 2 to Resolution N o. 2009-041 - FY 2010 Parks & Recreation Fund Budget 8. Amendment N o. 2 to Resolution N o. 2009-042 - FY 2010 Fire E quipment, Training and Apparatus Fund Budget 9. Amendment N o. 1 to Resolution N o. 2009-043 - FY 2010 Water Improvement Fund Budget 10. Amendment N o. 1 to Resolution N o. 2009-044 - FY 2010 Debt S ervice Fund Budget 11. Amendment N o. 2 to Resolution N o. 2009-045 - FY 2010 C ommunity Development Fund Budget 12. Amendment N o. 2 to Resolution N o. 2009-046 - FY 2010 S ewer Fund Budget 13. Amendment N o. 1 to Resolution N o. 2009-047 - FY 2010 Downtown Development Authority Fund Budget 14. Amendment N o. 1 to Resolution N o. 2009-048 - FY 2010 Brownfield Redev elopment Authority Fund Budget 15. Resolution N o. 2010-015 - Annual Determination of S treetlight Assessments - Lansing Board of Water and Light 16. Resolution N o. 2010-016 - Annual Determination of S treetlight Assessments - C onsumers E nergy 17. Resolution N o. 2010-017 - C onsumers E nergy C hange in S tanda rd S treetlighting C ontract Mid-B lock C rossing on Willoughby Road 18. S pecial U se Permit N o. 10-264 - 1381 N . C eda r Road, Mason - EDT C ontracting, Inc. - Tax Parcel #33-25-05-25-101-010 - C ontractor’s Offic e in A-1, Agricultural, Zoning District 19. Petition to Rezone a C s e N o. 10-865 - 3818 Holt Road - Harold Hurni - Tax Parcel #33-25-0513-376-002 - A-1, Agricultural to C -1, Low Impact C ommercial (Proposed Zoning Ordina nce N o. 619) Board of Trustees meeting adjourned at 9:13 p.m. - Board of Trustees meeting minutes are available on the Township’s Web S ite: ownship.com. C opies of the minutes are also available upon request f rom the Township C lerk. Offic e hours are 8:00 a.m. to 5:00 p.m. Monda y - Frida y, except holid ays.
The Delhi C harter Township Board met in a regular Board meeting on Tuesd ay, October 5, 2010 in the Multipurpose Room at the C ommunity S ervices C enter, 2074 Aurelius Rd., Holt, Michigan. S upervisor S tuart Goodr ich called the C ommittee of the Whole meeting to order at 6:00 p.m. Board Members Present: S upervisor S tuart Goodr ich, C lerk E van Hope, Treasurer Harry Ammon, Trustees Derek Bajema , John Hayhoe (arrived at 6:23 p.m.), Jerry Ketchum (arrived at 6:15 p.m.) , Roy S weet Board Member(s) Absent: N one N o Board Action was taken on the follow ing C ommittee of the Whole Agenda items: (U nless otherwise noted) Presentation by Rehmann Robson Department of Public S ervices - S eptember Activity Report Delhi C harter Township FY 2011 Budget Discussion C ommittee meeting adjourned at 7:32 p.m. The Board of Trustees meeting was called to order at 7:36 p.m. Board Action on the follow ing Township Board of Trustees Agenda items: (All items approved unless otherwise noted) 1. 2009 Annual Report - Capit al Area District Library Holt/Delhi Branch 2. a) Approval of Minutes - C ommittee Meeting of S eptember 21, 2010 b) Approval of Minutes - Regular Meeting of S eptember 21, 2010 c) Approval of Minutes - Regular Budget Meeting of S eptember 14, 2010 d) Approval of C laims - S eptember 21, 2010 in the amount of $282,762.18 e) Approval of Payroll - S eptember 30, 2010 in the amount of $11,039.75 f) S et Public Hearing - FY 2011 Budgets - General Fund and S pecial Revenue & Debt S ervice Funds for 10-19-2010 at 8:00 p.m. 3. Amendment for Professiona l S ervices - C ook and HCN/
NOTICE
Legals
TO THE REGISTERED ELECTORS RESIDING IN WHEATFIELD TOWNSHIP, NOTICE IS HEREBY GIVEN that the Public Accuracy Test for the N ovember 2, 2010 general election has been schedu led for Wednes d ay, October 20, 2010, at 10:00 AM in the Township Hall, 985 E . Holt Road, Williamston, MI 48895. The Public Accuracy Test is condu cted to det ermine that the program and the computer being used to tabulate the results of the election, counts the votes in the manner prescribed by law. Wheatfield ENT/
ICCN-86
9400
Denise Kapp Township C lerk 10/17/10
Delhi C harter Township Ingham C ounty, MI PUBLIC
O N TICE
O N TICE IS HERB E Y GIVEN that the Public Accuracy Test for the NOVEMBER 2, 2010 GENERAL ELECTION has been sched uled for Tuesd ay October 19, at 9:00 A.M. in the C lerk’s Offic e in the Delhi C harter Township C ommunity S ervices C enter, 2074 Aurelius Rd., Holt, Mi. The Public Accuracy Test is condu cted to det ermine that the program and the computer being used to tabulate results of the election, counts the votes in the manner prescribed by law. E van Hope, CMC Delhi C harter Township C lerk HCN/
IC-NC 86
9184
10/17/10
PUBLIC
NOTICE
The Leslie C ity C ouncil will hold a Public Hearing on Monda y, N ovember 1, 2010 at 7:00 p.m. at Leslie C ity Hall 107 E . Bellevue S treet to receive public comments pertaining to an addition to the C ity Of Leslie C ode of Ordina nces: An Ordina nce to provide for payment in lieu of taxes (PILOT) for a d welling projec t for persons of low income to be fina nced or assisted pursuant to the provisions of the S tate Housing Development Authority Act of 1966. A copy of the proposed Ordina nce is available for review in the Leslie C ity Offic es 106 E . Bellevue S treet, Monda y through Frida y, 8:00 a.m. to 4:30 p.m. The Leslie C ity C ouncil will accept comments at the hearing or in writing if the written comments are received by the C ity C lerk not later than 4:30 p.m. on the d ate of the hearing. Published: October 17, 2010
10/17/10 IC-CN 86
9376
Denae Davenport Leslie C ity C lerk 10/17/10
Ingham County | https://issuu.com/lansingstatejournal/docs/iccn_10_17_10 | CC-MAIN-2017-30 | refinedweb | 35,796 | 74.49 |
Hi all,
I have a program, which is invoked from a shell script. I need to return back to the shell script a status, whether the program succeeded or failed, so the shell script determines whether to continue with its normal course of actions or to stop upon faileur.
So, here's what I am assuming, and please do correct me if I am wrong.
I am planning to catch all the possible exceptions and upon catching each one, and properly handeling, I do a System.exit(2). Besides, at the very end of program flow, I do a System.exit(0).
So, in the shell script, I will check the value of $? by echoing it, and if it is 0, then the program ran successfully, else, there was some problems.
public class HelloWorld { public static void main( String[] args ) { try { callFirstMethod(); callSecondMethod(); System.exit(0); } catch (Exception e) { e.printStackTrace(); System.exit(2); } }
is my theory correct? please comment.
Thanks. | https://www.daniweb.com/programming/software-development/threads/130740/system-exit-in-catch-block | CC-MAIN-2022-21 | refinedweb | 161 | 73.07 |
Introduction to Programming Languages/Universal Polymorphism
Universal Polymorphism[edit]
Symbols that are universally polymorphic may assume an infinite number of different types. There are two kinds of universal polymorphism: parametric and subtyping. In the rest of this chapter we will see these variations in more detail.
Parametric Polymorphism[edit]
Parametric polymorphism is a feature of routines, names or symbols that can be parameterized in one or more types. This kind of polymorphism lets us to define codes that are generic: they can be instantiated to handle different types. The code below shows the use of a template, the way to implement parametric polymorphism in C++.
1 #include <iostream> 2 3 template <class T> 4 T GetMax (T a, T b) { 5 T result; 6 result = (a > b) ? a : b; 7 return (result); 8 } 9 10 int main() { 11 int i = 5, j = 6, k; 12 long l = 10, m = 5, n; 13 k = GetMax<int>(i, j); // type parameter: int 14 n = GetMax<long>(l, m); // type parameter: long 15 std::cout << k << std::endl; 16 std::cout << n << std::endl; 17 return 0; 18 }
The program above defines a polymorphic function called
GetMax (lines 3 to 8). The type variable
T, defined in the scope of
GetMax, will be replaced by an actual type during the function call. The main function shows two calls to
GetMax. The call at line 13 uses the type
int whereas at line 14 it uses the type
long. The arguments of
GetMax are compared using the "
>" operator. Therefore, to use this function, it is necessary that the actual type that replaces T implements this kind of comparison. Fortunately, C++ allows us to define this operator to our own types. As an example, the user defined class
MyInt, shown below, is a valid type to
GetMax, as it implements the greater-than operator:
#include <iostream> class MyInt { friend std::ostream & operator<<(std::ostream& os, const MyInt& m) { os << m.data; } friend bool operator >(MyInt& mi1, MyInt& mi2) { return mi1.data > mi2.data; } public: MyInt(int i) : data(i) {} private: const int data; }; template <class T> T GetMax (T a, T b) { return (a > b) ? a : b; } int main () { MyInt m1(50), m2(56); MyInt mi = GetMax<MyInt>(m1, m2); std::cout << mi << std::endl; return 0; }
Parametric polymorphism is present in many different statically typed languages. As an example, the function below, implemented in Java, manipulates a list of generic types. Notice that, even though C++ and Java share similar syntax, parametric polymorphism in these languages is implemented in different ways. In C++ templates, each instance of a parametric function is implemented separately. In other words, the C++ compiler generates a whole new function for each specialization of a polymorphic function. Java's generics only create one implementation for each parameterized function.
public static <E> void printList(List<E> l) { for (E e : l) { System.out.println(e); } }
SML implements parametric polymorphism in a way that is similar to Java. Only one instance of each parametric function exists in the entire program. These functions manipulate references to values, instead of the values themselves. The function below, for instance, computes the length of a generic list in SML. Notice that our implementation does not need to known anything about the values stored in the list. It only manipulates the structure of this list, considering any type stored there as a generic reference.
- fun length nil = 0 = | length (_::t) = 1 + length t; val length = fn : 'a list -> int - length [1, 2, 3]; val it = 3 : int - length [true, false, true]; val it = 3 : int - length ["a", "bc", "def"]; val it = 3 : int
Parametric polymorphism gives us the idea of a type constructor. A type constructor is a kind of function that receives types, and produces new types. For instance, in the Java program above, we saw the type constructor
List<E>. We cannot instantiate a Java object with this type. Instead, we need to use a specialization of it, such as
List<Integer>, for instance. So, instantiating
List<E> with the type
Integer, for instance, is analogous to passing this type to a single-parameter function
List<E> that returns back
List<Integer>.
Parametric polymorphism is an important mechanism of code reuse. However, not every programming language provides this feature. Parametric polymorphism is absent, for instance, from widely used languages, such as C, Fortran or Pascal. Nevertheless, it is still possible to simulate it using several different strategies. For example, we can simulate parametric polymorphism in C using macros. The program below illustrates this technique. The macro
SWAP has a type parameter, similarly to a type constructor. We have instantiated this macro twice, first with
int, and then with
char*.
#include <stdio.h> #define SWAP(T, X, Y) {T __aux = X; X = Y; Y = __aux;} int main() { int i0 = 0, i1 = 1; char *c0 = "Hello, ", *c1 = "World!"; SWAP(int, i0, i1); SWAP(char*, c0, c1); printf("%d, %d\n", i0, i1); printf("%s, %s\n", c0, c1); }
Subtyping Polymorphism[edit]
A well-known property present in object oriented languages is the Liskov's Substitution Principle. This principle says that in any situation in which the left-hand-side of an assignment expects a type T, it can also receive a type S, as long as S is subtype of T. Programming languages that follow the Liskov's Substitution Principle are said to provide subtyping polymorphism. The program below, written in Java, illustrates this kind of polymorphism. The three classes, String, Integer and LinkedList are subclasses of Object. Therefore, the function print can receive, as actual parameters, objects that are instances of any of these three classes.
1 import java.util.LinkedList; 2 public class Sub { 3 public static void print(Object o) { 4 System.out.println(o); 5 } 6 public static void main(String[] a) { 7 print(new String("dcc024")); 8 print(new Integer(42)); 9 print(new LinkedList<Integer>()); 10 } 11 }
Subtyping polymorphism works because if S is subtype of T, then S meets the contract expected by T. In other words, any property of the type T is also present in its subtype S. In the example above, the function print expects types that "know" how to convert themselves into strings. In Java, any type that has the property toString() has this knowledge. Given that this property is present in the class Object, it is also present in all the other classes that, according to the language's semantics, are subtypes of Object.
There are two basic mechanisms that programming languages use to define the subtype relation. The most common is nominal subtyping. Languages such as Java, C#, C++ and Object Pascal are all based on nominal subtyping. According to this system, the developer must explicitly state, in the declaration of S, that S is subtype of T. As an example, the code below illustrates a chain of subtypes in the Java programming language. In Java, the keyword extends is used to determine that a class is subtype of another class.
class Animal { public void eat() { System.out.println(this + " is eating"); } public String toString () { return "Animal"; } } class Mammal extends Animal { public void suckMilk() { System.out.println(this + " is sucking"); } public void eat() { suckMilk(); } } class Dog extends Mammal { public void bark() { System.out.println(this + " is barking"); } public String toString () { return "Dog"; } }
The other mechanism used to create subtyping relations is structural subtyping. This strategy is less common than nominal subtyping. One of the most well-known programming languages that foster structural subtyping is ocaml. The code below, written in this language, defines two objects, x and y. Notice that, even though these objects have not being explicitly declared with the same type, they contain the same interface, i.e., they both implement the methods get_x and set_x. Thus, any code that expects one of these objects can receive the other.
let x = object val mutable x = 5 method get_x = x method set_x y = x <- y end;; let y = object method get_x = 2 method set_x y = Printf.printf "%d\n" y end;;
For instance, a function
let set_to_10 a = a#set_x 10;; can receive either x or y, e.g.,
set_to_10 x and
set_to_10 y are valid calls. In fact, any object that provides the property set_x can be passed to
set_to_10, even if the object has not the same interface as x or y. We illustrate this last statement with the code below: In other words, if an object O provides all the properties of another object P, then we say that O is subtype of P. Notice that the programmer does not need to explicitly state this subtyping relation.
let z = object method blahblah = 2.5 method set_x y = Printf.printf "%d\n" y end;; set_to_10 z;;
In general, if S is a subtype of T, then S contains more properties than T. For instance, in our class hierarchy, in Java, instances of Mammal have all the properties of Animal, and, in addition to these properties, instances of Mammal also have the property suckMilk, which does not exist in Animal. The figure below illustrates this fact. The figure shows that the set of properties of a type is a subset of the set of properties of the subtype.
Nevertheless, there exist more instances of the supertype than instances of the subtype. If S is a subtype of T, then every instance of S is also an instance of T, whereas the contrary is not valid. The figure below illustrates this observation. | https://en.wikibooks.org/wiki/Introduction_to_Programming_Languages/Universal_Polymorphism | CC-MAIN-2017-39 | refinedweb | 1,580 | 62.88 |
Linked List Data Structure Implementation - No Java API
Dante Hawke
Greenhorn
Joined: Jan 27, 2009
Posts: 7
posted
Nov 16, 2009 19:12:36
0
Hi all, I was hoping some of you may be able to help me.
I have been tasked with implementing a linked list data structure that does not use any imports, other than a provided interface. This implementation must store items in the order they are added.
I thought that I should use an inner class to act as the Node class for this linked list, as it has to remain as generic and abstract as possible and should work for any type of Object you wish to add.
BasicCollection interface:
/** * @param <T> the type of the data stored in the collection. */ public interface BasicCollection<T> { public boolean add(T item); public boolean remove(T item); public boolean contains(T item); public boolean isEmpty(); public int size(); }
BasicLinkedList class:
/** * A class that is a linked list and can hold items */ public class BasicLinkedList<T> implements Iterable<T> { private Node header; private int size; /** * The default constructor for the BasicLinkedList class. */ public BasicLinkedList() { header = new Node(); this.size = 0; } /** * Adds an item to the collection. * * @param item - To be added to the list. * @return true - If the item was added. */ public boolean add(T value) { if(value != null) { // If value is not null. if(header.getNext().equals(null)) { // And If header.getNext is equal to null. header.setNext((Node)value); // Set header to point to the new item. } else { if(header.getNext() != null) { // If header is not pointing to null. Node temp1 = header.getNext(); // Set temp1 to point to the Node that header points to. while(temp1.getNext() != null) { // While this temp1.getNext is not null. temp1 = temp1.getNext(); // Set temp1 to current temp1.getNext. } temp1.setNext(new Node(value)); // Set the last Node to point to the new Node. } } } size++; return true; } /** * Checks whether the collection contains an item, using item.equals. * * @param item - To be checked. * @return true - If the collection contains the item. */ public boolean contains(T item) { Node temp2 = header.getNext(); while(temp2.getNext() != null) { // While this temp2.getNext is not null. temp2 = temp2.getNext(); // Set temp2 to current temp2.getNext. if (temp2.getValue().equals(item)) { // And for each of these if the value it holds .equals item return true; } } return false; } /** * Checks whether the list is empty. * * @return true - If the collection is empty. */ public boolean isEmpty() { if(header.getNext().equals(null)){ return true; } else { return false; } } /** * Removes one item from the collection that matches the given item using item.equals. * * @param - Item to be removed from the list. * @return - True if an item was successfully removed, false if the item was * not in the list. */ public boolean remove(T item) { return false; } /** * Returns the number of items in the list. * * @return size - Number of items in the list. */ public int size() { return size; } /** * toString method overridden. Prints all items in the collection. * Prints to standard output. * * @return String */ @Override public String toString(){ StringBuffer out1 = new StringBuffer("Values held in the linked list: \n"); Node temp3 = header.getNext(); while(temp3.getNext() != null) { temp3 = temp3.getNext(); out1.append(temp3.getValue()).append(" "); } return out1.toString(); } /** * An inner class that acts as a Node in the linked list. */ private class Node { private T value; private Node next; /** * Default Constructor for a Node. */ public Node() { this.value = null; this.next = null; } /** * Constructor for a new Node. * * @param value - The Object to be held in this Node. */ public Node(T value) { this.value = value; this.next = null; } /** * getItem - Return the item held in this Node. * * @return item - T in this Node. */ public Object getValue() { return value; } /** * getNext - Return the next node in the list. * * @return next - Reference to the next Node. */ public Node getNext() { return next; } /** * setNext - Set the next Node in the list. * * @param next - Reference to the next Node. */ public void setNext(Node next) { this.next = next; } } }
I am having problems
testing
my code by creating an instance of the BasicLinkedList class and adding some Integer objects, it fails on the 2nd line of the add method...
Can any of you provide any pointers or advise?
Many Thanks,
Dante.
Vijitha Kumara
Bartender
Joined: Mar 24, 2008
Posts: 3881
I like...
posted
Nov 16, 2009 19:49:38
0
Hi Dante, Welcome to JavaRanch
I suggest you first start with non-generic approach, once you got it working you can make it generic.
SCJP 5 | SCWCD 5
[
How to ask questions
] [
Twitter
]
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 41847
31
posted
Nov 17, 2009 01:58:08
0
Why isn't your size attribute static?
Until you have got it working, take out the Iterable interface.
I agree. Here's the link:
subject: Linked List Data Structure Implementation - No Java API
Similar Threads
cannot insert into linkedlist after delete
node class for linked list
Nullpointer.. am I losing a reference in this code?
My LinkedList Iterator - Can't print first element - No use of Java API
nullpointerexception
Doubly Linked List
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
JForum
|
Paul Wheaton | http://www.coderanch.com/t/471247/java/java/Linked-List-Data-Structure-Implementation | CC-MAIN-2015-18 | refinedweb | 854 | 68.47 |
function_trace 1.1.2 either a list of functions to be traced, or a custom tracer object.. The common options to the builtin Tracer classes are:
- include_hidden if set to True, also trace functions whose name starts with _. Note, the __repr__ function will never be traced, and currently any tracing of functions starting with __ are disabled.
-.
Examples
from function_trace import trace_on, StdoutTracer, all, mapcat with trace_on(StdoutTracer(mapcat(all, [Class1, module1, Class2, module2]), include_hidden=True, depths={module1.check_thing: 1, module2.unimportant_thing: 0 Class1.silly_thing: 0})):, prefixed with !!!. This makes it possible to see an exception propagating down the stack.
- Downloads (All Versions):
- 0 downloads in the last day
- 61 downloads in the last week
- 1042 downloads in the last month
- Author: Jeff Weiss
- Keywords: trace debugging
- License: PSF
- Package Index Owner: weissjeffm
- DOAP record: function_trace-1.1.2.xml | https://pypi.python.org/pypi/function_trace/1.1.2 | CC-MAIN-2016-18 | refinedweb | 141 | 57.16 |
package App::Sqitch::Plan::Line; use 5.010; use utf8; use namespace::autoclean; use Moo; use App::Sqitch::Types qw(Str Plan); use App::Sqitch::X qw(hurl); use Locale::TextDomain qw(App-Sqitch); our $VERSION = 'v1.0.0'; # VERSION has name => ( is => 'ro', isa => Str, required => 1, ); has operator => ( is => 'ro', isa => Str, default => '', ); has lspace => ( is => 'ro', isa => Str, default => '', ); has rspace => ( is => 'rwp', isa => Str, default => '', ); has lopspace => ( is => 'ro', isa => Str, default => '', ); has ropspace => ( is => 'ro', isa => Str, default => '', ); has note => ( is => 'rw', isa => Str, default => '', ); after note => sub { my $self = shift; $self->_set_rspace(' ') if $_[0] && !$self->rspace; }; has plan => ( is => 'ro', isa => Plan, weak_ref => 1, required => 1, handles => [qw(sqitch project uri target)], ); my %escape = ( "\n" => '\\n', "\r" => '\\r', '\\' => '\\\\', ); my %unescape = reverse %escape; sub BUILDARGS { my $class = shift; my $p = @_ == 1 && ref $_[0] ? { %{ +shift } } : { @_ }; if (my $note = $p->{note}) { # Trim and then encode newlines. $note =~ s/\A\s+//; $note =~ s/\s+\z//; $note =~ s/(\\[\\nr])/$unescape{$1}/g; $p->{note} = $note; $p->{rspace} //= ' ' if $note && $p->{name}; } return $p; } sub request_note { my ( $self, %p ) = @_; my $note = $self->note // ''; return $note if $note =~ /\S/; # Edit in a file. require File::Temp; my $tmp = File::Temp->new; binmode $tmp, ':utf8_strict'; ( my $prompt = $self->note_prompt(%p) ) =~ s/^/# /gms; $tmp->print( "\n", $prompt, "\n" ); $tmp->close; my $sqitch = $self->sqitch; $sqitch->shell( $sqitch->editor . ' ' . $sqitch->quote_shell($tmp) ); open my $fh, '<:utf8_strict', $tmp or hurl add => __x( 'Cannot open {file}: {error}', file => $tmp, error => $! ); $note = join '', grep { $_ !~ /^\s*#/ } <$fh>; hurl { ident => 'plan', message => __ 'Aborting due to empty note', exitval => 1, } unless $note =~ /\S/; # Trim the note. $note =~ s/\A\v+//; $note =~ s/\v+\z//; # Set the note. $self->note($note); return $note; } sub note_prompt { my ( $self, %p ) = @_; __x( "Write a {command} note.\nLines starting with '#' will be ignored.", command => $p{for} ); } sub format_name { shift->name; } sub format_operator { my $self = shift; join '', $self->lopspace, $self->operator, $self->ropspace; } sub format_content { my $self = shift; join '', $self->format_operator, $self->format_name; } sub format_note { my $note = shift->note; return '' unless length $note; $note =~ s/([\r\n\\])/$escape{$1}/g; return "# $note"; } sub as_string { my $self = shift; return $self->lspace . $self->format_content . $self->rspace . $self->format_note; } 1; __END__ =head1 Name App::Sqitch::Plan::Line - Sqitch deployment plan line =head1 Synopsis my $plan = App::Sqitch::Plan->new( sqitch => $sqitch ); for my $line ($plan->lines) { say $line->as_string; } =head1 Description An App::Sqitch::Plan::Line represents a single line from a Sqitch plan file. Each object managed by an L<App::Sqitch::Plan> object is derived from this class. This is actually an abstract base class. See L<App::Sqitch::Plan::Change>, L<App::Sqitch::Plan::Tag>, and L<App::Sqitch::Plan::Blank> for concrete subclasses. =head1 Interface =head2 Constructors =head3 C<new> my $plan = App::Sqitch::Plan::Line->new(%params); Instantiates and returns a App::Sqitch::Plan::Line object. Parameters: =over =item C<plan> The L<App::Sqitch::Plan> object with which the line is associated. =item C<name> The name of the line. Should be empty for blank lines. Tags names should not include the leading C<@>. =item C<lspace> The white space from the beginning of the line, if any. =item C<lopspace> The white space to the left of the operator, if any. =item C<operator> An operator, if any. =item C<ropspace> The white space to the right of the operator, if any. =item C<rspace> The white space after the name until the end of the line or the start of a note. =item C<note> A note. Does not include the leading C<#>, but does include any white space immediate after the C<#> when the plan file is parsed. =back =head2 Accessors =head3 C<plan> my $plan = $line->plan; Returns the plan object with which the line object is associated. =head3 C<name> my $name = $line->name; Returns the name of the line. Returns an empty string if there is no name. =head3 C<lspace> my $lspace = $line->lspace. Returns the white space from the beginning of the line, if any. =head3 C<rspace> my $rspace = $line->rspace. Returns the white space after the name until the end of the line or the start of a note. =head3 C<note> my $note = $line->note. Returns the note. Does not include the leading C<#>, but does include any white space immediate after the C<#> when the plan file is parsed. Returns the empty string if there is no note. =head2 Instance Methods =head3 C<format_name> my $formatted_name = $line->format_name; Returns the name of the line properly formatted for output. For L<tags|App::Sqitch::Plan::Tag>, it's the name with a leading C<@>. For all other lines, it is simply the name. =head3 C<format_operator> my $formatted_operator = $line->format_operator; Returns the formatted representation of the operator. This is just the operator an its associated white space. If neither the operator nor its white space exists, an empty string is returned. Used internally by C<as_string()>. =head3 C<format_content> my $formatted_content $line->format_content; Formats and returns the main content of the line. This consists of an operator and its associated white space, if any, followed by the formatted name. =head3 C<format_note> my $note = $line->format_note; Returns the note formatted for output. That is, with a leading C<#> and newlines encoded. =head3 C<as_string> my $string = $line->as_string; Returns the full stringification of the line, suitable for output to a plan file. =head3 C<request_note> my $note = $line->request_note( for => 'add' ); Request the note from the user. Pass in the name of the command for which the note is requested via the C<for> parameter. If there is a note, it is simply returned. Otherwise, an editor will be launched and the user asked to write one. Once the editor exits, the note will be retrieved from the file, saved, and returned. If no note was written, an exception will be thrown with an C<exitval> of 1. =head3 C<note_prompt> my $prompt = $line->note_prompt( for => 'tag' ); Returns a localized string for use in the temporary file created by C<request_note()>. Pass in the name of the command for which to prompt via the C<for> parameter. =head1 See Also =over =item L<App::Sqitch::Plan> Class representing a plan. =item L<sqitch> The Sqitch command-line client. =back =head1 Author David E. Wheeler <david@justatheory.com> =head1 License Copyright (c) 2012-2018 i | http://web-stage.metacpan.org/release/App-Sqitch/source/lib/App/Sqitch/Plan/Line.pm | CC-MAIN-2019-30 | refinedweb | 1,070 | 74.19 |
On 10/10/06, Alexey Varlamov <alexey.v.varlamov@gmail.com> wrote:
>
> Mikhail,
> BTW, what would you say if all JIT-specific properties were kept
> separately? E.g. if there were JAVA, VM, JIT types of properties
> storage, would it be of some convenience to JIT side? Just curious :)
>
I think it would be convenient if we can assign them from the command line.
Right now we have -Dvm. -Xem. -Djit. -Dgc. set of properties.
You propose to emphasize them with -X prefix, so we have -XDvm. -XDem. and
-XDgc. as the result.
Your approach is better because the namespaces are separated. It's safer and
we remove potential problems when a property with the same name appears in
user's code.
The old approach is better because it's do the same using less entities.
--
Mikhail Fursov | http://mail-archives.apache.org/mod_mbox/harmony-dev/200610.mbox/%3Cbc79dd600610100508u189809c9qf13661f0a5e3468c@mail.gmail.com%3E | CC-MAIN-2017-17 | refinedweb | 138 | 76.72 |
Here's a C program to find reverse of a string using pointers with output and explanation. This program uses C concepts like Pointers in C, Malloc function in C, Sizeof function in C and For Loop in C.
# include <iostream.h> int main(){ char *string = (char*) malloc(11*sizeof(char)), temp; int length; printf("Enter the no of letters in the string (max 10): "); scanf("%d", &length); for(int i = 0;i < length;i++){ printf("\nEnter character %d: ", (i + 1)); scanf("%c", &temp); *(string + i) = temp; } *(string + length + 1) = '\0'; printf("\nYou entered: %s", string); printf("\nReverse of your string: "); for(int i = length - 1;i >= 0;i--){ printf("%c", *(string + i)); } return 0; }
Output of above program
Enter the no of letters in the string (max 10): 6
Enter character 1: s
Enter character 2: t
Enter character 3: r
Enter character 4: i
Enter character 5: n
Enter character 6: g
You entered: string
Reverse of your string: gnirts
Explanation of above program
Malloc function used in this program is to dynamically allocate memory to pointer. Malloc needs size of memory that needs to be allocated as an argument. Malloc returns void pointer or void*.
(char*) malloc(11*sizeof(char))
By sizeof(char) we mean size of character which is usually 1 byte. The above line means that malloc needs to allocate 11*sizeof(char) or 11*1 bytes of memory on the stack.
As mentioned above that malloc returns void* that is why a type conversion to char* is needed as we want memory block for character data.
thanx alot...
but plz can u tell me how file concept is used in such programss..i can't understand file concepts.. | http://cprogramming.language-tutorial.com/2013/04/reverse-of-string-using-pointers-in-c.html?showComment=1365665375691 | CC-MAIN-2022-33 | refinedweb | 284 | 53.85 |
From: Jeff Garland (jeff_at_[hidden])
Date: 2005-06-03 08:43:13
On Thu, 2 Jun 2005 13:41:49 -0400, Howard Hinnant wrote
> On Jun 2, 2005, at 11:17 AM, Rene Rivera wrote:
>
> > There are some failures for date_time with CW-9 (and similar errors in
> > CW-8):
> >
> > CW-9.5 on Mac...
> >
> >
> >
> > CW-9.4 on Windows...
> >
> >
> >
> > CW-8.3 on Windows...
> >
> >
> >
> > They have this as the reason:
> >
> > "[ J. Garland ] Some older compilers are confused by the template
> > code here. These are new features to date-time in 1.33 and there is no
> > plan to backport to these non-compliant compilers."
> >
> > Now I don't particularly think of CW-9 as an "older" compiler. So is
> > that really the reason? Or is it just that it hasn't been
> > investigated?
>
> I just took a look at and it looks to me
> like an error in the date_time library. The compile time error is:
>
> Error : illegal operands 'std::basic_istringstream<char,
> std::char_traits<char>, std::allocator<char>>' >>
> 'boost::date_time::date_duration<boost::date_time::
> duration_traits_adapted>'
>
> And I can't find an operator >> (istream&, date_duration&) in
> namespace boost::date_time, though I can find one in
> boost::gregorian. I suspect that this would rightly cause the error.
>
> I haven't looked at any of the other failures.
You can find the code in boost/date_time/gregorian/gregorian_io.hpp - line
100. It's likely, however, that it is macro'ed out because if
BOOST_NO_STD_LOCALE is defined this code will not be included.
BOOST_NO_STD_LOCALE is controlled by:
//boost/config/compiler/metrowerks.hpp
// locale support is disabled when linking with the dynamic runtime
# ifdef _MSL_NO_LOCALE
# define BOOST_NO_STD_LOCALE
# endif
So my suspicion is that the real issue here is the failure comment is
misleading, or the configuration is in error. Do we need to change the config
option to let the locale-based code compile?
Jeff
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/2005/06/87803.php | CC-MAIN-2019-13 | refinedweb | 332 | 60.11 |
kirupaForum
>
Art and Design
>
Drawing and Design
> import swift3d in Lightwave or Maya
PDA
View Full Version :
import swift3d in Lightwave or Maya
helgi
August 8th, 2002, 09:26 AM
Hello,
Is it possible to import a swift 3d object in Lightwave or Maya ?
Wolf
August 8th, 2002, 09:46 AM
My first question is...do you work with MAYA? What version? 4 or 5. Yes i'm pretty shure that you can do the import, because Maya can import t3d.
hojo
August 17th, 2002, 10:07 AM
maybe im being an idiot or something, but why would you want to import swift3d to maya or lightwave..?
Wolf
August 20th, 2002, 03:06 PM
Well i didnt wanted to import a maya object to swift3d, i was just replying to helgi's question. with 3dstudiomax you can import and export an object to swift3d, its an advantage because what you can do in swift3d its more limited that in 3dstudiomax...so try to make a "mesh" of an object in 3d studio and export to swift3d so you can export this object has a *.swf. now make this object in swift3d only...compare the quality of the object, and the size of the file almost the same. Test it.
hojo
August 20th, 2002, 03:24 PM
nah, I meant the original post.
but I can see if you had something really nice you made in maya or lightwave that you wanted to play with in swift3d.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved. | http://www.kirupa.com/forum/archive/index.php/t-1676.html | crawl-003 | refinedweb | 261 | 81.02 |
also tested your theory in my lab and I got the same results as you did. I have also checked the Microsoft forums and there is also a question similar to yours and it is same result as well.
DFS referral 2012
Rest assured this is the correct outcome with 2012 DC's with DFS referral's.
Will.
Note: I never thought to try it, but I checked my referral list on my Windows 8.1 workstation (against my existing 2008 domain), and I show Sysvol and Netlogon only list a single entry for one DC as well. I guess Netlogon/Sysvol are special and do not show multiple referrals like other actual DFS namespaces (which are actually showing multiple referrals).
At any rate, thanks for answering my question! | https://www.experts-exchange.com/questions/28600571/New-2012-DC-in-2008-forest-domain-Netlogon-Sysvol-DFS-referrals-show-only-2012-DC.html | CC-MAIN-2018-26 | refinedweb | 129 | 61.77 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.