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
On Thursday 26th, there was a joint meeting with the Mobile Web Best Practices group which gave us a chance to explore some of the issues surrounding mobileOK as it affects both groups. The chair presented a slide that he's been showing to various audiences that tries to show a vision of how DRs can fit into what happens on the Web now, particularly in terms of identifying sites that meet specified criteria. This generated discussion around the idea of blogging/linking to/supporting DRs as an aid to trust, particularly with respect to blog spam. We then looked at the use cases. The POWDER use cases are being prepared for publication soon. These are based on those developed for the WCL-XG but need some revision. Particularly use case 1 which is "the mobileOK use case". Actions were assigned to make sure it is re-written and shared with MWBP before publication. The same use case can be re-phrased as 'the accessibility use case', the 'child protection use case' and the 'trust use case' — really it's the matching resources to delivery context/end user use case. We looked at ways to codify that adherence to mobileOK Pro (the name for the upper level of mobileOK conformance) always implies adherence to mobileOK Basic. Essentially, one is a sub-class of the other. There was then what amounted to a preview of the discussion planned for the following day on resource grouping with some comment from BP. Test implementations of mobileOK will be important test implementations of POWDER, so there's a lot of overlap here. An important part of the discussion was why mobileOK needs to be encoded in POWDER? There are simpler ways of tagging resources. The reasoning is that POWDER supports: 1) Independent certification of the claim to be mobileOK; 2) Detail of the the result of each test (pass, fail or warn); 3) DRs can contain descriptions from any namespace and so can serve many purposes. None of these would be true of, say <meta name="mobileOK" content="Basic" /> There was a discussion about whether a link/rel tag that points from a resource to a DR should include, or be able to include, a hint of the description that would be found in that DR. In other words, something like <link rel="POWDER mobileOK"… Thus an agent seeking mobileOK information would know to follow the link. There are arguments for this, particularly in terms of efficiency of processing. However, the arguments against were felt to be stronger. These centre around the need to go back and change all the link/rel tags every time you add a new description to a DR. It was resolved therefore that we would NOT seek to propose this, however, POWDER will define some queries that can be run against a DR to determine whether a particular descriptive vocabulary is used (such as mobileOK). On a related theme, should we define a 'well-known location' for DRs? This was discussed, particularly in the light of the fact that POWDER is chartered to offer a solution to prevent this being necessary — not just for POWDER but for other protocols such as P3P and robots.txt. The resolution was that no, we will not specify a 'well known location' (or similar), but will rely on link/rel tags to point to DR files. A discussion on the groups' timelines lead to an agreement that Mobile Web Best Practices should seek publication of the first working draft of its mobileOK Description Resources document simultaneously with POWDER's forthcoming Description Resources document. It is hoped that this will occur around July 2007 (both groups have f2f meetings scheduled that month although these will not be co-located). Finally, MWBP asked that it be possible within a DR to refer to any checker used to make the claim of mobileOK conformance, whether or not that checker was available online or not. We began the day by looking at the work of the Rule Interchange Format WG. This prompted a solid discussion of the pros and cons of the approach we've taken so far in wanting to define resource groups in terms of data to be processed versus coding the definition directly in rules. Several Rule languages are available (such as N3 Rules, SWRL etc.) but none is (yet) recognised as a full standard/Recommendation. The result of the discussion was that POWDER will define a resource group in terms of data but, importantly, will give examples of how these can be transformed into rules programmatically. There was considerable discussion around our expected use of terms from the FOAF vocabulary. In particular, terms marked as "unstable" in that document. We are pleased to note that the ERT WG has had similar discussions as it affects EARL. We discussed the possibility of defining our own terms but agreed that a) it is, of course, much better to use existing vocabularies and b) that the FOAF vocabulary is actually pretty stable, even the terms that are marked as unstable. Therefore we resolved that we would seek to promote the stabilisation of relevant terms by the FOAF community. If these efforts prove unsuccessful by September, we will return to the subject and consider, reluctantly, creating our own terms. A short discussion was held regarding the use cases as these will be discussed at length on the next telecon. However, new use cases are being drafted. The bulk of the meeting was devoted to the resource grouping document and many resolutions were taken. In addition to giving as clear explanations as we are able, we will also define groups using set notation and talk in terms of 'sets of resources.' This should aid clarity of thinking and give the document more rigour. Further, we agreed that the grouping document shall be renamed to POWDER: Grouping of Resources and the short name we seek in the TR space is 'powder-resource-groups' (and you can bet that discussion wasn't over in 5 minutes!). Set definition by IRIs will, of course, be supported. We need to check the details of this as it affects canonicalisation. We then turned to the properties we plan to use for defining a set in terms of URIs and URI components. Having resolved that a property like hasScheme would take a string and imply a matching rule, we needed to discuss which matching rule would be appropriate ( startsWith, endsWith, exact or contains). Some terms were changed, some were added but we have a list that will be shown in the next version of the document. N.B. Non-Web URIs are covered by virtue of the hasURI property which allows a Regular Expression to be matched against the full URI. We then hit our first area where the group can't reach consensus: how the different properties should be combined. How do we encode a set definition as being resources on example.org OR example.net where the path starts with either foo or bar? 5 possible methods are under discussion. Option 1: Multiple instances of the same property are combined with logical OR, different properties are combined with logical AND. Thus we would encode the example as: > For: this 'looks right' to some. Against: It is rather vague and relies on several assumptions being made. Can't use OWL cardinality. Option 2: All properties of Set are combined with logical AND but we introduce a new property and class that allows properties to be combined with OR thus: <wdr:Set> <wdr:includes> <wdr:unionOf> <wdr:hasHost>example.org</wdr:hasHost> <wdr:hasHost>example.net</wdr:hasHost> </wdr:unionOf> </wdr:includes> <wdr:includes> <wdr:unionOf> <wdr:pathStartsWith>foo</wdr:pathStartsWith> <wdr:pathStartsWith>bar</wdr:pathStartsWith> </wdr:unionOf> </wdr:includes> </wdr:Set> For: Logical, Sem-Web friendly. Against: what a lot of processing! Option 3: Properties are combined with logical AND but they take a white space separated list, members of which are combined with OR. <wdr:Set> <wdr:hasHost>example.org example.net</wdr:hasHost> <wdr:pathStartsWith>foo bar</wdr:pathStartsWith> </wdr:Set> For: compact, logical, can use OWL cardinality. Against: Processing may be heavy. Option 4: Allow multiple Scope statements in a DR and combine those with OR. <wdr:WDR> <wdr:hasScope> <wdr:Set> <wdr:hasHost>example.org</wdr:hasHost> <wdr:pathStartsWith>bar</wdr:pathStartsWith> </wdr:Set> </wdr:hasScope> <wdr:hasScope> <wdr:Set> <wdr:hasHost>example.org</wdr:hasHost> <wdr:pathStartsWith>foo</wdr:pathStartsWith> </wdr:Set> </wdr:hasScope> <wdr:hasScope> <wdr:Set> <wdr:hasHost>example.net</wdr:hasHost> <wdr:pathStartsWith>foo</wdr:pathStartsWith> </wdr:Set> </wdr:hasScope> <wdr:hasScope> <wdr:Set> <wdr:hasHost>example.net</wdr:hasHost> <wdr:pathStartsWith>bar</wdr:pathStartsWith> </wdr:Set> </wdr:hasScope> ... </wdr:WDR> For: Logically consistent. Maintains tight control on individual set definition. Allows easy integration with sets defined by property. May aid processing efficiency. Against: Allows multiple scope statements so that the scope of a DR is not closed - others can publish additional scope statements. Thus security is dependent on recognising the source of the scope statements. Option 5: None of the above — just use the Regular Expression property hasURI. Options 1 - 4 all use properties that match a string against a component of a URI. The hasURI property matches a RegEx against the whole thing so we could write our example as <wdr:Set> <wdr:hasURI>^(([^:/?#]+):)?(//[^:/?#]+\.)*example\.(org|net)/(foo|bar)</wdr:hasURI> </wdr:Set> For: Most sets are expected to be simple. If you need to write a complex Set definition, you probably know Regular Expressions or know someone who does (and they'd probably be written by machine anyway). So we can decide that all properties in the Set should be combined with AND, use OWL cardinality etc. Against: Goes against some of the design goals in that it requires knowledge of Regular Expressions. Also, they are error prone which may lead to resources being included or excluded by mistake. Finally it can't work with sets defined by resource properties (see next topic). End result — we will include these options in the first public working draft and seek feedback. At the end of the meeting we discussed two further issues briefly. A possible method to define a set by resource property is: 1 <wdr:Set> 2 <wdr:hasProperty> 3 <wdr:Property> 4 <ex:colour>red</ex:colour> 5 </wdr:Property> 6 <wdr:hasProperty> 7 <wdr:propLookUp rdf: 8 <wdr:method>HEAD</wdr:method> 9 <wdr:resultContains>#ff0000</wdr:resultContains> 10 </wdr:Set> Lines 2 - 6 allow the DR creator to specify that the resources must be red to be in the Set. Line 7 provides a URI that can be queried. This can be to any service that returns a result, thus it doesn't specify that a particular protocol must be used. It must support including the URI of the candidate resource (i.e. the resource whose membership of the set we are testing). Line 8 says that an HTTP HEAD request is sufficient and line 9 says that if the response contains ' ff0000' then the candidate resource is indeed red. Very early days on this — lots to think about. One question that keeps coming up — do we actually need to support set definition by resource property? At present, any such section of the document should be considered as a 'feature at risk' in the W3C sense. Finally, the group recognised a need to discuss support within POWDER for user-generated tags, probably drawing on SKOS. —Phil Archer The
http://www.w3.org/blog/powder/2007/04/
CC-MAIN-2016-44
refinedweb
1,918
53.61
[0.7.10] date field are not (correctly) handled Versions: 0.7.10 (and 0.7.8) with Sencha Touch 2.1.1 Browser: Chrome 24 (Win8 / Desktop) Severity: critical (data corruption) Using 'syncstorage' proxy in store, it seems that date field value are not correctly sent to the remote server when synchronizing new records (date for updated records are not sync at all, but I will open a new ticket for this case). When re-importing remote data in "empty" local storage (e.g. after a first login on a new device), date values for imported records are invalids (empty objects {}). So I supposed that date data are definitively lost. Test case (I modified the 'examples/touch/todo' example for this test case) MyApp.model.Todo line 29 (changed the 'timestamp' field type to DATE) PHP Code: [...] { name: 'timestamp', type: 'date' } [...] PHP Code: [...] record.set("completed", (completed == 1)); record.set("timestamp", new Date()); [...] PHP Code: [...] itemTpl: [ '<div class="completed{completed}">{task}-{timestamp}</div>' ], [...] Code: DEBUG: Transport.send { "service":"SyncRpcService", "from":"device-**********", "msg":{ "method":"putUpdates", "args":[{ "dd":{"userId":"**********", "databaseName":"todos", "generation":"0", "version":2}, "rd":{"deviceId":"device-***********","replicaId":"b6"}, "csv":"b1-66754329-5.b3-67258192.b6-67444510-5", "updates":"[ [\"b6-67444510\",\"_oid\",\"b6-67444510\",\"b6-67444510\"], [\"task\",\"test2\",\"b6-67444510-1\"], [\"details\",\"test2\",\"b6-67444510-2\"], [\"completed\",false,\"b6-67444510-3\"], [\"timestamp\",{},\"b6-67444510-4\"], [\"id\",\"b6-67444510\",\"b6-67444510-5\"] ]" }], "corr-id":6 }, [...] } - Login again and wait for sync: the list item will show title-[object Object]. Based on the SIO debug log, imported value for timestamp is {}: Code: DEBUG: SyncProxy.applyUpdate: (b6-67444510 . _oid = 'b6-67444510' @ b6-67444510) accepted, creating new record INFO: SyncProxy.applyUpdateToRecord: (b6-67444510 . task = 'test2' @ b6-67444510-1) accepted INFO: SyncProxy.applyUpdateToRecord: (b6-67444510 . details = 'test2' @ b6-67444510-2) accepted INFO: SyncProxy.applyUpdateToRecord: (b6-67444510 . completed = 'false' @ b6-67444510-3) accepted INFO: SyncProxy.applyUpdateToRecord: (b6-67444510 . timestamp = '{}' @ b6-67444510-4) accepted INFO: SyncProxy.applyUpdateToRecord: (b6-67444510 . id = 'b6-67444510' @ b6-67444510-5) accepted Thank you for the detailed test case to re-produce. We are investigating and will get back to you as soon as we know more. Hello, As a general practice we have avoided using the date field type. Instead storing the date as either a number: Code: date.getTime() We would recommend that you modify your code and not use the date field type with sync stores while we work on a better support for that field type. In the examples we provide (todo and shared data sync) we use date.getTime() so that the values can be sorted relative to one another. If your timestamp is for display purposes only then you can either convert the number into a date object then format it or you can simply store the date as a pre-formatted string. Hi Jason, Thanks for your advises (can't find where in documentation you warn about not using date field?). I finished my app (JDI for the HTML5 contest) so I don't look for an alternative solution, I just want to share my experience with Sencha IO and help you to enhance it. I started my project without SIO and use a local store. All my code was based on date manipulation and display (and it worked fine). When switching to SIO, I tried to use integer or string to deal with SIO limitations, but (after many hours of debug) I had to heavily hack my model and fix some of your code to get this to work. I needed support for null date, not sure that integer field can support null with SIO and did not want to have this special case: if (field == 0) means null. Using string seems OK, but there was the sorting issue (my field should be sorted as date). To workaround this, I defined my own Ext.data.Types (based on the string one): PHP Code: Ext.data.Types.DATETIME = { convert: function(value) { return (value === undefined || value === null) ? (this.getAllowNull() ? null : '') : String(value); }, sortType: Ext.data.SortTypes.asDate, type: 'datetime' }; So yes, I know that date are not totally supported in SIO and that it's preferable to not use it. But I think that you should fix this and transparently support date (and null date). Now, I still have two other date related bugs to report, are you interested in it? Hello, Again thank you for your detailed feedback. We are working on a more robust fix for the date issue. We don't cover the date issue in the documentation. I'll add it in the next release; assuming we don't fix the issue and provide full support for dates in sync stores.
https://www.sencha.com/forum/showthread.php?256842-0.7.10-date-field-are-not-(correctly)-handled&p=940090&viewfull=1
CC-MAIN-2015-40
refinedweb
778
66.23
Firstly, you'll need the Gosu Lib. found HERE! after you have that done. Create a folder for the project. then extract the Gosu folder (somewhere thats not in the project folder) then go into the Lib folder of gosu. copy "gosu.for_1_8.so", "gosu.rb" and "fmod.dll" into your project folder. now. open up Notepad(or a texteditor of your choice) and put this code in: require 'gosu' class GameWindow < Gosu::Window def initialize super(640, 480, false) self.caption = "Gosu Window" end def update end def draw end end window = Gamewindow.new window.show now save it as main.rb and run. now i shall explain what all this does. require 'gosu' this allows the ruby file to use Gosu's built in classes. class GameWindow < Gosu::Window creates a new class defined by the Gosu::Window class, allowing you to create a window. def initialize super(640, 480, false) self.caption = "Gosu Window" end when the GameWindow is created, it sets up a new window of 640 width and 480 hight, with a caption of Gosu window. window = Gamewindow.new window.show creates a new instance of the GameWindow class, then displays it on the screen. if there are any problems feel free to ask. the next part of this tut will show you how to create a sprite on the screen and move it using the arrow keys .. keep a look out
http://www.dreamincode.net/forums/topic/130006-create-a-game-in-ruby-pt-1/
CC-MAIN-2018-17
refinedweb
237
76.72
From: Dave Abrahams (abrahams_at_[hidden]) Date: 2000-01-29 16:01:33 on 1/29/00 3:10 PM, Valentin Bonnard at Bonnard.V_at_[hidden] wrote: >> In each case there are workarounds, however the point here is that the >> presence of an overload in namespace std may prevent overwise perfectly >> legal C++ code from compiling - and that code could be in your standard >> library - in other words simply including a user-defined header that >> defines overloads in std can disable standard library code. > > That's correct. It would basically imply that lib code > cannot use standard lib templates or function, only > non-standard ones. And that's _not_ what we wanted. YADR. > YADR? Please decode. Personally, I don't think I'd mind putting that restriction on library implementors. The fact that most names are available to users for use as preprocessor macros is a much more serious restriction on implementors. -Dave Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk
https://lists.boost.org/Archives/boost/2000/01/1974.php
CC-MAIN-2020-05
refinedweb
174
64.51
How )); } } Posted on February 4, 2013, in Dependency Injection, php, Symfony2, Technology and tagged DIC, guzzle, php, software, Symfony, technology, Twitter. Bookmark the permalink. 8 Comments. Gonzalo, although the “flat php” version works fine, the Symfony version doesn’t work for me( Symfony 2.2). It seems like passing the api version in baseurl on container is worth. The error: Client error response [status code] 404 [reason phrase] Not Found [url] The parameters after “/” dissapear. I tried pass the version api on container also and doesn’t work. Ok, after read the documentation I found the mistake. A “/” at the begining of statuses $twitterClient->get(‘/statuses/user_timeline.json’) Cool!. This sunday was marked in my personal ToDoList to check the issue and it’s solved before start!. I thought the problem was related to the changes that Twitter has been doing this days in its api (it was a nighmare in another proyect) I am traying to create a real time Symfony app using Ratchet library and I have already integrate ratchet in my symfony app but I have no idea how to start working with it I can’t find any tutorial or a small example about it. plz I nead you re help and that will be great if I can have just a small example to know how shoud I work with it Symfony2 show me two errors. InvalidArgumentException: There is no extension able to load the configuration for “twitter.config”. Looked for namespace “twitter.config”, found none FileLoaderLoadException: Cannot import resource from “services.yml”. (There is no extension able to load the configuration for “twitter.config”. Looked for namespace “twitter.config”, found none) That’s look like your yml file isn’t correct. You’re writing twitter.config at the same level of indentation than “parameters” (you missed the spaces before). “twitter.config” is a child of parameters. Symfony thinks that you’re trying to use a custom extension called “twitter.config” and it throws an error because it cannot find the extension. Pingback: 30+ Links to PHP Training Materials, News about Zend Optimizer+, MySQL 5.6 Release and More | Zfort Group Blog Pingback: 30+ Links to PHP Training Materials, News about Zend Optimizer+, MySQL 5.6 Release and More | Zfort Group Blog
https://gonzalo123.com/2013/02/04/how-to-configure-symfonys-service-container-to-use-twitter-api/
CC-MAIN-2016-30
refinedweb
377
57.06
C# Tips and Tricks Local Type Inference Local type inference was also the subject of another prior article, but again is worth mentioning here as it is very handy to have a solid understanding. You define variables with the var keyword and the compiler will figure out the type for you at compile time and replace it. It is great for results from query expressions as show in the example below. It may appear that it is untyped or even give the impression it is a variant. It is not. It is a strongly typed object whose type is set at compile time. var i = 5;int i = 5;string[] words = { "cherry", "apple", "blueberry" };var sortedWords = from w in words orderby w select w; Object and Collection Initializers Initializers introduce a concise syntax that combines object creation and initialization in a single step. It even allows for parentheses to be optional for paramaterless constructors as you'll see in the first line of the example below. Point p = new Point { X=3, Y=99 };Student myStudent = new Student() { Name = "John Doe", Class = "Senior", School = "Carmel" }; Initializers work very well with constructors. The example below shows an instance where a parameterized constructor is called along with remaining properties initialized. The constructor should commonly take all of the parameters so it isn't an ideal setup, but it illustrates the point well. class Customer{ public Customer(string customerKey) { ... } public string CustomerKey { get { ... } } public string ContactName { get; set; } public string City { get; set; }}var c = new Customer("MARKS"){ ContactName = "Mark Strawmyer", City = "Indianapolis"} Extension Methods Extension methods allow you to create new functionality on existing types. Even if the types are sealed. They are declared like static methods and called like instance methods. They are valid for use on interfaces or constructed types. The trailing sample code illustrates the use of extension methods to add a Triple and Half method on the decimal type. static class ExtensionSample{ public static decimal Triple( this decimal d ) { return d*3; } public static decimal Half( this decimal d ) { return d / 2; }}decimal y = 14M;y = y.Triple().Half(); Extension methods can be a very powerful tool. They can also be a very annoying tool if not used with some care. You should consider a separate namespace to allow them to be optional to the other developers that may be working within your codebase. Resist the temptation to put them on all objects by extending the object class. For consistency you should also make them behave like other instance methods. The following code sample illustrates very bad form that should not be practiced. The namespace is System, which means the scope of this extension is any code that comes in contact with it. It extends ALL objects. It also does not behave like a normal instance method. Normally calling an instance method on a null object would result in a NullReferenceException and not a Boolean true or false value. This is a code example of what is not advisable. namespace System{ public static class MyExtensions { public static bool IsNull(this object o) { return o == null; } }}while (!myObject.IsNull()) { ... } LINQ Performance Tip I'm not going to cover much on LINQ here as those are articles in and of themselves. Here is a LINQ performance tip that I experienced first hand on a project. Consider carefully the use of Table.ToList().Find(). Table.Where() is commonly a better option. ToList().Find() returns all records from a table and then runs the filter in memory. Table.Where() is performed in SQL and returns only the rows requested. An additional tip is there is a handy tool known as LINQPad that allows you to perform interactive queries of databases using LINQ. It is a code snippet IDE that will execute any C# expression or statement block, which is very handy for testing out LINQ. Page 2 of 3
http://www.developer.com/net/csharp/article.php/10918_3801306_2/C-Tips-and-Tricks.htm
CC-MAIN-2014-42
refinedweb
647
64
immy Retzlaff wrote: > [snip..] > . > > > A couple of functions I use in my apps : import imp, os, sys def main_is_frozen(): return (hasattr(sys, "frozen") or # new py2exe hasattr(sys, "importers") # old py2exe or imp.is_frozen("__main__")) # tools/freeze def get_main_dir(): if main_is_frozen(): return os.path.abspath(os.path.dirname(sys.executable)) return os.path.abspath(os.path.dirname(sys.argv[0])) get_main_dir() will return the directory the script is in - whether a frozen app or not (and however it is frozen). Regards, Fuzzy >Jimmy > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. > >_______________________________________________ >Py2exe-users mailing list >Py2exe-users@... > > > > > > My suggestion: Create a small patcher that merges the diffs, like it has been suggested before; But instead of doing this on individual files and shooting them into the zip, just diff the full zip file. Error Handling: When the 'installer' is patching, have it first move files to .old, then apply the patches into the original filename, followed by deleting the .old file. If the .old files exist on next app startup, you can reverse the patching and start over. I'd recommend making the main app (that is, the exe + the main py script) the patcher itself; Have it check for updates on startup, download & patch if an update is available, and then launch your actual script. A different solution is having the main app be a version checker and downloader, that does all of the above except the actual patching, which is managed by a patcher script downloaded with each version - that would allow flexibility in your patching system. - Thomas Jimmy Retzlaff wrote: > >]). Get your facts straight Jimmy! The problem you mention above is in your own application code, not Thomas' py2exe code. Jimmy p.s. - my code may not be the only thing I need help with :) Jimmy Retzlaff wrote: >=20 > Jimmy Retzlaff wrote: > > > > All this raises another question. Can I skip the zip file(s) altogether? > > Is there a way to tell py2exe to use the exe's folder (or some > > subfolder) as sys.path rather than the archive? If I can get things > > bootstrapped then I could skip zip files altogether. I'm guessing I'd > > have to modify/rebuild the C stub to do this. >=20 > I'm talking to myself here, hopefully someone else will benefit from my > ramblings. :) It appears that the only thing that needs to appear in > the zip file is __future__.pyo (or pyc is not optimizing), and the zip > can be a 0 byte file if nothing is imported from __future__ in the main > Python file. Since sys is built-in, it can be imported in the main file > and something like this can be done: >=20 > import sys > if hasattr(sys, 'frozen'): > sys.path.insert(0, sys.prefix + r'\library') >=20 > Then all modules & packages can appear in a "library" folder that sits > next to the exe. >=20 Uggh, it looks like I accidentally sent the last part of my conversation with myself to the ctypes list instead of the py2exe list... Anyway, I finally have something I'm pretty happy with. There is nothing extra in any of my python files except setup.py and a distribution is produced which includes all the pyo files and no zip files. Here is setup.py: import os from distutils.core import setup import py2exe.build_exe class py2exeSansZip(py2exe.build_exe.py2exe): def make_lib_archive(self, zip_filename, base_dir, verbose=3D0, dry_run=3D0): # Don't really produce an archive, just copy the files. from distutils.dir_util import copy_tree copy_tree(base_dir, os.path.dirname(zip_filename), verbose=3Dverbose, dry_run=3Ddry_run) return '.' setup(windows=3D['test.py'], cmdclass=3D{'py2exe' : py2exeSansZip}). Jimmy
https://sourceforge.net/p/py2exe/mailman/py2exe-users/?viewmonth=200502&viewday=23&style=flat
CC-MAIN-2018-13
refinedweb
631
74.39
Code Snippets This page contains a small collection of (mainly) bash commands that I discovered during the Ph.D. Bash is evil but during the Ph.D. was often useful to get stuff done quickly (and it is still useful today). [bash] print a beer icon in a script echo $'\360\237\215\272' or echo $'\360\237\215\270' echo $'\360\237\215\271' echo $'\360\237\215\273' echo $'\360\237\215\274' From [bash] copy the output of a command to the clipboard (on macosx) echo "pippo" | pbcopy Now cmd+v will paste pippo. [bash] zcat does not work on MACOS (.Z bug) sudo mv /usr/bin/zcat /usr/bin/broken-zcat sudo ln -s /usr/bin/gzcat /usr/bin/zcat [bash] awk insert blank line every n lines awk '{ if ((NR % 5) == 0) printf("\n"); print; }' For n == 5, of course. Substitute whatever your idea of n is. [bash] convert windows source file to unix dos2unix *.py [bash] remove first column from a file cut -f2- filename [bash] replace delete with backspace in screen You can define an alias in your ~/.bashrc file like: alias screen='TERM=screen screen' [bash] sort using tab as separator sort -t$'\t' -k 2 file [java] change java heap size java -Xmx<size> set maximum Java heap size e.g., java -Xmx4196m Pippo [bash] resolve redirected url URL=... REDIRECT_URL=$(curl -w %{redirect_url} URL) [bash] get a txt file edited from pirate pad curl [bash] dump a website wget -r -H -l1 -k -P $targetdir --exclude-domains ${comma-seperated domain name} --user=xxx --password=xxx $url [bash] get a webpage with autentication url= "" outpage = "" user="" pass="" curl -u $user:$pass $url > $outpage [linux] 10 nice hints [bash] how to get the sum of all the lines in the file awk '{a+=$0}END{print a}' abc [python] remove the garbage collector in python When you are working with a big data structure in python the garbage collector can slow down the execution, sometime can make sense to disable it. import gc gc.disable() [bash] how to query solr from the shell … Or just use python and the package pysolr. [bash] sum rows with the some field dictionary in awk: $ cat nayan.out saman 1 gihan 2 saman 4 ravi 1 ravi 2 $ awk '{arr[$1]+=$2} END {for (i in arr) {print i,arr[i]}}' nayan.out > nayan.out.tmp $ cat nayan.out.tmp ravi 3 saman 5 gihan 2 [maven] resources in a jar [bash] get all pdf in a page wget -m --accept=pdf -nd $url [bash] iterate over the lines of a jar while read line do echo $line done < file_to_read [bash] remove blank lines in a file grep -v '^[[:space:]]*$' file [bash] change tmp folder where sort put temporary files sort -T dir ... [bash] print number of a specific char for each line of a file awk -F'#' '{ print NF-1}' It will print how many chars ‘#’ per line [bash] replace a substring i=pippo.txt echo ${i/txt/tex} It will print pippo.tex [bash] sort on more than one field sort -k 1,1 -k 3,3nr file.tsv > tmp It sorts on the first field and if two elements are equal on the first, on the third field in reverse integer order [bash] remove all files of size 0 find . -type f -size 0k -exec rm {} \; | awk '{ print $8 }' [bash] remove all chars in a particular position from a file cut -c42- file It removes the first 42 characters from all the lines of a file. [bash] view what is appended on file tail -f file -n [bash] get words distribution from a file cat file | tr '[A-Z]' '[a-z]' | tr -sc '[a-z]' '\n' | grep -v '^[^a-z]*$' | grep -v '^[\]' | sort | grep -vxf topwords-ita.txt | uniq -c | sort -nrk1 [bash] tr complement tr -sc '[a-zA-Z]' '\n' < file It replaces all chars that are not alphabetic in new lines [bash] remove first or last lines sed '1d' filename To remove the first line sed '$d' filename To remove the last line [bash] Generate all the couples of terms tr -sc '[a-zA-Z0-9\n]' '\t' < inputFile | awk '{for (i = 1; i < NF; i++) print $i"\t"$(i+1); }' [bash] Find a process listening on a particular port sudo netstat -lpn | grep :8080 [bash] Check for proper number of command line args EXPECTED_ARGS=1 E_BADARGS=65 if [ $# -ne $EXPECTED_ARGS ] then echo "Usage: `basename $0` {arg}" exit $E_BADARGS fi [bash] Sort in numeric order with scientific notation allowed sort -g [bash] create ssh pub key <ssh-keygen -t rsa -C "your_email@example.com" # Creates a new ssh key, using the provided email as a label # Generating public/private rsa key pair. # Enter file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter] Now you need to enter a passphrase. Enter passphrase (empty for no passphrase): [Type a passphrase] # Enter same passphrase again: [Type passphrase again] Copy id_rsa.pub in .ssh/authorized_key to login on a remote machine without password. [bash] gzip a folder tar -czf folder_name.tar.gz folder_name/ [git] change the commit message git commit --amend -m "New commit message" [git] undo latest commit (e.g., if you commit -a -m instead of commit -m) git reset --soft HEAD^
https://diegoceccarelli.github.io/snippets/
CC-MAIN-2021-21
refinedweb
882
72.6
I am developing a C Sharp Word AddIn that acts the same as the File>Open option. The exception is that when I click on the AddIn, I want it to ask the user which file they want to open... I have .NET Framework 4, Visual Studio 2010 and Word 2010. Here is the code so far... using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; using Word = Microsoft.Office.Interop.Word; using Office = Microsoft.Office.Core; using Microsoft.Office.Tools.Word; using System.IO; namespace WordAddIn2 { public partial class ThisAddIn { private void ThisAddIn_Startup(object sender, System.EventArgs e) { System.Console.Write("Enter the file name: "); String fileName = System.Console.ReadLine(); Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application(); Word._Document oDoc; oDoc = oWord.Documents.Open(@"H:\SNH\" + fileName); } } } When I add the AddIn to Word and try to run it, it produces an error saying "This file could not be found." However, it was supposed to ask the user which file to open and never did. You are going to have to create a Windows.Form (or use WPF) and present it to the user. Currently you are using the console and that won't work. My Code Guru Articles mu moi, mu moi ra, mu moi open, mu moi open hom nay, mu sap open mu moi, mu moi ra, murongbay.net,mu moi open, mu moi open hom nay, mu sap open Forum Rules
http://forums.codeguru.com/showthread.php?535665-How-to-open-to-develop-a-C-Sharp-Word-Add-In-that-acts-the-same-as-File-gt-Open&p=2111273
CC-MAIN-2016-26
refinedweb
248
62.64
Here we will see how to get the sum of elements from index i to index j in an array. This is basically the range query. The task is easy by just running one loop from index i to j, and calculate the sum. But we have to care about that this kind of range query will be executed multiple times. So if we use the mentioned method, it will take much time. To solve this problem using more efficient way we can get the cumulative sum at first, then the range sum can be found in constant time. Let us see the algorithm to get the idea. begin c_arr := cumulative sum of arr if i = 0, then return c_arr[j]; return c_arr[j] – c_arr[i-1] end #include<iostream> using namespace std; void cumulativeSum(int c_arr[], int arr[], int n){ c_arr[0] = arr[0]; for(int i = 1; i<n; i++){ c_arr[i] = arr[i] + c_arr[i-1]; } } int rangeSum(int c_arr[], int i, int j){ if( i == 0){ return c_arr[j]; } return c_arr[j] - c_arr[i-1]; } main() { int data[] = {5, 4, 32, 8, 74, 14, 23, 65}; int n = sizeof(data)/sizeof(data[0]); int c_arr[n]; cumulativeSum(c_arr, data, n); //get cumulative sum cout << "Range sum from index (2 to 5): " << rangeSum(c_arr, 2, 5) << endl; cout << "Range sum from index (0 to 3): " << rangeSum(c_arr, 0, 3) << endl; cout << "Range sum from index (4 to 7): " << rangeSum(c_arr, 4, 7) << endl; } Range sum from index (2 to 5): 128 Range sum from index (0 to 3): 49 Range sum from index (4 to 7): 176
https://www.tutorialspoint.com/cplusplus-program-for-range-sum-queries-without-updates
CC-MAIN-2020-29
refinedweb
270
66.1
ETD Guide/Technical Issues/SGML\XML and Other Markup Languages SGML (Standard Generalized Markup Language) and XML (eXtensible Markup Language) are markup languages, which use tags ("<" and ">") with names of labels inside around the sections of the documents that are thus marked or bracketed. Document Type Definition (DTD) specifies the grammar or structure for a type or a class of documents. SGML requires a DTD while XML employs DTD optionally. But given current trends it seems that XML is most likely to be used due to the following reasons. - XML is a method for putting structured data in a text file for "structured data" think of such things as spreadsheets, address books, configuration parameters, financial transactions, technical drawings, etc. Programs that produce such data often also store it on disk, for which they can use either a binary format or a text format. The latter allows you, if necessary, to look at the data without the program that produced it. isn't HTML Like HTML, XML makes use of tags and attributes (of the form name="value"), but. In short it allows you to develop your own mark up language specific to a particular domain. - XML documents can be preserved for a long time. XML is, at a basic level an incredibly simple data format. It can write in 100 percent pure ASCII text as well as in a few other well-defined formats. ASCII text is reasonably resistant to corruption. Also XML is very well documented. The W3C’s XML 1.0 specification tells us exactly how to read XML data. - XML is license-free, platform-independent and well-supported. By choosing XML as the basis for some project, you buy into a large and growing community of tools (one of which may already do what you need!) and engineers experienced in the technology. Opting for XML is a bit like choosing SQL for databases: you still have to build your own database and your own programs/procedures that manipulate it, but there are many tools available and many people that can help you. And since XML, as a W3C technology, is license-free, you can build your own software around it without paying anybody anything. The large and growing support means that you are also not tied to a single vendor. XML isn't always the best solution, but it is always worth considering. - which describes a standard way to add hyperlinks to an XML file. XPointer & XFragments. XML Schemas help developers to precisely define their own XML-based formats. There are several more modules and tools available or under development. - XML provides Structured and Integrated Data XML is ideal for large and complex data like ETD’s because data is structured. It not only lets you specify a vocabulary that defines the elements in the document; but it also allows you to specify relations between the elements. - XML can encode metadata about DTD’s. Documents are often supplemented with metadata (that is data about data). If such metadata were included inside an ETD then it would make ETD self-describing. XML can encode such metadata. However on the downside XML comes with its own bag of discomforts. - Conversion from word processing forms to XML requires more planning is advance, different tools and broader learning about processing concepts than it is required for PDF. - There are many fewer people knowledgeable about these matters and tools that support this conversion are less mature and expensive. Also process of converting may be complicated, difficult and time consuming. - Writing directly in XML by using XML authoring tools requires some prior knowledge of XML. - Also XML is very strict regarding the naming and ordering of tags. It is also case sensitive illustrating the relative effort required by students to prepare ETD’s in this form. Process of Creating an XML document XML documents have four-stage life cycle. XML documents are mostly created using an editor. It may be a basic text editor like notepad. or .vi. editor. We may even use WYSIWYG editors. The XML parser reads the document and converts it into a tree of elements. The parser passes the tree to the browser that displays it. It is important to know that all this processes are independent and decoupled from each other. Putting XML to work for ETD’s Before we jump into the XML details for ETD.s we should make certain things clear, since we would be using them on a regular basis now onwards. DTD (Document Type Definition): An XML document primarily consists of a strictly nested hierarchy of elements with a single root. Elements can contain character data, child elements, or a mixture of both. The structure of the XML document is described in the DTD. There are different kinds of documents like letter, poem, book, thesis, etc. Each of the documents has its own structure. This specific structure is defined in a separate document called Document Type Definition (DTD). DTD used is based on XML and it covers most of the basic HTML formatting tags and also some specific tags from the Dublin core metadata. A DTD has been developed for ETD. The developed DTD is too generic. If someone wants to use mathematical equation or incorporate some chemical equation, it won't be sufficient. For that we can incorporate MathML (Mathematical Markup Language) and/or CML (Chemical Markup Language). There are defined DTDs for these languages that we also have to use for our documents. But research of incorporating more that one DTD for different parts of the documents is still going on. CSS (Cascaded Style Sheets): CSS is a flexible, cross-platform, standards-based language used to suggest stylistic or presentational features applied throughout entire websites or web pages. In their most elegant forms, CSS are specified in a separate file and called from within the XML or HTML header area when documents loads into the CSS-enabled browser. Users can always turn off the author's styles and apply their own or mix their important styles with the authors. This points to the "cascading" aspect of CSS. CSS is based on rules and style sheets. A rule is a statement about one stylistic aspect of one or more elements. A style sheet is one or more rules that apply to a markup document. An example of a simple style sheet is a sheet that consists of one rule. In the following example, we add a color to all first-level headings (H1). Here's the line of code - the rule - that we add: H1 {color: red} XSL (the eXtensible Stylesheet Language): XSL is a language for expressing stylesheets. It consists of two parts: - A language for transforming XML documents, and - An XML vocabulary for specifying formatting semantics. If you don't understand the meaning of this, think of XSL as a language that can transform XML into HTML, a language that can filter and sort XML data, a language that can address parts of an XML document, a language that can format XML data based on the data value, like displaying negative numbers in red, and a language that can output XML data to different devices, like screen, paper or voice. XSL is developed by the W3C XSL Working Group whose charter is to develop the next version of XSL. Because XML does not use predefined tags (we can use any tags we want), the meanings of these tags are not understood: could mean an HTML table or maybe a piece of furniture. Because of the nature of XML, the browser does not know how to display an XML document. In order to display XML documents, it is necessary to have a mechanism to describe how the document should be displayed. One of these mechanisms is CSS as discussed above, but XSL is the preferred style sheet language of XML, and XSL is far more sophisticated and powerful than the CSS used by HTML. XML NamespacesThe purpose of XML namespaces is function of XML namespaces. - XML namespaces are declared with an xmlns attribute, which can associate a prefix with the namespace. The declaration is in scope for the element containing the attribute and all its descendants. For example code below declares two XML namespaces. Their scope is the A and B elements: <A xmlns:abcd</A> - If an XML namespace declaration contains a prefix, you refer to element type and attribute names in that namespace with the prefix. For example code below declare A and B, code below is same as previous example but uses a default namespace instead of foo prefix: <A xmlns=""><B>abcd</B></A> Glossary attribute XML structural construct. A name-value pair within a tagged element that modifies certain features of the element. For XML, all values must be enclosed in quotation marks. cascading style sheets (CSS) Formatting descriptions that provide augmented control over presentation and layout of HTML and XML elements. CSS can be used for describing the formatting behavior of simply structured XML documents, but does not provide a display structure that deviates from the structure of the source data. CDATA section XML structural construct. CDATA sections can be used to mark tags or reserved characters with quotation marks and thus prevent them from being interpreted. For this reason, the CDATA section is especially useful for escaping markup and script. The syntax for CDATA sections in XML is <![CDATA[ ... ]]>. character data XML structural construct. The text content of an element or attribute. XML differentiates this plain text from markup. character set A mapping of a set of characters to their numeric values. For example, Unicode is a 16- bit character set capable of encoding all known characters; it is used as a worldwide character-encoding standard. component An object that encapsulates both data and code, and provides a well-specified set of publicly available services. data type The type of content that an element contains: a number, a date, and so on. In XML, an author can specify an element's data type, for example, with a tokenized attribute type. Microsoft is working with the W3C to define a set of standard types that anyone can freely use. document element The top-level element of an XML document; only one top-level element is allowed. The document element is a child of the document root. Document Object Model (DOM) The standard maintained by the W3C that specifies how the content, structure, and appearance of Web documents can be updated programmatically with scripts or other programs. The proposed object model for XML matches the Document Object Model for HTML so that script writers can easily learn XML programming. The XML DOM will provide a simple means of reading and writing data to and from an XML tree structure. document root The top-level node of an XML document; its descendants branch out from it to form the XML tree for that document. The document root contains the document element and can also contain a set of processing instructions and comments. document type declaration XML structural construct. A production within an XML document that contains or points to markup declarations that provide a grammar for a class of documents. This grammar is known as a Document Type Definition. The document type declaration can point to an external subset (a special kind of external entity) containing markup declarations, or can contain the markup declarations directly in an internal subset, or both. The DTD for a document consists of both subsets taken together. The syntax of the document type declaration is <!DOCTYPE content >. Document Type Definition (DTD) The markup declarations that describe a grammar for a class of documents. The DTD is declared within the document type declaration production of the XML file. The markup declarations can be in an external subset (a special kind of external entity), in an internal subset directly within the XML file, or both. The DTD for a document consists of both subsets taken together. Electronic Data Interchange (EDI) An existing format used to exchange data and support transactions. EDI transactions can be conducted only between sites that have been specifically set up with compatible systems. element XML structural construct. An XML element consists of a start tag, and end tag, and the information between the tags, which is often referred to as the contents. Elements used in an XML file are described by a DTD or schema, either of which can provide a description of the structure of the data. entity XML structural construct. A character sequence or well-formed XML hierarchy associated with a name. The entity can be referred to by an entity reference to insert the entity's contents into the tree at that point. The function of an XML entity is similar to that of a macro definition. Entity declarations occur in the DTD. entity reference XML structural construct. Refers to the content of a named entity. The name is delimited by the ampersand and semicolon characters; for example, &bookname; and <. It is used in much the same way as a macro. Extensible Linking Language (XLL) An XML vocabulary that provides links in XML similar to those in HTML but with more functionality. Linking could be multidirectional, and links could exist at the object level rather than just at a page level. Extensible Markup Language (XML) A subset of SGML that provides a uniform method for describing and exchanging structured data in an open, text-based format, and delivers this data by use of the standard HTTP protocol. At the time of this writing, XML 1.0 is a World Wide Web Consortium Recommendation, which means that it is in the final stage of the approval process. Extensible Stylesheet Language (XSL) A language used to transform XML-based data into HTML or other presentation formats, for display in a Web browser. Differs from cascading style sheets in that it can present information in an order different from that in which it was received. XSL will also be able to generate CSS along with HTML. XSL consists of two parts, a vocabulary for transformation and the XSL Formatting Objects. ID A special attribute type within the XML language. The ID attribute on the XML element provides a unique name, enabling links to that element using the IDREF attribute type. The value associated with the ID attribute must be unique within that XML document. IDs are currently declared with a DTD or schema. markup XML structural construct. Text in an XML document that does not represent character data: start tags, end tags, empty-element tags, entity references, character references, comments, CDATA section delimiters, DTDs, and processing instructions. mixed content XML structural construct. An element type has mixed content when elements of that type can contain character data, optionally interspersed with child elements. In this case, the types of the child elements can be constrained, but not their order or their number of occurrences. namespace A mechanism to resolve naming conflicts between elements in an XML document when each comes from a different vocabulary; it allows the commingling of like tag names from different namespaces.. NDATA The literal string "NDATA" is used as part of a notation declaration. See also notation. notation Usually refers to a data format, such as BMP. A notation identifies by name the format of unparsed entities, the format of elements that bear a notation attribute, or the application to which a processing instruction is addressed. notation declaration A notation declaration provides a name and an external identifier for a notation. The name is used in entity and attribute-list declarations and in attribute specifications. The external identifier is used for the notation, which can allow an XML processor or its client application to locate a helper application capable of processing data in the given notation. processing instruction (PI) XML structural construct. Instructions that are passed through to the application. The target is specified as part of the PI. The syntax for a PI is <?pi-name content?>. Resource Definition Framework (RDF) An object model similar in function to an application programming interface (API), RDF can be used by developers to access the logical meaning of designated content in XML documents. root element Sometimes this term is used to refer to the document element but this is misleading, since the top-level element and the document root are not the same. Because of this ambiguity, use of the term "root element" is discouraged. schema A formal specification of element names that indicates which elements are allowed in an XML document, and in which combinations. A schema is functionally equivalent to a DTD, but is written in XML; a schema also provides for extended functionality such as data typing, inheritance, and presentation rules. Standard Generalized Markup Language (SGML) The international standard for defining descriptions of structure and content of electronic documents. XML is a subset of SGML designed to deliver SGML-type information over the Web. target The application to which a processing instruction is directed. The target names beginning with "XML" and "xml" are reserved. The target appears as the first token in the PI. For example, in the XML declaration <?xml version="1.0"?>, the target is "xml". text markup Inserting tags into the middle of an element's text flow, to mark certain parts of the element with additional meta-information. tokenized attribute type Each attribute has an attribute type. Seven attribute types are characterized as tokenized: ID, IDREF, IDREFS, ENTITY, ENTITIES, NMTOKEN, and NMTOKENS. Uniform Resource Identifier (URI) The generic set of all names and addresses that refer to resources, including URLs and URNs. Defined in Berners-Lee, T., R. Fielding, and L. Masinter, Uniform Resource Identifiers (URI): Generic Syntax and Semantics. 1997. See updates to the W3C document RFC1738. The Layman-Bray proposal for namespaces makes every element name subordinate to a URI, which would ensure that element names are always unambiguous. Uniform Resource Locator (URL) The set of URI schemes that have explicit instructions on how to access the resource on the Internet. Uniform Resource Name (URN) A Uniform Resource Name identifies a persistent Internet resource. valid XML XML that conforms to the vocabulary specified in a DTD or schema. W3C World Wide Web Consortium well-formed XML XML that meets the requirements listed in the W3C Recommendation for XML 1.0: It contains one or more elements; it has a single document element, with any other elements properly nested under it; each of the parsed entities referenced directly or indirectly within the document is well-formed. A well-formed XML document does not necessarily include a DTD. World Wide Web Consortium (W3C) The international consortium founded in 1994 to develop standards for the Web. See XLL Extensible Linking Language XML Extensible Markup Language XML declaration The first line of an XML file can optionally contain the "xml" processing instruction, which is known as the XML declaration. The XML declaration can contain pseudoattributes to indicate the XML language version, the character set, and whether the document can be used as a standalone entity. XML document A data object that is well-formed, according to the XML recommendation, and that might (or might not) be valid. The XML document has a logical structure (composed of declarations, elements, comments, character references, and processing instructions) and a physical structure (composed of entities, starting with the root, or document entity). XML parser A generalized XML parser reads XML files and generates a hierarchically structured tree, then hands off data to viewers and other applications for processing. A validating XML parser also checks the XML syntax and reports errors. Next Section: Multimedia
http://en.wikibooks.org/wiki/ETD_Guide/Technical_Issues/SGML%5CXML_and_Other_Markup_Languages
CC-MAIN-2014-10
refinedweb
3,265
55.03
With the polymorphism Java can Suppose that you're developing an application. You start by creating a class named Player that represents one of the players. This class has a public method named move() that returns an int to indicate which square of the board the player wants to mark: class Player { public int move() { for (int i = 0; i < 9; i++) { System.out.println("\nFrom Basic:");. Now you need to create a subclass of the Player class that uses a more intelligent method to choose its next move: class BetterPlayer extends Player { public int move() { System.out.println("\nFrom Better:"); return findBestMove(); } private int findBestMove() { int square = 0; // code to find the best move goes here return square; } } As you can see, this version of the Player class overrides the move method and uses a better algorithm to pick its move. The next thing to do is write a short class that uses these two Player classes to play a game. This class contains a method named playTheGame() that accepts two Player objects. It calls the move method of the first player and then calls the move method of the second player: public class Main { public static void main(String[] args) { Player p1 = new Player(); Player p2 = new BetterPlayer(); //type is Player playTheGame(p1, p2); } public static void playTheGame(Player p1, Player p2) { p1.move(); p2.move(); //calling method from BetterPlayer } } Notice that the playTheGame() method doesn't know which of the two players is the basic player and which is the better player. It simply calls the move method for each Player object. When you run this program, the following output is displayed on the console: From Basic: From Better: When the move method for p1 is called, the move method of the Player class is executed. But when the move method for p2 is called, the move method of the BetterPlayer class is called. Java knows to call the move method of the BetterPlayer subclass because it uses a technique called late binding. During Late binding the compiler can't tell for sure what type of object a variable references, it doesn't hard-wire the method calls when the program is compiled. Instead, it waits until the program is executing to determine exactly which method to call.PreviousNext
https://www.demo2s.com/java/java-class-polymorphism.html
CC-MAIN-2021-04
refinedweb
382
63.73
Unity 2021.1.7.7f1 Mobile: [Android] App stops due to OnPixelCopyFinishedListener not being supported on devices with lower than 24 SDK (1331290) Mobile: [Android] Time.deltaTime value becomes constant 0.3(3) after sending to the background and resuming an Application (1328545) OpenGL: SRP Batcher not working with OpenGL APIs when the project is built (1331098) MacOS: [macOS] Unity crashes when exception thrown after a DLL has been loaded (1318755) Linux: Linux Editor crashes at "_XFreeX11XCBStructure" when loading tutorials (1323204) Metal: Performance in Game View is significantly impacted by Gfx.WaitForPresentOnGfxThread when a second monitor is connected (1327408) Global Illumination: Reflection probes don't contain indirect scene lighting after the on-demand GI bake from the Lighting window (1324246)) Terrain: All the textures are cleared when creating Texture array (1323870) Animation: AnimationEvent is fired late or isn't fired at all when Animation's 'Motion Time' value is set manually (1324763) Mobile: [Android] Build fails when there are 680 or more files in the Streaming Assets folder (1272592) Global Illumination: Performance regression when baking light probes with a light cookie in the scene (1323393) Asset Import Pipeline: Prefab script field reference is lost when project is upgraded (1328724) IMGUI: Contents of a ModalUtility window are invisible when it is launched from a Unity Context Menu (1313636).7f1 Release Notes Improvements Burst: Added Android x86_64 and re-enable x86 support. Burst: EmbeddedLinux Platform support added. Package: Visual Scripting - Migration tools were improved to allow users to migrate their project to recent Visual Scripting version. XR: Updated XR Plug-in Management to 4.0.3. API Changes HDRP: Added: Added an info box for micro shadow editor. (1322830) HDRP: Added: Added support for alpha channel in FXAA. (1323941) XR: Deprecated: Updated Windows MR XR SDK Plug-in to 5.3.0. Changes Burst: Revert to internal linkage for Android X86 (32bit) to ensure ABI compliance. HDRP: Changed default sidedness to double, when a mesh with a mix of single and double-sided materials is added to the ray tracing acceleration structure (case 1323451). (1323451) HDRP: Changed ray tracing acceleration structure build, so that only meshes with HDRP materials are included (case 1322365). (1322365) HDRP: Default black texture XR is now opaque (alpha = 1). HDRP: Disabled TAA sharpening on alpha channel. HDRP: Film grain does not affect the alpha channel. HDRP: Increased path tracing max samples from 4K to 16K. (1327729) Fixes 2D: Fixed initial rendering animated tiles when a CompleteObjectUndo is registered for a Tilemap while in Play mode. 2D: Fixed issue when upgrading a Tilemap with invalid data where transform and color data was not maintained, and loaded from the original Tile Asset instead. (1324908) 2D: Fixed wrong Sprites being shown for Animated Tiles when TilemapRenderer is in Individual mode and user sets new Tiles on the Tilemap. (1329054) Animation: Fixed values defaulting to zero when disabling writeDefaultValue on a State and mixing. (1303570) Asset Pipeline: Fixed an issue where unsaved changes could be lost when renaming/moving an asset. (1329404) Burst: Burst no longer logs a warning when opening the standalone Profiler. Burst: Fixed a bug where methods with the same name and namespace, but in different assemblies, could resolve to the wrong method. Burst: Fixed an issue whereby default initializing the first field in a static readonly struct, but explicitly initializing a subsequent field, would result in the wrong constant data being written. Burst: Fixed an UnauthorizedAccessExceptionthat could occur when using Burst in players built for the macOS App Sandbox. Editor: Added System.IO.Compression to reference assemblies when targeting .NET 4.7.1 (editor only contexts). (1275859) Editor: Console window 'Clear on Recompile' option no longer clears player build errors. (1327074) Editor: Fixed an issue causing invalid ScriptableObjects to added as a sub-asset causing the editor to crash during serialisation. (1257558) Editor: Fixed Gizmo rendering code crash in some invalid WhellCollider configurations. (1326188) Editor: Fixed pivot settings buttons in top toolbar not updating scene views immediately. (1300924) Editor: Fixed the resolution, insets and safe area of the Device Simulator when simulating Android devices in windowed mode. (1217736) Editor: The editor no longer freezes when FixedTimestep setting in the Preferences is set to 0/0. (1326481) Graphics: Fixed camera not rotating in HDRP Template with input system v1. Graphics: Fixed issue with GrayScaleRGBToAlpha for 16bpc textures. (1327917) Graphics: Fixed line & trails deforming when points were too close together. (1275386) Graphics: Removed the error message when encountering incompatible pipeline stages on DX12. (1279311) HDRP: Fixed a NaN generating in Area light code. HDRP: Fixed camera preview with multi selection. (1324126) HDRP: Fixed CustomPassUtils scaling issues when used with RTHandles allocated from a RenderTexture. HDRP: Fixed Decal's UV edit mode with negative UV. HDRP: Fixed GBuffer clear option in FrameSettings not working. HDRP: Fixed issue with an assert getting triggered with OnDemand shadows. HDRP: Fixed issue with constant buffer being stomped on when async tasks run concurrently to shadows. HDRP: Fixed issue with history buffers when using multiple AOVs. (1323684) HDRP: Fixed issue with the color space of AOVs. (1324759) HDRP: Fixed potential NaN on apply distortion pass. HDRP: Fixed the camera controller in the template with the old input system. (1326816) HDRP: Fixed usage of Panini Projection with floating point HDRP and Post Processing color buffers. macOS: Removed extraneous dylibs from Contents of built mac player. (1312216) Package Manager: Fixed the issue where Package Manager window does not pick up the right version when there are multiple versions of the same asset in the cache. (1330231) Particles: Give better feedback in the Inspector about incorrectly configured SpriteAtlas assets. (1318608) Scripting: Ensure virtual call is made when delegate target is another delegate targeting a virtual method. (1188422) Scripting: Fixed crash that was caused by passing a generic type into FindObjectsOfType. (1312890) Serialization: Fixed Property Diff after clearing array w/refs. (1266303) Shadergraph: Fixed an issue where an integer property would be exposed in the material inspector as a float [1332563]. Universal: Fixed an issue where changing camera's position in the BeginCameraRendering do not apply properly. (1318629) Universal: Fixed an issue where ShadowCaster2D was generating garbage when running in the editor. (1304158) WebGL: Fixed the Chrome deprecation warning about the use of SharedArrayBuffer. (1323832) XR: Fixed APK hang on Oculus Quest when debugging Vulkan APKs using RenderDoc that use lazily-allocated memory. (1325632) XR: Release resized XR eye textures for Vulkan. (1276514) Changeset: d91830b65d9b
https://unity3d.com/unity/whats-new/2021.1.7
CC-MAIN-2021-39
refinedweb
1,066
55.34
Join us in Chat. Click link in menu bar to join. Unofficial chat day is every Friday night (US time). 0 Members and 1 Guest are viewing this topic. #include "mbed.h"Serial pc(USBTX, USBRX);Serial ax500(p9,p10);Timeout off;int a,b,c;void stop(){int b=0; ax500.printf("!a00\r"); wait_ms(10); ax500.printf("!b00\r"); wait_ms(1000); b=1; }void forward(unsigned char speed_A,unsigned char speed_B){char tick_A,tick_B,optical_A,optical_B; ax500.printf("!A%02x\r",speed_A); wait_ms(10); ax500.printf("!B%02x\r",speed_B); if (tick_A!=tickA){optical_A++;if(tickB!=tickB){optical_B++;}}int main() {int speed_A =60;int speed B =60;if speed A // from dec 0 --> 127(00-->7F) forward(speed); wait(5); } #define PGain 10#define DGain 5#define IGain 1 //You play with these to make it work//Define global variablesint error = 0;int dEr = 0;int oldEr = 0;int integrateEr = 0;int SENSOR_LOC = 5; //5? Why not? Whatever you want it to beint PID_OUT = 0; //This is what you use to compute your control commandmain(){ ...do stuff, doesn't matter what. //READ SENSORS SENSOR_IN = readMySensor(); //this is whatever function you use to do it //update the errors error = SENSOR_LOC = SENSOR_IN; dEr = error - oldEr; //technically divide by dt, but this is handled by DGain integrateEr += error; //Add the error to the integrator oldEr = error; //vitally important, this step PID_OUT = PGain*error + DGain*dEr + IGain*integrateEr; //Now you set your limits. Let's say we're going to put PID_OUT directly //into the motors as a PWM command, but we need to limit it tbetween //0 and 127 if (PID_OUT < 0) PID_OUT = 0; if(PID_OUT > 127) PID_OUT = 127; //set your speed using your function SET_SPEED(PID_OUT);} The main problem is I don't know how to make both motors drive straight.if I set speed to 60 for both, and If left motor is faster than right motor, then right motor speed++. But then right motor speed would be faster, so left motor have to ++. Quote. Quote from: jkerns on April 19, 2012, 08:14:46 PMQuote.Cause what I'm afraid is it will keep adding up until eventually the right motor will be faster than the leftmotor ,and then it will just snowball again and again until it reaches the max .How do I get it to match a target value when theres no target value? #include "mbed.h"Serial pc(USBTX, USBRX);Serial ax500(p9,p10);InterruptIn trigger_A(p26);InterruptIn trigger_B(p25);Ticker calculate;//******************************************************************************************************************************************************************88//Define global variables.//Initialization.int enc_A,enc_B=0; char optical_A = 0;char optical_B = 0;int PGain=10;int DGain=5;int error = 0;int dEr = 0;int oldEr = 0;int integrateEr = 0;int SENSOR_LOC = 5; //5? Why not? Whatever you want it to beint PID_OUT = 0;int speed_B; unsigned int distance=0;//******************************************************************************************************************************************************************void calc(){error = enc_A - enc_B;dEr = error - oldEr; //technically divide by dt, but this is handled by DGainoldEr = error; //Copy error into oldErPID_OUT = PGain*error + DGain*dEr ;if(PID_OUT > 10) // Why 10? Okay I'll try 10 { PID_OUT = 10; }if(PID_OUT < -10) { PID_OUT = -10; } speed_B = speed_B + PID_OUT;}void stop(){ calculate.detach(); distance=(enc_A+enc_B)/2*20; //Total ticks from both enc/2 multiply with 20mm ax500.printf("!a00\r"); wait_ms(10); ax500.printf("!b00\r"); wait_ms(1000); enc_A=enc_B=0;}void forward(unsigned char speed_A,unsigned char speed_B){ if (speed_A>127) { speed_A=127; } if (speed_A<0) { speed_A=0; } else if (speed_B>127) { speed_B=127; } else if (speed_B<0) { speed_B=0; } ax500.printf("!A%02x\r",speed_A); wait_ms(10); ax500.printf("!B%02x\r",speed_B); calculate.attach(&calc,1.0); //Software interrupt. Calls calc function every 1 s.}void tick_A(){enc_A++;}void tick_B(){enc_B++;} int main() { // from dec 0 --> 127(00-->7F)int speed_A =60;int speed_B =60;trigger_A.rise(&tick_A);trigger_B.rise(&tick_B); forward(speed_A,speed_B); wait(4); stop(); wait(2); pc.printf("the distance is %u mm\r\n",distance); }
http://www.societyofrobots.com/robotforum/index.php?topic=15561.msg111897
CC-MAIN-2014-49
refinedweb
651
64.91
Java ping FAQ: How do I ping a computer from a Java program (or Java class, or Java method)? I've been working on a new Java networking application, and as part of network debugging, I wanted to be able to ping a server from my Java program. I thought writing a “Java ping” class/program would be straightforward, but in short, it wasn’t, so I wrote a little helper class to let me call the operating system ping command, and use the output from it. (Not what I wanted, but it works.) I'm not going to get into the discussion too much today, as I'm still working on this class, so without much introduction, here's the source code for a Java ping class I've created. This class lets me ping other servers/hosts from my Java application, using the ping command from the host operating system. In my case, I'm using Mac OS X 10.5, so I'm using the Mac ping command, which is located in the /sbin directory. My Java ping class (program) source code Here's the source code for my JavaPingExampleProgram: import java.io.*; import java.util.*; /** * A Java ping class. * Created by Alvin Alexander, devdaily.com. */ public class JavaPingExampleProgram { public static void main(String args[]) throws IOException { // create the ping command as a list of strings JavaPingExampleProgram ping = new JavaPingExampleProgram(); List<String> commands = new ArrayList<String>(); commands.add("/sbin/ping"); commands.add("-c"); commands.add("5"); commands.add(""); ping.doCommand(commands); } /** * Provide the command you want to run as a List of Strings. Here's an example: * * List<String> commands = new ArrayList<String>(); * commands.add("/sbin/ping"); * commands.add("-c"); * commands.add("5"); * commands.add(""); * exec.doCommand(commands); * * @param command The command you want to execute, provided as List<String>. * @throws IOException This exception is thrown so you will know about it, and can deal with it. */ public void doCommand(List<String> command) throws IOException { String s = null; ProcessBuilder pb = new ProcessBuilder(command); Process process = pb.start(); BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream())); BufferedReader stdError = new BufferedReader(new InputStreamReader(process); } } } As I mentioned, this Java ping class is still a work in progress, but it does work. As the main method shows, you can ping a network host like by creating your system command as a List of String objects. The command shown in the code would look like this if issued on the command line: /sbin/ping -c 5 Java ping class/program and InetAddress As a final note before leaving today, I thought I'd be able to accomplish this task using the isReachable method of the InetAddress class, but that method didn't work as expected. For instance, while I am able to ping from the command line, the isReachable method returns false when I try to access the same hostname. Therefore, I created my own Java ping program, as shown above. Okay, one more final note: As you might guess from my Java ping class/program, I'm actually working to make this class more generic, so I can easily run any system command. Running the command is easy, but trying to determine what to do with standard output and standard error streams requires a little more thought, especially if you want to run your commands from a Java GUI app, and display the output in real time in the GUI.
https://alvinalexander.com/java/java-ping-class/
CC-MAIN-2022-05
refinedweb
570
59.13
Hello, I have an enum defined as follows public enum EnumStuff { Value1 = 1, Value2 = 2, Value3 = 3 } I am trying to retrieve the name as well as the value from each value inside of this enum. However, I have tried the following and it does not work. public class Test { public static void Main(String[] args) { EnumStuff es = EnumStuff.Value1 Type t = e.GetType(); FieldInfo[] fi = t.GetFields(); foreach (FieldInfo i in fi) { Console.WriteLine("Name: " + i.Name); Console.WriteLine("Value: " + i.GetValue(es)); } } } Instead of printing the value, it prints the name of the variable. Is there a way to display both the name and the value for each variable in the enum? Thank you for your help
http://forums.devshed.com/net-development-87/reflection-95688.html
CC-MAIN-2015-06
refinedweb
119
76.22
Now that we have a good understanding of all the API calls we need to make, we can start setting up the project. I'll be building this project as a Node project simply because it's the lowest overhead and easy to host somewhere. The goal for today is to have a basic Node project that we can run. On running the code, it should list all unsubscribed people from Revue and all the subscribers. Creating the project Let's get started. Create a new node project. # Create folder mkdir revue-sendy-sync # Navigate into the folder cd revue-sendy-sync # Init new node project npm init We should now have our basic project with a package.json file. The first thing I did was change it to module type so we can use imports. { "name": "revue-sendy-sync", "version": "1.0.0", "type": "module", ... } The next thing we want to do is add some packages that we'll use. So far, we know we need some environment variables and want to make some API calls. The packages we can use for that are dotenv and node-fetch. npm i dotenv node-fetch With those installed, we can define a .env file. This file can be used to store your environment variables. While creating this, also make sure to exclude it by using your .gitignore file. (You don't want your secret to being committed to git!) Inside the .env file, add the following variable. REVUE_API_TOKEN={YOUR_TOKEN} Note: Don't have the token? Read the article on retrieving all the API keys. Then the last file we need is an index.js file. This will be the brains of the operation. Create the file, and start by importing the packages we installed. import dotenv from 'dotenv'; import fetch from 'node-fetch'; dotenv.config(); console.log(`I'm working!`); You can now try to run this by executing node index.js. In return it should show you "I'm working". Calling the Revue API from Node.js Let's start with the first piece of software. We want to be able to call the Revue API. We can start with the unsubscribe call. To make things scaleable, I created a custom function for this purpose. const getRevueUnsubscribers = async () => { const response = await fetch( '', { headers: { Authorization: `Token ${process.env.REVUE_API_TOKEN}`, 'Content-Type': 'application/json', }, method: 'GET', } ).then((res) => res.json()); return response; }; As you can see, we use the node-fetch package to request the unsubscribed endpoint. We then pass the Authorisation header where we set the API token. Note: This token is loaded from our .envfile. Once it returns, we convert the response to a valid JSON object and eventually return that. Then we have to create a function that runs once our script gets called. This is called an Immediately invoked function expression (IIFE for short). (async () => { const revueUnsubscribed = await getRevueUnsubscribers(); console.log(revueUnsubscribed); })(); This creates a function that invokes itself, so it will now run when we run our script. In return, it will console log the JSON object of people who unsubscribed on Revue. Yes, that was more straightforward than I thought. We already have one call done. Let's also add the call that will get the subscribed people. const getRevueSubscribers = async () => { const response = await fetch('', { headers: { Authorization: `Token ${process.env.REVUE_API_TOKEN}`, 'Content-Type': 'application/json', }, method: 'GET', }).then((res) => res.json()); return response; }; And we can add this to our IIFE like this. (async () => { const revueUnsubscribed = await getRevueUnsubscribers(); console.log(revueUnsubscribed); const revueSubscribed = await getRevueSubscribers(); console.log(revueSubscribed); })(); Let's try it out and see what happens. Nice, we can see both API calls return data. Cleaning up For those paying attention, we created some repeating code. The Revue API calls look the same, so we can change things around a little bit. const callRevueAPI = async (endpoint) => { const response = await fetch(`{endpoint}`, { headers: { Authorization: `Token ${process.env.REVUE_API_TOKEN}`, 'Content-Type': 'application/json', }, method: 'GET', }).then((res) => res.json()); return response; }; (async () => { const revueUnsubscribed = await callRevueAPI('subscribers/unsubscribed'); console.log(revueUnsubscribed); const revueSubscribed = await callRevueAPI('subscribers'); console.log(revueSubscribed); })(); The code still does the same thing, but now we only leverage one uniform function. It only limits to GET requests, but for now, that's precisely what we need. Conclusion This article taught us how to call the Revue API from NodeJS. If you want to follow along by coding this project yourself, I've uploaded this version to GitHub. We'll call the Sendy API in the following article, so keep an eye!
https://h.daily-dev-tips.com/revue-sendy-sync-project-setup-revue-calls
CC-MAIN-2022-33
refinedweb
757
68.77
Replace cd E:www80curl with cd /d E:www80curl (or just add the line E:). By default, the cd command will change the current directory for the named drive yet not the current drive. Assuming you have the following file structure (and if I didn't misunderstand your description): rootPath/ +-- ConfigFile.ini +-- distFolder/ +-- YourApp.jar You should set task parameters like this: Action: Start a program Program/script: "C:Program Files (x86)Javajre7injavaw.exe" Add arguments (optional): -jar "rootPathdistFolderYourApp.jar" Start in (optional): rootPath By this way, Windows scheduler should init your java application in rootPath directory and it shouldn't have problems to load ConfigFile.ini Note: C:Program Files (x86)Javajre7injavaw.exe is my java path, just use yours of course. Also note is necessary use javaw.exe. Finally at Start in section, rootPath doesn't be quoted.") you could write the return to a text file then the next day the program reads the text file and starts with the number it reads from the text file then re-writes the new value to the text file this way you can save data while the program isnt running and retreive it later Hope that help :) Obviously this comment was the answer: use the full path of myJar.jar instead of a relative path - the running directory of the windows scheduler is C:WindowsSystem32 and your jar-file is probably not in this directory. So, what's the problem? After downloading you can check the Demo.cs, where you can find the method private void CreateSchedulerItem() and the event triggerItem_OnTrigger. You can change this event to run the batch file that you need. You can create a VBS file like below Dim iex Set iex = CreateObject("internetexplorer.app location") iex.Navigate "" ie.Visible=True Then schedule the file for execution or use this Very interesting. Try moving file to itself by "cmd /c move file.txt file.txt". You are correct that opening file in notepad would need you to save it. however I would like to say no file, even if some changes being made to it, need to be saved. In my understanding if any application that is making change to the file is actually writing to it permanently. Why not just call ScheduledExecutorService.scheduleAtFixedRate or ScheduledExecutorService.scheduleWithFixedDelay? UPDATE This is one means of implementing what (I believe) you want: ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); void start(final Connection conn) { executor.scheduleWithFixedDelay(new Runnable(){ public void run(){ try { poll(conn); } catch (Exception e) { e.printStackTrace(); } } }, 0, 1, TimeUnit.HOURS); } private void poll(Connection conn) throws SQLException { final ResultSet results = conn.createStatement().executeQuery("SELECT song, playtime FROM schedule WHERE playtime > GETDATE() AND playtime < GETDATE() + 1 HOUR"); while (results.next()) { final String song = results.getString("song"); final Time time = Do I need to spawn the schedules off on a new thread? No, rufus-scheduler does it for you. Do I need to create a new scheduler instance for each schedule I'm going to create? No, not at all. Have you tried without setting a frequency (using rufus-scheduler's default frequency)? Although you are not hitting a rufus-scheduler issue, please read: You are not giving any detail about your environment, it's very hard to help you. Try to iterate from small to big. Have a small schedule thinggy work and then proceed one step after the other. My workaround is to call a .BAT file from the Task Scheduler. This batch file then calls the PowerShell script file: powershell c:dir1AutoPopulate.ps1 Seems to work. open('xyz') does not search the various python import paths. If you give a relative path name, it starts with the current working directory, appends your path and looks there. If you give an absolute path, it ignores the current directory. It's hard to say what is slowing down your app from the information given. As LearnCocos2D suggested, you can use Instruments to figure out where the slow stuff is. Or if you want to get very granular analysis, you can always use the following macros in your code: #define TIC start = [NSDate date] #define TOC -[start timeIntervalSinceNow] #define TOCP NSLog(@"TIME: %f", TOC) Before using, be sure to declare NSDate *start in scope of use. Then just put a series of TIC/TOC or TIC/TOCP pairs in your code to print out times your code is taking in different places. You can very quickly find the bottlenecks this way. Try looking at solr-data-import-scheduler. Although I haven't used it personally, I know of people who have done, and they seem to be happy with it. If using servlets, and want to run your job on application startup, I guess this is how you should proceed to achieve. The Job Class public class DummyJob{ public DummyJob() throws ParseException, SchedulerException { JobDetail job = new JobDetail(); job.setName("dummyJ"); job.setJobClass(NotificationCreater.class); SimpleTrigger trigger = new SimpleTrigger(); trigger.setName("mn"); trigger.setStartTime(new Date(System.currentTimeMillis() + 1000)); trigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY); trigger.setRepeatInterval(30000); Scheduler scheduler = new StdSchedulerFactory().getScheduler(); scheduler.start(); scheduler.scheduleJob(job, trigger); } } The servlet public class JobInitializerServlet extends HttpServlet { /** * */ private static final long serialVersio The Insert Should be Performed after select, then you will be able to insert the updated value. Currently you are getting the value from database add 5 to it and then leave. and insert has already been done for 1 in the start of the script By default, the operators pick a scheduler that introduces the least concurrency required for the operator. If you want to know what is being used in the debugger, then put a break point in your observer and look at the stack trace. You should extend the class TaskScheduler in order to write your own scheduler. Once done, you can plug it in your code via the JobTracker property mapred.jobtracker.taskScheduler. You can find TaskScheduler inside org.apache.hadoop.mapred. HTH. You have to COMMIT your DML statements. There is no COMMIT in PL/SQL block and I guess in procedure RUNREPORT either. You don't need an apostrophe around sysdate, it's not a string literal. job_action => 'BEGIN RUNREPORT(''NAME'', ''VERSION'', sysdate, ''11-Jun-13''); COMMIT; END;', BYMINUTE does not mean what you would expect. From documentation: "This specifies the minute on which the job is to run. Valid values are 0 to 59. As an example, 45 means 45 minutes past the chosen hour". What you need is repeat_interval => 'FREQ=MINUTELY;INTERVAL=10' You can check next run date and more by querying user_scheduler_jobs. Check this post on SO. Some good options and details. I'd recommend Quartz.NET Okay here is what I did finally. I converted the datetime to string format and the used it in JFS view. DateTime dateTime = date == null ? null : new DateTime(triggers.get(0).getNextFireTime()); if (dateTime != null) { quartzJobList.add(new QuartzJob(jobName, jobGroup, dateTime.toString("MM/dd/yyyy hh:mm:ss"))); } The authors of Stackoverflow used a solution based on adding an item to the cache, then running their scheduled code when the cache item expired and ran a callback method. Here is their implementation: Edit: When it says "at startup", this means in your Global.asax file, in an event called Application_Start. I think you could use shutdownNow method, this should Attempts to stop all actively executing tasks and halts the processing of waiting tasks according to the docs. From the man page of sched_setscheduler(), ca The events are delivered on the specific scheduler. For example you may want your events delivered on the threadpool rather than the UI thread. You could use Scheduler.Default and then any downstream processing of your events will not impact the UI rendering. Of course you would then need to marshal the results back to the UI scheduler. For this switch you can use the ObserveOnDispatcher() method to put subsequent processing back to the UI thread. You are setting the dataSource to use JSONP but in the action you are just returning JSON JSONP takes a standard JSON response and wraps in a function call. This allows it to be loaded by adding a <script> tag into the HTML document JSON example { 'hello': 'world', 'num': 7 } JSONP example callback({ 'hello': 'world', 'num': 7 }); MVC doesn't have built in support for JSONP so you can either can in (have a look at this) or it looks like you are using it on the same domain so plain JSON would work I see some issues with your abstraction... It appears that you abstract the queue, but not the Job class. This should be the opposite (or at least your life will be a lot easier that way). public interface IJob { MyJobType Type{ get; set; } string Name { get; set; } int Priority { get; set; } void RunJob(); } You can remove IQueue since you are not using it anyway. Use only one queue unless there is a good reason not solved by #3 Abstract your job class - after all the Job that creates the cheese sandwiches will not be the same as the one that handles meetings. With something like the interface above you can order jobs by type (an enumeration you create) and priority, then run them using IJob.RunJob without having to know what they actually do in each implementation According to the docs, sched will run all scheduled events with run(). The text is a little obscure, but I believe that run() returns once all scheduled events are complete. If that is the case you will need to add more events and call run() again, and given your reported results that seems to be what is happening. yes there is. have a look at quartz scheduler. its really not difficult to set-up: // Grab the Scheduler instance from the Factory Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler(); // and start it off scheduler.start(); //); That's a classic: (new google groups) (unfortunately, most of the links in those discussions are dead (4 years ago...)) You'll have to check your Passenger configuration to see how it behaves. You'll have to make sure the process where the rufus-scheduler thread is started is preserved somehow. Take the time to read the Passenger configuration / manual and experiment tuning it. I vaguely remember that those could help: Ajet's answer in Rufus Scheduler not What about using an existing scheduling library like Quartz.net? Quartz.NET is a full-featured, open source job scheduling system that can be used from smallest apps to large scale enterprise systems. Quartz.NET is a pure .NET library written in C# and is a port of very propular open source Java job scheduling framework, Quartz . This project owes very much to original Java project, it's father James House and the project contributors. REVISED The Scheduler class has a private constructor, which means that you cannot extend it without modifying the Guava library code. You therefore need to take the alternative approach suggested by the javadocs. If more flexibility is needed then consider subclassing CustomScheduler. (The compilation error is a bit misleading in this case ... but the bottom line is that the extend approach will not work.) Replace below code in onCreate() method private Timer refresh = null; private final long refreshDelay = 5 * 1000; if (refresh == null) { // start the refresh timer if it is null refresh = new Timer(false); Date date = new Date(System.currentTimeMillis()+ refreshDelay); refresh.schedule(new TimerTask() { @Override public void run() { postHttpRequest("Test","Test"); refresh(); } }, date, refreshDelay); Use JobDataMap to hold your custom data and use during the executing of job. Ex: JobDetail job = JobBuilder.newJob(TestJob.class) .withIdentity("testJob") .build(); job.getJobDataMap().put("mobile", "1234567890"); job.getJobDataMap().put("msg", "Your balance is low"); public void execute(JobExecutionContext jExeCtx) throws JobExecutionException { try { JobDataMap dataMap = context.getJobDetail().getJobDataMap(); String msg = dataMap.getString("msg"); String mobile = dataMap.getFloat("mobile"); SendSms.sendSms(mobile,msg); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } log.debug("TestJob run successfully..."); } I've added scheduling to a __init__ module in one of my project application (in terms of Django), but wrapped with small function which prevents queueing jobs twice or more. Scheduling strategy may be dependent of your specific needs (i.e. you may need additional checking for a job arguments). Code that works for me and fit my needs: import django_rq from collections import defaultdict import tasks scheduler = django_rq.get_scheduler('default') jobs = scheduler.get_jobs() functions = defaultdict(lambda: list()) map(lambda x: functions[x.func].append(x.meta.get('interval')), jobs) now = datetime.datetime.now() def schedule_once(func, interval): """ Schedule job once or reschedule when interval changes """ if not func in functions or not interval in functions[func] Oracle Scheduler has all options where you are looking for and probably more. See Overview of Oracle Scheduler for some global info. It comes doen to having a central schedular database that submits jobs to remote job agents that do the work pretty much independent from the central schedular repository. It does report back status etc. when the repository is accessible after a job has finished. It's a very powerful tool and it takes away a lot of complex tasks for you by giving a framework that you can start using right out of the box. I do not completely understand your situation. However I can offer a suggestion, will the following be possible: Store those values in a new table. Use a separate SQL query to retrieve these 2 values, which you store in variables. Then just set those values to point to those 2 variable. All the above must happen on page load and before setting those 2 values. Hope it helps. the values in quartz_trigger i.e. the next_fire_time in table is changed after the execution >time of the job Yes, this is quartz actually does in case of misfires. As per the misfire instruction provided while creating a trigger, quartz calculates how many times the misfired execution has to be executed. As per your code , you have set the misfire instruction as "fireAndProceed" , So Quartz just executes the very first misfired execution ( and neglect all the subsequent remaining misfires). Ex: If you set the trigger to fire between 2Pm to 4pm with interval of 30 min and if scheduler was down during 2:29pm to 3.29pm, then only one trigger execution of time 2.30pm will be executed ( and executions of 3.pm will be neglected). Hope this answers your question. :-)
http://www.w3hello.com/questions/Python-scheduler-using-bat-file
CC-MAIN-2018-17
refinedweb
2,410
65.93
Off the back of the Interface Monitoring post I had created a class that queries the Ens.AlertRequest global and returns the entries between 6pm the night before and 6am in the morning. I tested this build in our T&D environments and the build worked very well. However in our production environment the query is being truncated, by what I believe to be a timeout and I get a partial query output. In the System>SQL pages my 12 hour query times out. I compared the Global size by running a SELECT MAX(ID) query and got a return of 60,244,962 records. This may go some way to explain why the query is taking longer and possibly timing out. In our T&D environments (which we don't purge), we have only 1 million and 2.5 million records. For messages we in production we have a 90 day purge limit. I wonder if the Ens.AlertRequest global isn't being purged and if so why it isn't as this global is considered to be a message in my mind. Any advice please. Regards Stuart Please find my method below which is used to drive a Business Operation. It's activated by a schedule on a daily basis at 6am: MAX(ID) isn't necessarily the record count. Try a "select count(*) from Ens.AlertRequest" query and see what you get. Compare that to "'select count(*) from Ens.MessageHeader where MessageBodyClassName = 'Ens.AlertRequest'" If the numbers are in line with the MAX(ID), then my suspicion is that you either don't have "BodiesToo" checked or do have "KeepIntegrity" checked in your purge process configuration. Either of those may be keeping old Ens.AlertRequest bodies around. Hi Jeffrey, SELECT COUNT(ID) & SELECT COUNT (*) are timing out via the System>SQL pages. I had a look at our purge settings and we have "BodiesToo" unchecked and "KeepIntegrity" checked. The next way forward would be to investigate the effect of purging with the "BodiesToo" and see if this reduces the EnsAlertRequest global size. If you have access to Caché terminal, you can run run queries that won't time out: (the sample below assumes your namespace is "PROD"; just substitute whatever your production's namespace is for that). USER> zn "PROD" PROD> d $system.SQL.Shell() SQL Command Line Shell ---------------------------------------------------- The command prefix is currently set to: <<nothing>>. Enter q to quit, ? for help. PROD>>SELECT COUNT(*) AS AlertCount FROM Ens.MessageHeader WHERE MessageBodyClassName = 'Ens.AlertRequest' AlertCount 2205 PROD>>Q PROD> So ... if you don't have BodiesToo checked, you most likely have lots of orphaned message bodies taking up database space. And KeepIntegrity is probably retaining a lot of message headers (and associated bodies) that you don't care about anymore. There are reasons you would not want to turn KeepIntegrity off in earlier versions of Caché/Ensemble, like pre-2015 releases. If you're on a release more modern than that and you don't need to worry about messages with parent/child relationships (certain batch types, for example), you can probably turn that off. There are a couple of articles regarding the management of orphaned bodies here on DC. Might be worthwhile to peruse them :) Thanks Jeffrey. I've spoken to our Caché ODBA and he concurs there are orphaned records in the Ens.Message* globals. We're on 2017.1 currently, but have been live since Caché 2012, which may explain todays issues. Looking at the purge tasks we have records with no timestamp, which would escape the purging process. Our Caché ODBA is going to open a WRC to confirm the best course of action for a one off purge of these Ens.Message* globals. Thank you so much for your advice as it has helped immensely identifying this issue. To leave a comment or answer to post please log in Please log in
https://community.intersystems.com/post/ensalertrequest-summary-queries-timing-out
CC-MAIN-2020-10
refinedweb
651
74.69
Re: [Zope] how do you pronounce 'ZOPE'? ross posts or HTML encoding! ** (Related lists - ) -- Chris McDonough Digital Creations Publishers of Zope - ___ Zop Re: [Zope] help with rpms on RedHat6.2 ://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - ) -- Chris McDonough Digital Creations Publishers of Z RE: [Zope] Memory creep John, If you can figure out how to use them, the pair of methods implemented on the Control_Panel named "manage_debug" and "manage_profile" might help you... e.g. . I can't give much in the way of explanation of them, there might be some good RE: [Zope] Zclass inheritence What Re: [Zope] Zclass inheritence lass list contains the same selection of bases - no Zclasses among them. Same deal under 2.1.4. I think debuging mode is operating on the both of them, for what it's worth. Which bit of code should I start looking through, first? :-) -- Chris McDonough Digital Creations Publishers of Z Re: [Zope] Executing an external program owser. -=Brad=- ___ Zope maillist - [EMAIL PROTECTED] ** No cross posts or HTML encoding! ** (Related lists - ) -- Chris McDonou RE: [Zope] Subclassing from Custom Python Classes You should also note that your subclass must obey the ZODB persistence rules, which basically state that mutable sub-objects should be treated immutably. For example, self.bird='parrot' # OK self.map['bird']='parrot' # NOT OK, will not trigger persistence RE: [Zope] How to know the number of parents of an element ??? Errr... untested.. but should work. dtml-let a="_.len(PARENTS)" ... /dtml-let -Original Message- From: Frédéric QUIN [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 24, 2000 12:38 PM To: [EMAIL PROTECTED] Subject: [Zope] How to know the number of parents of an element ??? Hi RE: [Zope] ANN: Perl For Zope The only badness I can see coming out of this is this: At present, I can consult at a client who is running Zope, and I'm reasonably confident that I can read and understand all their code. When people can write their site half in Perl, I could well be stuck... unless I learn Perl :-) RE: [Zope] ANN: Perl For Zope This is pretty silly. Very soon we'll be forced, 'cause most Products will be in Perl (yse, I've read the FAQ and saw "no Perl Products"; it's temporary, mark you). ___ Zope maillist - [EMAIL PROTECTED] RE: [Zope] Using relational DB for ZODB storage Ivan... Hi, It's a "grassroots" effort. Jonothan Farr ([EMAIL PROTECTED]) is heading up the project, and I'm helping. We've gotten a few prototype versions up and running using MySQL and Interbase, but I'd say we're a few weeks away from being able to release an alpha. You can get more RE: [Zope] ANN: Perl For Zope Ooo Ooo - XSLT? Presumably I should read your sentence as "You will have the option of using Perl as well as XSLT methods pretty soon" and not "Thou wilt need Perl to get XSLT methods" ? :) The former... see Re: [Zope] ? Yeah," Re: [Zope] Hot backups Patrick, as the Data.fs file is always appended to (as opposed to being overwritten in places), I think you should be OK backing it up on the fly. "Patrick J.M. Keane" wrote: Is there any facility in Zope for doing a hot backup, without shuting down zope, taking a backup copy of var -- can [Zope] Duplicate messages Sorry about the continued dupes folks, I'm trying to flush the sendmail mqueue on the mail list server, and its processing rules are not as smart as I would have hoped. Hopefully once the flush is done we'll be back to normal... ___ Zope maillist - [Zope] test ignore please ___ Zope maillist - [EMAIL PROTECTED] ** No cross posts or HTML encoding! ** (Related lists - Re: [Zope] import folder at other place than root Peter, you can change this in the Python file lib/python/OFS/ObjectManager.py here: def manage_importObject(self, file, REQUEST=None): """Import an object from a file""" dirname, file=os.path.split(file) if dirname: raise 'Bad Request', 'Invalid file name Re: [Zope] Use of lambda expression in DTML What I would like to say is that if your application needs lambda, filter or map, your code is getting bejond report or presentation generation (for which DTML is intended) and in the realm of data manipulation and business rules. In this case your code would be much better placed in some Re: [Zope] defining counters in zope(newbie) Sudhir, Hi... It's natural to want to do this in DTML... but probably not the best idea. I know it's a lot to chew to have to use Python to do stuff like this (you don't), but it would make your life probably a lot easier to do this in an external method or a Python method. That said [Zope] test, please ignore... Chris McDonough Digital Creations Publishers of Zope - ___ Zope maillist - [EMAIL PROTECTED] ** No cross posts or HTML encoding! ** (Related lists - Re: [Zope] What are the best general books on Object Oriented designprinciples?principles? Chris, At the end of the article named "Gaining Zope Enlightenment By Grokking Object Orientation", (), you will find a reference to a book by Scott Ambler named "The Object Primer". This is a great starting point. Chris Beaumont Re: [Zope] Use of lambda expression in DTML Nick Drew wrote: |I can see that argument... it depends on the reader, I suppose. I |wouldn't complain much actually if the Python code had functional stuff |in it. It's having it in DTML that bugs me, for reasons that |have to do |with separating HTML-like stuff from the stuff that RE: [Zope] Proposal for mail-in to Zope I'm interested in this, although I have a lot on my plate right now and can't help in development. I see objects in Zope being able to handle a call to one of their methods that passes off a chunk of email text and stuffs it in an attribute for later display or catalog. I think you should RE: [Zope] ZOPE, Xemacs, html-mode, indentation. I, Re: [Zope] dtml-tree help Pete Kazmier wrote: Hi, I think this is a simle question but I've been struggling for the last two days trying to get it to work. I have a heirarchy of folders (really a custom container class) and files (really a custom object). I want to emulate the Window's Explorer interface, left Re: [Zope] Can't find some products on Something's hosed on Zope.org. It won't be available for at least a few hours. This is baaad. Sorry. Petr Knapek wrote: Hi Zopists, today I tried to download 2 products for zope from (namely 'Photo' and 'A Simple Photo Album Product' and the server respond me that the pages Re: [Zope] Missing how tos Pierre, check back on zope.org in a few hours, it's having problems. The howto is still there, I'm sure. Pierre Rougier wrote: hi all, I am looking for the documentation of the "multiple selection" type, but the "how to" does not exist anymore on zope.org. argh... Has anyone of u a [Zope] ANN: InterbaseStorage alpha release Hi, The alpha release of a Zope storage that uses the Interbase relational database to store object database information is available at. It's a full-featured storage. Guinea pigs^H^H^H^H^H^H^H^H^H^H^H Testers wanted. -- Chris. Re: [Zope] Importing data Have you tried pushing the 'Export' button in the management interface? -- Chris McDonough Digital Creations Publishers of Zope - ___ Zope maillist - [EMAIL PROTECTED] ** No cross RE: [Zope] Newbie query, localhost:8080 doesnt work!! See -Original Message- From: Rajil Saraswat [mailto:[EMAIL PROTECTED]] Sent: Friday, June 16, 2000 7:57 PM To: [EMAIL PROTECTED] Subject: [Zope] Newbie query, localhost:8080 doesnt work!! Hi , I have [Zope] Re: [Zope-dev] sql-statements in DTML-Methods.... Zope differs from PHP and ASP systems in this regard. I don't think anyone using Zope that I've seen inlines SQL inside DTML.The separation of SQL and presentation via DTML is intentional. Though it's not always as expedient, the intent of the separation is to provide you with layers of Re: [Zope] Instanciate a ZClass out of Zope This limitation will effectively go away as soon as ZEO goes open source. Oleg Broytmann wrote: You cannot open independent connection to ZODB while Zope is active - Zope locks the database, and by purpose. You must access ZODB only through Zope machinery. Or stop Zope, open ZODB and RE: [Zope] ZOBD caching products? This is a 'feature' of the product initialization process. Note that I am just documenting buginess here, I should try to fix this when possible. When a Product can't be initialized (a syntax error, a bad import, whatever), sometimes it will revert back to the state at which it wrote a good RE: [Zope] brain hurts regarding dynamic fcn args in Python Is there a (straightforward?) way to dynamically compose function argument lists? For example, in C, you can write" f(arg1, arg2, (conditional expression)?(val for TRUE state):(val for FALSE state)). This can be emulated in Python by the boolean logic: ( ({conditional expression}) and RE: [Zope] brain hurts regarding dynamic fcn args in Python Oops, I'm not quite right about this. This FAQ explains it better... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, June 19, 2000 4:51 PM To: [EMAIL PROTECTED] Subject: RE: [Zope] brain hurts regarding Re: [Zope] Embedding authentication in a Zope Website Knight, The primary way of obtaining the credentials of the currently logged in user is through the AUTHENTICATED_USER attribute of the REQUEST object, ala: dtml-unless "REQUEST.AUTHENTICATED_USER.getName() == 'Anonymous' Important stuff /dtml-unless Unimportant stuff. You probably don't RE: [Zope] Embedding authentication in a Zope Website RE: [Zope] Basic site management using zope and other queries 1. Can zope do basic site management. for example missing link checks. say if we call an object which doesnt exist. can zope show us where we have gone wrong.(without actually checking each and every object manually) No. 2. I have large number of small html documents(17,000). I RE: [Zope] help a zope newbie I RE: [Zope] Unique Identifiers for Zope Objects I'm looking for an internal globally unique identifier for objects in my Zope store. The object path would be that. I know that I can use id=object.absolute_url() to create an identifier and then something.resolve_url(id) to recover the object from the identifier -- but I have two RE: [Zope] More verbose zope errors Do a view source on the page to show the traceback contents when they don't show up within the page body. -Original Message- From: ethan mindlace fremen [mailto:[EMAIL PROTECTED]] Sent: Monday, June 26, 2000 11:08 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [Zope] RE: [Zope] geting the type of an object from within dtml ??? == it works]' Re: [Zope] Bizarre new problem... I suspect this is coming from MySQLdb. From the Python DB-API spec: OperationalError Exception raised for errors that are related to the database's operation and not necessarily under the control of the programmer, e.g. an unexpected disconnect occurs, the data source name is not found, a RE: [Zope] Re[2]: [Zope] CASE tools and Zope ZClasses can indeed be brains. -Original Message- From: R. David Murray [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 28, 2000 12:52 PM To: Alexander Chelnokov Cc: Dieter Maurer; zope Subject: Re: [Zope] Re[2]: [Zope] CASE tools and Zope On Wed, 28 Jun 2000, Alexander RE: [Zope] Urgent problem: Database and large clock skew Jim, It might be wise to just truncate the Data.fs at the point the transactions occurred. See -Original Message- From: Jim Flanagan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 28, 2000 1:46 PM To: [EMAIL PROTECTED] Subject: RE: [Zope] Version Lock Error When the users hit a DTML method that tries (maybe in a roundabout way, have a ZCatalog?) to write to an object in the ZODB that's been locked in a version, you'll get this. Try to figure out where it's happening by examining the DTML method that they're hitting and figure out where you're Re: [Zope] zope and caching Here at DC we recently had a "jam session" discussion on caching. I don't think anything "hard" came out of it, we just tossed around some ideas. DC has several current contract customers who are going to need high speed pretty badly. Of course, they're also going to be using ZEO, which Re: [Zope] Deinstalling Products?! Are you sure you deleted it from the right place? Also, did you delete it from the Products Management screen of the control panel? Jonathan wrote: Hi all, Removed a product from the Products folder, but Zope still seems to import it from a folder that is not there anymore. Does Zope RE: [Zope] LONG insert 2000 chars fail Use form action=bleah method=post? -Original Message- From: Andy Gates [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 06, 2000 10:32 AM To: [EMAIL PROTECTED] Subject: Re: [Zope] LONG insert 2000 chars fail Message-ID: [EMAIL PROTECTED] Priority: NORMAL X-Mailer: Execmail Re: [Zope] newbie questions Hi Frank, It sounds like your SourceSafe tie in could potentially be a fairly complex undertaking. Amos Latteier wrote an example COMObject product that will show you the mechanics of utilizing COM objects from Zope. This might help. And though I know you don't want to VC Zope objects, you Re: [Zope] newbie questions AFAIK, it would be a bad idea a) if writes were not appends and b) if records written to the FileStorage were not written atomically. But neither is the case, so it's safe to just copy it without shutting it down. The only time this may not be the case is if it were copied during a pack Re: [Zope] Problems shutting down Zope This is a 'normal' message. Zope 2.2 releases suppress the error message on shutdown. Not sure what's up with the tutorial. You may want to try the latest 2.2 beta release as the tutorial comes preinstalled. Firestar wrote: Hi, i have just installed Zope-2.1.6 on a linux server. Starting RE: [Zope] Redirect Back You may either use Javascript's history method or use RESPONSE.REDIRECT(REQUEST['HTTP_REFERER']). The former is preferred as the latter isn't always accurate nor available. -Original Message- From: Aaron Williamson [mailto:[EMAIL PROTECTED]] Sent: Friday, July 07, 2000 11:45 AM To: RE: [Zope] Redirect Back Oops, sorry, not RESPONSE.REDIRECT, instead RESPONSE.redirect. -Original Message- From: Chris McDonough [mailto:[EMAIL PROTECTED]] Sent: Friday, July 07, 2000 11:54 AM To: 'Aaron Williamson'; [EMAIL PROTECTED] Subject: RE: [Zope] Redirect Back You may either use Javascript's Re: [Zope] help! zope down on it's knees I'm curious about the fact that apache can render the page immediately by talking through pcgi/fcgi to ZServer but ZServer can't render the page quickly when you talk to it directy via HTTP. The only reasoning I can see for that is some sort of caching at the browser or in the http server. RE: [Zope] Adding comments to documents like in ACS ... This is something I've wanted to see for a long time too. The Portal Toolkit () evidently has a "discussable" mixin class that allows users to add comments to documents. You may want to check it out. This feature should probably be abstracted out of the portal RE: [Zope] Adding comments to documents like in ACS ... Tino Wildenhain wrote: Chris McDonough wrote: I really like ACS' "bboard" system, that's the kind of functionality I think these objects should provide. Yes. And I often wonder where my notes to sessions walk to. For the meantime, at least for docuements and methods, we c Re: [Zope] Linux user group Darn. I had slides for a LUG presentation up on one of my former company's servers, but they seem to have taken the box down. I don't have it archived anywhere. Maybe somebody made a copy? It was from... errr... maybe November last year? CURTIS David wrote: Greetings, I am a member of RE: [Zope] (no subject) This is a job for __bobo_traverse__ (yes, I know, unlikely name, but what has now become Zope used to be named Bobo). Without using __bobo_traverse__, which is defined as a method on the object which you access via traversal, you can't easily use "extra" URL elements as parameters to pass to the RE: [Zope] (no subject) Thanks for responding so quickly. I'm not sure I understand. The problem here, and the reason I can't simply use a form or a session, is that I want to set a series of links that send different options to the same method. I guess it's the equivalent of passing args to a dtml method RE: [Zope] Newbie: Zope a webserver? Serving PHP and Perl Lucas, If you don't know of a reason you would need Apache, you don't need it. :-) Zope does not directly handle PHP tags. -Original Message- From: Lucas Young (c) [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 13, 2000 6:44 PM To: '[EMAIL PROTECTED]' Subject: [Zope] Newbie: Zope a RE: [Zope] Ho do you access parent's parent folders? Try, dtml-var "Sub1.My_Qry()" If you need to pass arguments to My_Qry: dtml-var "Sub1.My_Qry(arg1='val1', arg2='val2')" Don't worry, it only gets worse. :-) -Original Message- From: danchik [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 13, 2000 10:01 PM To: [EMAIL PROTECTED] Re: [Zope] ZCatalog Jon Re: [Zope] ZCatalog Jonathan Desp wrote: Hi Chris, thanks alot for your help, You said: dtml-var title You would replace it with: a href="dtml-var "catalog.getpath(data_record_id_)"" dtml-var title But there is no dtml-var title I think it's the right file "Report" though, he said: Re: [Zope] ZCatalog Jonathan, Please respond to the list as well as to me so others can benefit. What's happening here is that your catalog is named "s". I should have noticed this the first time around. But I didn't. The bit you want is: a href="dtml-var "s.getpath(data_record_id_)"" dtml-var title Whether RE: [Zope] ZCatalog Jonathan, See -Original Message- From: Jonathan Desp [mailto:[EMAIL PROTECTED]] Sent: Monday, July 17, 2000 4:38 AM To: Chris McDonough; [EMAIL PROTECTED] Subject: Re: [Zope] ZCatalog Hi Chris, If I type " Re: [Zope] Writing a Zope Help System There is also a file in the Zope distribution in $SOFTWARE_HOME/docs/HELPSYS.txt that I think is up-to-date. ethan mindlace fremen wrote: "J. Atwood" wrote: Has anyone posted a help on writing Zope help into your product for 2.2? Docs Wiki: RE: [Zope] Bi-directional update of Data.fs If you're doing little or nothing in the way of Python development in base classes (e.g. you're doing all of your development in the instance or in ZClasses), you may want to take a look at ZEO (). Setting up the ZEO "storage server" overseas and using a local RE: [Zope] Bi-directional update of Data.fs Perhaps. Patches accepted :-) -Original Message- From: Chris Withers [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 19, 2000 5:27 AM To: Chris McDonough Cc: 'Brenton Bills'; [EMAIL PROTECTED] Subject: Re: [Zope] Bi-directional update of Data.fs Chris McDonough wrote RE: [Zope] Bi-directional update of Data.fs Actually, there is a proposal on the table for something like this in a Wiki I can't find going by the name of "QuorumBasedReplication" -Original Message----- From: Chris McDonough Sent: Wednesday, July 19, 2000 9:51 AM To: 'Chris Withers'; Chris McDonough Cc: 'Brenton Bill RE: [Zope] looping through objectValues, how to get methods? days_mixing = getattr(i, 'mixing_for') a = days_mixing() -Original Message- From: ed colmar [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 19, 2000 11:09 AM To: [EMAIL PROTECTED] Subject: [Zope] looping through objectValues, how to get methods? I have a method that looks RE: [Zope] Changing my session identity In dtml: raise Unauthorized You are unauthorized. /raise If you enter a new valid username/password combo in, you'll be validated and your identity will be changed. If you cancel or enter an invalid username/password combo, you'll still be logged in as whomever you started with. RE: [Zope] Bi-directional update of Data.fs Hammersmith [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 19, 2000 1:50 PM To: Chris McDonough; [EMAIL PROTECTED] Subject: Re: [Zope] Bi-directional update of Data.fs If you manage to find it, would you post a link to it? Thanks. -Otto. Chris RE: [Zope] Changing my session identity No, unfortunately, you need to stop and restart the browser. -Original Message- From: Jim Washington [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 20, 2000 10:40 AM To: Chris McDonough Cc: [EMAIL PROTECTED] Subject: Re: [Zope] Changing my session identity How does one become RE: [Zope] URL quoting in python I often create an external method for this... em: def url_quote(s): import urllib return urllib.quote_plus(s, safe='') Silly, but it works. I think the alternative is to hack the DT_Util.py module in the DocumentTemplate directory to expose urllib or a derived function. -Original RE: [Zope] Infoworld Review of Zope No. He got it wrong. ZEO is open-sourced, free, and available for download and has been since ~ a month ago. Write to the InfoWorld guy and tell him. :-) -Original Message- From: Brad Clements [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 20, 2000 1:46 PM To: [EMAIL PROTECTED] [Zope] Product Developer's Guide just going to rip it off wholesale, we'll certainly ask your permission to use the content, and you'll be the decider. Tks! Chris McDonough Digital Creations Publishers of Zope - ___ Zope maillist - [EMAIL PROTECTED] http RE: [Zope] A Description with a Search Engine using the advanced ZCatalog program ? The ZCatalog doesn't return the actual object that is indexed. It returns a representation of the object in the form of a "brain" which you can use to reference the object. dtml-in Catalog dtml-with sequence-item dtml-var "Catalog.getobject(data_record_id_).myMethod()"br RE: [Zope] URL quoting in python Didn't happen for me (Zope 2.2b4). I got Invalid attribute name, "url_quote", for tag dtml-call "REQUEST.set('URL', URL2+'?action=Add Material Infoproduct_number='+product_number)" url_quote, on line 195 of index_html It also fails for dtml-return... It looks like url_quote is RE: [Zope] ZCatalog dynamic sites Dimitris, Yes, ZCatalog cannot index methods which require call arguments. Pages generated from SQL data either use "brains" of SQL methods or squery string arguments of a DTML method, and therefore need to be passed arguments and cannot be cataloged. -Original Message- From: [EMAIL RE: [Zope] Zope-killer: zSQL method that crashes Zope If you haven't added your problems to the Collector on Zope.org, it would be very good to do so... it doesn't seem that anybody from the community is coming up with a fix and a lot of folks from DC out at the O'Reilly open source convention... putting this in the Collector ensures that it'll get RE: [Zope] request for advice Ste: RE: [Zope] zope.org down The InterbaseStorage product is full-featured (undo, versioning). But I've gotten little response to releasing it, and I don't think anyone is using it, so bugs are sure to exist. -Original Message- From: ethan mindlace fremen [mailto:[EMAIL PROTECTED]] Sent: Monday, July 24, 2000 RE: [Zope] zope.org down Withers [mailto:[EMAIL PROTECTED]] Sent: Monday, July 24, 2000 11:34 AM To: Chris McDonough Cc: Ethan Fremen; Cary O'Brien; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [Zope] zope.org down Chris McDonough wrote: The InterbaseStorage product is full-featured (undo, versioning Re: [Zope] user permissions No, that should do it. Re: [Zope] zeo and rdb backend I think it'd be great if you wrote something up about using ZEO in general, myself... "Bak @ kedai" wrote: On Mon, 24 Jul 2000, [EMAIL PROTECTED] wrote: followup on my problem i just need to give permission to both machine to access the database. after that, restart zope and everything is RE: [Zope] user permissions I've never heard of anything like this. What roles does "Mike" have? What *does* show up in the Contents screen for "Mike"? -Original Message- From: J. Michael Mc Kay [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 25, 2000 10:02 AM To: Chris McDonough; josh on RE: [Zope] namespace and PARENTS doubt Untested: dtml-let level1="_.getitem(PARENTS[1], 'folder1')" level2="_.getitem(level1, 'folder')" dtml-with level2 ...commands.. /dtml-with /dtml-let -Original Message- From: Fabio Akita [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 25, 2000 5:46 PM To: [EMAIL PROTECTED] Re: [Zope] Problem with ZCatalog output and SiteAccess (with workaround) Marcin, Can you post this problem in to the Collector?. I think there's a simple fix to make ZCatalog play nicely with Site Access, and if it's in the collector, we won't forget about it. Marcin Kasperski wrote: In short: ZCatalog getpath method [Zope] Re: display of SQL request answer Vincent, This may be helpful: Also, this question is more suited for the main Zope mail list ([EMAIL PROTECTED])... I've moved it there as a result. Vincent DELHOMMOIS wrote: Hi, I am using the Z ODBC DA connexion to [Zope] Re: Problem Anvita, JavaScript is inlined in a DTML method just like it would be inside a file on a filesystem. Because JavaScript runs on the client, you just need to make sure that you return it somehow in the response to the client. There is no "magic" to doing this... as a simple example: - create a RE: [Zope] Zope Sybase DA Zope 2.2 What's the problem? Does it not work? -Original Message- From: Stephen Nosal [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 26, 2000 10:00 AM To: [EMAIL PROTECTED] Subject: [Zope] Zope Sybase DA Zope 2.2 Folks - Anyone have any info or pointers running the Zope Sybase DA RE: [Zope] problem with dtml-in and Zope 2.2 First of all, make sure you don't try to define classes that should be persistent in an external method... it wont work the way you expect it to. Second (untested): def getRecords(self): """ """ class record: __allow_access_to_unprotected_subobjects__ = 1 # this may be RE: [Zope] Question Lionel, A couple of ground rules first: please dont post HTML to the list or post messages marked "importance: high" to the list. Errr.. after reading your question, I've finally come to grips with the fact that I have no idea what you're asking. Sorry! Please explain more. -Original RE: [Zope] Who is uid 506? The reason the files are owned by 506 is an artifact of the way the RPM was packaged. Either untar and install the source as a "normal" user or maybe contact the maintainer of the RPM and see if this installation behavior is intentional (I imagine it is). -Original Message- From: RE: [Zope] Can multiple processes access a ZODB3 file? The RE: [Zope] Can multiple processes access a ZODB3 file? Sorry about this, mail server troubles. -Original Message- From: Chris McDonough [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 29, 2000 1:12 AM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: [Zope] Can multiple processes access a ZODB3 file? The ZODB is generally RE: [Zope] What is the best method to enter more attributes about DTL Document? There's not a particularly obvious solution other than to define a ZClass which inherits from DTML Document and exposes a constructor form that asks for these properties as well as an edit form that does same. See the ZClass tutorial on Zope.org at
https://www.mail-archive.com/search?l=zope@zope.org&q=from:%22Chris+McDonough%22
CC-MAIN-2017-47
refinedweb
4,676
61.97
Update: thanks to Bill for catching that VB doesn't show snippet shortcuts in the statement completion. I've updated the VB picture below to better illustrate what is going on. Also, check out Bill's post, as he talks about using the '?' to insert snippets. This is probably a much better tip than the previous two. Code Snippets have the support to be given a "shortcut", usually an abbreviated version of the code snippet name that you can type into the editor and hit tab to insert. To insert, simply type in the name of the snippet, e.g. "for", then hit tab. Note that if statement completion is open, you'll have to hit tab twice to insert the snippet. In both Visual Studio 2005 and 2008, you will be able to see C# Code Snippet shortcuts in the Statement Completion window. Below is the for snippet displayed within the Statement Completion window. Note the snippet icon to the left. In Visual Studio 2008, you won't see VB snippets in the statement completion window, but you will see a note in the tooltip when you can hit tab twice to insert the corresponding snippet. VB does NOT display snippets in the statement completion window, it only displays namespaces, types, members and Keywords. Also note that with VB you cannot insert a snippet by typing it's name and hitting tab if the shortcut is a substring of anything that displays in the completion window. (you could in 2005, but this was broken intentionally for 2008) Sara Ford writes about inserting snippets in VB and C#. Unfortunately, Sara has got it quite right. In All code snippets are found in the Code Snippet Manager. It is found at Tools - Code Snippet Manager All code snippets are found in the Code Snippet Manager. It is found at Tools - Code Snippet Manager. Trademarks | Privacy Statement
http://blogs.msdn.com/saraford/archive/2007/12/12/did-you-know-you-can-insert-a-code-snippet-via-its-shortcut-keyword.aspx
crawl-002
refinedweb
315
73.47
Hi all I am new to Visual c++2008 sp1 as well as to this forum.I just downloaded it yesterday and tried to give it a shot.So I ran a program but the output it shows is in nor relation with the program.The file is: and the output is like:and the output is like:Code:#include<iostream> #include "stdafx.h" using namespace std; int main() { int i; system("cls"); cout<<"\n Enter the value of i="; cin>>i; cout<<"\n Result="<<i; system("pause"); return 0; } Enter the value of i4 i=4Press any key to continue.......... As you can see this is not the correct output of the program.Please help!!!
https://cboard.cprogramming.com/windows-programming/138948-cant-understand-outout.html
CC-MAIN-2017-26
refinedweb
116
71.65
We are moving our product’s OS from RedHat 5 to 6, as well as new version of ‘gcc’ (4.X) along with RH6. To port the existing code to RH6 with new compiler, there might be a lot of things we need to care. This post gives a brief summary for the issue during our trial and hopefully would be updated timely. May it help:) 1. C++ header file include #include <iostream.h> -> #include <iostream> #include <typeinfo.h> -> #include <typeinfo> #include <list.h> -> #include <list> #include “poll.h” -> #include <poll.h> #include “fcntl.h” -> #include <fcntl.h> a. All the standard C++ header file need to omit “.h”; b. Standard C header file could have both format: #include <stdio.h> OR #include <cstdio> NOT #include “stdio.h” 2. SCTP library libsctp.a -> -lsctp RH 6 does not support static lib of SCTP. Should be dynamically linked. 3. SCTP struct/API sctp_adaption_layer_event -> sctp_adaptation_layer_event SCTP_ADAPTION_INDICATION -> SCTP_ADAPTATION_INDICATION sctp_connectx(int, sockaddr*, int) -> sctp_connectx(int, sockaddr*, int, sctp_assoc_t*) a. Member name updated in structure sctp_event_subscribe b. Member name updated in enum sctp_sn_type c. New argument updated in function sctp_connectx 4. Linux Kernel API extern struct net_device *dev_get_by_name( const char *name) -> extern struct net_devide *dev_get_by_name( struct net *net, const char *name).
https://davejingtian.org/2012/02/19/redhat-6-porting-code-to-rh6/
CC-MAIN-2018-43
refinedweb
206
63.05
Red Hat Bugzilla – Bug 244695 syntax error in include/asm/page.h? Last modified: 2007-11-30 17:12:07 EST Trying to compile the VMware modules with 2.6.21-1.3223.fc8, I get: include/asm/page.h: In function 'pte_t native_make_pte(long unsigned int)': include/asm/page.h:112: error: expected primary-expression before ')' token include/asm/page.h:112: error: expected ';' before '{' token include/asm/page.h:112: error: expected primary-expression before '.' token include/asm/page.h:112: error: expected `;' before '}' token Note that this particular file is being compiled in C++ mode, not C mode. The function in question is: static inline pte_t native_make_pte(unsigned long val) { return (pte_t) { .pte_low = val }; } I made the problem go away by changing it to this: static inline pte_t native_make_pte(unsigned long val) { pte_t ret; ret.pte_low = val; return ret; /* return (pte_t) { .pte_low = val }; */ } I can't claim to understand the niceties of C++ syntax enough to understand why the C++ compiler didn't like the previous syntax, nor do I know whether this is a problem with the header file or a problem with g++ (gcc-c++-4.1.2-13 is what I've got), so I'm making a best guess and filing under kernel. Please reassign if appropriate. *** Bug 244696 has been marked as a duplicate of this bug. *** This is a vmware problem, they need to change their code. Kernel headers have never supported c++ compilation, and never will AFAICT.
https://bugzilla.redhat.com/show_bug.cgi?id=244695
CC-MAIN-2017-04
refinedweb
247
59.5
Can There Be a Non-US Internet? samzenpus posted about a year ago | from the new-management dept. . (5, Funny) JamesRing (1789222) | about a year ago | (#44956413) Re:Oblig. (5, Insightful) TheRon6 (929989) | about a year ago | (#44956435) Re:Oblig. (1) JamesRing (1789222) | about a year ago | (#44956471) Re:Oblig. (0) Anonymous Coward | about a year ago | (#44956759) This is the only way for US to win, legalize free-market gambling! Brazilians? (1) Anonymous Coward | about a year ago | (#44956429) How about the entire world. Different Governments have Different Issues (5, Insightful) billstewart (78916) | about a year ago | (#44957055). Technically yes; practically unlikely (4, Insightful) YttriumOxide (837412) | about a year ago | (#44956431) Actually... (0) Anonymous Coward | about a year ago | (#44956491) Short of a new network protocol you might have issues getting the IP blocks for international routing. The only way I can see it happening is during the migration to IPv6 and only if either the world unanimously votes to start their own equivalent of IANA allows current non-US blocks to remain allocated without paying a second time (perhaps simply paying their next renewal fee to the Internationalized replacement to 'port over') and formally choosing to disconnect from the US portion of the internet in order to avoid any segmentation caused by US routing tables disagreeing on IPv6 address ownership. Personally however I think skipping over IPv6 and adding some 'forwards compatible' region address blocks to the protocol to better handle future networking needs (notably for offering an easier way to avoid 'namespace pollution' by seperating the networks into regions based off a numerical 'country id', and perhaps eventually even a 'celestial body' id would go a long ways towards avoiding another IPv4 style migration when we begin approaching the new networks limitations in what will probably turn out to be the forseeable future.) Re:Actually... (1) phantomfive (622387) | about a year ago | (#44956547)). Re:Actually... (0) Anonymous Coward | about a year ago | (#44956839) Except it has little to do with namespacing and addressing. The network topology of the Internet run a lot non-US Internet traffic through the US. (See the Snowden Powerpoints.) To fix that you need to start laying fiber. Amazon.*** namespaces (1) billstewart (78916) | about a year ago | (#44957019):Technically yes; practically unlikely (5, Interesting) khasim (1285) | about a year ago | (#44956505) (4, Insightful) Anonymous Coward | about a year ago | (#44956915) It's quite amazing how many commercial entities get by just fine by never having any dealings with the US at all. Re:Technically yes; practically unlikely (0) 93 Escort Wagon (326346) | about a year ago | (#44957005) Yeah - look at Nokia for instance! Re:Technically yes; practically unlikely (0) Anonymous Coward | about a year ago | (#44956973) Technically or otherwise it is quite possible. The Internet was designed to be distributed and fault tolerant. The two main things that put the Internet in the hands of the US is the ICANN, the cables under the control of the US entities, the rest are more or less artificial. Re:Technically yes; practically unlikely (2) flyingfsck (986395) | about a year ago | (#44957077) National DNS roots (2) Animats (122034) | about a year ago | (#44956437) The day may be approaching when some countries will have their own DNS roots and root servers. That's been threatened before, but now it's more likely to happen. Re:National DNS roots (1) Anonymous Coward | about a year ago | (#44956715) That's how the internet has always worked. yes (0) Anonymous Coward | about a year ago | (#44956453) anything can be non-us based what's stopping them from building an internet 2.0 stack? financial resources, technical ingenuity and will power are all that is needed Re:yes (1) Cryacin (657549) | about a year ago | (#44956985) No (2) symbolset (646467) | about a year ago | (#44956467) Re:No (1) sjames (1099) | about a year ago | (#44956489) Not even nuclear mines? Re:No (-1) Anonymous Coward | about a year ago | (#44956581) I'd expect a less idiotic comment from someone with such a low UID. But alas... Re:No (1) sjames (1099) | about a year ago | (#44956735):No (0) Anonymous Coward | about a year ago | (#44956787) Said determination would destroy the lines on its own, thus defeating its own purpose given that the submarine could be autonomous. Re:No (0) sjames (1099) | about a year ago | (#44956935) of course, there couldn't be anything like cameras to catch a party red handed, a mine to create evidence, or an encrypted channel. That would be so beyond anyone's capability. Re:No (1) philip.paradis (2580427) | about a year ago | (#44956903):No (1) sjames (1099) | about a year ago | (#44956947) Why ironic? Re:No (2, Interesting) Anonymous Coward | about a year ago | (#44956509). Study Cryptography kiddies, this is only the beginning of the arms race. Re:No (1) wooferhound (546132) | about a year ago | (#44956613) Re:No (2) symbolset (646467) | about a year ago | (#44956901) - theoretically possible but forever suspect. The NSA has some rather special people in the field and has poisoned the pool of available art. All of this is assuming they can't compromise or sniff the signal out of either end, which is probably the easiest route. You can't slant drill a conduit all the way across the Atlantic, and if you could the first good earthquake would cut your line. I am sticking with "not practical with available systems and materials." Maybe one day, with entangled neutrinos or something. Re:No (0) Anonymous Coward | about a year ago | (#44956515) Quantum encryption maybe? Chances are that encrypted, distributed P2P networks will become more common, which may impact on the larger businesses. Re:No (0) Anonymous Coward | about a year ago | (#44956571) Re:No (0) Anonymous Coward | about a year ago | (#44956599) That's what end-to-end encryption is for. WTF is the point? (5, Insightful) Anonymous Coward | about a year ago | (#44956475):WTF is the point? (-1) Anonymous Coward | about a year ago | (#44956623) The problem with the US is not just the resources, it's the pussy-ass attitude of spending all of those resources internationally on humanitarian and police actions. Those are freaking EXPENSIVE. Bombing the shit out of any piss-ant country who challenged the US would have been much cheaper. Take away 100% of US humanitarian aid to foreign countries and 100% US military expenditure on defense or police action on foreign issues and that would save about a half a trillion dollars a year. And what would be lost? I don't know, every other country in the world manages to survive without spending a trillion dollars on foreign policy. If other countries want to bitch about US involvement, go ahead, stand on your own. Re:WTF is the point? (-1) Anonymous Coward | about a year ago | (#44956861) You're thinking is outdated. The US isn't supporting US interests, multinational capitalism needs an army and we had one standing around. Everyone else is fine with the arrangement despite their euroleft whining. Re: WTF is the point? (0) Anonymous Coward | about a year ago | (#44956699) The 1% of the U.S. that owns all the money believes these things. The other 99% have morals. The problem is that the 99% honestly feel killing is wrong. Otherwise there would be more "terrorism" in the U.S. Yes, but it won't make any difference. (5, Insightful) Eskarel (565631) | about a year ago | (#44956513):Yes, but it won't make any difference. (1) asmkm22 (1902712) | about a year ago | (#44956635) Also, and not to sound like an apologist, pretty much every other country has just as crappy government reputations for things like privacy. Re:Yes, but it won't make any difference. (1) aralin (107264) | about a year ago | (#44956677) No. Re:Yes, but it won't make any difference. (1) Anonymous Coward | about a year ago | (#44956705) Re:Yes, but it won't make any difference. (2) stenvar (2789879) | about a year ago | (#44956827) I have. The EU laws on privacy laws have huge holes and exemptions in them for national security and other shenanigans. And even if they weren't, there is no guarantee that they are enforced either. Re:Yes, but it won't make any difference. (4, Insightful) Anonymous Coward | about a year ago | (#44956747):Yes, but it won't make any difference. (0) Anonymous Coward | about a year ago | (#44956765) Hell....#2 should be war not ear =/ Re:Yes, but it won't make any difference. (1) antifoidulus (807088) | about a year ago | (#44956831) Re:Yes, but it won't make any difference. (3, Interesting) stenvar (2789879) | about a year ago | (#44956835):Yes, but it won't make any difference. (4, Insightful) Dahamma (304068) | about a year ago | (#44956669). (0) Anonymous Coward | about a year ago | (#44957089) There is exactly one undersea cable that connects South America to the rest of the world that doesn't go through the US. Re:Yes, but it won't make any difference. (2) Rantank (635713) | about a year ago | (#44956767) In the short term the Chinese have banned the purchase of American networking hardware, and instead requires people to buy Chinese or if that's not available to buy European. In the long term, China has a history of putting it's money where it's mouth is when it comes to fixing situations it doesn't like. Tricks will only work once against China, after that they start working on a solution to prevent it ever happening again. It may take them years but expect that to occur with the internet too. I don't know if the American government was naive or incompetent but they only have themselves to blame for how the world evolves the internet because of this. In the end we've lost something that may never have existed in the first place, but we lost it all the same. Thanks America... thanks for nothing.... talk about an own goal... Re:Yes, but it won't make any difference. (2) SuricouRaven (1897204) | about a year ago | (#44956975):Yes, but it won't make any difference. (1) Eskarel (565631) | about a year ago | (#44957041) terms of what it can prosecute you for. China is not, and has already hacked services to get the personal information of people who have "wrong" opinions and then arrested those individuals. My fucking god I'm getting sick of this idea that China and Russia are good guys who don't oppress their people like the evil US does. The US is only bush league evil, China and Russia are major league. Re:Yes, but it won't make any difference. (2) Benaiah (851593) | about a year ago | (#44956815) Re:Yes, but it won't make any difference. (2) jandersen (462034) | about a year ago | (#44956885) .. directly to Europe and cut the one running to the US, would not even notice the difference. Re:Yes, but it won't make any difference. (4, Insightful) Eskarel (565631) | about a year ago | (#44957013) For the purposes of this argument any service which has any physical presence in the US whatsoever is a service based in the US. All such companies are required to comply with US law, which would include FISA warrants. That's the tricky bit you see. Re:Yes, but it won't make any difference. (1) Eskarel (565631) | about a year ago | (#44957047) As another point, Google no longer have operations in China for the specific reason that having any offices there subjected them to Chinese law. Can There Be a Non-US Internet? (0) Anonymous Coward | about a year ago | (#44956531) Re:Can There Be a Non-US Internet? (1) Anonymous Coward | about a year ago | (#44956691) No, I heard it was 10" of solid rebar. No escape from the NSA (1) AHuxley (892839) | about a year ago | (#44956533) wireless, on site staff or wired links. Water, gas, electrical, public/private medical billing, emergency services, transportation, police/jail/legal/gov... everything that a skilled outside spy agency 'needs' to track domestic patterns and target individuals. Such an air gapped national system running domestic code would suggest to the US needs CIA/special forces teams 'on site' for long term database entry in the future. An epic nation building boondoggle for domestic hardware supplies, skilled coders, telcos, engineers and private security firms. The most important aspect the US seemed to have wanted to shape was standards of crypto, OS and database backends per nation. To be decoded and readable from the USA as needed with limited US or local staff 'knowing'. So you need your own file system, own OS, own database, own crypto and understanding that all wider national and international networks are a constant threat. Is your country any safer from the NSA and CIA/special forces teams on the ground than say the Soviet Union was? No, but the per site cost just went way up. Re:No escape from the NSA (0) Anonymous Coward | about a year ago | (#44956637) No escape ? Your perspective is rather limited, as, it seems, your imagination also is. People thought there was "no escape" from the Nazis too, and look what happened to them. When enough people get fed up, all manner of change can happen. You should study more history, there is much to be learned from it. / Re:No escape from the NSA (1) AHuxley (892839) | about a year ago | (#44956723) political leaders where happy to let their national networks be reduced to junk status after the 1960's. Not a technical problem .... (0) Anonymous Coward | about a year ago | (#44956539) This isn't really a technical issue. Of course a non-US "Internet" can exist - at heart the internet is just a huge network of computers. The real issue is content. What exactly would a Brazilian internet offer that would interest people in Sweden, the UK or Japan? Or for that matter, people in Brazil? The US isn't just the predominant force on the internet for technical reasons, although they certainly help. The US probably have the world's largest group of creative people, and the websites and services they create are in English, the only real international language right now. Big business has such a grip on popular web sites and services that it's easy to forget that many of the most popular sites today were started by a handful of people who had a good idea - like Google, Facebook and Yahoo. Without good content and services, a non-US internet wouldn't get any visitors - it would be greatly reduced in value from what we have today. It's not impossible - the ability of other countries to ignore US software patents would be extremely useful - but it would take a number of years for the alternative internet to reach the level of usefulness that we have today. Is there enough incentive for companies and people to rebuild the internet from scratch? Re:Not a technical problem .... (1) durin (72931) | about a year ago | (#44956661) The onslaught of marketing from the (currently) big sites in the US has actually helped to kill off quite a few sites in other countries. Many of those sites offered the same thing as the big US sites, and predated them by a few years, but were mostly limited to the local spoken language. As for the "US probably have the world's largest group of creative people", I'd like some of what you're smoking. Re:Not a technical problem .... (0) Anonymous Coward | about a year ago | (#44956871) The problem is that this kind of "news" is the same kind of bs propaganda Americans have to deal with everyday. Brazil is definitely not trying to block US services or itself from the rest of the world. It's mostly trying to use the human and national rights card to bring servers, services and infrastructure to the country. And doing so by protecting it's citizens rights and holding the companies accountable, at the same time that they protect national resources. Google and Facebook won't quit a free country with 200 million people just because they will have to spend some money abroad. Specially if you consider that Brazil is in the top countries for their services. On a different subject, some of the things that are not being discussed in US or in the English speaking internet and actually matters (is true) is how US companies did strategic planning for previous governments (before Lula) that included privatizing communications, oil, energy, etc and having an actual american spy center in Brasília. Our previous governments were part of the American system, all that is coming out and Brazil has been asking for full disclosure so that we can know who is working for whom. I do agree with you, ignoring patents would bring huge advancements all around the world, and even more in US if they were willing to do the same with their own patents (cause they already do with others patents). Why do we keep discussing this... (4, Insightful) geekmux (1040042) | about a year ago | (#44956551) ..:Why do we keep discussing this... (2) AHuxley (892839) | about a year ago | (#44956611) deal with the USA to be allowed to. Re:Why do we keep discussing this... (0) Anonymous Coward | about a year ago | (#44956733) Hell, what do you think the Russian government is paying Snowden for right now? It isn't just to embarrass us. Re:Why do we keep discussing this... (4, Insightful) LordLucless (582312) | about a year ago | (#44956879) ..:Why do we keep discussing this... (0) Anonymous Coward | about a year ago | (#44956981) ...as if the United States was the first, last, and only country to hold a government that spies on its own citizens in some way? Argumentum ad hominem tu quoque. Re:Why do we keep discussing this... (1) gmuslera (3436) | about a year ago | (#44957001) Remember when? (2) EzInKy (115248) | about a year ago | (#44956557) (2) phantomfive (622387) | about a year ago | (#44956567):in reality (1) hyades1 (1149581) | about a year ago | (#44956807) another country, or convict somebody in a US court and demand their extradition. Re:in reality (1) phantomfive (622387) | about a year ago | (#44957093) (2, Insightful) vikingpower (768921) | about a year ago | (#44956685) PHP & MySQL (0) Max_W (812974) | about a year ago | (#44956687) Re:PHP & MySQL (1) worf_mo (193770) | about a year ago | (#44956967) Hey now, no need to put the rest of the world in such a bad light! Re:PHP & MySQL (1) Max_W (812974) | about a year ago | (#44957051) That is not what they declared (5, Informative) Anonymous Coward | about a year ago | (#44956689). Re:That is not what they declared (0) Anonymous Coward | about a year ago | (#44956753) "they are planning to offer alternatives for people who care" I was reffering to the nacional mail service starting an email service. Just notice I wasn't clear. I find very bad the press is giving this kind of twist, like the Brazilian government is turning Iranian or Chinese. We are fighting for human rights, not against them (and keeping things the way they are is against human rights). This balkanization thing that's going around is the same kind of bs propaganda you guys have to deal with everyday. Be aware and take care. Yes (0) Anonymous Coward | about a year ago | (#44956707) Pssst, Ever heard about China? mod Up (-1) Anonymous Coward | about a year ago | (#44956709) WWW (0) Max_W (812974) | about a year ago | (#44956717) Otherwise we would have several Internets: a Microsoft Internet, Apple Internet, IBM Internet, etc. Geneva is an international city and the CERN is an international project. Re:WWW (4, Informative) drwho (4190) | about a year ago | (#44956771) There Internet (Arpanet) existed before WWW. WWW is a subset of the Internet. Re:WWW (2) Max_W (812974) | about a year ago | (#44956841) to the world. It is not. We thought that the US government is playing a positive role for the Internet. Until E.S. revealed what is really going on. Instead of working together with other governments to fight spam, cyber crime, etc. it all came down to the total carpet spying on us, to creating back-doors. It is not nice at all. Re:WWW (4, Informative) Dynedain (141758) | about a year ago | (#44956961):WWW (1) Max_W (812974) | about a year ago | (#44957015) By the way, the actual invention was done not by a programmer but by the an engineer who was doing the real work. Re:WWW (2, Interesting) Bogtha (906264) | about a year ago | (#44956951) Internet. Something can be on the WWW and not on the Internet and vice-versa. Re:WWW (1) simonbp (412489) | about a year ago | (#44956931) are in the US. Then, mainly US companies took that university network and popularized it. So, it's very much the fault of the US university system that the internet is so open. Re:WWW (1) simonbp (412489) | about a year ago | (#44956937) *word Re:WWW (1) Max_W (812974) | about a year ago | (#44957045):WWW (1) DNS-and-BIND (461968) | about a year ago | (#44957085) Then it wouldn't be the Internet; duh (0) drwho (4190) | about a year ago | (#44956763) It's not the Internet without the USA. Sure, take and do what you want, filter all and so forth, but once you disconnect the USA, in its entirety, from your little country's network then it is not the Internet. I am not saying this to condone or damn NSA surveillance; I am just stating the facts. Re:Then it wouldn't be the Internet; duh (1) Max_W (812974) | about a year ago | (#44956789):Then it wouldn't be the Internet; duh (0) Anonymous Coward | about a year ago | (#44956837) did the USA actually sign up to the Universal Declaration of Human Rights? There are a good number of international treaties that the US has not signed. If I remember correctly, the US got away with Gitmo was because they hadn't signed that treaty. If the UN wants to take a stand may I humbly suggest that the up-sticks and leave NYC. I am sure Brazil (as well as a host of other countries) would welcome them. Re:Then it wouldn't be the Internet; duh (1) symbolset (646467) | about a year ago | (#44956929) Can I attach my puke to an e-mail to Brazil? (0) Anonymous Coward | about a year ago | (#44956773) Hypocrisy, Latin style. As if Brazil's spy agencies weren't using the Web to spy on other countries. The "no-content internet" (0) Anonymous Coward | about a year ago | (#44956809) The WWW has been around for at least 20 years. Other countries have had plenty of opportunities to create amazing websites, internet service etc. While there are all kinds of great English-language websites in other countries (like the BBC), well over 80% of popular English-language internet sites were created by US people and companies. So we can pretend that everybody else in the world is suddenly going to get creative and entrepreneurial, but they have already had 20 years to do it. Why would anything change now? If the US internet went dark, almost nobody would know how to find an alternate search engine, and everyone would be clamoring for their Facebook fix ... Disclaimer: I am not from the USA and I dislike the internet being so US-centric, but it is what it is - I'm not about to start denying reality. Mod me into oblivion if you so wish. It doesn't really matter... (1) theNAM666 (179776) | about a year ago | (#44956881) Because the NSA is still going to p0wn your routers. And find a way to get the data home. Done. I still use a remainder of a non-US internet (1) dbIII (701233) | about a year ago | (#44956899)
http://beta.slashdot.org/story/192109
CC-MAIN-2014-41
refinedweb
3,980
70.53
When. Table of Contents What is Bypass? Bypass is described as “a quick way to create a custom plug that can be put in place instead of an actual HTTP server to return prebaked responses to client requests.” What does that mean? Under-the-hood Bypass is an OTP application that masquerades as an external server listening for and responding to requests. By responding with pre-defined responses we can test any number of possibilities like unexpected service outages and errors along with the expected scenarios we’ll encounter, all without making a single external request. Using Bypass To better illustrate the features of Bypass we’ll be building a simple utility application to ping a list of domains and ensure they’re online. To do this we’ll create new supervisor project and a GenServer to check the domains on a configurable interval. By leveraging Bypass in our tests we’ll be able to verify our application will work in many different outcomes. Note: If you wish to skip ahead to the final code, head over to the Elixir School repo Clinic and have a look. By this point we should be comfortable creating new Mix projects and adding our dependencies so we’ll focus instead of the pieces of code we’ll be testing. If you do need a quick refresher, refer to the New Projects section of our Mix lesson. Let’s start by creating a new module that will handle making the requests to our domains. With HTTPoison let’s create a function, ping/1, that takes a URL and returns {:ok, body} for HTTP 200 requests and {:error, reason} for all others: defmodule Clinic.HealthCheck do def ping(urls) when is_list(urls), do: Enum.map(urls, &ping/1) def ping(url) do url |> HTTPoison.get() |> response() end defp response({:ok, %{status_code: 200, body: body}}), do: {:ok, body} defp response({:ok, %{status_code: status_code}}), do: {:error, "HTTP Status #{status_code}"} defp response({:error, %{reason: reason}}), do: {:error, reason} end You’ll notice we are not making a GenServer and that’s for good reason: By separating our functionality (and concerns) from the GenServer, we are able to test our code without the added hurdle of concurrency. With our code in place we need to start on our tests. Before we can use Bypass we’ll need to ensure it’s running. To do that, let’s update test/test_helper.exs look like this: ExUnit.start() Application.ensure_all_started(:bypass) Now that we know Bypass will be running during our tests let’s head over to test/clinic/health_check_test.exs and finish our setup. To prepare Bypass for accepting requests we need to open the connect with Bypass.open/1, which can be done in our test setup callback: defmodule Clinic.HealthCheckTests do use ExUnit.Case setup do bypass = Bypass.open() {:ok, bypass: bypass} end end For now we’ll rely on Bypass using it’s default port but if we needed to change it (which we’ll be doing in a later section), we can supply Bypass.open/1 with the :port option and a value like Bypass.open(port: 1337). Now we’re ready to put Bypass to work. We’ll start with a successful request first: defmodule Clinic.HealthCheckTests do use ExUnit.Case alias Clinic.HealthCheck setup do bypass = Bypass.open() {:ok, bypass: bypass} end test "request with HTTP 200 response", %{bypass: bypass} do Bypass.expect(bypass, fn conn -> Plug.Conn.resp(conn, 200, "pong") end) assert {:ok, "pong"} = HealthCheck.ping("{bypass.port}") end end Our test is simple enough and if we run it we’ll see it passes but let’s dig in and see what each portion is doing. The first thing we see in our test is the Bypass.expect/2 function: Bypass.expect(bypass, fn conn -> Plug.Conn.resp(conn, 200, "pong") end) Bypass.expect/2 takes our Bypass connection and a single arity function which is expected to modify a connection and return it, this is also an opportunity to make assertions on the request to verify it’s as we expect. Let’s update our test url to include /ping and assert both the request path and HTTP method: test "request with HTTP 200 response", %{bypass: bypass} do Bypass.expect(bypass, fn conn -> assert "GET" == conn.method assert "/ping" == conn.request_path Plug.Conn.resp(conn, 200, "pong") end) assert {:ok, "pong"} = HealthCheck.ping("{bypass.port}/ping") end The last part of our test we use HealthCheck.ping/1 and assert the response is as expected, but what’s bypass.port all about? Bypass is actually listening to a local port and intercepting those requests, we’re using bypass.port to retrieve the default port since we didn’t provide one in Bypass.open/1. Next up is adding test cases for errors. We can start with a test much like our first with some minor changes: returning 500 as the status code and assert the {:error, reason} tuple is returned: test "request with HTTP 500 response", %{bypass: bypass} do Bypass.expect(bypass, fn conn -> Plug.Conn.resp(conn, 500, "Server Error") end) assert {:error, "HTTP Status 500"} = HealthCheck.ping("{bypass.port}") end There’s nothing special to this test case so let’s move on to the next: unexpected server outages. Τhese are the requests we’re most concerned with. To accomplish this we won’t be using Bypass.expect/2, instead we’re going to rely on Bypass.down/1 to shut down the connection: test "request with unexpected outage", %{bypass: bypass} do Bypass.down(bypass) assert {:error, :econnrefused} = HealthCheck.ping("{bypass.port}") end If we run our new tests we’ll see everything passes as expected! With our HealthCheck module tested we can move on to testing it together with our GenServer based-scheduler. Multiple external hosts For our project we’ll keep the scheduler barebones and rely on Process.send_after/3 to power our reoccuring checks, for more on the Process module take a look at the documentation. Our scheduler requires three options: the collection of sites, the interval of our checks, and the module that implements ping/1. By passing in our module we further decouple our functionality and our GenServer, enabling us to better test each in isolation: def init(opts) do sites = Keyword.fetch!(opts, :sites) interval = Keyword.fetch!(opts, :interval) health_check = Keyword.get(opts, :health_check, HealthCheck) Process.send_after(self(), :check, interval) {:ok, {health_check, sites}} end Now we need to define the handle_info/2 function for the :check message sent send_after/2. To keep things simple we’ll pass our sites to HealthCheck.ping/1 and log our results to either Logger.info or in the case of errors Logger.error. We’ll setup our code in a way that will enable us to improve the reporting capabilities at a later time: def handle_info(:check, {health_check, sites}) do sites |> health_check.ping() |> Enum.each(&report/1) {:noreply, {health_check, sites}} end defp report({:ok, body}), do: Logger.info(body) defp report({:error, reason}) do reason |> to_string() |> Logger.error() end As discussed we pass our sites to HealthCheck.ping/1 then iterate the results with Enum.each/2 applying our report/1 function against each. With these functions in place our scheduler is done and we can focus on testing it. We won’t focus too much on unit testing the schedulers since that won’t require Bypass, so we can skip to the final code: defmodule Clinic.SchedulerTest do use ExUnit.Case import ExUnit.CaptureLog alias Clinic.Scheduler defmodule TestCheck do def ping(_sites), do: [{:ok, "pong"}, {:error, "HTTP Status 404"}] end test "health checks are run and results logged" do opts = [health_check: TestCheck, interval: 1, sites: ["", ""]] output = capture_log(fn -> {:ok, _pid} = GenServer.start_link(Scheduler, opts) :timer.sleep(10) end) assert output =~ "pong" assert output =~ "HTTP Status 404" end end We rely on a test implementation of our health checks with TestCheck alongside CaptureLog.capture_log/1 to assert that the appropriate messages are logged. Now we have working Scheduler and HealthCheck modules, let’s write an integration test to verify everything works together. We’ll need Bypass for this test and we’ll have to handle multiple Bypass requests per test, let’s see how we do that. Remember the bypass.port from earlier? When we need to mimic multiple sites, the :port option comes in handy. As you’ve probably guessed, we can create multiple Bypass connections each with a different port, these would simulate independent sites. We’ll start by reviewing our updated test/clinic_test.exs file: defmodule ClinicTest do use ExUnit.Case import ExUnit.CaptureLog alias Clinic.Scheduler test "sites are checked and results logged" do bypass_one = Bypass.open(port: 1234) bypass_two = Bypass.open(port: 1337) Bypass.expect(bypass_one, fn conn -> Plug.Conn.resp(conn, 500, "Server Error") end) Bypass.expect(bypass_two, fn conn -> Plug.Conn.resp(conn, 200, "pong") end) opts = [interval: 1, sites: ["", ""]] output = capture_log(fn -> {:ok, _pid} = GenServer.start_link(Scheduler, opts) :timer.sleep(10) end) assert output =~ "[info] pong" assert output =~ "[error] HTTP Status 500" end end There shouldn’t be anything too surprisingly in the above test. Instead of creating a single Bypass connection in setup, we’re creating two within our test and specifying their ports as 1234 and 1337. Next we see our Bypass.expect/2 calls and finally the same code we have in SchedulerTest to start the scheduler and assert we log the appropriate messages. That’s it! We’ve built a utility to keep us informed if there’s any issues with our domains and we’ve learned how to employe Bypass to write better tests with external services. Caught a mistake or want to contribute to the lesson? Edit this page on GitHub!
https://elixirschool.com/en/lessons/libraries/bypass/
CC-MAIN-2021-25
refinedweb
1,620
58.89
Hi, First of all, it is not required to extend the class to have attributes, but if you need a subclass for some other reason, then there is a way to solve this. Simply make your class A behave as a Club class in the eyes of the framework. Meaning you will have to put attributes on the Club class for them to be available for class A. This will make ClubQuery work also. There is a .Net attribute you will have to add to class A, with the name EntityTypeOverrideAttribute, like this: [StarCommunity.Core.Modules.EntityTypeOverride(typeof(Club))] public class A : Club { } Great! Didn't know about the EntityTypeOverride, it solved everything (altough I had to transfer data from attribut of class A to matching Club attribute). The reason to extend Club was simply to handle attributes without having to know the attribute name all over the site, like a.Location instead of club.getAttributeValue<string>("attr_location")... Anyway, thanks a lot - it saved my day :) Is there any way to query custom attributes in an extended class? I have extended the Club module to a new class A, with some extra attributes. When searching for A I use ClubQuery and gets the expected result - as long as I create queries with only Club attributes (Name, Description, etc.). BUT I now want to create a query with a custom attribute that only exists in the extension (A). Of course the following error occurs: "There is no attribute with the name 'attr_location' for the type 'StarCommunity.Modules.Club.Club'." Any ideas how to solve this? Should I somehow create a custom AQuery, extending ClubQuery? How could I then force it to query type A? Or should I add the attribute to Club and somehow get/set custom attribute in base class of A?
https://world.optimizely.com/forum/legacy-forums/Episerver-Community/Thread-Container/2008/9/attribute-query/
CC-MAIN-2021-39
refinedweb
302
72.97
Issue importing multiple tasks to Appigo ToDo Hello, I'm new to Python so apologies in advance for a newbie question. I would like to create a pythonista program that can copy a list of tasks from my clipboard and pass them to either Appigo ToDo or Reminders. The clipboard data may contain: Buy lettuce Buy laundry detergent Buy tomatoes The code below appears to function for only the first task in the list stored in the clipboard. Does anyone know how I can modify this to work with Appigo Todo? Alternatively, does anyone know if there is a URL scheme to access Reminders? Thanks in advance! -jtg ---code below--- <pre>import clipboard import urllib import webbrowser todo = 'appigotodo://x-callback-url/import?name=' text = clipboard.get() tasks = text.split('\n') for index in range(len(tasks)): task = urllib.quote(tasks[index]) webbrowser.open(todo + task)</pre> I'm not really familiar with Appigo Todo, so I'm not sure if their URL scheme supports adding multiple todos in one go. What happens in your script is that as soon as you open the first URL, Pythonista exits and Appigo Todo is opened, so the script doesn't continue. That is in general how URL schemes work, you would have to find a way (if possible) to add multiple tasks in <em>one</em> URL. There is no URL scheme for Apple's built-in reminders app. Btw, there's no need to use the index in your for-loop, just write: <pre>for task in tasks: ...</pre> Thank you for the quick response OMZ! This makes sense. I think I'll inquire with Appigo regarding whether it's possible to add multiple tasks in one URL. Thanks, jtg Just realized that I had bought Appigo Todo at some point, so I've experimented a little, but it doesn't seem to be possible to add multiple tasks by opening one URL... OMZ - thanks for trying to look into this further! Viticci - thank you for sending that. It's a similar use case and might be worth checking out Due if it supports sequential tasks. Thanks! - Denrael245 Just curious; my understanding is that Reminders is at it's core iCal style calendars. Would it be possible to update entries in Reminders by approaching it that way?
https://forum.omz-software.com/topic/243/issue-importing-multiple-tasks-to-appigo-todo/3
CC-MAIN-2018-09
refinedweb
386
65.01
XOR turns out to be a bad argument. In this document I will illustrate that how a logistic regression can hold up against a support vector machine in a situation where you would expect a support vector machine to perform better. Typically logistic regression fails due to the XOR phenomenon that can occur in data, but there is a trick around it. The goal of this document is to convince you that you may need to worry more about the features that go into a model, less about which model to pick and how to tune it. For this experiment I will use python and I’ll assume that the following libraries are loaded: import numpy as np import pandas as pd import patsy from ggplot import * from sklearn.linear_model import LogisticRegression from sklearn.svm import SVC from sklearn.metrics import confusion_matrix da = np.random.multivariate_normal([1,1], [[1, 0.7],[0.7, 1]], 300) dfa = pd.DataFrame({'x1':da[:,0], 'x2': da[:,1], 'type' : 1}) db1 = np.random.multivariate_normal([3,0], [[0.2, 0],[0, 0.2]], 150) dfb1 = pd.DataFrame({'x1':db1[:,0], 'x2': db1[:,1], 'type' : 0}) db2 = np.random.multivariate_normal([0,3], [[0.2, 0],[0, 0.2]], 150) dfb2 = pd.DataFrame({'x1':db2[:,0], 'x2': db2[:,1], 'type' : 0}) df = pd.concat([dfa, dfb1, dfb2]) (ggplot(aes(x='x1', y='x2', color="type"), data=df) + geom_point() + ggtitle("sampled data")) This should show a dataset similar to this one: We’ve generated a classification problem that is impossible to split linearly. Typically we would expect the (linear) logistic regression to perform poorly here and we would expect a (non-linear) support vector machine to perform well. y,X = patsy.dmatrices("type ~ x1 + x2", df) Let’s see how both models perform now. > pred = LogisticRegression().fit(X,ravel(y)).predict(X) > confusion_matrix(y,pred) array([[223, 77], [118, 182]]) > pred = SVC().fit(X,ravel(y)).predict(X) > confusion_matrix(y, pred) array([[294, 6], [ 2, 298]]) The SVM performs much better than the LR. How might we help this? Let’s see if we can help the logistic regression out a bit. Maybe if we combine x1 and x2 into something nonlinear we may be able capture the problem in this particular dataset better. > df['x1x2'] = df['x1'] * df['x2'] > y,X = patsy.dmatrices("type ~ x1 + x2 + x1x2", df) > pred = LogisticRegression().fit(X,ravel(y)).predict(X) > confusion_matrix(y,pred) array([[290, 10], [ 3, 297]]) I am feeding different data to the logistic regression, but by combining x1 and x2 we have suddenly been able to get a non-linear classification out of a linear model. I am still using the same dataset however, which goes to show that being creative with your data features can have more of an effect than you might expect. Notice that the support vector machine doesn’t show considerable improvement when applying the same trick. > pred = SVC().fit(X,ravel(y)).predict(X) > confusion_matrix(y, pred) > array([[294, 6], [ 2, 298]]) Why is this trick so useful? You can apply more statistical theory to the regression model which is something a lot of clients (especially those who believe in econometrics) find very comforting. It is less a black box and feels like you might be better prepared for when something goes wrong. The main lesson here is, before you judge a method useless, it might be better to worry about putting useful data in it first.
https://koaning.io/posts/linear-models-solving-non-linear-problems/
CC-MAIN-2020-16
refinedweb
574
57.27
#include <CallbackThread.h> Templates specify the type of user data (C) and the type of the callback function (F). F defaults to take a std::mem_fun call on C, so that it is used with a class method, but you could just as well use a standard c-style static function. Definition at line 109 of file CallbackThread.h. List of all members. Definition at line 111 of file CallbackThread.h. false Definition at line 119 of file CallbackThread.h. Definition at line 132 of file CallbackThread.h. Definition at line 145 of file CallbackThread.h. Definition at line 156 of file CallbackThread.h. [private] don't call [protected, virtual] Reimplemented from PollThread. Definition at line 255 of file CallbackThread.h. true sets the polling frequency to p, if immediate is set then it will call interrupt() so the period takes effect on the current cycle Definition at line 159 of file CallbackThread.h. [protected] function to be called from within new thread Definition at line 257 of file CallbackThread.h. Referenced by CallbackPollThread(), poll(), and ~CallbackPollThread().
http://www.tekkotsu.org/dox/classCallbackPollThread.html
CC-MAIN-2022-33
refinedweb
177
59.6
Login.aspx File Logon.aspx is the file to which the request is redirected if ASP.NET does not find a cookie with the request. This URL was set up in the configuration file. In the following example, a form containing two text boxes (labeled E-mail Name and Password) and a Submit button is presented to the client user. The user enters the e-mail name and password, and clicks the Submit button. The code then looks for this name and password combination in an XML file located in this directory. If it is in the file, the user is connected to Default.aspx. If it is not, the AddUser.aspx file is called. To create a file to log on a user - Import the necessary namespaces. - Create a script section for the code. - Implement a Logon_Click function. - If the page is not valid, tell the user. Set up a string named cmdthat is initialized to UserEmail="MyName", where MyName is the user's e-mail name. The regular expression validator control attached to the input control has already determined that the e-mail name is formatted properly and does not contain invalid characters. - Create a new instance of the DataSet class. - Read in the XML file containing authenticated user name and password combinations. The retrieved data resides in ds, the DataSet created in the previous step.CAUTION For the sake of simplicity and the clarity of the example, the following code does not follow best design practices for security. It does not invoke any file-locking or file-sharing flags. Also, in a commercial Web site, you should use a relational database or other secure and scalable mechanism to store the list of authenticated users. - Create a new instance of a DataTable named usersthat is initialized to ds. - Check for any matches between the logon name and the list of names in Users.aspx. For each match found, record the name in a DataRow named matches.Note For the sake of simplicity, this example expects each name to be unique; therefore, only the first match found is used. - Check each of the name matches found in the previous step to see whether there is a matching password for any of them. - If a user name match is found, hash the user's password and compare it to the hash stored in the Users.xml file. DataRow row = matches[0]; string hashedpwd = FormsAuthentication.HashPasswordForStoringInConfigFile (UserPass.Value, "SHA1"); String pass = (String)row["UserPassword"]; if( 0 != String.Compare(pass, hashedpwd, false) ) // Tell the user if no password match is found. It is good // security practice give no hints about what parts of the // logon credentials are invalid. Msg.Text = "Invalid Credentials: Please try again."; else // If a password match is found, redirect the request // to the originally requested resource (Default.aspx). FormsAuthentication.RedirectFromLoginPage (UserEmail.Value, Persist.Checked); } else { // If no name matches were found, redirect the request to the // AddUser page using a Response.Redirect command. Response.Redirect("AddUser/AddUser.aspx"); } } </script> <body> - Display a form to collect the logon information. - Create a User E-mail Name text box. Add a RequiredFieldValidator control and a RegularExpressionValidator control that check for a valid e-mail name entry. The RegularExpressionValidator verifies that the e-mail address is in valid e-mail format (for example, name@contoso.com) and does not contain invalid characters that could compromise security. <td>e-mail:<> - Create a Password text box. - Create a Persistent Cookie check box. If the Persistent Cookie box is selected, the cookie is valid across browser sessions. Otherwise, when the browser is closed, the cookie is destroyed. Issuing persistent cookies might be desirable for some sites for reasons of convenience, but it is offers less protection than issuing short-lived cookies. - Create a Submit button that causes the Logon_Click event to be raised on postback. See Also ASP.NET Web Application Security | Forms Authentication Using an XML Users File
https://msdn.microsoft.com/en-us/library/s5wzk21y(v=vs.71).aspx
CC-MAIN-2015-22
refinedweb
654
58.58
QWizardPage Class Reference The QWizardPage class is the base class for wizard pages. More... #include <QWizardPage> This class was introduced in Qt 4.3. Properties Public Functions - 221 public functions inherited from QWidget - 29 public functions inherited from QObject - 13 public functions inherited from QPaintDevice Signals: - initializePage() is called to initialize the page's contents when the user clicks the wizard's Next button. If you want to derive the page's default from what the user entered on previous pages, this is the function to reimplement. - cleanupPage() is called to reset the page's contents when the user clicks the wizard's Back button. - validatePage() validates the page when the user clicks Next or Finish. It is often used to show an error message if the user has entered incomplete or invalid information. - nextId() returns the ID of the next page. It is useful when creating non-linear wizards, which allow different traversal paths based on the information provided by the user. - isComplete() is called to determine whether the Next and/or Finish button should be enabled or disabled. If you reimplement isComplete(), also make sure that completeChanged() is emitted whenever the complete state changes.. Property Documentation subTitle : QString. By default, this property contains an empty string. Access functions: See also title, QWizard::IgnoreSubTitles, and Elements of a Wizard Page. title : QString This property holds the title of the page. The title is shown by the QWizard, above the actual page. All pages should have a title. The title may be plain text or HTML, depending on the value of the QWizard::titleFormat property. By default, this property contains an empty string. Access functions: See also subTitle and Elements of a Wizard Page. Member Function Documentation QWizardPage::QWizardPage ( QWidget * parent = 0 ) Constructs a wizard page with the given parent. When the page is inserted into a wizard using QWizard::addPage() or QWizard::setPage(), the parent is automatically set to be the wizard. QString QWizardPage::buttonText ( QWizard::WizardButton which ) const(). void QWizardPage::cleanupPage () [virtual] This virtual function is called by QWizard::cleanupPage() when the user leaves the page by clicking. void QWizardPage::completeChanged () [signal](). QVariant QWizardPage::field ( const QString & name ) const [protected] Returns the value of the field called name. This function can be used to access fields on any page of the wizard. It is equivalent to calling wizard()->field(name).())); } See also QWizard::field(), setField(), and registerField(). void QWizardPage::initializePage () [virtual] This virtual function is called by QWizard::initializePage() to prepare the page())); } The default implementation does nothing. See also QWizard::initializePage(), cleanupPage(), and QWizard::IndependentPages. bool QWizardPage::isCommitPage () const Returns true if this page is a commit page; otherwise returns false. See also setCommitPage(). bool QWizardPage::isComplete () const [virtual] This virtual function is called by QWizard to determine whether the Next or Finish button should be enabled or disabled. The default implementation returns true if all mandatory fields are filled; otherwise, it returns false. If you reimplement this function, make sure to emit completeChanged(), from the rest of your implementation, whenever the value of isComplete() changes. This ensures that QWizard updates the enabled or disabled state of its buttons. An example of the reimplementation is available here. See also completeChanged() and isFinalPage(). bool QWizardPage::isFinalPage () const. int QWizardPage::nextId () const [virtual] This virtual function is called by QWizard::nextId() to find out which page to show when the user clicks the Next button. The return value is the ID of the next page, or -1 if no page follows. By default, this function returns the lowest ID greater than the ID of the current page, or -1 if there is no such ID.(). QPixmap QWizardPage::pixmap ( QWizard::WizardPixmap which ) const. void QWizardPage::registerField ( const QString & name, QWidget * widget, const char * property = 0, const char * changedSignal = 0 ) [protected](). void QWizardPage::setButtonText ( QWizard::WizardButton which, const QString & text )(). void QWizardPage::setCommitPage ( bool commitPage )(). void QWizardPage::setField ( const QString & name, const QVariant & value ) [protected] Sets the value of the field called name to value. This function can be used to set fields on any page of the wizard. It is equivalent to calling wizard()->setField(name, value). See also QWizard::setField(), field(), and registerField(). void QWizardPage::setFinalPage ( bool finalPage ). void QWizardPage::setPixmap ( QWizard: the entire wizard using QWizard::setPixmap(), in which case they apply for all pages that don't specify a pixmap. See also pixmap(), QWizard::setPixmap(), and Elements of a Wizard Page. bool QWizardPage::validatePage () [virtual](). QWizard * QWizardPage::wizard () const [protected] Returns the wizard associated with this page, or 0 if this page hasn't been inserted into a QWizard yet. See also QWizard::addPage() and QWizard::setPage(). No notes
http://qt-project.org/doc/qt-4.8/qwizardpage.html
crawl-003
refinedweb
772
50.23
Summary: Guest blogger, Trevor Sullivan, talks about invoking CIM methods via Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Today we have another guest post from Trevor Sullivan. Trevor is an Honorary Scripting Guy, and a recognized Microsoft Community Contributor (MCC). To see more of Trevor’s guest posts, see these Hey, Scripting Guy! Blog posts. Note This is the fourth in a series of five posts by Trevor where he talks specifically about using the CIM cmdlets. To catch up, read the following posts: Here’s Trevor… In yesterday’s post, we talked about reading and writing CIM properties. Today, we’ll look at WMI/CIM methods. In the context of programming terminology, methods generally represent actions that you can perform against an object. In CIM/WMI, this is no exception. Similar to properties, methods can be declared as static or instance methods. Static methods are declared on a class, and generally don’t operate on any particular instance of that class. Instance methods are generally actions that are performed against a specific instance of the class. Classes are blueprints of an object that do not represent an instance of the object itself. For example, think of a car blueprint. The blueprint represents what a car might look like, how many wheels it has, how many doors it has, the size of the engine, what type of transmission it has, and so on. Blueprints are not actual cars, however. Therefore, a static method might be defined at the class (blueprint) level called Build(), which produces a car. Instance methods generally operate on an instance of the class that declares the method. To get an instance of a car, you must first call the blueprint’s Build() method. When you have a specific car (instance) that is built according to the blueprint’s (class) specifications, you could begin calling instance-level methods on it. On any given car instance, you might have a method called Drive(), which causes the car to move. Similarly, you might have an OpenHood() method, which opens the hood of the vehicle. Because these methods operate on a specific car, they are better declared at the instance (specific car) level as opposed to the class (blueprint) level. Moving from the car example to a software example, you could have a class called Process. This class does not represent a specific process (such as svchost.exe or iexplore.exe), but rather, it defines a blueprint for what a process looks like. In CIM/WMI, there is in fact a class called Win32_Process that exists in the root\cimv2 WMI namespace. This class has a static (blueprint) method called Create(), which allows you to create (start) a process in a Windows operating system. After you have a process, you have the ability to terminate the process using the Terminate() method. The Terminate() method is an instance-level method because the action of terminating is performed against a specific process. Here is some sample script that shows how to call the Win32_Process.Terminate() CIM method by using the new Invoke-CimMethod cmdlet. This method call is particularly easy because we do not have to specify any method parameters. # Start a new instance of notepad.exe notepad; # Retrieve the Win32_Process instance for notepad.exe $Notepad = Get-CimInstance -ClassName Win32_Process -Filter "Name = 'notepad.exe'"; # Invoke the Win32_Process.Terminate() method Invoke-CimMethod -InputObject $Notepad -MethodName Terminate; Static methods can be called easily also. Let’s take a look at the Win32_Process.Create() method, which creates a new process. The Create() method is different from Terminate() because it requires that we pass method parameters to it, specifically the path to the process that we want to start. How do we know what those parameters are? Let’s first look at a list of CIM methods that are available for the Win32_Process class: (Get-CimClass -ClassName Win32_Process).CimClassMethods; Then, let’s narrow things down specifically to the Create() method: (Get-CimClass -ClassName Win32_Process).CimClassMethods['Create'].Parameters; Now we can see a list of all the method parameters that Create() requires: To use Invoke-CimMethod to call the Create() method, we need to create a HashTable of parameters to pass into it. $Arguments = @{ CommandLine = 'notepad.exe'; CurrentDirectory = $null; ProcessStartupInformation = $null; }; Then, we can call the method. Invoke-CimMethod -ClassName Win32_Process -MethodName Create -Arguments $Arguments; When you run the previous script on a local computer, you should see notepad.exe running. You might wonder why we left out the ProcessId parameter when we started the process. The reason is that the process ID is an “out” parameter, which is returned to us when the process is launched. We do not need to pass a ProcessId into the Create() method, because that simply doesn’t make sense. A couple of days ago, I briefly mentioned how WMI methods are not bound to the .NET objects, when you use the CIMCmdlets PowerShell module. Let’s take a look at how things have changed from the traditional WMI days. One relatively common task that is performed through WMI is terminating processes, which we explored earlier in this post. If you want to terminate a process by using WMI, you could simply call the appropriate WMI method on the WMI object that you received from the Get-WmiObject cmdlet: (Get-WmiObject -Class Win32_Process -Filter "Name = 'notepad.exe'").Terminate(); If you want to call a static method on a class, such as the Create() method on the Win32_Process class, you could use the [wmiclass] type accelerator to get a reference to the class, and then call the static method by using the dot/period operator: ([wmiclass]"root\cimv2:Win32_Process").Create('notepad.exe'); If you called the method without any parameters and sans the parentheses, Windows PowerShell used to show you the WMI method signature. Unfortunately, you now have to use a bit more effort to figure out the method signature by using an external GUI tool, or by using the Get-CimClass cmdlet, as previously demonstrated. Well, that’s all for today! We’ll wrap things up tomorrow by looking at CIM sessions and Windows PowerShell sessions. ~Trevor That is all there is to invoking CIM methods. CIM Week will continue tomorrow when Trevor will talk about CIM sessions and PS Remoting.
http://blogs.technet.com/b/heyscriptingguy/archive/2014/01/30/invoking-cim-methods-with-powershell.aspx
CC-MAIN-2015-06
refinedweb
1,042
64.51
The board game scrabble works by assigning points to wooden tiles arranged in cells on a board. It's described here:. We'll simplify this considerably, and consider the following question. We begin with the letter-scoring scheme from Scrabble: a = 1, b = 3, c = 3, d = 2, ..., z = 10. Given a text file - a novel for example, and a word size, say 7 characters, what is the highest-(or a highest-) scoring word in the the file of that word size? Your solution should include two files: A driver, which we provide below, and which you must use, and a file called Scrabble.java, which does the heavy lifting for the application. The Scrabble file should extend Echo, in the standard way we've indicated (it can also extend the LineReader class from Chapter 11 of the text). Tips: Make sure you read Chapter 10 of the text as a prelude to doing this problem. Here is a list from a to z of the letter scores from Scrabble: {1,3,3,2,1,4,2,4,1,8,5,1,3,1,1,3,10,1,1,1,1,4,4,8,4,10} It's far easier to convert lines of text to lowercase before processing. Use a StringTokenizer object to chop up a line into words. Handle characters that show up inside words, such as apostrophe and hyphen this way: treat a word like "can't" as a five character word, and score the apostrophe as 0. Also, use this String as the second parameter to your StringTokenizer constructor: ",.?! {}[];:". The result of using this String will mean that a word like "students'" (note apostrophe at end) should have length 9. This is the driver they have given us to use: import java.util.*; import java.io.*; public class ScrabbleDriver{ public static void main(String args[]) { try{ Scanner s = new Scanner(System.in); System.out.println("enter file name, then word size"); String f = s.next(); int size = s.nextInt(); Scrabble scrab = new Scrabble(f,size); scrab.readLines(); scrab.reportWinner(); } catch(Exception e) {System.out.println(e);} } } I am not sure how to go about coding this so if anyone could help that would be great.
https://www.daniweb.com/programming/software-development/threads/277249/scrabble-class
CC-MAIN-2018-30
refinedweb
369
73.07
I am trying to iterate through a JSON object to import data, i.e. title and link. I can't seem to get to the content that is past the : [ { "title": "Baby (Feat. Ludacris) - Justin Bieber", "description": "Baby (Feat. Ludacris) by Justin Bieber on Grooveshark", "link": "", "pubDate": "Wed, 28 Apr 2010 02:37:53 -0400", "pubTime": 1272436673, "TinyLink": "", "SongID": "24447862", "SongName": "Baby (Feat. Ludacris)", "ArtistID": "1118876", "ArtistName": "Justin Bieber", "AlbumID": "4104002", "AlbumName": "My World (Part II);\n", "LongLink": "11578982", "GroovesharkLink": "11578982", "Link": "" }, { "title": "Feel Good Inc - Gorillaz", "description": "Feel Good Inc by Gorillaz on Grooveshark", "link": "", "pubDate": "Wed, 28 Apr 2010 02:25:30 -0400", "pubTime": 1272435930 } ] def getLastSong(user,limit): base_url = '' user_url = base_url + str(user) + '/' + str(limit) + "/" raw = urllib.urlopen(user_url) json_raw= raw.readlines() json_object = json.loads(json_raw[0]) #filtering and making it look good. gsongs = [] print json_object for song in json_object[0]: print song : Your loading of the JSON data is a little fragile. Instead of: json_raw= raw.readlines() json_object = json.loads(json_raw[0]) you should really just do: json_object = json.load(raw) You shouldn't think of what you get as a "JSON object". What you have is a list. The list contains two dicts. The dicts contain various key/value pairs, all strings. When you do json_object[0], you're asking for the first dict in the list. When you iterate over that, with for song in json_object[0]:, you iterate over the keys of the dict. Because that's what you get when you iterate over the dict. If you want to access the value associated with the key in that dict, you would use, for example, json_object[0][song]. None of this is specific to JSON. It's just basic Python types, with their basic operations as covered in any tutorial.
https://codedump.io/share/FaUU2kMVrD3k/1/iterating-through-a-json-object
CC-MAIN-2017-34
refinedweb
297
76.72
Notes from Dave Winer’s Session at RSS Winterfest Published: 01/24/04 On Wednesday, January 21, 2004, I joined Dave Winer, Rick Heller, and Jim Moore at the Berkman Center for Internet & Society for Dave’s talk about RSS during the RSS Winterfest conference. Below are my notes from that session. A transcript of the talk and more materials are available on the wiki for this session. Dave Winer is the founder of UserLand software and is called the “father of RSS.” The utility of RSS is what many people don’t realize. Many people focus on the technicalities of it: whether you’re using RDF or namespace or something like that instead of focusing on what it can do. Aggregators are magic. “What would a presidential campaign that is completely RSS enabled look like?” There’s a window of time when we can do incredible things. Time in a presidential campaign is compressed more so than in the real world. There’s no business plan. Nothing like that. There are next steps. It’s a struggle for this community to accept that there are users in this space and that we would all gain if we could make it easier for them to participate, use the technology. Protocols, what do users want from RSS. They want it to be easier. They want more. Today, we are in the early adopter phase of RSS. Everyone who’s a user is also an evangelizer. We’re leaving the layer that’s defined by what the geeks can accomplish and moving into the layer where people who have a vested interest will take over. Competitive advantage to better information flow. While giving them want they want isn’t a technical challenge, it’s difficult to really listen to what they’re saying and strive to really understand it and give them what they’re looking for. Dave wants the focus of the conference to be on the use of RSS. The technology is fascinating, but the challenges in front of RSS aren’t technological challenges. Users won’t say “We want a better spec for RSS.” They’ll say, “We want it to work better.” RSS has a certain syntax, regularity. Dave thinks the RSS spec isn’t going anywhere. It basically is what it is and it isn’t going anywhere. He sees a large installed base developing around that format and people not being concerned with the specs and such. What happens to campaign blogs after the election? Bob Graham’s blog is already gone. Questions: Jeff Jarvis asked for examples of innovative uses for RSS. After thinking for a moment, Dave responded by saying “Maybe innovation isn’t the right word, but value is.” What’s important is whether people are using RSS for valuable things, not necessarily innovative things. - Using robots to scrape RSS - PubSub.com–contains info specific to particular issues by searching thousands of blogs Posted on Scripting News - weather.com Someone posted a link to feeds for bargain shopping on the wiki for this session. He doesn’t want to depend on the monoculture of the big media. He wants RSS to be a distribution point for many people, a decentralized communication system. Usability is an issue: how can it become mainstream if it isn’t usable. Dave asks, “Does it have to go mainstream?” If RSS were to become mainstream, it has to become mainstream. He thinks it becomes a browser issue. (Over lunch, he explained that he doesn’t mean browsers should necessarily include an aggregator when he says that. He thinks browsers have the ability to make it easier for people to use RSS. He explained two ways that browsers can do this by helping people subscribe to things or by working with someone’s aggregator when they’re online to coordinate subscriptions.) RSS has been around since 1999. There are things the browser could do to make it easy to use. If we had the source code to MSIE, we could solve the problem. Rick, Jim, and I were introduced and then we had the opportunity to speak about our interest in RSS. Rick, a volunteer with Wesley Clark’s campaign, talked about the Clarkbot, a script that searches a database of RSS feeds for mentions of Clark. Jim, who works for the Dean campaign, talked about using feeds to learn about things happening in real time. He worked with Dave on Channel Dean. Though it’s biased towards Dean stuff, the technology has bigger applications. Jim wants it to be an open platform people can build on top of. Only if RSS is unbiased will people buy into it. I said, though not as eloquently, that I’m interested in RSS on two levels: as a content creator (thinking of the Web sites and newspaper my office produces) and as a librarian looking to use it to inform myself and as a way for me to inform my clients. Jim Moore: “You can create a public good, but not actually win in the end.” Automation is a big thing with computers. RSS is basically easy Web surfing. Is there going to be an agreement on what RSS stands for? Netscape invented the term RSS with “site summary” as the SS. Dave thought “site summary” would be confusing. Dave calls it “Really Simple Syndication.” “They’re not really interesting names, let’s put it that way.” If people have the power to set up their own feeds, does that take away the power of the media companies? What kind of reaction do you think media companies will have as people do this? Dave answers: at what point do the publishing companies draw the line and say no more power to the users? If the professional reporters don’t cover the stories accurately ? If they want to be competitive, they have to do this. Competitive media companies should do this. It took Martin Nisenholtz of the New York Times a few days to make a decision about it. NYT is a leader in Web stuff. Dave thinks they moved pretty aggressively to do it. Companies putting ads into RSS is dangerous. The medium is getting commercialized. It will get much more so in the future. Is RSS like a smart librarian? Dave says it’s more like a dumb librarian or dumb programmer.
http://blogs.harvard.edu/jkbaumga/list-of-longer-pages/notes-from-dave-winers-session-at-rss-winterfest/
CC-MAIN-2016-40
refinedweb
1,062
66.94
Terrel Shumway wrote: > If this is cool with everyone, I will build and submit a patch. > I guess everyone here is very busy. Here is the patch anyway: Consider this an ALPHA release. I am posting it for the masochisitic. I'll-get-back-to-this-after-finals-are-over-ly yours, Terrel Thank you for your cooperation. ---------------------------------------------------------------------------- ). 1) Engine is a singleton at the top of the hierarchy. An Engine contains a Host for each virtual host. 2) a Host is overkill for webware: a) apache is faster, b) python (without rexec) does not provide enough protection to run untrusted code it the same VM. Each Host has one or more Contexts 3) a Context is somewhere between a webware Application and your proposed Context. Each Context has one or more Wrappers. A context can also contain child Contexts, thus allowing unlimited nesting. 4) A wrapper is a leaf node that corresponds to a Servlet/Resource combination.. ender wrote: > > i'm against altering the operation of the base distribution because i want to > be able to give back what i build to the community, and i strongly feel that > at least the concept of directory handlers (or maybe just regex'd handlers) > should be in the core. > In progress. I did most of the work about a month ago, but I never finished the Unit tests. In about 20 minutes (11:00 PST (UTC-8:00)), checkout > > on a side note i'm also a bigger fan of composition over inheritance as a > means of code reuse. much easier to unit test, and much more likely to be > resusable (ie glue togther quickly exisiting components), esp. because python > allows multiple inheritance, not that this seems to be used abusively in > Webware, which is a good thing, just a personal preference. Me too. Idea: Instead of usage OneShot adapters to start Monitor.py from Cgi or FastCgi adapter - if It fails connection with AppServer. "=3.) If anyone is interested, here is an article describing ASP+, which is Microsoft's latest rewrite of Active Server Pages: Some of the improvements are really just eliminating the blatant problems in ASP. But I do find some of these ideas quite compelling, in particular the idea of Web Controls seems particularly useful in making it easier to write dynamic sites that work cross-browser. In a nutshell, it's a "control" that generates matching client-side HTML and server-side code to respond to events, and automatically tailors them for the particular browser being used. You can easily create new Web Controls, too. Any thoughts on how useful Web Controls are and how something similar could be implemented in Webware? -- - Geoff Talvola Parlance Corporation gtalvola@... I looked a little bit at the Mailman internationalisation code to see how to adapt it to Webware. (especially Mailman/Defaults.py and Mailman/i18n.py). The big question is if we want to change the language after startup or not. The latter case is much easier. The actual Mailman code uses some new Python 2.1 features to get the stack frame to serve as the namespace source. If this fails Mailman falls back to a _mailman C-module and finally uses a pure Python approach which works in every supported version of Python. With that it is possible to write internationalized strings as follows: listname = ... print _('No such list: %(listname)s') and _ searches for a variable name "listname" automagically which is a cool feature. listname = ... print _('No such list: %(listname)s' % listname) will not work, because listname is set at runtime (not at translation time). The Mailman i18n.py also uses class SafeDict(UserDict): """Dictionary which returns a default value for unknown keys. This is used in maketext so that editing templates is a bit more robust. """ I put all this stuff into one MiscUtils file (i18n.py) so one can write from MiscUtils.i18n import set_language, _ import time set_language('de') now = time.ctime(time.time()) print _('The current time is: %(now)s') print _('Webware is cool!') I really get Die aktuelle Zeit ist Mon Mar 12 02:57:57 2001 Webware ist cool! :-) I use the following files for that Webware/locale/de/LC_MESSAGES/webware.mo Webware/MiscUtils/i18n.py generated by pygettext.py -a -o webware.po i18n.py msgfmt.py webware.po You can run the example also with python i18n.py de The directory names are hardcoded right now, one has to make this Webware compliant. --- If one does does not need this runtime translation feature, then can use the normal _ magic from gettext. I'm not sure if this dynamic translation is really needed, but there will hopefully be some feedback.. I attached the 2 files webware.mo and i18n.py for testing.. ---------- One could use the same trick for simple templates (no loop, just filling variables) whitout even having to use a explicit dictionary, but this is not really fast.. -- Tom Schwaller Sorry about the problems you're having. We probably didn't test the FCGIAdapter enough for the last re;lease as we were concentrating on some other Adapters. OK, let me try to answer the questions that don't require me to look at the code, and if that doesn't fix it, we'll dig in. ----- Original Message ----- From: Ian Bicking <ianb@...> To: <webware-discuss@...> Sent: Sunday, March 11, 2001 5:51 PM Subject: [Webware-discuss] Problems setting up FastCGI SNIP > > I tried following the instructions at the top of FCGIAdapter.py. > There were a couple thing that seem to be bugs, but might be > misunderstandings on my part: > > >From the instructions, shouldn't this be FCGIAdapter.py ? > In the default setup, yes. > FastCgiExternalServer ../cgi-bin/FCGIWebKit.py -host localhost:33333 # the path is from the SERVER ROOT > > <Location /FCGIWebKit.py> #or whatever name you chose for the file above > SetHandler fastcgi-script > Options ExecCGI FollowSymLinks > </Location> > >. And what > should this be if you use the extension-based approach? (I'm working > towards getting this on a shared host, where I imagine I'll have to > use extensions, but I don't really know yet) > Not sure what you mean here. > Then, on line 154 of FCGIAdapter.py, there seemed to be a bug. I'd > think the line should be: > > _adapter = FCGIAdapter(WebKitDir) > OK, I'm not sure without looking and I can't look at the moment. I'll get back to you. > > Otherwise, WebKitDir is left out, which seems to not work at all. > >. Jay "Jay Love" <jsliv@...> wrote: [...] > >. Why no, I'm not. I thought FastCGI started the server... but now I'm realizing there's several different servers in question -- FCGIAdapter serves connections to FastCGI, but AppServer in turn is the server for the adapter. Okay. So, I tried running ./AppServer (as root), but I still get the same result (FastCGI times out). > And what > > should this be if you use the extension-based approach? (I'm working > > towards getting this on a shared host, where I imagine I'll have to > > use extensions, but I don't really know yet) > > > > Not sure what you mean here. Never mind that. Just me being confused. [...] > >. I tried running the appserver, but it didn't seem to change anything. WebKit.fcgi is a symbolic link to CFGIAdpater.py, and I made the changes to httpd.conf more or less like the documentation said. If I can get this working while understanding what I did, I can write up more complete install documentation. Thanks. -- Ian Bicking 4869 N. Talman Ave., Chicago, IL 60625 (773) 275-7241 ianb@... At 03:23 AM 3/12/2001 +0100, Tom Schwaller wrote: >I'm not sure if this dynamic translation is really needed, >but there will hopefully be some feedback.. Hi Tom, Yes this looks very interesting and I think we need to be able to switch languages at run time for the simple reason that different requests can have different language preferences. e.g., you and I could hit the admin pages of the same app server, thereby required English and German. Haven't had a chance to digest the rest of your comments... -Chuck Chuck Esterbrook wrote: > > At 03:23 AM 3/12/2001 +0100, Tom Schwaller wrote: > >I'm not sure if this dynamic translation is really needed, > >but there will hopefully be some feedback.. > > Hi Tom, > > Yes this looks very interesting and I think we need to be able to switch ok, thanks.. > languages at run time for the simple reason that different requests can > have different language preferences. e.g., you and I could hit the admin that's a good point, so we need this kind of dynamic translation.. > pages of the same app server, thereby required English and German. > > Haven't had a chance to digest the rest of your comments... The stuff I appended works out of the box, but has to be refined. Another enhancement would be to get all translations into memory and then just switch (see the example in the Python docs) at runtime. That seems much better than just overriding _translation each time. For big sites this could of course blow up the memory usage so a translation sweeping could be a solution, but I'm not sure how big this stuff gets. -- Tom Schwaller ender wrote: > > On Sunday 11 March 2001 14:07, Tom Schwaller wrote: > >>ender wrote: > >>> it could be interesting to use postgres's oo features or it might be > >>> problematic, the only one i'm considering at the moment is table > >>> inheritance. the problem with using this stuff is how vendor dependent it > >>> is. every ordbms seems to do things its own way, with its own caveats > >>> (oracle, sapdb, postgres). > >> > >>As far as I can see table inheritance maps 1-1 to the A(B) (B: base > >>class) > >>constuct of MiddleKit. It would be really intresting to see how well > >>this works. > > it (the pg inheritance scheme) works pretty well. the child tables physically > (??) inherit columns of the super table. and to take a term from object > databases, it supports extents in the sense that the parent table can be > queried for info in the child tables (the syntax is non standard but pg 7.2 > will probably change the syntax to the sql3 standard), so you can identify > all objects of certain base table. the two current caveats are indexes must > be recreated on the child tables (they aren't inherited) and the current > nonstandard method of querying about inherited rows from a parent table, > they're also might be some problems other types of constraints.... don't know > i've only casually experimented with it. > > >>I never used that feature right now with PostgreSQL, but wonder if is is > >>performing well with say 20-30 derived classes from a simple base class > >>(that's > >>what I'll need if I rewrite my community system. I have a general > >>content class with > >>attached comment and point system which will be used as a base class for > >>more specialized content like books, FAQ entries and the like..) > > the data is retrieved by some rdbms magic and it obviates the need for extra > joins to build up a useful set of information about a row in a child table, > this generally leads to some siginfigant performance gains. > > the openacs.org team looked into this feature pretty carefully before > deciding it against it (mainly because of portability but also about concerns > on whether its ready for primetime). there are some discussions on the > development bboards there about this stuff, (including a benchmark), if you > want more info. > > the debate over the features > > the decision not to use these features > interesting, thanks for the links and the explanation. -- Tom Schwaller At 05:10 AM 3/11/2001 -0800, ender wrote: >would you mind doing a quick architecture document of middlekit, since >middlekit isn't plug and play for anything but mysql, this would be useful. I wouldn't mind, but it will probably be at least a week before this happens. I'll know more in a week. :-) > >>We will definitely need to refactor some things as we expand our support > >>for other databases. As you already pointed out, some of MySQL's > >>conveniences like connecting to a database via a connection and "if exists" > >>aren't even supported by other databases (which others have touted as more > >>advanced). > >don't get me started... mysql's features come about as a factor of its having >ignored most concepts of relational dbs in favor of offering a sql frontend >(parser, execution plan, optimizer) to a flat file system (which is also one >of the reasons it was easy to graft on berkely db) without any complications >like traditional rdbms concepts. (just my opinion). :-) I knew that would get you excited! But my comments weren't entirely facetious. The MySQL guys seem to have at least provided several conveniences (like the ones described above) that eluded the other database designers. >there seem to multithreading pitfalls overall the place. i think some thought >should be given to adding utility synchronization functions to the Webware, a >global place for lock storage might allow for reporting via the AdminServlet >on things like lock contention and other useful stats. Interesting thought. >i was worried initially when hearing about middlekit and when initially >looking through the code for hidden mysql isms everywhere, but i'm pretty to >happy to state that i don't see too many. of course the real test will be an >actual adaptor to another system. Glad to hear it. -Chuck
http://sourceforge.net/mailarchive/forum.php?forum_name=webware-discuss&max_rows=25&style=nested&viewmonth=200103&viewday=12
CC-MAIN-2013-48
refinedweb
2,268
64
[ BUILD # : 201210310001 ] [ JDK VERSION : 1.6.37 ] See the following code. <code> public class NewClass1 { private static final String method (String path) { return null; } } </code> Try to "fix code..." on the method. ACTUAL: "remove final modifier from the method declaration" is shown twice - see attached screenshot EXPECTED: "remove final from method declaration" is shown once Created attachment 127052 [details] Same hint twice ??? Fixed in jet-main. Integrated into 'main-golden', will be available in build *201211070001* on (upload may still be in progress) Changeset: User: Dusan Balek <dbalek@netbeans.org> Log: Issue #221397: "remove final modifier from the method declaration" hint is shown twice - fixed.
https://netbeans.org/bugzilla/show_bug.cgi?id=221397
CC-MAIN-2015-48
refinedweb
105
58.89
At 10:27 2/4/01 +0200, Stefan Bodewig wrote: >> It was just an idea I had ages ago (or maybe it was suggested on the >> list?). Essentially associated with every task there are certain >> "aspects" that have little to do with what the task does but do >> relate to how we "host" the task. Some aspects that have been >> suggested so far include > >I agree that we should move things common to all tasks out of the Task >interface itself, what I'm not convinced of is the use of namespaces >here. Why should a build file writer be bothered to know whether >failonerror is handled by the task itself or something else?. However it is at higher complexity build files (medium->high complexity) where the advantage would be shown. Mainly as it would allow core to be clean and handling of tasks predictable. For big build processes it would allow customisation without magic variables (ala GUMPs sysclasspath) and added value (ie assign fee: namespace to something specific to buisness). | *-----------------------------------------------------*
http://mail-archives.eu.apache.org/mod_mbox/ant-dev/200104.mbox/%3C3.0.6.32.20010403115505.00970100@alphalink.com.au%3E
CC-MAIN-2020-10
refinedweb
171
64.34
Hello Adobe Forums, I hope this post finds you well. Flex n00ber here and I sure could use some help understanding this process. It's killin' me! I have a ComboBox being populated by a system service array of values. (getSystems()) I also have a multi-select enabled spark List being populated by a different service. (getIterations()) The label values for the spark list are just numbers 1 through 15. What I'm trying to achieve: When I select a system in the cbo box, I need to call a service that returns an array of the values associated with that selected system and then programmatically select those values in the spark list. I do have a service that returns an array of that data based on the value of the cboBox.selectedItem.sysID. (getIterationsBySysID()) What does it take to make this happen? I hope I explained this in a meaningful way. ciao, -aaron Hi Just set the selected items property of the list control with the array thet u are getting from the service or match the service results with the complete data in list and find the index of each and every item that has been returned from the service and push the index values to an array and assign the array to the selected indices property of list . This will show all the index values as selected. So that's the 1000 foot view, you make it sound easy... =/ Thanks for reading my post selvakumar p. Will someone help me understand how to first make an array of results from a service? Should I make a new service to ONLY bring back the int's I plan on using for the selected index or is it ok to bring back three values with one being the index int I want to use? If three things are coming back into an array all how do I specify I want the first index item to be used as the selected indexes? [0] I guess my real disconnect (besides having little AS knowledge) is not knowing the correct way to generate an array of values based on the change event of a control and then calling that set of values within another control as the selectedIndices. I've been loving it (Flex) up until this point, but now I'm thoroughly frustrated. I'm going back to google to see if I can find that one tutorial. The computer I'm building this on does not have internet connectivity. I'm going to hand jam all of the code I'm using in a sample application I've built for this one problem. The setup: 1 spark List 1 Combo Box One service populates the list. One service populates the Combo Box. One service passed the variable containing a systemID from the selectedItem in Combo Box. The list selectedIndices should be the result of the service with variable call. Here's the code I'm using. <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns: <fx:Script> <![CDATA[ import mx.controls.Alert; import mx.events.FlexEvent; import spark.events.IndexChangeEvent; protected function list_creationCompleteHandler(event:FlexEvent):void { getCDRTiterationsResult.token = systemService.getCDRTiterations(); } protected function comboBox_creationComplete(event:FlexEvent):void { getAllSystemResult.token = systemService.getAllSystem(); } protected function comboBox_changeHandler(event:IndexChangeEvent):void { getCDRTbySysIdResult.token = systemService.getCDRTbySysId(comboBox.selectedItem.sysID); } ]]> </fx:Script> <fx:Declarations> <s:CallResponder <systemservice.SystemService <s:CallResponder <s:CallResponder <s:CallResponder </fx:Declarations> <s:List <s:AsyncListView </s:List> <s:ComboBox <s:AsyncListView </s:ComboBox> </s:Application> Please someone enlighten me on what part I'm missing here. And thank the gods it's Friday! -aaron Set a result event on the service that gets the list selection items. Have that event push the selectedIndices with this 'magical' loop. LOL (I call it magic because it had me mystified for two days!) private function onCatResult(e:ResultEvent):void { var v:Vector.<int> = new Vector.<int>(); for(var i:int = 0;i<e.result.length;++i) { //Alert.show("Selecting " + e.result[i].cdrtID); v.push(e.result[i].cdrtID -1); } MyList.selectedIndices = v; } I had to subtract one from the pushed value in order to compensate for the zero based index of the returning array. Hopefully this will help someone in the future, I certainly struggled with it. ciao, -aaron spark.components.List has spark.components.SkinnableDataContainer in its class hierarchy which dispatches a dataProviderChanged event whenever the dataProvider changes. Unfortunatly there is no [Event] metadata in SkinnableDataContainer that allows using this event in MXML. So, you'll need to create your own custom component that extends List. package { import spark.components.List; [Event(name="dataProviderChanged", type="flash.events.Event")] public class MyList extends List { public function MyList() { super(); } } } This works with other List-based components (like DropDownList) too. North America Europe, Middle East and Africa Asia Pacific South America
http://forums.adobe.com/message/4371690
CC-MAIN-2013-20
refinedweb
806
58.48
How to create custom components in CSharp (C#)Hello everyone, in this article we are going to talk about how can we create a custom component in Visual Studio and C#. We are going to make a custom digital clock example. Let's get started. I always keep my projects tidied up. First create a folder in your project. We are going to create our components classes in this folder. Below image you can find how can we do it. And then add a Custom Control in this folder. This control class will be our component. Below image you can find it. Below code block will be generated automatically: namespace CustomComponentExample.TheComponent { partial class DigitalClock { /// } } We are going to need some variables in this example. We will make a digital clock component. We will define hour, minute and second variables. We will show them in our component now. //we will update this variables from upper class. public int val_hour = 0; public int val_minute = 0; public int val_second = 0; //we do not need this update from upper class so define as private private string current_clock = "00:00:00"; We are going to show somethingon our form. It means we are going to paint something on form. So we need to add a protected function below to paint our component : protected override void OnPaintBackground(PaintEventArgs pevent) { base.OnPaintBackground(pevent); } Now we are ready to show something on screen. Below code block will draw the clock information on screen. //we will update this variables from upper class. public int val_hour = 0; public int val_minute = 0; public int val_second = 0; private string str_hour = "00"; private string str_minute = "00"; private string str_second = "00"; //we do not need this update from upper class so define as private private string current_clock = "00:00:00"; protected override void OnPaintBackground(PaintEventArgs pevent) { base.OnPaintBackground(pevent); //To prevent painting single character... str_hour = val_hour < 10 ? "0" + val_hour : val_hour.ToString(); str_minute = val_minute < 10 ? "0" + val_minute : val_minute.ToString(); str_second = val_second < 10 ? "0" + val_second : val_second.ToString(); current_clock = str_hour + ":" + str_minute + ":" + str_second; pevent.Graphics.DrawString(current_clock, new Font("Comic Sans MS", 32), Brushes.Black, new PointF(0, 0)); } //This function is required to refresh this component public void refreshClock() { this.Refresh(); } Now let's write some code to show current time on the screen. So what we will do now. We are going to declare a Timer and set the interval as 1000ms. It will update the clock every 1 second. Below code block will do this. Timer tmrClock; private void Form1_Load(object sender, EventArgs e) { tmrClock = new Timer(); tmrClock.Interval = 1000; tmrClock.Tick += TmrClock_Tick; tmrClock.Start(); } private void TmrClock_Tick(object sender, EventArgs e) { digitalClock1.val_hour = DateTime.Now.Hour; digitalClock1.val_minute = DateTime.Now.Minute; digitalClock1.val_second = DateTime.Now.Second; digitalClock1.refreshClock(); } Maybe you will need some functions inside your component. If you need that you have to add component inside your namespace. In this case I will do as below: using CustomComponentExample.TheComponent; That is all in this article. Have a good creating custom components Burak Hamdi TUFAN
https://thecodeprogram.com/how-to-create-custom-components-in-csharp--c--
CC-MAIN-2021-10
refinedweb
502
61.53
My program compiles without any errors, however, when I go to run it all I get is a message saying "Welcome to the Payroll Program". From there it does not print anything else nor allows me to enter any information. If someone could please take a look at my program and let me know what I am overlooking, I'm new to looping and I believe my issue is somewhere within my looping structures. It would be greatly appreciated!! :) // Fig. 1.1: Payroll Part 2 // Payroll program calculates employee's weekly pay. import java.util.Scanner;// program to use import scanner public class PayrollPart2 { //main method begins execution of java program execution public static void main( String args[] ) { System.out.println( "Welcome to the Payroll Program!" ); boolean stop = false; // Loop until user types "stop" as the employee name. while (!stop); { // create scanner to obtain input from command window Scanner input = new Scanner(System.in ); System.out.println(); // outputs a blank line System.out.print( "Enter Employee's Name or stop to exit program: " ); String empName = input.nextLine(); // employee name if ( empName.equals("stop")) { System.out.println( "Program Exited" ); stop = true; } else { float hourlyRate; // hourly rate float hoursWorked; // hours worked float weeklyPay; // Weekly Pay for employee System.out.print( "Enter hourly rate: " ); // prompt for hourly rate hourlyRate = input.nextFloat(); while (hourlyRate <= 0) // prompt until positive value is entered { System.out.print( "Hourly rate must be a positive number. " + "Please enter the hourly rate again: " ); hourlyRate = input.nextFloat(); // read hourly rate again } System.out.print( "Enter hours worked: " ); // prompt for hours worked hoursWorked = input.nextFloat(); while (hoursWorked <= 0) // prompt until a positive value is entered { System.out.print( "Hours worked must be a positive number. " + "Please re-enter hours worked: " ); // prompt for positive value for hours worked hoursWorked = input.nextFloat(); // read hours worked again } // Calculate Weekly Pay. weeklyPay = (float) hourlyRate * hoursWorked; // multiply sum // Display Output Results and sum System.out.print( empName ); // display employee name System.out.printf( "'s weekly pay is: $%,.2f\n", weeklyPay); // display weekly pay } } // Display ending message: System.out.println( "Closing Payroll Program." ); System.out.println(); // outputs a blank line } // end method main } // end class PayrollPart2
https://www.daniweb.com/programming/software-development/threads/137110/need-help-with-java-payroll-program-part-2
CC-MAIN-2018-30
refinedweb
358
60.41
Urgent - Need changes in Small Java Project This project received 20 bids from talented freelancers with an average bid price of ₹209 INR / hour.Get free quotes for a project like this Project Budget₹100 - ₹400 INR / hour Total Bids20 Project Description Hello! We have a small project of Online Tender Management System using Struts - Hibernate framework developed previously. But now, on running the project, it is sometimes displaying exception as "no action mapped for namespace and also the"factory=[url removed, login to view]().buildsessionfactory()" is shown as deprecated . It also shows a sql exception as "access denied for user ".Due to this the project is not [url removed, login to view] code for the project is complete only thing is it is showing the above mentioned exception. So I need someone to resolve this issue. Additional Skills Required: Struts Hibernate Java/JSP MySQL On satisfactory work, you will be considered for unlimited work from us. Happy Bidding... Thank you. Minimum bid will be accepted. Ideal Bid: 2 USD/
https://www.freelancer.com/projects/Java-JSP/Urgent-Need-changes-Small-Java/
CC-MAIN-2016-07
refinedweb
170
56.35
Let me start this blog by confessing that I am a Java guy who first learned Python three years back but haven’t used it much in my day to day work. So, after three long years, I have decided to brush up on my Python skills by developing a simple web application. By simple I don’t mean “Hello World” application but an application which does some work like storing data to a database. After spending some time googling “best web framework in Python,” I zeroed in on Flask. Flask is a microframework for Python based on Werkzeug and Jinja 2. It is a very easy to learn framework and is based on convention over configuration, which means that many things are preconfigured with sensible defaults. as shown below. Prerequisite Before we can start building the application, we’ll have to do few setup tasks : - Basic Python knowledge is required. - Sign up for an OpenShift Account. It is completely free and instant .. Source code of the application that we will be developing in this blog is on github Step 1 : Create an OpenShift Python Application We will start by creating an OpenShift Python 2.7 application. OpenShift also supports Python 2.6 and Python 3.3, but for this blog we will be sticking with Python 2.7. To learn more about the Python 3.3 cartridge, please refer to this blog. The OpenShift Python 2.7 cartridge by default uses mod_wsgi Apache HTTP Server module that provides a WSGI compliant interface for hosting Python based web applications under Apache.To create a Python 2.7 application named todo, type the command shown below. $ rhc app create todo python-2.7 postgresql-9.2 The command shown above will create an application container for us, called a gear, and setup all of the required SELinux policies and cgroup configuration. Next, it will install all the required software on your gear. It will also install PotsgreSQL 9.2 on your application gear and will create a database with the same name as the application name. OpenShift will also setup a private git repository with some template code, and then clone the repository to your local system. Finally, OpenShift will propagate the DNS to the outside world. You can view the application details using the command shown below. $ rhc show-app --app todo todo @ (uuid: 522425cd500446b3ec000294) ------------------------------------------------------------------------------- Domain: xxxxx Created: 11:14 AM Gears: 1 (defaults to small) Git URL: ssh://522425cd500446b3ec000294@todo-xxxxx.rhcloud.com/~/git/todo.git/ SSH: 522425cd500446b3ec000294@todo-xxxx.rhcloud.com python-2.7 (Python 2.7) ----------------------- Gears: Located with postgresql-9.2 postgresql-9.2 (PostgreSQL Database 9.2) ---------------------------------------- Gears: Located with python-2.7 Connection URL: postgresql://$OPENSHIFT_POSTGRESQL_DB_HOST:$OPENSHIFT_POSTGRESQL_DB_PORT Database Name: todo Password: AXtK_CELQXJK Username: adminiid3lsl Step 2 : Look at Default Template Application The default structure of the template application created by OpenShift is shown below. todo wsgi/ Externally exposed wsgi code goes here wsgi/static/ Public static content gets served here libs/ Additional libraries data/ For not-externally exposed wsgi code setup.py Standard setup.py, specify deps here app.py.disabled This file may be used instead of Apache mod_wsgi to run your python web application in a different framework .openshift/ Location for OpenShift specific files action_hooks/ Various scripts to hook into application lifecycle markers/ Marker files for hot deployment , debugging etc All the application code will be placed in the wsgi folder and application dependencies will be added to setup.py. Step 3 : Adding Flask and Flask-SQLAlchemy Dependencies OpenShift uses Setuptools which is a collection of enhancements to the Python distutils , that allow developers to more easily build and distribute Python packages, especially ones that have dependencies on other packages. We will add Flask and Flask-SQLAlchemy dependencies to setup.py as shown below. from setuptools import setup setup(name='TodoApp', version='1.0', description='Todo Application', author='Shekhar Gulati', author_email='', url='', install_requires=['Flask==0.7.2', 'MarkupSafe' , 'Flask-SQLAlchemy==0.16'], ) The key attribute in the code shown above is install_requires=[‘Flask==0.7.2’, ‘MarkupSafe’ , ‘Flask-SQLAlchemy==0.16’]. The install_requires attribute is used to specify a list of strings that represent python modules that your app needs. If you need other modules that are not listed you can just add new elements to setup.py. The reason we pegged to a certain version is 1) this prevents the build from checking versions with every git push and 2) it also prevents a build from putting in a version that breaks our code without our knowledge. Step 4 : Make Flask Say Hello We will start developing our todo application by creating a new file called todoapp.py in wsgi folders. On windows you can just create a new file named todoapp.py, by right clicking in explorer and saying new text file, then change .txt extension with .py extension. $ cd wsgi $ touch todoapp.py Open your favorite editor and add following lines to it. from flask import Flask app = Flask(__name__) @app.route('/') @app.route('/hello') def index(): return "Hello from OpenShift" if __name__ == '__main__': app.run() The code shown above does following : - Import the Flask class from the flask module and then create an instance of Flask class. This instance will be our WSGI application. - Next we define a route which tells Flask that on root(‘/’) and home(‘/home’) url, it should invoke index() function. The index() function just simply returns “Hello from OpenShift” string which will be rendered by the browser. - Finally, if the name of the application module is equal to “_ _main_ _” then run method is invoked to run the server. The last change needed to make this “Hello World” application work on OpenShift is to update a file named application which OpenShift created under wsgi folder. Change the content of the file with the one shown below. #!/usr/bin/python import os virtenv = os.environ['OPENSHIFT_PYTHON_DIR'] + '/virtenv/' os.environ['PYTHON_EGG_CACHE'] = os.path.join(virtenv, 'lib/python2.7/site-packages') virtualenv = os.path.join(virtenv, 'bin/activate_this.py') try: execfile(virtualenv, dict(__file__=virtualenv)) except IOError: pass from todoapp import app as application The application file is required by OpenShift and it basically calls the todoapp file that we created earlier. After all the code changes are done, add the code to the git repository, commit it, and push it to OpenShift gear. $ git add . $ git commit -am "hello world from flask" $ git push The application will be accessible at-{domain-name}.rhcloud.com. Replace {domain-name} with your domain name. Step 5 : Defining your Model In this blog, we are using Flask-SQLAlchemy which is a Flask extension that adds SQLAlchemy support to our todoapp application. SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL. Open the todoapp.py and add Todo model class to it as shown below. from datetime import datetime from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config.from_pyfile('todoapp.cfg') db = SQLAlchemy(app) class Todo(db.Model): __tablename__ = 'todos' id = db.Column('todo_id', db.Integer, primary_key=True) title = db.Column(db.String(60)) text = db.Column(db.String) done = db.Column(db.Boolean) pub_date = db.Column(db.DateTime) def __init__(self, title, text): self.title = title self.text = text self.done = False self.pub_date = datetime.utcnow() @app.route('/') @app.route('/hello') def index(): return "Hello from OpenShift" if __name__ == '__main__': app.run() In the code shown above we made the following additions. - First we imported SQLAlchemy class from flask_sqlalchemy module. This is required to work with Flask-SQLAlchemy. - Then we created an instance of SQLAlchemy class by passing it application object. The application object was loaded with database configuration which we specified in todoapp.cfg file. We will be creating todoapp.cfg later in this post. - Next we defined our Todo model by extending db.Model class and declaring all the Todo model attributes. Next, create a new file called todoapp.cfg in wsgi folder. It will house all our application configuration. On windows you can just create a new file named todoapp.cfg, by right clicking in explorer and saying new text file, then change .txt extension with .cfg extension. $ cd wsgi $ touch todoapp.cfg Add following lines to todoapp.cfg import os SQLALCHEMY_DATABASE_URI = os.environ['OPENSHIFT_POSTGRESQL_DB_URL'] SQLALCHEMY_ECHO = False SECRET_KEY = 'secret key' DEBUG = True Once you go into production, you will probably want to turn off DEBUG until you run into problems. This will help with performance since you won’t be writing as much to files. Update the application file under wsgi folder so that it creates the database. Add the two lines at the end of file. from todoapp import * db.create_all() Step 6 : Persisting Todo Items to PostgreSQL Next we will add a route “/new” which will render a form when a user makes a get request to-{domain-name}.rhcloud.com/new. And when user submit the form using POST method it will write the todo item to database. Add following lines to todoapp.py. from flask import Flask, request, flash, url_for, redirect, render_template, abort @app.route('/new', methods=['GET', 'POST']) def new(): if request.method == 'POST': todo = Todo(request.form['title'], request.form['text']) db.session.add(todo) db.session.commit() return redirect(url_for('index')) return render_template('new.html') Flask uses Jinja2 as its templating language. For those of you new to the flask framework, templates basically facilitate the seperation of presentation and processing of your data. Templates are web pages that have mostly static elements and integrate programming logic which produces dynamic content. In the code snippet shown above we are rendering a template called ‘new.html’. Create a new folder called templates under wsgi folder and create a new.html in it and add the following lines. $ cd wsgi $ mkdir templates $ cd template $ touch new.html Next copy the content shown below in new.html. {% extends "layout.html" %} {% block body %} <form action="" method=post <h2>Create New Todo</h2> <div class="control-group"> <div class="controls"> <input type="text" id="title" name="title" class="input-xlarge" placeholder="Please give title to todo item" value="{{ request.form.title }}" required> </div> </div> <div class="control-group"> <div class="controls"> <textarea name="text" rows=10 <div class="controls"> <button type="submit" class="btn btn-success">Create Todo</button> <a href="{{ url_for('index') }}">Back to list</a> </div> </div> </form> {% endblock %} The new.html template extends another template called layout.html. The layout.html is where we will define the layout of our web application. Create a new file called layout.html in the templates folder under wsgi and following content. Basically, template inheritance makes it possible to keep certain elements on each page like header, footer, etc. <!doctype html> <title>TodoApp -- Store your Todo items</title> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <style> body { padding-top: 60px; padding-bottom: 100px; } </style> <link href="/static/bootstrap.css" rel="stylesheet"> <link href="/static/bootstrap-responsive.css" rel="stylesheet"> <script src="/static/jquery.js"></script> <script src="/static/bootstrap.js"></script> ="/">TodoApp</a> <div class="nav-collapse collapse"> <ul class="nav"> <li class="active"><a href="/">Home</a></li> <li><a href="/new">New Todo</a></li> </ul> </div> <!--/.nav-collapse --> </div> </div> </div> {%- for category, message in get_flashed_messages(with_categories=true) %} <p class="flask {{ category }}-flash">{{ "Error: " if category == 'error' }}{{ message }}</p> {%- endfor %} <div id="main" class="container"> {% block body %}{% endblock %} <hr> <footer id="footer"> <p>Todo App built using Flask, SQLAlchemy, PostgreSQL , and Twitter Bootstrap</p> <p><a href="" target="_blank"><img alt="Powered by OpenShift" src=""></a></p> </footer> </div> Flask will look for templates in the templates folder. Templates have access to request, session, g objects, as well as the get_flashed_messages() function. We have used get_flashed_messages() method above. This method pulls all flashed messages from the session and returns them. As Flask configured Jinja2 templating engine for our application, HTML escaping is also enabled for the application. This makes sure the application is secure. You should head over to Jinja2 official documentation for more information. The project uses Twitter bootstrap to beautify the application. Copy the files from and put in static folder under wsgi. The static folder is for serving static files. $ cd ../static $ wget $ wget $ wget $ wget Commit the code and push it to OpenShift gear $ git add . $ git commit -am "added functionality to create a new todo" $ git push Now if you go to-{domain-name}.rhcloud.com/new you will see a form where you can create todo items as shown below. Next, create a new Todo item by entering some details and pressing “Create Todo” button. The application will first save the todo item and then redirect you to index “/” page. To view the persisted todo item we will log into our application gear and run psql PostgreSQL client. $ rhc ssh --app todo $ [todo-xxxx.rhcloud.com 5204d6c75973cac7a00001ef]\> psql psql (9.2.4) Type "help" for help. todo1=# \dt List of relations Schema | Name | Type | Owner --------+-------+-------+-------------- public | todos | table | adminwrqfzbx (1 row) todo1=# To view the created todo item we will run select query as shown below. todo1=# select * from todos; todo_id | title | text | done | pub_date ---------+-----------------------+--------------------------+------+---------------------------- 1 | Learn Flask framework | Read Flask Documentation | f | 2013-08-10 02:51:43.007073 (1 row) todo1=# Step 7 : View all Todo Items on Index Page The next feature that we are going to implement is to show all the todo items on the index page. So, if a user goes to-{domain-name}.rhcloud.com/ then he/she will see all the todo items. Update the index() function in todoapp.py with the following lines: @app.route('/') def index(): return render_template('index.html', todos=Todo.query.order_by(Todo.pub_date.desc()).all() ) Create a new file called index.html in the templates directory and add the following content: {% extends "layout.html" %} {% block body %} <div id="main" class="container"> <h2>All Items</h2> <table class="table table-hover"> <tr> <th># <th>Title <th>Date <th>Text {%- for todo in todos %} <tr class={{ "success" if todo.done }}> <td><a href="/todos/{{ todo.id }}">{{ todo.id }}</a> <td style={{ "text-decoration:line-through" if todo.done }}>{{ todo.title }} <td>{{ todo.pub_date.strftime('%Y-%m-%d %H:%M') }} <td>{{ todo.text }}</td> {%- endfor %} </table> <p> <a href="{{ url_for('new') }}" class="btn btn-large btn-primary">New Todo</a> </div> {% endblock %} Commit the changes and push to OpenShift gear. $ git add . $ git commit -am "added index()" $ git push Now if you go to-{domain-name}.rhcloud.com , you will see as shown below. Please replace {domain-name} with your own domain name. Step 8 : View and Update a Todo Item The next functionality that we are going to implement is viewing and updating a specific todo item. When a user goes to-{domain-name}.rhcloud.com/todos/1 then he/she should see a form filled with details of todo item with id 1. A user can change the values and submit the form again. This will update the values of the todo item. A user can update the todo item to mark todo as done. Add a new function to todoapp.py as shown below. @app.route('/todos/<int:todo_id>', methods = ['GET' , 'POST']) def show_or_update(todo_id): todo_item = Todo.query.get(todo_id) if request.method == 'GET': return render_template('view.html',todo=todo_item) todo_item.title = request.form['title'] todo_item.text = request.form['text'] todo_item.done = ('done.%d' % todo_id) in request.form db.session.commit() return redirect(url_for('index')) The view.html template is shown below. Create a new file with name view.html in templates directory and place the content shown below in it. {% extends "layout.html" %} {% block body %} <form action="" method=post <h2>Create New Todo</h2> <div class="control-group"> <div class="controls"> <input type="text" id="title" name="title" class="input-xlarge" placeholder="Please give title to todo item" value="{{ todo.title }}" required> </div> </div> <div class="control-group"> <div class="controls"> <textarea name="text" rows=10 <div class="controls"> <input type=checkbox name=done.{{ todo.id }}{{ " checked" if todo.done }}> </div> </div> <div class="control-group"> <div class="controls"> <button type="submit" class="btn btn-success">Update Todo</button> <a href="{{ url_for('index') }}">Back to list</a> </div> </div> </form> {% endblock %} Commit the code and push it to OpenShift gear. $ git add . $ git commit -am "added view or update functionality" $ git push Now if you go to-{domain-name}.rhcloud.com/todos/1 then you will see a todo item as shown below. You can mark the checkbox and press “Update todo” and you will see the todo marked done on the index page. Conclusion In this blog we covered how developers can build web applications in Python using Flask framework and PostgreSQL database and deploy it to OpenShift. If you are looking to host your Python application.
https://blog.openshift.com/build-your-app-on-openshift-using-flask-sqlalchemy-and-postgresql-92/
CC-MAIN-2017-22
refinedweb
2,809
59.6
A runtime type checker (contract system) and JSON validator Project description Obiwan is also exemplary for describing and checking external data e.g. JSON and msgpack, and has a json parser that does this. Obiwan machinary can also be used for checking contracts, constraints and expectations in normal code rather as an assert.() (Obiwan attaches to the Python VM using settrace(). You need to call the installer in each thread you want checked) you are now running obiwan! Runtime execution will be slower, but annotated functions will be checked for parameter correctness! All strings in your function annotations are ignored;(obj: {"a":int, "b": float}) -> {"ret": number}: return {"ret": a/b} Checking can support the checking of optional and noneable attributes: def example(obj: {"a":int, optional("b"): float}): ... Checks can contain dictionary and other attributes too: def example(person: {"name":str, "phone": {"type":str, "number":str}}): ... Dictionaries can be checked for key and value types, as well as by key name. E.g. to ensure that a function returns only dictionaries mapping strings to integers: def example() -> {str: int}: ... You can specify alternative constraint types using sets: def example(x: {int,float}): ... In fact, number type is just a set of int and float. And noneable is just a way of saying {...,None} Lists mean that the attribute must be an array where each element matches the constraint e.g.: def example(numbers: [int]): ... And sets which must be all of one type can be specified with a set containing a single element: def example(x: {str}): ...]) json.loads(tainted, template={"type": str, "data": { ....(a: duck(name=str,get_name=function)): ... This means that a must be something with a name attribute of type string, and a function attribute called get_name. You can of course use classes to: class Person: def get_name(self): ... def example(callback: function): ... If you want, you can describe the parameters that the function should take: def example(callback: function(int,str)): ... However, all the functions passed to example8 must now be properly annotated with a matching annotation. The special type any can be used if you do not want to check the type: def example(callback: function(int,any,number)): ... You can also specify that a function should support further arguments using ellipsis: def example. Project details Download files Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
https://pypi.org/project/obiwan/1.0.7/
CC-MAIN-2018-22
refinedweb
403
57.06
In the spirit of improving my software engineering practices I have been trying to make more use of the Python logging module. In common with many programmers my first instinct when debugging a programming problem is to use print statements (or their local equivalent) to provide an insight into what my program is up to. Obviously, I should be making use of any debugger provided but there is something reassuring about the immediacy and simplicity of print. A useful evolution of the print statement in Python is the logging module which can be used as a simple print function but it can do so much more: you can configure loggers for different packages and modules whose behaviour can be controlled centrally; you can vary the verbosity of your logging messages. If you decide to switch to logging to a file rather than the terminal this can be achieved too, and you can even post your log messages to a website using HTTPhandler. Obviously logging is about much more than debugging. I am writing this blog post because, as most of us have discovered, using logging is not quite as straightforward as we were led to believe. In particular you might find yourself in the situation where you feel you have set up your logging yet when you run your code nothing appears in your terminal window. Print doesn’t do this to you! Loggers are arranged in a hierarchy. Loggers have handlers which are the things that cause a log to generate output to a device. If no log is specified then a default log called the root log is used. A logger has a name and the hierarchy is defined by the dots in the name, all the way “up” to the root logger. Any logger can have a handler attached to it, if no handler is attached then any log message is passed to the parent logger. A log record has a message (the thing you would have printed) and a “level” which indicates the severity of the message these are specified by integers for which the logging module provides convenient labels. The levels in order of severity are logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL. A log handler will output a message if the level of the message is equal to or more than the level it has been set to. So a handler set to WARNING will show messages at the WARNING, ERROR and CRITICAL levels but not the INFO and DEBUG levels. The simplest way to use the logging module is to import the library: import logging Then carry out some minimal configuration, logging.basicConfig(level=logging.INFO) and then put logging.info statements in our code, just as we would have done with print statements: logging.info("This is a log message that takes a parameter = {}".format(a_parameter_value)) logging.debug, logging.warning, logging.error and logging.critical are used to publish log messages with different levels of severity. These are all convenience methods which remove the need to explicitly give the level as found in the logging.log function: logging.log(logging.INFO, "This is a log message") If we are writing a module, or other code that we anticipate others importing and running then we should create a logger using logging.getLogger(__name__) but leave configuring it to the caller. In this instance we use the name of the logger we have created instead of the module level “logging”. So to publish a message we would do: logger = logging.getLogger(__name__) logger.info("Hello") In the module importing this library you would do something like: import some_library logging.basicConfig(level=logging.INFO) # if you wanted to tweak the levels of another logger logger = logging.getLogger("some other logger") logger.setLevel(logging.DEBUG) basicConfig() configures the root logger which is where all messages end up in the absence of any other handler. The behaviour of logging.basicConfig() is downright obstructive at times. The core of the problem is that it can only be invoked once in a session, any future invocations are ignored. Worse than this it can be invoked implicitly. So if for example you do: import logging logging.warning("Hello") You’ll see a message because secretly logging has effectively run logging.basicConfig(level=logging.WARNING) for you (or something similar). This means that if you were to then naively go ahead and run basicConfig yourself: logging.basicConfig(level=logging.INFO) You would see no message when you subsequently ran logging.info(“Hello”) because the “second” invocation of logging.basicConfig is ignored. We can explicitly set the properties of the root logger by doing: root_logger = logging.getLogger() root_logger.setLevel(logging.INFO) You can debug issues like this by checking the handlers to a logger. If you do: import logging lgr = logging.getLogger() lgr.handlers You get the empty list []. Issue a logging.warning() message and you see that a handler has been added to the root logger, lgr.handlers() returns something like [<logging.StreamHandler at 0x44327f0>]. If you want to see a list of all the loggers in the hierarchy then do: logging.Logger.manager.loggerDict So there you go, the logging module is great – you should use it instead of print. But beware of the odd behaviour of logging.basicConfig() which I’ve spent most of this post griping about. This is mainly so that I have all my knowledge of logging in one place rather than trying to remember which piece of code I pulled off a particular trick. I used the logging documentation here, blog posts by Fang (here) and Praveen Gollakota (here) and tab completion in the ipython REPL in the preparation of this post.
http://www.ianhopkinson.org.uk/tag/python/
CC-MAIN-2019-47
refinedweb
950
56.25
So, my intuition of shadowing of functions is that the compiler will prefer the version from my module unless the arguments don't match, but if I shadow import func Foundation.puts private extension StaticString { @_transparent var cString: UnsafePointer<CChar> { UnsafeRawPointer(utf8Start) .assumingMemoryBound(to: CChar.self) } } func print(_ string: StaticString) { puts(string.cString) } // Calls Swift.print, and does a surprisingly large amount of work to print // something that should constant propagate to a zstring and a count. print("Hello, world!") It calls Swift.print instead of my version that delegates to puts. That would make me think that maybe the compiler just prefers String to StaticString, except that if I wrap the definition and call of do { func print(_ string: StaticString) { puts(string.cString) } // Calls my print and constant propagates "Hello world!" into a zstring print("Hello, world!") } So, in short, I have no idea how the compiler decides which version of a shadowed function to use.
https://forums.swift.org/t/confused-about-shadowing-of-functions-from-another-module/47270
CC-MAIN-2021-31
refinedweb
159
58.28
Literally, latch means a device for keeping a door or gate closed. Its meaning is analogous to a gate in Java as well. So if latch (gate) is open, everyone can pass through it but when it's shut, no one is allowed to cross over. With this as background let's go in detail: It's one of the advanced threading/concurrency concepts of Java. Java provides a Latch API named as CountDownLatch which got introduced in Java 5 ( java.util.concurrent package). So now on; I will refer Latch and CountDownLatch interchangeably to refer to the same thing. Latch is a synchronizer that can delay the progress of threads until it reaches its terminal state. [A synchronizer is any object that coordinates the control flow of threads based on its state] So it is used to synchronize one or more tasks by forcing them to wait for the completion of a set of operation being performed by other tasks. CountDownLatch in actionLet me start directly with a simple example to stress on the fundamentals of this API. Below sample program has two tasks (as taskone() and tasktwo()) represented as methods. And I want to make sure that taskone() should get completed before tasktwo(). import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; public class CountDownLatchTest { static CountDownLatch latch; CountDownLatchTest(final int count) { latch = new CountDownLatch(count); } public void firstTask() { Runnable s1 = new Runnable() { public void run() { try { System.out.println("waiting...."); TimeUnit.SECONDS.sleep(5); } catch (InterruptedException e) { e.printStackTrace(); } // finish first activity before last line latch.countDown(); } }; Thread t = new Thread(s1); t.start(); } public void secondTask() { Runnable s2 = new Runnable() { public void run() { try { System.out.println("wait...."); latch.await(); // perform task here System.out.println("after wait.... done"); } catch (InterruptedException e1) { e1.printStackTrace(); } } }; Thread t = new Thread(s2); t.start(); } public static void main(String[] args) throws InterruptedException { CountDownLatchTest cdlt = new CountDownLatchTest(1); cdlt.secondTask(); TimeUnit.SECONDS.sleep(5); cdlt.firstTask(); } } Output: wait.... waiting.... after wait.... done waiting.... after wait.... done Above example shows CountDownLatch attribute getting initialized to a value of 1 through constructor. Two tasks in above example are synchronized though CountDownLatch. Task2 i.e. secondTask() should wait for completion of Task1 i.e. firstTask(). Run above example and notice the sequence in which output appears on the console. Please note few important points - Any task that calls await() on the object will block until the count reaches zero or it's interrupted by another thread. secondTask() gets blocked after call to await(); evident from output. - Call countDown() on the object to reduce the count. The task that call countDown() are not blocked. This cal signals the end of the task. This method need to be called at the end of the task. - As soon as count reaches zero; threads awaiting starts running. - The value of count which is passed during creation of latch object is very important. It should be same as the number of task which needs to be finished first. If count is 5 then first task should be called five times to make sure that count has reduced to 0. - You can also use wait and notify mechanism of Java to achieve the same behavior but code will become quite complicated. - One of the disadvantage of CountDownLatch is that its not reusable once count reaches to zero. But Java provides another concurrency API called CyclicBarrier for such cases. Usage of CountDownLatch - Use this when your current executing thread/main thread needs to wait for the completion of other dependent activities. - Ensure that a service doesn't start until other services on which it depends have not completed. - In a multi-player game like RoadRash; wait for all players to get ready to start the race. --- do post your comments/questions !!! do post your comments/questions !!!
http://geekrai.blogspot.com/2013/04/latches-in-java.html
CC-MAIN-2019-04
refinedweb
637
57.87
Here is a screenshot of my kivy app. I am trying to get the TextInput BoxLayout BoxLayout TextInput center:self.parent.center BoxLayout TextInput TextInput import kivy from kivy.app import App from kivy.uix.widget import Widget from kivy.uix.label import Label from kivy.uix.boxlayout import BoxLayout class TimeTabler(Widget): pass class TimerApp(App): def build(self): return TimeTabler() if __name__ == "__main__": TimerApp().run() #:kivy 1.0 BoxLayout: orientation: 'vertical' size: root.size BoxLayout: orientation: 'vertical' Label: text: 'TimeTabler' BoxLayout: TextInput: text: '%s' % (self.parent.center) # why does this work here size_hint: None, None width: sp(200) height: sp(30) center: self.parent.center # but not here You gave the TextInput size_hint: None, None, therefore the BoxLayout doesn't try to manually give it the right size, and it assumes the default size of 100, 100. Just delete the size_hint line to fix it. Also, several widgets have lines like size: self.size. This is meaningless, self refers to the widget itself, and clearly the line does nothing since it just tries to set the size to what it already is. Things would also be simpler if you made your TimeTabler inherit from BoxLayout instead of Widget. That way you wouldn't need to manually set it's child BoxLayout's size. Edit: It looks like I misunderstood what you wanted, here's an example that uses an AnchorLayout to center the TextInput: <TimeTabler> BoxLayout: orientation: 'vertical' size: root.size on_touch_down: print self.pos, self.size canvas: Color: rgba: 0, 1, 1, .3 Rectangle: size: self.size pos: self.pos BoxLayout: orientation: 'vertical' size: self.size Label: text: 'TimeTabler' BoxLayout: id: bl on_touch_down: print 'center', self.center canvas: Color: rgb: 1,1,1 Line: rectangle: self.x, self.y, self.width, self.height AnchorLayout: TextInput: size_hint: None, None text: '%s, %s' % (self.get_center_x(), self.get_center_y()) I think your problem was the BoxLayout automatically sets the position of the TextInput even when it is setting its own size. A simple way around this is to just next the TextInput in another widget, in this case an AnchorLayout that takes care of the centering for you. You could also just use a Widget and your previous mechanism of setting the TextInput center.
https://codedump.io/share/zRTQaOZd5Eii/1/centering-textinput-within-a-boxlayout-in-kivy
CC-MAIN-2017-26
refinedweb
373
59.9
Today we get to take on one of the core items of object-oriented programming, inheritance. Particularly the dangers of inheritance and what is a better way in many cases. Inheritance is a core part of what makes object-oriented great and powerful when used correctly. What we will go over in this blog post is a particular pattern that gives us some of the capabilities of inheritance, while keeping us safe and maintaining encapsulation. First off, there are a couple of different types of inheritance; the first is implementation inheritance which is one class extends the functionality of another class. This is the type of inheritance we will be talking about in this blog post. There is also interface inheritance where a class implements an interface or one interface extends another interface. This second type of inheritance is not covered in this blog post. The core of what the title of this blog post comes down to is that inheritance breaks encapsulation. The problem comes in that changes to the super class can cause issues in the sub-classes without the sub-classes realizing it. This can lead to breakage, unexpected data leakage, and other issues that would best be avoided. This means the sub-classes need to evolve in lock step with their parent classes or risk encountering issues. Let's look at an example, and although contrived, the example in the book is solid at showing the issues. The idea behind this example class is that it creates a method for a user to have a HashSet that can retrieve how many times an item was added to it. Let's take a look. @NoArgsConstructor public class InstrumentedHashSet<E> extends HashSet<E> { @Getter private int addCount = 0; public InstrumentedHashSet(int initCap, float loadFactor) { super(initCap, loadFactor); } @Override public boolean add(E e) { addCount++; return super.add(e); } @Override public boolean addAll(Collection<? extends E> c) { addCount += c.size(); return super.addAll(c); } } This implementation, although it looks reasonable, has an issue that you won't discover until you realize how the implementation of HashSet works. Under the hood addAll simply calls add to insert elements so when you perform the call myCoolInstrumentedHashSet.addAll(List.of("a","b","c")) you end up with an addCount of 6 not 3 like you would expect. Three get added in the addAll call and 3 get added in the add call. There are ways to "fix" this issue, like removing the code in the addAll call, but that is still making it dependent on the implementation of the class. While it works today, will it work tomorrow? In addition to the coupling discussed above, there are other issues with using inheritance when it comes to fragility. As time goes on various things can happen to the super class. It can inherit new abilities with new methods, potentially conflicting with the names of methods in your subclass, it can expose internal state that you were depending on controlling the invariants of, and various other issues. There must be a better way!? Well there is. Enter composition. What in the world is composition? Well simply put, instead of extending a class's functionality a class simply has an instance of that class as an internal member and it delegates behaviors to it. This changes the inheritance is-a relationship to a has-a relationship. Let's take a look at what this could look like with our example from above: public class InstrumentedSet<E> extends ForwardingSet<E> { @Getter private int addCount; public InstrumentedSet(Set<E> wrappedSet) { super(wrappedSet); } @Override public boolean add(E newElement) { addCount++; super.add(newElement); } @Override public boolean addAll(Collection<? extends E> newElements) { addCount += newElements.size(); return super.addAll(newElements); } } @RequiredArgsConstructor public class ForwardingSet<E> implements Set<E> { private final Set<E> set; public void clear() { set.clear(); } public boolean contains(Object o) { return set.contains(o); } public boolean isEmpty() { return set.isEmpty(); } public int size() { return set.size(); } ... repeated for every method in the Set interface. } OK what did we just see. We took our one class using inheritance and turned it into two classes without using inheritance but using composition. What did this gain us? It helps us have more robust code. We have isolated ourselves from changes in the individual concrete classes, there is no chance of something changing out from under us because we control the whole interface, etc. We also got some more flexibility. We now take in a Set of any type (not just HashSet) and can operate on any of them. We can even add the instrumentation after the Set has been initialized by some other piece of code. The way we are using the wrapper class above is called the Decorator pattern. We are taking an already existing object and "decorating" it with additional behavior while still allowing it to be used as the original object. So nothing is without it's downsides, what are our downsides here? Well the main one should be pretty obvious. We took a pretty small class using inheritance and ended up with two classes and a lot more mind numbing code where we just duplicating an interface as we forward on calls. While this is a good chunk of code it's not hard code to write. This is such a solid pattern that languages such as Kotlin build syntactic sugar around making this pattern easier to code up without so much code. You can also reuse these forwarding classes after you have written them. I have also always wondered if you could use Java proxies to generate these forwarding classes at runtime. Make that an exercise for the reader. Inheritance truly does have a place. When you can truly say that WidgetB is-a WidgetA then an inheritance relationship can be appropriate. If WidgetB instead just needs to have the behavior of WidgetA then composition is likely what you are after. Honestly, if you can get away with composition it's likely the safer bet. There is a lot of robustness and power that comes when you use this pattern and I hope you can recognize when this pattern could be useful to you as your continue along your development efforts. Discussion (1)
https://practicaldev-herokuapp-com.global.ssl.fastly.net/kylec32/effective-java-tuesday-favor-composition-over-inheritance-4ph5
CC-MAIN-2021-21
refinedweb
1,038
56.15
Azure Storage for Serverless .NET Apps in Minutes WebDev Tools Azure Storage is a quick and effortless way to store data for applications that has high availability, is secure, scales and is redundant. This blog post walks through a simple application that creates a short code for a long URL to easily reference it. It uses Table Storage to map codes to URLs and a Queue to process redirect counts. Everything is handled by serverless Azure Functions. The only prerequisite to build and run locally is Visual Studio 2017 15.5 or later, including the Azure Developer workload. That will automatically install the Azure Storage Emulator you can use to program against tables, queues, blobs, and files on your local machine. You do not have to have an Azure account to run this on your machine. Build and Test Locally with Function App Host and Azure Storage Emulator You can download the source code for this project here. Feel free to jump ahead to follow the step-by-step instructions, or watch me follow through this blog post in a short video: Open Visual Studio 2017 and create a new “Azure Functions” project (the template will be under the “Cloud” category). Pick a name like, ShortLink. In the next dialog, choose “Azure Functions v1”, select “Http Trigger”, pick “Storage Emulator” for the Storage Account, and set Access rights to “Anonymous.” Right-click the name Function1.cs in the Solution Explorer and rename it to LinkShortener.cs. Change the function name to “Set” and update the code to use “href” instead of “name” as follows: Hit F5 to run the function locally. You should see the function console launch and provide you with a list of URLs to access your function. Access the end point from your web browser by copying and pasting the URL for the “Set” operation. You should receive an error message asking you to pass an href. Append the following to the end of the URL: ?href= You should see the URL echoed back to you. Stop debugging (SHIFT+F5). Out of the box, the functions template creates a function app. The function app hosts multiple functions, which are snippets of code that can be triggered by various events. In this example, the code is triggered by an HTTP/HTTPS request. Visual Studio uses attributes to declare the function name and specify the bindings. The log is automatically passed into the method you to to write logging information. It’s time to add storage! Table Storage uses a partition (to segment the data) and a row key (to identify a unique data item). The app will use a special partition of “1” to store a key that indicates the next code to use. The short code is generated by a simple algorithm that translates an integer to a string of alphanumeric characters. To store a short code, the partition will be set to the first character of the code, the row key will be the short code, and a target field will contain the full URL. Create a new class file and name it UrlKey.cs. Add this using statement: using Microsoft.WindowsAzure.Storage.Table; Then add the class: Next, add a class named UrlData.cs, include the same “using” statement and define the class like this: Add the same using statement to the top of the LinkShortener.cs file. Azure Functions provides special bindings that take care of connecting to various resources. Modify the Run method to include a binding for the key and another binding that will be used to write out the URL information. The Table attributes represent bindings to Table Storage. Different parameters allow behaviors such as passing in existing entries or collections of entries, as well as a CloudTable instance you can think of as the context you use to interact with a specific table. The binding logic will automatically create the table if it doesn’t exist. The key entry is automatically passed in if it exists. This is because the partition and key are included in the binding. If it doesn’t exist, it will be passed as null and you can initialize it and store it as a new entry: Next, add the code to turn the numeric key value into an alphanumeric code, then create a new instance of the UrlData class. The final steps for the redirect loop involve saving the data and updating the key. The response returns the code. Now you can test the functionality. Make sure the storage emulator is running by searching for “Storage Emulator” in your applications and clicking on it. It will send a notification when it is ready. Press F5 and paste the same URL used earlier with the query string set. If all goes well, the response should contain the initial value “BNK”. Next, open “Cloud Explorer” (View -> Cloud Explorer) and navigate to local developer storage. Expand table storage and view the two entries. Note the id for the key has been incremented: With an entry in storage, the next step is a function that takes the short code and redirects to the full URL. The strategy is simple: check for an existing entry for the code that is passed. If it exists, redirect to the URL, otherwise redirect to a “fallback” (in this case I used my personal blog). The redirect should happen quickly, so the short code is placed on a queue for a separate function to process statistics. Simply declaring the queue with the Queue binding is all it takes for the storage driver to create the queue and add the entry. You are passed an asynchronous collection so you may add multiple queue entries. Anything you add is automatically inserted into the queue. It’s that simple! Run the project again, and navigate to the new “Go” endpoint and pass the “BNK” parameter. Your URL will look something like:. You should see it redirect to the page you originally passed in. Refresh your Cloud Explorer and expand the “Queues” section. There should be a new queue named “counts” with a single entry (or more if you tried the redirect multiple times). Processing the queue ties together elements of the previous function. The function uses a queue trigger and will be called for and with each entry in the queue. The implemented logic simply looks for a matching entry in the table, increments the count, then saves it. Run the project, and if your Storage Emulator is running, you should see a call to the queue processing function in the function app console. After it completes, refresh your Cloud Explorer. You should see the queue is now empty and the count has been updated on the URL in Table Storage. Publish to Azure It’s great to be able to run and debug locally, but to be useful the app should be hosted in the cloud. This step requires an Azure Account (you can get one for free). Right-click on the ShortLink project and choose “Publish…”. Make sure “Azure Function App” and “Create New” are selected, then click the “Publish” button. In the dialog, give the app a unique name (it must be globally unique so you may have to try a few variations). Choose “New” for the resource group and give it a logical name, then choose “New” for plan. Give the plan a name (I like to use the app name followed by “Link”), choose a region close to you and pick the “Consumption Plan” then press “OK.” Click “Create” to create the necessary assets in Azure. Visual Studio will create the resources for you, build your application, then publish it to Azure. When everything is ready, you will see the message “Publish completed.” in the Output dialog for Build. Test adding a link (replace “myshortlink” with your own function app name): “ Then test the redirect: You can use the Storage Explorer to attach to Azure and verify the count. But wait – isn’t Azure Storage supposed to be secure? How did this just work without me entering credentials? If you don’t specify a connection string, all storage references default to an AzureWebJobsStorageconnection key. This is the storage account created automatically to support your function app. In your local project, the local.settings.jsonfile points to development storage (the emulator). When the Azure Function App was created, a connection string was automatically generated for the storage account. The application settings override your local settings, so the application was able to run against the storage account without modification! If you want to connect to a different storage account (for example, if you choose to use CosmosDB for premium table storage) you can simply add a new connection string and specify it as a parameter on the bindings and triggers. When you publish from Visual Studio, the publish dialog has a link to “Manage Application Settings…”. There, you can add your own settings including any custom connection strings you need, and it will deploy the settings securely to Azure as part of the publish process. That’s all there is to it! Conclusion There is a lot more you could do with the application. For example, the application “as is” does not have any authentication, meaning anyone could access your link shortener and create short links. You want to change the access to “Function level” for the “Set” function and secure the website with an SSL certificate to prevent anonymous access. For a more complete version of the application that includes logging, monitoring, and web front end to paste links, read Build a Serverless Link Shortener Faster than you can Finish your Latte. The intent of this post was to illustrate how easy and effective the experience of integrating Azure Storage with your application can be. There are SDKs available to perform the same functions from desktop and mobile applications as well. Perhaps the biggest benefit of leveraging storage is the low cost. I run a production link shortener that processes several hundred hits per day, and my monthly cost for both the serverless function and the storage is less than one dollar. Azure Storage is both accessible and cost effective. Here is the full project. Enjoy!
https://devblogs.microsoft.com/aspnet/azure-storage-for-serverless-net-apps-in-minutes/
CC-MAIN-2019-26
refinedweb
1,703
63.9
Below is the code I have, and the output is below that. It all seems right, but I don't want it to print out the 0's if they appear in the output. How do I do that? #include <iostream> #include <iomanip> using namespace std; int main() { double moneyOwed = 0.0; double moneyPaid = 0.0; double change = 0.0; int change1 = 0; int dollars = 0; int quarters = 0; int dimes = 0; int nickels = 0; int pennies = 0; cout << "Customer owes: $"; cin >> moneyOwed; cout << "Customer pays: $"; cin >> moneyPaid; cout << fixed << setprecision(2); //calculations change = moneyPaid - moneyOwed; change1 = change * 100; dollars = change1 / 100; quarters = change1 % 100 / 25; dimes = change1 % 100 % 25 / 10; nickels = change1 % 100 % 25 % 10 / 5; pennies = change1 % 100 % 25 % 10 % 5; //change cout << "Change due: $" << change << endl; cout << "Dollars: " << dollars << endl; cout << "Quarters: " << quarters << endl; cout << "Dimes: " << dimes << endl; cout << "Nickles: " << nickels << endl; cout << "Pennies: " << pennies << endl; cin >> change; return 0; } Customer owes: $1.30 Customer owes: $2.00 Change due: $0.70 Dollars: 0 Quarters: 2 Dimes: 2 Nickles: 0 Pennies: 0
https://www.daniweb.com/programming/threads/509702/change-calculator
CC-MAIN-2018-05
refinedweb
175
80.01
Component Extensions for Runtime Platforms Visual C++ provides language extensions to help you program against runtime platforms. By using C++/CX, you can program Universal Windows Platform apps and components that compile to native code. Although you can create Universal Windows Platform Universal Windows Platform apps in C++, see Roadmap for Windows Runtime apps using C++. C++/CLI extends the ISO/ANSI C++ standard, and is defined under the Ecma C++/CLI Standard. For more information, see .NET Programming with C++/CLI (Visual C++). Data Type Keywords. Override Specifiers (C++/CLI). Keywords for Generics The following keywords have been added to support generic types. For more information, see Generics. Miscellaneous Keywords The following keywords have been added to the C++ extensions. Template Constructs The following language constructs are implemented as templates, instead of as keywords. If you specify the /ZW compiler option, they are defined in the lang namespace. If you specify the /clr compiler option, they are defined in the cli namespace. Declarators The following type declarators instruct the runtime to automatically manage the lifetime and deletion of allocated objects. Additional Constructs and Related Topics This section lists additional programming constructs, and topics that pertain to the CLR. See Also .NET Programming with C++/CLI (Visual C++) Native and .NET Interoperability
https://docs.microsoft.com/en-us/cpp/windows/component-extensions-for-runtime-platforms
CC-MAIN-2018-17
refinedweb
212
50.73
Overview: This post will go over some simple but effective ways to setup common initialization and cleanup for Unit Tests on a larger scale than [ClassInitialize] and [TestInitialize] methods can provide for. First, to establish a common starting point I’ll go over some of the basics, if you’re already familiar with using the ClassInitialize/Cleanup and TestInitialize/Cleanup attributes in unit tests you may wish to skip this next part. Background: When you have some setup and cleanup code that needs to run for several unit tests typically you would put them in the same Test Class and use a combination of Class Initialize/Cleanup and Test Initialize/Cleanup methods. A simple start would be something like this: [TestClass] public class TestClass1 { [TestInitialize] public void TestInit() { Console.WriteLine("TestClass1.TestInit()"); } [TestMethod] public void TestMethod1() { Console.WriteLine("TestClass1.TestMethod1()"); } [TestMethod] public void TestMethod2() { Console.WriteLine("TestClass1.TestMethod2()"); } [TestCleanup] public void TestCleanup() { Console.WriteLine("TestClass1.TestCleanup()"); } } If you run both tests here the output will be: TestClass1.TestInit() TestClass1.TestMethod1() TestClass1.TestCleanup() and TestClass1.TestInit() TestClass1.TestMethod2() TestClass1.TestCleanup() The methods marked with the attributes [TestInitialize] and [TestCleanup] run before and after each test in that class. If instead you’d like to only run the initialization code once before all tests (not each individual test) you could use [ClassInitialize] and [ClassCleanup] instead, or you can also use them in combination. Going Beyond Local ClassInitialize and TestInitialize What can I do if I have a large project, with dozens or even hundreds of unit test methods spread across several classes and you want to share some setup or cleanup code between those tests? One approach would be to create some initialize and cleanup helper methods in a separate class and call those methods from each of your individual test classes initialize and cleanup methods. Another approach, the one I personally prefer, is to create a base class for your test classes. For example: [TestClass] public class TestBase { [TestInitialize] public void BaseTestInit() { Log.AppendLine("TestBase.BaseTestInit()"); } [TestCleanup] public void BaseTestCleanup() { Console.WriteLine(Log.ToString()); } public static StringBuilder Log { get { if (s_log == null) { s_log = new StringBuilder(); } return s_log; } } static StringBuilder s_log; } [TestClass] public class TestClass1 : TestBase { [ClassInitialize] public static void ClassInit(TestContext testContext) { Log.AppendLine("TestClass1.ClassInit()"); } [TestInitialize] public void TestInit() { Log.AppendLine("TestClass1.TestInit()"); } [TestMethod] public void TestMethod1() { Log.AppendLine("TestClass1.TestMethod1()"); } } Notice that the base class “TestBase” is also using the [TestClass] attribute, although we won’t be putting any test methods in this class. This allows the use of the [TestInitialize] and [TestCleanup] attributes within our base class. If you ran the tests in TestClass1 you would see the following output: TestClass1.ClassInit() TestBase.BaseTestInit() TestClass1.TestInit() TestClass1.TestMethod1() The [ClassInitialize] will always run first, it’s static and will be invoked by the unit test engine before instantiating the test class. Next we see that the Test Initializer in the base class is called, followed by the Test Initializer in the test class itself, and lastly the test method is executed. How can I create an initialization method that will run before any class initialization methods in my test project? Building on the common base class approach described above you could simply add a static constructor to your base class and either perform the initialization there or call the method that will perform the desired initialization. The resulting base class might look like this: [TestClass] public class TestBase { static TestBase() { s_log = new StringBuilder(); Log.AppendLine("TestBase.ctor()"); } [TestInitialize] public void BaseTestInit() { Log.AppendLine("TestBase.BaseTestInit()"); } [TestCleanup] public void BaseTestCleanup() { Console.WriteLine(Log.ToString()); } public static StringBuilder Log { get { return s_log; } } static StringBuilder s_log; } Will the same approach that was used for [TestInitialize] work with [ClassInitialize] in a base class? Not exactly, if you create a [ClassInitialize] attributed method in the base class it won’t ever get called unless you explicitly call it at the beginning of your derived test classes ClassInitialize method; which of course is nowhere near as nice as the above approach. If you really wanted this functionality you could hook the method calls using reflection and set things up that way, but that’s beyond the scope of this post. Setting up the relationship in the reverse would be much easier, but is of questionable value. By reverse order I mean that it would be easier to create a method that resided in the base class and was called once per test class but it would be called after the derived classes ClassInitialize method. The only viable option that I can come up for achieving an inheritable class initialization approach would be to ditch the ClassInitialize mechanism altogether and go back to good old fashioned class constructors. Example: [TestClass] public class TestBase { static TestBase() { s_log = new StringBuilder(); Log.AppendLine("TestBase.TestBase() <-- acts as ClassInitialize in base"); } [TestInitialize] public void BaseTestInit() { Log.AppendLine("TestBase.BaseTestInit()"); } [TestCleanup] public void BaseTestCleanup() { Console.WriteLine(Log.ToString()); } public static StringBuilder Log { get { return s_log; } } static StringBuilder s_log; } [TestClass] public class TestClass1 : TestBase { static TestClass1() //Replaces ClassInitialize method { Log.AppendLine("TestClass1.TestClass1() <-- acts as ClassInitialize in derived"); } [TestInitialize] public void TestInit() { Log.AppendLine("TestClass1.TestInit()"); } [TestMethod] public void TestMethod1() { Log.AppendLine("TestClass1.TestMethod1()"); } [TestMethod] public void TestMethod2() { Log.AppendLine("TestClass1.TestMethod2()"); } } Running TestMethod1 in the derived class produces the following output:<?xml:namespace prefix = o TestBase.TestBase() <-- acts as ClassInitialize in base TestClass1.TestClass1() <-- acts as ClassInitialize in derived TestBase.BaseTestInit() TestClass1.TestInit() TestClass1.TestMethod1() TestBase.BaseTestInit() TestClass1.TestInit() TestClass1.TestMethod2() PingBack from I don’t think that the last part of your post is accurate. MSTest creates your test fixture once for each test and hence it does not double for ClassInitialize. TestDriven.Net DOES support inheritance of ClassInitialize but it does not support AssemblyInitialize. In addition, if you’re using MSTest you’re probably looking to it for the TFS integration so you have to make sure that works too. Good catch George, I corrected the last part so that it works as described. The constructors should of course be static in order to work as the static ClassInitialize would. Your approach of putting common initialization code in a base class is perfect, with one caveat. If you use the nifty new TestCategory attribute, your inherited code won't get run if you specify one or more categories, unless you give the base class its own category (i.e., "always"), and remember to always specify the "always" category. After more research, things seem a little more complicated. TestInitialize and TestCleanup seem to work from the base class, regardless of categories, even if the base class isn't marked as a TestClass. ClassInitialize, ClassCleanup, and AssemblyInitialize, however, only seem to work from the derived class, regardless of categories, even if the base class is marked as a TestClass. This is Visual Studio 2010 SP1 targeted at .NET 4.0. I came across something weird: I have a base class with TestClass attribute which contains the common TestInitialize and TestCleanup methods. In the derived test class, I am running a data driven test method which reads data from an XML file. The XML file has several rows of data. When executing the test method, for the first time the TestInitialize method from the base class is called alright, the test method executes and the TestCleanup from the base class is called. Now for the second iteration the TestInitialize method of the base class is NOT called, the test method executes and the TestCleanup of the base class is called, effectively screwing up the whole testing. Is this a common phenomena, are there any workarounds? Good info, covers *almost* everything… How would you do the equivalent of [ClassCleanup]? I've tried finalizers but they don't seem to do what I'm expecting…
https://blogs.msdn.microsoft.com/densto/2008/05/16/using-a-base-class-for-your-unit-test-classes-2/
CC-MAIN-2018-34
refinedweb
1,292
53.41
The London Times is.” See the Times article here And from Richard North at The EU Referendum, this video news report link and his commentary:”. Read his complete essay here He’s gone now, dead man walking Here is a great clip from an interview panel featuring Pachauri and the head o the California Air Resources Board (June 2008). It’s quite revealing to weigh Pachauri’s claims and his rhetoric against what has been learned in the past few months. Here’s a sample: PACHAURI: . URL: Cheers, Ken in North Dakota And he called the Indian Scientific position arrogant? Certainly no respect or consideration for any organization or for anybody. Should be booted out into the alley. The front door is too good for him. Mr. Railway Engineer, you do know what the light at the end of your tunnel looks like? We still have a long way to go. It will take a lot more disclosures of lies, manipulation, frauds and debunking before the warmist’s give up as becomes clear from the following example: While paying lip service to skeptics, UK chief science advisor insists it is “unchallengeable” that man is changing the climate! Are you sure Dr Pachauri isn’t from Chicago? Sounds like Chicago politics to me. “within three or four days, we were able to come up with a clear and a very honest and objective assessment of what had happened” Hmm… I heard no mention of Halcrow Consulting anywhere in the ‘honest and objective assessment of what had.” From the World Wildlife Fund web site: Climate Witness Science Advisory Panel (SAP) Prof. Dr Murari Lal, specialises in global and regional climate variability, scenario development, regional environmental change, … ecosystem modeling, regional adaptation & mitigation potential, water resource management; Environment and Carbon Trading Group Halcrow Consulting India Ltd., India Did you catch that: Carbon Trading is part of the Environment Division, now that is a surprise. “Environment and Carbon Trading Group Halcrow Consulting India Ltd., India” See also: From the CRUs own website we know the World Wildlife Fund funds the CRU. bottom of this page:->WWF->IPCC Carbon Trading->IPCC Carbon Trading->IPCC->Carbon Trading or Carbon Trading->Pachauri->Carbon Trading An employee of a Carbon Trading department, working for the World Wildlife Fund, submitting bogus content to the IPCC, just to scare people into implementing Carbon Trading. Does that look like a mistake to you? OT- the Penn State report is late. Anyone see it? Somehow this context reminds me of the wonderful little book, “On Bullshit.” Pachauri appears to be a consummate BS artist. I think what happens to bad BS artists is that they stop believing in their BS, and they are caught, or lose their stomach for it. And what happens to great BS artists is they believe their BS, they run too many absurd bets against reality, and eventually reality calls them on it, and they fail. Pachauri’s bet has been called. My own bet is, he’s gone in a month. I am torn between wanting to see him gone sooner (so he does less damage) and later (so he twists in the wind, and damages the IPCC brand with his contortions). Hear no Evil! A whimsical look at the Senate reaction to Obama’s claim of “the overwhelming scientific evidence for Climate Change”. Whether he can hold on to get out AR5 is the least of Dr Pachauri’s problems. As damaged goods, who will want to hire him post-IPCC? For his influence and pull? Will those with grants want to dispense them to any activity which hires him? I perceive that Pachauri will brass it out until the bitter end. This is actually a blessing in disguise since it will take down the IPCC as well. It will stain the UN also. But it will be hard to see that stain on such an already discolored reputation. Pachauri keeps hanging himself. All anyone wants fron the UNIPCC is simply transparency, accountability and responsibility. When their climate claims are exaggerated, manipulated and made up then it is unlikely we will get what we want anytime soon. At last Pachauri and company are toast? Weird newscast. It gave all sides of the story. Pachuri isn’t going to stand down cause he says he’s going to stand up!? On the 4th of December, Pachauri put out a statement that included: .” And: “In summary, no individual or small group of scientists is in a position to exclude a peer-reviewed paper from an IPCC IPCC assessments comprehensive, unbiased, open to the identification of new literature, and policy relevant but not policy prescriptive.” “No possibility” and “no ability” are emphatic statements. They are falsified by the existence of even a single contray example. So he knew that these statements were false when he issued them. Uh oh. .” Damning evidence that Pachauri is corrupt — the bigger question — how many other people at the IPCC are equally corrupt and how high and far does it go? This latest development has to be linked to Pauchauri’s comments in early November when he was challenged on the glacier issue and accused the Indian scientists/government of being arrogant and guilty of voodoo science. It would appear that when he made these serious accusations, he already knew that the IPCC report was wrong and there was no scientific evidence backing up the IPCC glacier claims. Accordingly, it would appear that at the very least he was being disengenuous, if not deceiptful in not answering honestly/truthfully the issues of doubts raised in November. This looks bad for the chairman of a supiosedly independent scientific body. what a classic response from pachauri! Science Mag: Extended Interview: Climate Science Leader Rajendra K. Pachauri Confronts the Critics Pallava Bagla Q: Has all that has happened this winter dented the credibility of IPCC? R.K.P.: I don’t think the credibility of the IPCC can be dented. If the IPCC wasn’t there, why would anyone be worried about climate change? The BBC published these denials by Pachauri on Dec. 5, 2009. Article by above mentioned Bagla. They’ve been sitting out there little noticed all this time. “Himalayan Glaciers Melting Deadline a ‘Mistake’,” by Pallava Bagla in Delhi. Includes Pachauri calling India’s Environment Minister Ramesh’s findings on glaciers “voodoo science”. Why would Pachauri feel that he could pull this on his own people? What am I saying? Gore almost got away with it too… Where does this put the EPA and CO2 controls? “Oh what a tangled web we weave, When first we practise to deceive! ” [Sir Walter Scott] Ken – that clip is an absolute ‘gotcha.’ Clearly, Pachauri does not feel bound by facts when a good cause is at stake. He needs to go, not only for the credibility of the IPCC, but for the credibility of science. The reason that warmists are losing the debate is that they are not arguing on the basis of facts, but choose instead to push implausible propaganda to motivate action. It is a stupid strategy, that has now been found out. If leading physical scientists don’t start condemning this use of spin, bullying, and half-truth, large sections of the public may lose faith in science altogether. Not just climate science, but all public science. If the IPCC goes down, so does the EPA endangerment finding. We will all miss Rajendra Pachauri when he’s gone. Slicker, more polished crooks in high places hope the story will stop there. With kind regards, Oliver K. Manuel Emeritus Professor of Nuclear & Space Sciences Former NASA PI for Apollo? This is a brilliant report from Ninad D. Sheth “I did not have sex with that glacier.” (I reminded myself of my 1st marriage on that one ;)…. Why does this surprise anybody, this ‘charade’ as it has been exposed? It is drawing out now only the *thickest* of low-level trolls who are becoming as ‘thick as fur’ … gone are the days when Joel Shore, noted physicist would debate and argue actual (albeit perhaps obscure, non-essential) technical points, we now have certain ‘thickheads’ who don’t even know the basis (initially counter SM and MM), the beginnings (David Fenton communications), the reason for existence (promote _only_ the AGW viewpoint) of RC (realclimate.org)!!!! . . Ken Smith (17:54:52) : “Here is a great clip from an interview panel featuring Pachauri and the head o’ the California Air Resources Board (June 2008).” Do you mean this CARB?? Oh, bother (18:03:33) : “Mr. Railway Engineer, you do know what the light at the end of your tunnel looks like?” No, but the higher-ups have selected him to inspect the undercarriage of the train they’re preparing to toss him under. Cleansing the IPCC of Pachauri no more cleanses the IPCC than firing Phil Jones,Michael Mann, and their ilk, would cleanse the legacy of IPCC ‘science’. The entire administrative edifice of the IPCC should be discarded and replaced with nothing at all. This intergovernmental attempt at supranational administration is revealed to be a failed experiment. The IPCC, from its creation, was an agenda immune to refutation. We seem to be forgetting that these people are career diplomats/beurocrats. As such their lives revolve around reaching agreements and consensus. With that in mind, I contend Pachauri will neither resign nor will he be sacked. What will happen is that he will be PROMOTED within the UN, with the usual accolades and thankyous for his dedication yada yada yada. Don’t be surprised if Yves De Boer isn’t standing beside him at the press conference announcing this. Show of support wink wink David Ball – Re: Skepticalscience, I post there sometimes, it is a very well run sight, and except for a couple of contributors, most of the regulars seem to be very ernest. I am not a sceptic per se, but a lukewarming fencesitter, so it is nice to be able to get some of my questions answered by both sides in a respectful manner. Try it! P.S. I do not post controversial stuff, cuz I am way out of my league, I just ask questions of things that interest/bother me. I –finally– begin to smell the distinct aroma of toast. Oliver K. Manuel (18:58:46) :?> If only it were that simple. The rot goes far beyond the scientists, they are just the front lines. If we were talking about infantry, they would be called “bullet stops”. The roy will protect itself. The scientists will leave one by one, each with a severance package requiring non-disclosure of terms and issues. That protects the scientists because they legaly can’t discuss what happened and why for fear of losing their severence package. It protects the rot higher up because now no one is going to give up their severence package to let the cat out of the bag that they were just producing the results that the higher ups wanted. They’ll quietly find low profile jobs with the assistance of the political hacks they are protecting. The IPCC will get reorganized or dissolved and replaced, with the political hacks who now cannot be implicated still in charge. When a suitable time has passed they quietly resurrect their soldiers with new titles and positions and issues to manipulate the tax payer with. I wish it were not so, but I am old enough to be cynical and to have seen history repeat itself. CAGW Theory Avalanche Danger has been updated to: Unprecedented OT – Question Where is Al Gore these days? not “roy”… “rot” David Ball (19:06:11) : SlightlyO/T~~ I see that skepticalscience blog has misrepresented skeptics by an order of magnitude. Alarming. David, most alarming to me is that they would like to literally silence all opposition. The first indignant reaction is always, “blah blan Shouldn’t be allowed!” Stalin would have been proud. I have a particularly insightful comment here from over at realclimate: ****1.. 2.!*************** We teachers joke about the weak “Gene Pool” sometimes. But this is proof. Leo G (19:32:05), The fact that an alarmist propaganda blog, which censors uncomfortable skeptics’ posts, calls itself “Skeptical Science,” should make it clear to you that they are starting out with a lie from the get-go. Believe their AGW spin if you want to. But I’d hope you would be smarter than that. Ask your questions here. You will get much more honest answers. ClimateGate2009 (18:16:17) : “A whimsical look at the Senate reaction to Obama’s claim of “the overwhelming scientific evidence for Climate Change”.” The full quote that the Demmunists are snickering at is something like: “Did you know that there are actually people who deny the overwhelming scientific evidence for climate change?” Imagine that. “The chairman of the leading climate change watchdog was I once said on WUWT that Pachauri should resign. I have since then changed my mind because I think he has become our best ally. :o) Quote: bateman (19:33:23) : .” Exactly! I have observed and could name members of the round robin-ed circle of peer-reviewed trust for space sciences since the early 1960s. But I was more disturbed when the Climategate scandal exposed these scientists and the UN’s IPCC as part of an unholy international alliance of politicians, scientists, news media and publishers that have used science as a propaganda tool to try to control the world. That is frightening! In the best of circumstances, self-governance may work if the people have reliable information. What’s how it looks from the “Show-Me” state, Oliver K. Manuel Smokey (19:56:30) : Smokey (19:56:30) : Leo G (19:32:05), Ask your questions here. You will get much more honest answers. Ask at both sites, and compare your answers. Where is Al Gore these days? I think he’s over at Sherwin-Williams trying to develop a new white wash. davidmhoffer (19:45:25) : If only it were that simple. The rot goes far beyond the scientists, they are just the front lines. If we were talking about infantry, they would be called “bullet stops”. The rot will protect itself. The rot will try to protect itself; that’s what this whole thing has always been about. Depending on how this plays out, AGW could become a textbook case in how scientists can go bad. Scientists are highly egotistical and many of them do not take criticism well. Even though this is contrary to the principles of science, it is not contrary to the principles of psychology — it is typical human nature. The whole thing is nothing more than a classic case of abuse of power by pusillanimous people. And now the whole thing is collapsing. Popcorn? “Jimbo (19:46:23) : OT – Question Where is Al Gore these days?” And how about our friends Joel Shore, Tom P et al.? Hello,….. Policitians, Main Stream Media, Wake up. How long are you going to have your head stuck on stupid? Parliament is not in session and you cannot learn anything while your typing drivel. Maybe spend some time on the internet and search climategate, IPCC AR4 bogus, scandals at the CRU, NASA and Penn State. You will be very surprised to learn a lot of things have happen since your went and Rip Van Winkled on us. IPCC AR4 is a fraud and all the scientists involved in this have their reputations and credibility in disrepute. You will now realize there is something important to write. Like, Why are we on the doorstep of signing legally binding legislation based on a false report. You could also ask the politicians why they Rip Van Winkled. Hello, are you still sleeping….Wake up and get your head out of stupid. They call him Pants-down Pachy round here The time is not now – but its near When quizzed about ice He replied in a trice “I’ve been cate-gore-ickly clear” That is frightening! In the best of circumstances, self-governance may work if the people have reliable information>. watcword is vigilence. Albert Einstein said he did not know what wespons keboard and an ethernet cable. The shaman’s mistake was inventing writing. My regrets to the many femaile posters here, I’m just to sleepy to word this to be more inclusive, but rest assured I mean all of us. So long, Choo Choo You gonna get back into the failed solar panel business that you had in Europe? You could never find an “angle” to make people want to buy solar panels because they weren’t worth the money – you figured the only way to get people to buy solar panels, was to have the Government FORCE people to buy solar panels You figured wrong, Choo Choo O/T but perhaps informative: This will all definitely end up in court. This might also help to explain the position of the BBC, the Environment Agency, other Government and some Universities. : FIVE AND A HALF TRILLION DOLLARS!!!! These guys are in this [expletive deleted] deep, and many may stand to loose their pensions, and some churches other than the ‘Church of AGW’ may also loose their robes. It is going to be a mess. It will definitely end up in court. Members of the IIGCC include [I trimmed the list a bit]: Baptist Union of Great Britain BBC Pension Trust Just a crazy thought for the US readers here. The US constitution requires a separation between church and state. Specifically it states the US government shall not establish a state religion. Environmentalism in general (endangered species, zero threshold tolerance for all toxins) and anthropogenic global warming specifically (we are all going to die unless we live in mud huts again) meets all of the qualifications describing a religion. The proponents are immune to logic and prosecute their non-scientific beliefs with religious zealotry. They have insinuated themselves into government and are making their personal faith the official US national religion. I wonder if there is a constitutional challenge or remedy to reverse this religious takeover? Otherwise these religious environmental mullahs will ruin this country. Fraudulent science was used to buttress the AGW premise and it was found out thanks to WUWT and others. I wonder how much fraudulent science is being used to stand-up the other enviro-green arguments. I think it may be a rich mother-lode for others to mine. These may be easier to topple than AGW was. We never voted for these religious environmental mullahs. We never had a choice. Mariss Did we transit in Bizzaro World when the sun went blank for the last two years? You could hold a black card in front of their faces and they would still claim it is white… unbelievable! Can we have those Indian journalists come here to the U.S.? It seems like they actually do their jobs, ask questions, consider all sides, realize BS when they hear it and report the truth. Most of our media? Not so much. In the thread title, “Pachuri” should read “Pachauri”. Anyone has noted already? Was wondering if you saw my belated reply to you on the “Mosher:The hackers” thread? This presumes that he actually believed the story in the first place. Please. This is simple foolishness. Like predicting the Greenland Northern ice table will melt in 10 years. Fantasy. Bogus physics. It is a con. He was in for the money. Think craps table. Oh, bother (18:03:33) : “Mr. Railway Engineer, you do know what the light at the end of your tunnel looks like?” I’m picturing Wile E. Coyote slowing turning to look at the camera… Kate (19:50:45) : Is there such a term as speciesist? The self loathing is shocking, only exceeded by the dangerous line of thinking in “the common people” view. This man need also to experience a subsistance level lifestyle for a year or so. Yes we have issues to sort out. There have been improvements which are being ignored and downplayed. But to view civilization as a curse (which Hansen has said recently, n’est pas?), saddens me tremendously. @ davidmhoffer Your post immediatley above is very moving and inspirational! I think all of us here are very conscious that we are witnessing – partaking in – a very important moment in the human story. I can’t contribute to the science but I’m doing my best instead to disseminate the facts and to bring this site and a couple of others inc CA to the attention of as many people as possible, so to assist the collective effort in another way. Thank you Anthony for having persevered, and for providing this extraordinary ‘environment’ in which the truth can seed, grow, and take wings. I don’t have children, but those who do will be forever in debt to you and those like you who’ve fought the good fight. My post of (22:17:47) was directed to davidmhoffer (21:01:36) . Thanks Someone above asked where Al Gore is. I wondered, too, because I thought maybe he finally found some dignity somewhere to stop this nonsense. But no! He’s busy right this moment pushing this climate hysteria as religion. See my post and click links (the religion post on his site is dated 1/22/10). Gore – with Yale University, of all places, and churches – is desperately working to indoctrinate people, complete with prayer, in climate change. I think everyone probably already knows about his company Silver Springs, which will provide software and meters to monitor our carbon usage. Not only is that Orwellian and creepy, but he’s going to make millions, billions… No wonder he’s cramming this crap through as religion. He wants his damn money and he wants it now!. One last thought, why can a person – like I heard on the news the other day – go away to prison for stealing a trench coat, but Gore is involved in deceiving everyone on the planet for his own gain – yet he’s not locked up? What if Pachuri is only a front man — for bigger fish pulling the strings… And now that AGW is crashing down — he’s the designated fall guy — not that he isn’t guilty, mind you, just that he isn’t alone… As of my writing foxnews.com is now carrying this story on top of their home page, left column. The headline in the graphic that has a photo of Mr. P. sez: ”Before Copenhagen, Climate Chief… KNEW OF ERRORS”. When you click on the photo at foxnews, the underlying piece links to the same Times Online article as this thread start. AND: If you click on the foxnews link UNDER the graphic that sez: ”U.N.’s Global Warming Report Under Fresh Attack for Rainforest Claims”, they have a piece that is IMO a good summary of Amazon-Gate. Attaboy, FoxNews. . . . :-] CNN ?? . . . Nowhere that I can see. . . . Someone floated the idea on another blog yesterday that Pachauri had been put in place by the Bush admin with the express purpose of discrediting AGW/climate change and bringing the whole shebang into disrepute, but I find that a little farfetched esp as they might well have got away with the scam without CRU/Climategate. But in the Alice in Wonderland world of climate change, who can rule out any scenario?. Clear voodoo chairmanship…..Pachauri now a zombie! Andrew30 (18:07:17) : Damn good points Andrew….. Pachauri’s goose is cooked. That’s ironic considering he’s a vegetarian an’ all;-) Screwing these warmist Watermelon types is getting to be more and more a necrophilic perversion. I expect soon that they’ve have lost even the ability to flinch when you stick it in ‘em. –. jaymam (23:16:34) : “He should believe in ‘global warming’ since that is happening, slightly” Apart from the fact that “believe in” is an inappropriate terminology in this context… doesn’t the truth of “global warming is happening” depend on the time scale you are referring to, and the integrity and accuracy and adequacy (all of which are questionable at this stage of our knowledge) of the data you base your opinion on? Andrew30 above discusses the Institutional Investors Group on Climate Change (IIGCC), which “represents assets of around €4trillion” and includes a whopping number of prominenten in the U.K., both social and governmental. I’ve got to figure that there are similar critters, institutions, and aggregates who are stuck deeply into this same humongous fiscal Tar Baby in these United States, and there are foxes and bears a-plenty slavering to rend their flesh. One of the principles of economics is that malinvestments must be liquidated. The financial slight-of-hand types who inflated the residential housing bubble in America and made it “the way to promotion and pay” had long known that it was soon coming to a pop, and obviously they’d been manipulating the “global warming” fraud as a vehicle through which they could fasten their fangs at another point upon the body politic’s jugular vein. Those who took their counsel and followed these “master of back-stabbing, cork-screwing, and dirty dealing” types into positions in this castle-in-the-clouds environment are now hearing the gurgle-gurgle of flowing currency circling the drain. Look forward to another “stimulus package” from Barry Soetoro and his little ACORN elves as the politically connected swashbucklers on Wall Street squeal (again) for rescue. Where are Joel Shore and Scott Mania when we need them? They made a high quality counter point to the rest of us-including me-singing from the same song sheet. Are they embarassed at the recent deluge of information which seems to point out their position was based on incorrect information? Or did they merely become exasperated at being the lone voices. Debate is good. Come back Joel and Scott-all is forgiven. Tonyb davidmhoffer (19:45:25) : erm, yes. I think that’s what happened to the excellent German scientists after WWII. Reformed into NASA or the like. And your spelling was not a mistake. “Roy” means “royalty” after all :) Each one of them will stay completely incapable to admit an error until they’re thrown under the bus. Ignorance was their recipe to success, ignorance will bring them down. Loot at Gore. He learned that when you don’t know the answer to a question, just invent one that suits your needs and try to get away with it. Asked about the temperature of the earth’s core, he hesitates, then laughs nervously and says millions of degrees. Pachauri is exactly like that. They make their answers up as they go. Pachauri, Gore and the entirety of The Team make up their answers as they go. It’s an entire culture of con artists. Climate sceptics bask in warmth of bad news. No. MOD!! [Thanks, fixed. ~dbs] Jus’ followin’ the tracks.. “DirkH (00:46:20) : [...] They make their answers up as they go. Pachauri, Gore and the entirety of The Team make up their answers as they go. It’s an entire culture of con artists.” …look at this explanation by Vicky Pope about how the long term projections by the Met Office are made and how reliable they are. Start watching at 0:55. She says they made 400 models, “representing all that we know about the uncertainty of the science in our models”. Wait. They can cover all parameter permutations of the things they don’t know and thus have to parameterize to run a model at all with 400 runs? No. Again, this is making up an answer and trying to get away with it, a bald faced lie. They made 400 models because that was the maximum number they could run in the timeframe given. The entire philosophy of climate “science” is: when we can deceive 85% of the population, that’s more than enough in a democracy. It’s not even an attempt at believable propaganda. It’s incompetence and confidence tricks wherever you look. Chili palmer (18:52:49) I notice NOW the BBC report of Dec. 5. 2009 that you have highlighted was inconspicuously hidden away in the South Asia section of the BBC site, not exactly somewhere I would normally read, very convenient if the BBC didn’t want to rock the boat 2 days before Copenhagen. Well worth the read thanks. Something that should not be overlooked here, with regard to the bigger picture, is that this is yet another ‘sceptical’ article in the London Times. The two left-leaning UK papers, The Guardian and the Independent will never express scepticism over AGW because to them Man-made Global Warming is short for Western Capitalist Man-made Global Warming and to question that would be to question their whole raison d’être. However, the centre/right-wing press is becoming much more outspoken (and, if you ever read the comments on an AGW article in them, with justification if they want to keep their readership). What with the Climategate enquiry, the Parliamentary investigation, the Lawson think-tank being set up, and the upcoming election, amongst other things, it does look like the UK is going to be the major battleground over AGW in the coming months. The ongoing very cold winter is also helping the sceptics’ cause. At the moment, the momentum is all with the sceptical side thankfully. I agree with I once said on WUWT that Pachauri should resign. I have since then changed my mind because I think he has become our best ally. :o) I agree. It’s Machiavellian, but the longer Pachauri and his followers try to defend the IPCC the more opportunities there will be to get the media on our side and expose the IPCC’s political agenda and corrupted science (and the problems with CRU, GISS and USHCN etc.). The reality is that while we are winning the scientific arguments, the media are only just beginning to take an interest , and there are still many people and politicians who are convinced the planet is heading for catastrophic warming as a result of our CO2 emissions, who will not willingly divest their personal and financial commitments to AGW. Much depends on the course taken by the mainstream media; will they let their love of scare stories (like the Himalayan glaciers disappearing by 2035 – which perfectly demonstrates their scientific illiteracy and gullibilty) get in the way of proper investigation of what is arguably the largest scientific scandal in history? Having seen how the MSM failed to question or take any interest in the many holes in the offical 9/11story, and then lapped up the illegal war in Iraq, I am not too optimistic that we can rely on them too much. The BBC had the bones of the glaciergate story on December 5th – but buried it on the south-asia section of their website. Likewise the CRU emails and code, which they sat on for weeks, and then, even after it went viral on the web, they chose to ignore and play down, apart from an odd 5 minute report on Newsnight. It seems that Andrew Neil and Stephen Sackur are the journalists in the BBC with any credibilty. This is going to be a long battle, and I fear it may well take a few more long cold winters in the NH to get the idiots in Washington, NYC, London and Berlin to see the light. Looking at the geo-politics of AGW, there is no way that the Russians and Chinese will go along with significant CO2 emission reductions, as their economies are too dependent on fossil fuels and economic development. The question is whether they will be happy to watch the west waste money and resources on pointless AGW mitigation policies. In the cold war, this would have been the obvious course of action for them. But now with a global economy, and so much Chinese investment in the USA (and UK), they will hopefully want to see some return (or at least get the interest payments back), which is much more likely if we have functioning economies, where we burn coal and oil for heat and energy, rather than fanny about trying to capture the CO2 in it. So the Chinese and Russians are going to be key players (and allies) in the political battle to overthrow the AGW alarmists. (And I have no problem with that, the planet’s too small for us all not work together). Sorry, that was meant to be a short comment, but its Saturday morning and freezing outisde. >. The BBC needs putting out to grass – or perhaps putting down. It is past its sell-by date. . The Times link is incomplete, here is the full one: Pachauri already has his next career move sorted. He is going to be a writer of fiction and his first book is already out. Easy transition. It amazes me how one man can be on so many dfferent boards and panels, he must have written this whilst flying around the world to save the planet. In his own words: “The major financial scandal that one of the largest IT companies in India, Satyam Computer Services Limited, has been involved in has shaken the confidence of the public, of the government and the corporate sector in general across India. Given the size and scale of this major fraud, there would also be several organizations across the world that would also be affected profoundly by this development particularly those that have had dealings with Satyam. Cases of corporate misdemeanor and fraudulent and unethical acts by top management appear to have become widespread in recent years, and this at a time when the social, environmental and governance challenges facing human society require a high sense of corporate social responsibility and ethics in corporate organizations! (his exclamation mark) I am seriously considering the launch of a global movement called Forum for Revival of Ethics & Ecosystems for and by Youth (FREE Youth). Would those who read this blog care to provide any reactions? “ vibenna (18:55:38) : “If leading physical scientists don’t start condemning this use of spin, bullying, and half-truth, large sections of the public may lose faith in science altogether. Not just climate science, but all public science.” It appears that the era of men and woman with integrity has passed. Science, money and politics are so interconnected; it is actually – Politics – money – science. “Here are the answers, here’s the money – find us the questions.” Loose faith! – It would take a reformation complete with “the inquisition” (not quite – but close) to restore mine. What’s that you say? The outstandingly respectable Dr P deliberately making a false statement (or two)? Getting EU research money after he knew his data was wrong? Shurely Shome Mistake? “Ralph (01:31:17) : >. ” Not entirely fair! i read the mentioned article on Dec 06th – it was linked to on the South Asia section of the news that day. As i’m interested in what happens in India, Pakistan etc i check that page regularly, and there it was. Granted, it should also have been linked in Science/Environment which it wasn’t. This was written before Copenhagen: . Sometimes it’s difficult for me to understand the way TV viewers process information. It’s been such a long time now i last used TV news. I am am just repeating another blogger – but can’t resist Calling Joel Shore – Calling Joel Shore – Calling Joel Shore – Where are you we need you for balance!!!! Sorry – just could not help myself.!!! Richard North is doing a superb job in exposing Pachuari and the IPCC for what they are. He should be Knighted for ‘services to realism”. Thank you Richard. Please keep up the great work. I clicked on the Speakers Bureau ad just for fun. Pachauri is top of the environment list here, some other noteworthy names there as well, including Crispin Tickell, Maurice Strong and intrepid explorer Penn Hadow: .” You can hire Al Gore here: ” James F. Evans (22:49:43) : What if Pachuri is only a front man — for bigger fish pulling the strings…” In German the saying goes: ‘The fish starts to stink at the head’. So you would have to wonder what body part Pachauri is. And who is the head. DirkH (01:55:53) : . The BBC’s website is so extensive that unless a story is linked from the front page or a regional front page, or for example the Science/Environment section, it is effectively hidden. I came across the BBC’s Himalaya Glacier pages – Himalayan glaciers’ ‘mixed picture’ (December 1st) and then: (Himalayan glaciers melting deadline ‘a mistake’ Dec 5th) back in December, totally by accident, while looking for something else. And I suspect that both the pages were put on by the South-Asia editor, without approval from the BBC’s Politbureau / ‘Policy Unit’ in London. They certainly weren’t picked up by any UK BBC staff anyway. Right, must go out, the sun has now finally risen over the distillery roof, so it might just be above freezing. Money laundering the Russian way? If you want to broaden the scope a little, try these emails. They are only part quoted and there is a chance that I have missed some continuity; but it sure looks fishy to me. (Some email parts have been deleted for brevity, without changing the meaning) …………………. From: “Tatiana M. Dedkova” To: K.Briffa@uea.ac.uk Subject: schijatov Date: Thu, 7 Mar 96 09:41:07 +0500.. ………………………………………………. From: “Isaak M. Khalatnikov” To: k.briffa@uea.ac.uk Subject: Keith Briffa Date: Tue, 10 Jun 97 07:18:26 +0400 (MSD) Dear Keith, Thank you for the message of 5 June, 1997. I am anderstanding your difficulties with transfering money and I think the best way for us if you will bring money to Krasnoyarsk and I give you a receipt. Rashit will go to Yamal at the end of June and I go to the Polar Urals at the beginnind of July. We can find money temporary at our Institute and other sources for three months to fulfill our fieldworks. Sincerely yours Stepan Shiyatov …………………………………………. From: Keith Briffa To: evag@ifor.krasnoyarsk.su Subject: transfer Date: Wed Nov 18 11:04:42 1998 Cc: stepan@ipae.uran.ru Eugene I am told that the money transfer ( 5000 u.s. dollars) should have gone to the bank account you stated. Please let me know if this is received by you. I am also sending Stepan’s 5000 dollars to Switzerland now to be carried back by his colleague. best wishes Keith …………………………….. From Richard North’s site I noticed this dated 29th Jan so I await the full report with interest Mpaul@634, of course what the guy is saying is absolutely correct, no one scientist or group can keep peer reviewed papers out of the IPCC. However what the moron has side stepped is the very fact that individual scientists and groups HAVE conspired to keep papers that go against Mann made global warming ™ from being peer reviewed in scientific publications and to keep those papers from being published, which in effect means they can be ignored by the IPCC. Unless of course that paper is from the wwf et al. Regards Mailman I made a funny spoof trailer starring Pachauri as the Wolfman of Copenhagen, must watch and rate! Enjoy! “The chairman of the leading climate change watchdog was informed that claims about melting Himalayan glaciers were false before the Copenhagen summit…” I suspect that Pachauri knew long before Dec 09. OT, but here in Australia, the media are on an all-out scare campaign. Stranded walruses a scare website is and it appears to be in German, ice meting, the same old adverst on TV with black carbon balLOONs escaping up into the sky etc. And in February, the Govn’t tries to sell an ETS to the Senate. Icing on the cake tonight; Doom gloom movie “The Core”. Good one, zombiehellmonkey. I gave it 5 stars. Talk about condemned out of his own mouth- from pat(18:49:17) Quote from Pachauri “If the IPCC wasn’t there, why would anyone be worried about climate change?” Indeed, why would they? When did Pachauri Know? We know he knew in Dec ‘09, but he first said he knew in January ‘10. However when he knew we knew he knew in Dec ’09, he said he did know but he was too busy. I reckon he knew before we knew he knew but he knows that we don’t know that for sure! zombiehellmonkey (02:46:46) : Yup – it’s got to be 5 stars. Andrew30, wow stunning find; the BBC and a great deal of local authority pensions depend on AGW that explains everything! Sooner this comes crumbling down the better, if I was told my pension was fragged because of this I might break out the pitchfork and go for the people who instigated this dodgy investment plan. Would Dr Phillip Bratby contact me? (email via Anthony please). Louis Hissink Editor, AIG NEWS @David Ball (19:06:11) : ?” Sure, give it a try, but keep it academic and polite. A little circularity may help your post get past the moderators. At the very least you’ll create some extra work for their censors. skepticalscience is run by an Aussie. Usually those guys tend to be rather cool headed, but realize that right now Australia is in the midst of their summer heat. I’m not surprised that you’ve been blocked at numerous alarmist sites, since blocking dissenting views is the hallmark of propagandist sites that have an agenda, have an aversion to debate and don’t give a **** about the truth. Andrew30 (18:07:17) : “…within three or four days, we were able to come up with a clear and a very honest and objective assessment of what had happened” Hmm… I heard no mention of Halcrow Consulting anywhere in the ‘honest and objective assessment of what had happened’.,,” Roger Knights (00:59:47) : “.” Your both right I think, Dr, Lal will be sure to get the chop as well. I was amazed to hear his confession of guilt in the Daily Mail article – it beggars belief! Excerpt and URL to full article below:-…” I keep thinking about the old myth about how foxes rid themselves of fleas by grabbing some wool in their mouth and backing in to water until all the fleas are on the wool, and they let go of the wool. If you think of the IPCC as the fox, Pechauri as the wool and the fleas as inconvenient truths and criticism…. The pseudo-science is settled, the only remaining problem is reality. Geoff Sherrington (02:35:08) : From: “Isaak M. Khalatnikov” to Keith Briffa In view of what has happened, perhaps that should have been “Kalashnikov”. “within three or four days, we were able to come up with a clear and a very honest and objective assessment of what had happened” And after less than a week the science was settled again. Pechauri ? not Pinochio? If he were it seems as if his nose would be at least 6metres long. David Ball (22:43:16) : My post of (22:17:47) was directed to davidmhoffer (21:01:36) . Thanks Saw it Dave, but have since dropped the thread. Blowing through cowtown on weekend, will wave as I go by. They are all complicit in the IPCC lies, that’s how these things always turn out. Patchy Pachauri tells lies Whose size justifies our surprise When he slips in a trice On the Glaciergate ice No-one denies his demise [snip if you want!] As it happens, we were all terribly preoccupied with a lot of events. We were working round the clock ———————————————————– We were studying the effect of the Royal We and got distracted. It was horrid, you should have been there, we would have waved. The Nationalpost is not quite mainstream, but they are one of only two national papers in Canada. That said, the writer is full time with the CBC (Canada’s version of the BBC for you Brits). The CBC hasn’t been alarmist per se in mu opinion, but they have certainly been warmist. One of their own speaking out is sgnificant. Unfortunately, the “real culprits” of AGW are not the Pachauri’s and Lal’s, the Phil Jones’ or the Michael Mann’s, or the millions and millions duped into demonstrating and chanting for, and donating to, “the cause”. The worst among us are the business men and politicians who used “science” and fear and sought to seperate us from our meager savings and basic freedoms for their own perverse gain. Presidents, Vice Presidents, and Prime Ministers, Senators and Representatives, MP’s, Banking and Industrial Tycoons, Publishers and Political Party bosses, these privilaged few are the true scum of the Earth. Who will hold them to account? John and Mary Voter won’t! Quote: Luboš Motl (23:49:24) : .” I fear that you may be right. He learned from the very best. In the face of precise, space-age measurements, the Geophysics Section of NAS and NASA have lied very successfully about Earth’s heat source – the Sun. His foolishness was in thinking that people could be equally as easy deceived about the weather! With kind regards, Oliver K. Manuel Emeritus Professor of Nuclear & Space Sciences Former NASA PI for Apollo “A disgusting putrid apology of an outrageous perversion of the scientific method. I would urge all readers to review the comments as their very sharp audience weighs in and cuts the apologists to shreds. I have included one that will make all Cornell alumni very proud: .” …- “Negating “Climategate”: “…” Climate Science Survive Stolen E-Mail Controversy (Read Comments) Scientific American ^ | Jan 29, 2010 | David Biello Copenhagen …” It’s never the lie that get you – it’s the cover-up. Although Pachauri of TERI (Trick Every Reasonable Individual) and Jones of CRU (Crooked Research Unit) can squeal and bleat they have done nothing wrong, it is fast becoming apparent that only career politicians and the gullible are prepared to believe them anymore. The bottom line is we have to go back to basics – back to the basic data of many thousands of temperature sites – and have sceptics and alarmists both agree how the readings from each one of these sites should be adjusted/’homogenised’ to reflect reality. This is a truly huge task as all the CRU manipulated data is now so corrupted/manipulated as to be effectively useless. The next task is to have a well-funded independent scientific commission of independents, advised by both sceptics and alarmists, scientifically prove the warming impact, if any, of each of the various ‘greenhouse gases’ and then determine whether or not natural cycles, ‘greenhouse gases’, or a mixture of both is responsible for the very modest warming trend (~0.7 degrees C) of the past century. This unfortunately would be impossible for many reasons, but most importantly as it would remove much of the reason for the existence of the many deeply flawed greenie and quasi-government funded climate organisations – no more snouts in the grants trough would not be an acceptable option for the self-appointed leaders of the alarmists. Pachauri obviously needs to go – but he is only a small part of the issue. We have in place multiple individuals who are wedded to an activist environmentalist agenda. Taking out Pachauri will be useful only insofar as it leads to changes in the way lead authors are chosen and the original review and summary criteria for the IPCC are adhered to. In other news Obama takes on college football, right up there with climate change and IPCC fraud. “Justice Dept.: Obama administration may take action on BCS” Read More:….f#ixzz0e6iLwwX0 climate skepticism – the new form of gay. Have you come out of the closet yet? Need advice on how to tell your parents? In the army they have a dont ask, dont tell policy. We really need a skeptics pride ‘march’ day Someone else may have pointed this out but the following from ABC news on-line via Climate Depot. (My bold) “Toyota, the world’s largest automaker, also contributed $80,000 to TERI. Last week the Japanese company was awarded the $1.5 million (¬. zombiehellmonkey (02:46:46) : You the man! ROTFLMAO. Good acting by RKP! A good post from The Times comment section “toyotawhizguy (04:13:28) : [...] since blocking dissenting views is the hallmark of propagandist sites that have an agenda, have an aversion to debate and don’t give a **** about the truth.” Just for the record, the WWF did delete my comments when i wanted to soothe them about the fate of the polar bear, pointing out that its numbers are up. One moment my post was up, the next it was gone without a trace. Maybe they don’t want their visitors to be informed? Wonder why? Lal now claims he was misquoted. He’ll be able to brazen it out unless the reporter taped him. Or if an IPCC insider or (preferably) two comes out with accounts of routine internal suppression of awkward corrections. OTOH, if the reporter has got him taped, then Lal will be done for. (It’s the cover-up that sinks you, not the crime.) OT…I clicked on the Join Leonardo/NRDC go-to ad link….and found this little gem.. “…Not to mention the fact that President Obama spent 15 hours at the negotiating table in Copenhagen drafting an international climate accord with his own pen because he believes so deeply in the need to confront climate change…” I said “Wow. What a sacrifice.” But the good part is that WUWT gets paid, AND I get inspired by the acts of our great leaders. See? It pays to click on the links!! Pachauri, Lal, Jones, Mann (et al) are mortally wounded has beens. Gut shot banditos. It really doesn’t matter if they stay on where they are at or not, their organizations are also dying a slow uncureable death. It’s a vicious form of organizational cancer. Not seen this linked to yet, so here goes. An apparently rational report about research that may imply a negative feedback via H2O, with the Guardian apparently reporting it a non-hysterical manner. Susan Solomon, of the US National Oceanic and Atmospheric Administration, says something that deserves an award if true: “What I will say, is that this [new study] shows there are climate scientists round the world who are trying very hard to understand and to explain to people openly and honestly what has happened over the last decade.” Turns out Obama et al in the White House have included about$700 Billion in Cap & Trade revenues in their budget projections. As the IPCC fraud unravels, as Barry’s political bank account goes into over draft, it is very, very unlikely the Dumbocrats can scam or bribe Cap & Trade legislation into ka=law. So the Obama administration will be looking at an additional deficit load equal to the “lost” revenue . . . should put the USA over the $2 TRILLION annual deficit. That should make Americans want to support CO2 reductions. . Not to mention the extra millimeters of extension to the nose due to thermal expansion from Mann made Global Warming and his Hockey Stick. Jaymam, Sorry to shake your cage – but YES! our kids are being fed this (explative deleted) and have been for years in science class. They believe their teachers, and the teachers believe what they’re teaching because Al Gore, a former Vice President, The EPA, the Federal Government, and etc. tell them so. Textbooks agree, and many teach the textbooks without critical review. Take a look at television – buy energy efficient appliances – not because it will save you money, but it will prevent three polar bears from drowning… End of rant… Satisfaction at seeing some people caught up in their own game, or overwhelmed by a desire to be important is one thing, but getting education into line will be the biggest problem. Mike Despite reports that CRU scientist could not be prosecuted, this article states otherwise: Professor Phil Jones could face 10 years on fraud charges!!!!!! DennisA (02:17:44) : You can hire Al Gore here: Could he be hired for a “Celebrity Dunk Tank” at a carnival? *whock* (ball misses target) Come on, show me some heat! *whock* Getting warmer! *whock* Getting hot now! *clang* *sploosh* Wow that’s cold! Er, I meant warm. Warmer! It’s Boiling Hot!! Why do these political pundits think that Pachauri will resign? They must be confusing him with someone who gives a damn. Why do they think he will be pushed? They must be confusing the IPCC with a democratic institution, accountable to the people they serve. These political pundits are normally right on the button when they comment on democratically elected representatives, but they are applying one measure to gauge something different. And yet, the longer he clings on, the more disrepute he will bring down upon the whole rotten edifice. Ron de Haan, Glad to see you got your email sorted! I agree with your post, that too much emphasis has been given to the one confirmed illegality – FOIA violations. There are obviously more angles to this work in progress than that. Your link focuses on fraud, quite rightly. There is also the additional factor of conspiracy – clearly evidenced in the emails. Conspiracy to commit crimes is outside the summary justice act and not bound by the statute of limitations. I would have thought, at the very least, there is evidence of conspiracy to violate FOIA laws. “While paying lip service to skeptics, UK chief science advisor insists it is “unchallengeable” that man is changing the climate!” Well, it is. How *much* we are changing the climate, whether one means globally or locally, whether one means changing temperature or rainfall or snowfall, whether one means changing averages or distribution, and whether said changes are good, bad, indifferent or catastrophic, that of course is another matter completely! Trouble is, what people hear when you say “man is changing the climate” is “man is causing catastrophic global warming” – but they’re not the same statement at all! Trick is to know both what he meant and what he was trying to imply… @ Baa Humbug (07:00:54) : So Toyota sent TERI $80,000 and got $1.5 million back? Seems like the best return any investor in TERI is ever going to see. BTW, can someone explain how the self-described full-time salaried TERI employee Pachauri could so busy setting up Copenhagen? Did he take vacation, go on sabbatical? Or is TERI simply paying at least one person to produce and promote reports that help it bring in customers and funds? Conflict of interest? Of course not, no one’s self-interest was conflicted. There’s now a Climategate Downfall lampoon linked from EUReferendum. davidmhoffer (21:01:36) : In primitive tribes, the fiercist warrior held the power to make group decisions. The smartest guy in the tribe became the shaman. …. watchword is vigilence….. The shaman’s mistake was inventing writing. My regrets to the many female posters here, I’m just to sleepy to word this to be more inclusive, but rest assured I mean all of us. An excellent summation of history. Unfortunately the priesthood/chiefs have recently learned to remain hidden and work through puppets like Al Gore, Maurice Strong and Pachauri. In this way they avoid being lynched by the angry masses when they people realize they have been robbed. All they have to do is move onto the next scheme with new puppets and the masses never figure out who was actually behind their fleecing. As a female I resent the politically correct terms since I consider myself part of “mankind” Politically correct terms are just another device used in the “lets you and he fight” game fostered by the priesthood/chiefs to control the masses. DennisA (02:17:44) : You can hire Al Gore here: Could he be hired for a “Celebrity Dunk Tank” at a carnival? ******************************************************************** Yes!!!!!!!!!!! I’ll hold a bake sale to raise some cash. Who’s in? Update on BBC…” I would say that the BBC has a major non-Scientific reason for their AGW Bias. If this AGW thing does not pan out then perhaps a lot of BBC pensioners will be left ‘. “Can we have those Indian journalists come here to the U.S.? It seems like they actually do their jobs, ask questions, consider all sides, realize BS when they hear it and report the truth. Most of our media? Not so much.” The USA media is bought and paid for and has been for years. JP Morgan bought controlling interest in the 25 major newspapers ninety years ago according to the U.S. Congressional Record February 9, 1917 and nothing much has changed since then except the names. jaymam (23:16:34) :. ******************************************************************** Okay, let’s play ignorant. That’s fun! What kind do you think the schools are cramming down the kids throats? Come on! Where have you been? Gore’s still brainwashing young minds with his “humans are evil and causing global peril” crap for years. Political activism has allowed this to be in the curriculum. Kids can’t don’t know math, proper English, how to think critically (ie being spoon-fed what the Unions, activists, politicians believe). Teachers should be published? You don’t have kids, do you? This is all mandated testing now. ALL teachers would need to be “published”. Teachers don’t have freedom to pick and choose in these mandated tests – they have no choice in the testing these days. Beside your foggy understanding of today’s public schools, you have an odd idea of how science should be taught: “belief” in politicized propaganda. Michele (22:45:38) : “.” I hope she has the wherewithal to take the school to court on this if needed. Feeding propaganda/religion to a child in school is sickening. If Al Gore is now pushing AGW as a religion she may have a real good case. Hope it turns into another nail in the coffin of AGW. James F. Evans (22:49:43) : “What if Pachuri is only a front man — for bigger fish pulling the strings…” Of course he is only a front man. Follow the money and look at how much the World Bank and the rest of the central bankers were set to gain. Fred (07:53:57) : “…..So the Obama administration will be looking at an additional deficit load equal to the “lost” revenue . . . should put the USA over the $2 TRILLION annual deficit. That should make Americans want to support CO2 reductions.” WRONG “That should make Americans want to” find a rope and a stout tree limb. I wonder if there are enough tall cherry trees in DC….. DennisA (02:17:44) : You can hire Al Gore here: I would love to hire Al Gore to speak to a packed out hall. Once he was on stage, I would sneak in Lord Monckton and release him onto the stage. Carnage would ensue! one more wheel has fallen off the wagon mercurior (13:49:23) : Your comment is awaiting moderation Reply: What are you whining about? This is a moderated site. All comments await moderation. Please do not waste our time with this [self snip]. ~ ctm “Aunty Freeze (13:41:58) : [...] I would love to hire Al Gore to speak to a packed out hall. Once he was on stage, I would sneak in Lord Monckton and release him onto the stage. Carnage would ensue!” It would be over in 5 minutes. And it would only take so long because the viscount is such a polite person. First the WWF, then Greenpeace followed by Insurance companies and Event management. Well now its Mountaineering mags and a student’s dissertation Pity the MSM media didn’t pick up on this before. I broke this story in my blog post on January 26, see here: where I wrote: lies,.” See the rest of the blog for evidence that the 2035 figure was debunked in the peer-reviewed literature in 2005, and previously by Jack Ives (expert on Himalayas) in 2004. But though Pachauri and TERI would have known this, as I report in the blog post: .”” latitude (08:00:05) : -. WORSE than that – they had a peer-reviewed paper in the Himalayan Journal of Sciences in their hands in 2005 that told them it was UNTRUE, see The paper is here (wait for it to load as PDF – be patient): Think of how much simpler Choo Choo’s life would be if it weren’t for all those pesky “deniers.” He could just dictate what everybody should do and get on with his life. The insolence of these people! It was a dark and stormy night, and Choo-Choo was penning his novel with Shirley, when to his eyes did appear AGW-Al. …- “Revealed: the racy novel written by the world’s most powerful climate scientist. (Excerpt) Read more at telegraph.co.uk” Michelle – question: Which state in the US was she calling from? (you wrote: O/T, but interesting – I heard a caller on a radio today say that she had to go to defend her child in school against a principle, teacher and union member because her son failed a state mandated test. Why did he fail?) OK, here are some revised goals, after Copenhagen, from the warmers. You need to read the comments. If you click on davidmhoffer’s post you will be taken to another brilliant piece! Don’t miss it. And thanks for the link to openthemagazine, whoever did that! After reading an earlier post on “Glaciergate” I decided to check up the other Murari Lal references used in the IPCC AR4 WGII report. One that I found interesting is “Lal, 2003″ – “Global climate change: India’s monsoon and its variability. Jour- nal of Environmental Studies and Policy”. What’s interresting is that the journal is published by TATA Energy Research Institute (TERI) where Pachauri himself is a Director General One example where it’s referenced (Page 476): “Frequency of monsoon depressions and cyclones formation in Bay of Bengal and Arabian Sea on the decline since 1970 but intensity is increasing causing severe floods in terms of damages to life and property Lal, 2001, 2003″ From the first reference () you can find that frequency of monsoons has indeed declined but to say that it’s intensity HAS increased is quite a stretch. Lal assumes in the report – from model simulations saying sea surface temperature WILL increase – that so WILL the intensity of monsoons. Notice the change of tense. No measurements to verify that is mentioned in the report. Now I’m looking for help from English reader on the other reference to verify what’s actually sad in that one. It seems to be available in the British Library. Are we looking at an monsoongate here? Has this been posted before? From the Times, 29 Jan 2010 British geographers find uncharted glaciers in Albania “the largest of which is the size of six football pitches” For Andrew 30….moving the pawn? you mean moving the queen! Your pawns are moving too many squares each time, ever heard of guilty by association? Does not stand up in legal circles. Too many shortcuts my friend, a bit lazy on your part. Tighten all this up a bit and then it might be a useful read…. See my article on this topic at WanderingEducators.com:
http://wattsupwiththat.com/2010/01/29/uh-oh-pachuri-caught-out-in-ipcc-glacier-issue/
CC-MAIN-2013-20
refinedweb
10,664
71.95
Java programmers have become familiar with the online Java API documentation, available from Sun and mirrored elsewhere [8]. This professional looking style of code documentation is created semi-automatically from commented source code by the javadoc tool, which comes standard with the Java Software Development Kit (SDK). Java programmers already use javac and java to create and execute programs, now it's time to add the API Document Generator to your toolbox. Javadoc facilitates good software engineering by allowing programmers to work concurrently on different parts of a system. The object relationships specified by class interfaces can all be defined in the Javadoc generated HTML API documentation. Good API documentation allows programmers to access documentation for every component within a software system. Even if these components are still being coded, the engineer can use knowledge of their interfaces to write tighter, more integrated code. Maintenance is not a problem for an API made with Javadoc. Interfaces and method signatures can be kept constant as code is modified. The HTML documentation may be optionally updated to reflect or at least mention changes in the implementation; but that is not necessary. Programmers write Javadoc comment blocks within the source code of a program. Javadoc parses the raw source code files looking for Javadoc comment blocks and constructs indexed documentation from them. Javadoc creates a page for each class, with a method overview section and more detailed description section for each method. The first sentence of any method description comment is included in the method overview section, with the complete text of the comment to be found in the detailed description section. Although Javadoc ignores code implementation of constructors and methods, it does rely on javac to compile the declarations, i.e. the class and interface definitions as well as the method signatures. If no default constructor is defined, Javadoc will include it because the compiler indicates the default Object constructor is inherited by your class [10]. Javadoc works just as well on an abstract class as it does on a class definition that may be instantiated into objects. It makes no difference to the compiler run by Javadoc whether you have implemented your code fully. In this way Javadoc supports documentation and coding in any order. Javadoc assembles hierarchical relationships between packages, interfaces, and classes, creating HTML pages from a standard style sheet (.css file) if none is specified. For more information on style sheets, refer to a very good introduction from CNET [1]. Java supports two styles of explicit comments. The first style is the traditional C comment, where characters between the start comment mark /* and the end comment mark */ are considered a comment and ignored by the compiler. results.print(System.out); /* Send answers to standard output. */ problems.print(System.err); /* Send errors to error channel. */ The second type of comment comes from C++, where characters between the start comment mark // and the end of that line are ignored by the compiler and considered a comment [2]. results.print(System.out); //Send answers to standard output. problems.print(System.err); //Send errors to error channel.Often it is quite useful to have a comment block, which spans many lines of code. In this case you can make your many line comment from C or C++ style comments. Have a look at the following code that demonstrates both techniques. /* Here we print the answer of the computer's joke: hard calculations of the meaning of life, etc. */ int ultimateAnswer = 42; System.out.println ("The ultimate answer: " + ultimateAnswer); System.out.println ("\nSorry, we were just kidding there."); // Is the computer really sorry for System.out.println ("Some computers have ego problems and"); // its mistake? I think if it was it System.out.println ("have a rather loose grip on reality."); // should make us cookies or something. Understand that the above examples should not to be included in your code. Their emphasis is on the format of the comments rather than their content. While we're on that subject... System.out.println(firstString); /* Print two strings System.out.println(otherString); to standard output. */Only the first of the intended two commands will actually be executed. You see the problem, right? Our programmer accidentally wrapped the comment block around his or her second command. A C++ style comment block would have been much more appropriate. Generally, an even marginally useful code comment is better than none at all, but there are always extreme cases that are exceptions to the rule. The following are two great examples of how not to comment your code. studentCounter++; // increment the variable that counts the studentsUnless the person reading the code has a bare minimum of programming experience, the comment on this line accomplishes nothing by over explaining simple syntax. Assume someone reading your comments knows the language. maximum = (number1 >number2) ? index1 : index2; /* choose one */This second horrible comment is more ambiguous than the statement itself, just making things worse. Brian W. Kernighan and Rob Pike have some excellent suggestions for writing comments. They are said best as they appear in "The Practice of Programming," [3]: i++has incremented i. import java.util.Random; /** * A simple class to generate random integer arrays, * often quite useful for testing sorting algorithms. * * <p> * Written as an example for an ACM Crossroads article * about using <code>javadoc</code>, the Java API * documentation generator of HTML pages. * * @author Kevin Henry <khenry@ece.villanova.edu> * * @link * @link * * @see java.lang.Integer * * @version 0.1 */ public class GenerateIntArray { /** * Create an array of primitive int values. Accept specified * number of values to generate, and an inclusive range within * which the generated values should fall. * * <p> * This is a trivial method written just to demonstrate how a * comment is written for Javadoc. Notice the special tags: * * @since 0.1 * * @param size the size of the array to create * (the number of values to generate) * @param min the least value that may be generated * @param max the greatest value that may be generated * * @return an array of <code>size</code> primitive int * values between the <code>min</code> and * <code>max</code> range, inclusive */ public int [] generateRandomIntArray (int size, int min, int max) { Random generate = new Random (); int [] array = new int [size]; for (int index = 0; index < size; index++) array [index] = generate.nextInt (max - min + 1) + min; return array; } }If your comment blocks follow the above style, Javadoc will notice them and create the appropriate HTML for the Java code. See the java output. Notice especially that HTML was included for a default constructor (NOTE: none of the links on that page work!). This is a result of Javadoc invoking part of javac. You can use most standard HTML tags within your Javadoc comment blocks. Javadoc can understand and include standard HTML, it generates Web pages after all. Still, keep in mind that it's not a good idea to use tags like <h2></h2> in your comments. Javadoc will include them, but your browser may become confused when it tries to display the resulting pages because Javadoc inserts it own headings and yours will interfere with them. The above example code also shows the most common Javadoc tags and where you are most likely to use them. The following table summarizes these Javadoc tags. For more information about the Javadoc tags, see the Javadoc Home Page [10], Javasoft's page of style suggestions for commenting code with Javadoc [5], or Sun Microsystems' How To Write Comments for Javadoc [8]. c:\programs> javadoc org.acm.crossroads MySimpleProgram.javaThis command will generate and link HTML documentation for the classes found in the package org.acm.crossroads and in the source code file MySimpleProgram.java. Package names and source code file names may be given to Javadoc in any order. You may notice that the standard Java API documentation is nicely linked together. That is, where one class takes a String as a parameter, a link appears so someone browsing the documentation can follow to learn more about that class. Unless you tell Javadoc to link your HTML documentation to the standard Java API, your pages will have no links, just parameters listed as java.lang.String. Your classes probably rely heavily on the standard Java API or some others, so to link documentation together do the following (when invoking javadoc, keep the entire command on one line, for readability this line is split): c:\programs> javadocYou can link to Javadoc API posted anywhere on the Web. For example, if you have other API posted on your personal site, you can link your newest production by simply giving Javadoc the URL of your existing documentation. You can also link to HTML pages on disk, but the local links Javadoc creates for you may become dead if you later post your documentation to the Web. -link -link org.acm.crossroads MySimpleProgram.java There is also a sourcepath option available to the command line, which tells Javadoc where to look for the Java source code files it should parse to create the documentation. The Javadoc sourcepath default is the current command line directory, which is used as the base for all class and package source code files. Using the sourcepath option overrides the default. It is worth mentioning that there is a bug in the Javadoc tool that prevents @see tags from linking properly. The text appears, but is not referenced properly or linked anywhere. The bug is discussed in more detail on Sun's pages of documentation for the tool [9]. In the example above, what should have been a link to the Integer class of the Java API Specification shows up as a plain text java.lang.Integer. The tool version 1.2 did indicate a problem by warning me it could not find that class. As mentioned above, Javadoc works by calling javac on the source code files. If your code is not in proper Java syntax you will not be able to use Javadoc. Javadoc 1.3 includes the capability of further customizing the appearance of your automatically generated documentation. Up to this point we have only mentioned or worked with the standard doclet, the only style of Web page available to us for automatic generation. By creating your own set of classes that will parse Java source code and create HTML documentation, you can override the standard doclet and exercise more control over how your API documentation will look. For more information about this process, see the Doclet Overview provided by Sun [6]. This article discussed Javadoc, a powerful tool for easily creating professional looking documentation. Hopefully, this article helped you to realize the usefulness of Javadoc and will provide guidance for your upcoming projects. Last Modified: Location:
http://www.acm.org/crossroads/columns/ovp/august2000.html
crawl-001
refinedweb
1,780
55.54
We’re giving away 1,500 more DJI Tello drones. Enter to win › Tutorial Nidhi Shah | Published March 5, 2019 CloudContainersDevOpsObject Storage ASP.NET Core is a cross-platform, open source framework that builds modern applications by using the C# programming language. Kubernetes is an open source system for automating deployment, scaling, and management of containerized applications. Kubernetes is an open source project, which can run in many different environments: from laptops to high-availability multi-node clusters, from public clouds to on-premise deployments, from virtual machines to bare metal. In this tutorial, you will learn to deploy a simple ASP.NET Core app to Kubernetes. The main purpose of this tutorial is for you to turn your code into a replicated application that’s running on Kubernetes. You can take any application that you developed on your machine, turn it into a Docker container image, and then run that image on the IBM Cloud Kubernetes Service (IKS).. Deploying Kubernetes is definitely worth it in cases where you need to: The IBM Cloud Kubernetes Service provides a native Kubernetes experience that is secure and easy to use. The service removes the distractions that are related to managing your clusters and extends the power of your apps with IBM Watson™ and other cloud services by binding them with Kubernetes secrets. It applies pervasive security intelligence to your entire DevOps pipeline by automatically scanning images for vulnerabilities and malware. The goal of this tutorial for you is to turn your code into a replicated application that runs on Kubernetes. You can take the code that you developed on your machine, turn it into a Docker container image, and then run that image on the IBM Cloud Kubernetes Service. The IBM Cloud: Getting started tutorial for ASP.NET Core App is used as an example application in this tutorial. The IBM Cloud: Getting started tutorial for ASP.NET Core App uses this sample application to provide you with a sample workflow for working with any .NET Core app on IBM Cloud™ you set up a development environment, deploy an app locally and on IBM Cloud, and integrate an IBM Cloud database service in your app. The application uses a Cloudant® noSQL DB service from IBM Cloud to add information to a database and then return information from a database to the UI. This gif contains a title that welcomes the user, prompts the user to enter a name, and then lists the database contents with the names Joe, Jane, and Bob. The user enters “Mary” and the screen refreshes to display, “Hello, Mary, I’ve added you to the database. The database contents listed are now Mary, Joe, Jane, and Bob.” Upon completion of this tutorial, you will know how to: You’ll need following installed on your machine. git clone This step is to verify whether your app is running successfully locally before deployment. You can start by verifying the version of dotnet as follows: dotnet --version Next, navigate to your App folder. cd get-started-aspnet-core/src/GetStartedDotnet Restore the app with the following command: dotnet restore This uses NuGet to restore dependencies and project-specific tools that are specified in the project file. By default, the restoration of dependencies and tools are executed in parallel. For more info visit Docs. Now, run your application with the following command: dotnet run The application starts listening on port 5000. You will see the following message. 5000 ... Now listening on: Application started. Press Ctrl+C to shut down. To pack the application and its dependencies, create a new folder named publish for deployment to a hosting system for execution. We have to use dotnet to publish. Then it’s ready to run anywhere. publish for deployment Publish the app to get a self-contained DLL using the dotnet publish command. dotnet publish dotnet publish -c Release Running publish displays some messages with a successfully published DLL at the end of the process. For our example, you can see the following message. publish ... Once the application is ready, we can make an image of it and put it inside a container. We need a file that contains step-by-step instructions to deploy the image inside the container to run our application anywhere. This Dockerfile is a basic file and you may only require a few lines to get started with your own image. Go to the app folder (here GetStartedDotnet) and create a Dockerfile to define the Docker image. Add the contents of Dockerfile by using your favorite editor (vim, nano, etc.) and save the file. vi Dockerfile FROM microsoft/aspnetcore:2.0 WORKDIR /app1 COPY ./bin/Release/netcoreapp2.0/publish . ENTRYPOINT ["dotnet", "GetStartedDotnet.dll"] The first line we added FROM microsoft/aspnetcore:2.0 will download the aspnetcore image from the hub repository, so it actually contains the .NET Core and you don’t need to put it inside the image. You can find more repositories and versions in the Docker hub. FROM microsoft/aspnetcore:2.0 aspnetcore The Dockerfile line WORKDIR /app sets our working directory in the app folder, which is inside the container that we’re building. WORKDIR /app Now we need to copy the contents of the publish folder into the app folder on the image COPY ./bin/Release/netcoreapp2.0/publish. COPY ./bin/Release/netcoreapp2.0/publish Note: You can find this path in the output when you run dotnet publish -c Release. dotnet publish -c Release The last line in the Dockerfile is the ENTRYPOINT statement: ENTRYPOINT ["dotnet", "GetStartedDotnet.dll"]. This line tells Docker that it should run the dotnet command with GetStartedDotnet.dll as parameter. ENTRYPOINT ENTRYPOINT ["dotnet", "GetStartedDotnet.dll"] You can test your dockerized app by following the steps below. This section is optional for this tutorial, though. First, build an image. docker build -t get-started-aspnet Note: You can choose any name for your app. Running the build command displays the following message in the end. ... Successfully tagged get-started-aspnet:latest The following command will run an app. docker run -d -p 8080:80 --name app get-started-aspnet Navigate to to access your app in a web browser. Clean up with the following commands. docker stop /app docker rm /app These above commands stop and remove the Docker container of your app, respectively. You can use them to remove your container if you no longer need it. We are now ready to create our Kubernetes cluster. Make sure you are logged into your IBM Cloud account by using: ibmcloud login or ibmcloud login --sso Create the IKS cluster for deployment. i. Create a Kubernetes cluster by choosing Cluster Type – Free. Give a unique name to the cluster and click Create Cluster. Note: For more details, see Creating a Kubernetes cluster in IBM Cloud. ii. It will take some time. It is ready to use if you see the following: It’s time to deploy your containerized application to the Kubernetes cluster. From now on, you’ll use the kubectl command line. kubectl On running the kubectl get nodes command, you should see something like the following. kubectl get nodes NAME STATUS AGE VERSION 10.76.197.43 Ready 1d v1.10.8+IKS Our example application uses the Cloudant database to save the data that was entered. The goal here is to show how the database is created and can be deployed to the IKS cluster. You can use any database for this purpose and follow the same steps of deployment that are mentioned here (or avoid these steps if your application does not use database at all). To create an IBM Cloud Cloudant Database, create a new Cloudant database instance. Select Use both legacy credentials and IAM under Available authentication methods. Create new credentials under Service Credentials and copy the value of the url field. (See image below). Create a Kubernetes secret with your Cloudant credentials.. For more info, visit Kubernetes Secret. kubectl create secret generic cloudant --from-literal=url=<URL> For example: kubectl create secret generic cloudant --from-literal=url= You will need this info in your deployment. You can see your secrets by using the following command. kubectl get secrets This will display all the secrets you created in their respective clusters. The IBM Cloud Container Registry provides a multi-tenant private image registry that you can use to safely store and share your Docker images with users in your IBM Cloud account. Log in to the Container Registry Service to store the Docker image that we created with Docker. ibmcloud cr login Find your container registry namespace by running the following command. ibmcloud cr namespaces If you don’t have any, create one by using following command. ibmcloud cr namespace-add <name> For example: ibmcloud cr namespace-add aspnetapp-01 Identify your Container Registry by running the following command. ibmcloud cr info For example: registry.ng.bluemix.net registry.ng.bluemix.net Build and tag (-t) the Docker image by running the command below, replacing REGISTRY and NAMESPACE with the appropriate values. -t REGISTRY NAMESPACE docker build . -t <REGISTRY>/<NAMESPACE>/myapp:v1.0.0 docker build . -t registry.ng.bluemix.net/aspnetapp-01/myapp:v1.0.0 It will display the following message in the end. ... Successfully tagged registry.ng.bluemix.net/aspnetapp-01/app:v1.0.0 Push the Docker image to your Container Registry on IBM Cloud. docker push <REGISTRY>/<NAMESPACE>/myapp:v1.0.0 Verify that the image was pushed successfully by running the following command. ibmcloud cr image-list Good work! You set up a namespace in the IBM Cloud Container Registry and pushed a Docker image to your namespace. Once you have a running Kubernetes cluster, you can deploy your containerized application on top of it. To do so, you create a Kubernetes Deployment configuration. The Deployment instructs Kubernetes on how to create and update instances of your application. Once you create a Deployment, the Kubernetes master schedules the mentioned application instances onto individual Nodes in the cluster. A Kubernetes Deployment Controller continuously monitors those instances that were created. If the Node that’s hosting an instance goes down or is deleted, the Deployment controller replaces it. This provides a self-healing mechanism to address machine failure or maintenance. To create a deployment, you will create a folder called “kubernetes” and create a deployment.yaml file. mkdir kubernetes vi deployment.yaml # Update <REGISTRY> <NAMESPACE> values before use # Replace app name instead of get-started-aspnet if you wish to use different name for your app apiVersion: apps/v1 kind: Deployment metadata: name: get-started-aspnet labels: app: get-started-aspnet spec: replicas: 2 selector: matchLabels: app: get-started-aspnet template: metadata: labels: app: get-started-aspnet spec: containers: - name: get-started-aspnet image: <REGISTRY>/<NAMESPACE>/myapp:v1.0.0 ports: - containerPort: 8080 imagePullPolicy: Always env: - name: CLOUDANT_URL valueFrom: secretKeyRef: name: cloudant key: url optional: true The deployment get-started-aspnet was created, indicated by the .metadata.name field. The Deployment creates two replicated Pods, indicated by the replicas field. These replicas are needed to handle the traffic in deployment. You can keep it to 1 as well. The selector field defines how the Deployment finds which Pods to manage. However, more sophisticated selection rules are possible, as long as the Pod template itself satisfies the rule. The Pods labeled app: get-started-aspnet are using the labels field. The Pod template’s specification, or .template.spec field, indicates that the Pods run one container, get-started-aspnet, which runs the <REGISTRY>/<NAMESPACE>/myapp:v1.0.0 Docker image. Open port 8080 so that the container can send and accept traffic. Set the imagePullPolicy of the container to Always. The Secret information has been updated in the env field, like the CLOUDANT_URL that we mentioned while creating our Secret for the Cloudant database. .metadata.name replicas 1 app: get-started-aspnet .template.spec field <REGISTRY>/<NAMESPACE>/myapp:v1.0.0 imagePullPolicy Always env Create a deployment by using the following command. kubectl create -f kubernetes/deployment.yaml The output will display, similar to the following message. deployment "get-started-aspnet" created By default, the pod is only accessible by its internal IP within the cluster. Create a Kubernetes Service object that external clients can use to access an application running in a cluster. The Service provides load balancing for an application. Use the NodePort 8080 to expose the deployment. kubectl expose deployment get-started-aspnet --type NodePort --port 8080 --target-port 8080 You will see the following message. service "get-started-aspnet" exposed To verify that your application is running successfully, you need to check the STATUS of your pod. It should be in a state of Running: Running kubectl get pods -l app=get-started-aspnet It should look like the following: NAME READY STATUS RESTARTS AGE It should also show two instances as we have set two replicas in our deployment. To access your ASP.Net Core application: ibmcloud cs workers YOUR_CLUSTER_NAME kubectl describe service get-started-aspnet http://<WORKER-PUBLIC-IP>:<NODE-PORT>/ This is how you could deploy and access your application in the IKS environment. Use the following commands to clean up the sample application that we created for this tutorial: kubectl delete deployment,service -l app=get-started-aspnet kubectl delete secret cloudant This concludes a simple, getting-started walkthrough of an ASP.NET Core app deployment in IKS. By following this tutorial, you can take any application that you have developed on your machine, turn it into a Docker container image, and then run that image on IBM Cloud Kubernetes Service. This tutorial also explained how you can put sensitive information into secrets. We have only touched the surface of this technology and I encourage you to explore further with your own pods, replication controllers, and services. You can also put your new skills to the test with the code pattern, Build an airline booking platform on a private cloud. This is a blog post on how to troubleshoot cert-manager, the Kubernetes add-on that automates and manages TLS certificates. CloudCloud Native+ Kubernetes is only a few years old, but already developers are playing with ways to extend it to suit their… CloudContainers+ Back to top
https://developer.ibm.com/tutorials/aspnet-core-app-deployment-in-ibm-cloud-kubernetes-service/
CC-MAIN-2019-22
refinedweb
2,374
56.96
the first problem is this message : "AttributeError: 'module' object has no attribute 'SDCard'", i am using the sdcard.py from ... /sdcard.py, but i don't know how to solve this problem. And the second one is how can i put the SD card to save the variables that i said before? The code i am using for test the SD card Code: Select all import machine, sdcard, os from machine import Pin, SPI spisd = SPI(-1, sck=Pin(14), mosi=Pin(15), miso=Pin(2)) sd = sdcard.SDCard(spisd, machine.Pin(13)) os.mount(sd, '/sd') os.listdir('/sd') os.umount('/sd')
https://forum.micropython.org/viewtopic.php?f=18&t=7606&p=43350
CC-MAIN-2020-16
refinedweb
103
71.55
The Simpsons characters recognition and detection using Keras (Part 1) Deep Learning : Training a convolutional neural network to recognize The Simpsons characters. As a big Simpsons fan, I have watched a lot (and still watching) of The Simpson episodes -multiple times each- over the years. I wanted to build a neural network which can recognize characters. I don’t know right now what will be the applications of the neural net (perhaps computing the characters presence in each episode). This project is not specially difficult but can be time consuming, because I have to manually label many pictures of each character. I didn’t find any The Simpsons characters database on the Internet so I am building it by myself (I am still labeling pictures when I have time). I think it could be useful for other ones. The dataset is already available on Kaggle with exploratory code (in the Kernels section). After learning and using TensorFlow for different projects, I want to use Keras because of its simplicity (compared to TensorFlow for example) and its capacity (TensorFlow backend) for experimentation. Keras is a Deep Learning library written in Python by Francois Chollet. My approach to solve this problem will be based on convolutional neural networks (CNNs) : multi-layered feed-forward neural networking able to learn many features. You can find the code on the github repo . Building the image dataset The dataset currently features 18 classes/characters (the data on Kaggle contains 20 classes, but currently I used only 18 characters for training). Please check the image below for the characters used. The pictures are under various size, scenes, could be cropped from other characters and are mainly extracted from episodes (season 4 to 24). The training set includes about 1000 images per character (still labeling data to get to this number). The character is not necessarily centered in each image and could sometimes be with other characters (but it should be the most important part in the picture). With label_data.py, you can label data from .avi movies : you can get a cropped sub picture (left or right part) or the full picture and then label it by entering a part of the character name (burns for Charles Montgomery Burns). To add more data, I also use the Keras model. I capture videos and get 3 pictures for each frame I analyzed (left part, right part, full) and then I ask my algorithm to classify each pictures. Afterward, I check each picture it has classified. It’s still manual but it’s faster and it’s an incremental process that’s more and more fast, particularly for “small” characters. Preprocessing The first step for preprocessing pictures is resizing them. We need to have all pictures with the same size for training. I will convert data as float32 to save some memory and normalize them (divide by 255.). Then, instead of characters name, I use numbers and thanks to Keras, I can quickly convert those categories to vectors : import keras import cv2pic_size = 64 num_classes = 10 img = cv2.resize(img, (pic_size, pic_size)).astype('float32') / 255. ... y = keras.utils.to_categorical(y, num_classes) I am splitting my dataset into a training and a testing set : for this, I use sklearn train_test_split function. Deep Learning Model(s) Now, let’s begin the “funny” part : defining our model. Right now, we’ll use a feed forward 4 convolutional layers with ReLU activation followed by a fully connected hidden layer (see below for a deeper model). This model is similar to the CIFAR example from Keras documentation. I also use dropout layers to regularize and avoid overfitting. The output layer uses softmax activation to output the probability for each class. I also tried to replace ReLU by ELU (like ReLU but with a mean closer to zero) but it didn’t work. Categorical Cross Entropy loss is -as often- used. And for the optimizer, I use RMS Prop which is a stochastic gradient descend where we “divide the learning rate for a weight by a running average of the magnitudes of recent gradients for that weight” . Training the model For the training, the model is iterating over batches of training set (batch size : 32) for 200 epochs. As I don’t have a huge data set, I am using data augmentation (which is really simple to use with Keras library). It means doing a number of random variations over the pictures so the model never see the same picture twice. This helps prevent overfitting and helps the model generalize better. datagen = ImageDataGenerator( featurewise_center=False, # set input mean to 0 over the dataset samplewise_center=False, # set each sample mean to 0 featurewise_std_normalization=False, # divide inputs by std samplewise_std_normalization=False, # divide each input by its std rotation_range=0, # randomly rotate images in the range width_shift_range=0.1, # randomly shift images horizontally height_shift_range=0.1, # randomly shift images vertically horizontal_flip=True, # randomly flip images vertical_flip=False) # randomly flip images This take a while running on CPU (on my computer) so I run it on GPU with AWS EC2, Tesla K80: 8 seconds per epoch. In total, it took 20 minutes (which is really quick for deep learning). As we can on the plot, after 200 epochs, it seems to have reach the asymptote, without an obvious overfitting. Moreover, the accuracy seems good too. Classification evaluation Of course, right now, it’s complicated to have a true model accuracy because of the low number of pictures but as the number of pictures will grow, it will be more pertinent. Thanks to sklearn it’s really easy to print a classification report : As you can see, the accuracy (f1-sport) is really good : above 90 % for every character except Lisa. The precision for Lisa is 82%. Maybe Lisa is mixed up with other characters. Indeed, Lisa is often mixed up with Bart. Probably because many pictures of Lisa contain Bart too. Adding a threshold to improve the accuracy In order to improve the precision (so, of course decrease the recall, but I would try to not decrease it too much), I thought that I can maybe add a threshold. Before to talk about a threshold to improve accuracy. I just want to had a famous graph about recall and precision. I compute some statistics about good and wrong predictions : maximum probability predictions, the probability difference between the best two candidates and the std. For good predictions : Max : 0.83, Difference Two First : 0.773, STD : 0.21 For wrong predictions : Max : 0.27, Difference Two First : 0.092, STD : 0.07 If the probability of the predicted character (1.) is too low, the standard deviation of the prediction (2.) is too high or the probability difference between the two most likely characters (3.) is too low maybe we can say that we don’t want to predict a character at all. So I plot those 3 values for the test set to find a line (or a hyperplane) to separate good and wrong predictions. I did it for both characters. As you can see it’s impossible to find a linear separation and to have a simple threshold, for both graphs, between good and wrong predictions. Of course, we can see that wrong predictions are concentrated in the lower left of each graph but in this corner, there are too many good predictions too. If I choose a threshold (for example, threshold regarding the probability difference and probability of the best candidate), my recall will be lower. Maybe the best thing, to do to improve the accuracy and not affect too much the recall, is to plot those graphs for every character or for a character with a low precision (e.g. Lisa Simpson). Moreover, the threshold could be useful for pictures without famous characters or with not character at all. Currently, I do have a “no-character” class in my model but I can probably add with a threshold. I don’t think that we can finding the perfect formula (between the probability of the best prediction, the probability difference and the standard deviation) so I will just focus on the probability of the best prediction. Recall and Precision regarding the probability of the best prediction There is classic trade-off between recall and precision and as often we couldn’t maximize recall and precision at the same time. So, it depends what we want exactly. Regarding the probability minimum for the predicted class, we can plot the F1-score, the recall and the precision. As we can see, it really depends on the characters. For example, if we focus on Lisa Simpson, it would be interesting to add a probability minimum for predicted class (=0.2), but this threshold will not be really useful for all classes combined. So regarding of the application, we should add or not a threshold around 0.2–0.4 for the probability minimum for the predicted class. Improving the CNN model As I said earlier, I have a four convolutional layers models. To make the neural net understands more details and more complexity, we can get deeper and add more convolutional layers. It’s what I did. I tried with 6 convolutional layers and going deeper (dimensions of the output space 32, 64, 512 vs 32, 64, 256, 1024) . It has improved the accuracy (precision and recall) as you can see below. The lower precision is 0.89 for Nelson Muntz and we only had 300 training examples for this character. Moreover, this model converge quicker : only 40 epochs (vs 200). It tooks 15 minutes to train on a Tesla K80. Visualizing predicted characters As you can see, the neural network is pretty accurate to recognize and classify characters. Then, I predict characters in a video. Indeed, the predictions are faster enough (less than 0.1 s to predict a picture) to predict multiple frames each second. If you have any questions, please feel free to contact me and moreover, if you like this post don’t hesitate to recommend it :-). The dataset is on Kaggle, download it and have fun ! The next steps with a detection model in addition of the classification model are described in Part 2. Alexandre Attia
https://medium.com/alex-attia-blog/the-simpsons-character-recognition-using-keras-d8e1796eae36
CC-MAIN-2020-24
refinedweb
1,699
54.83
In this tutorial, you will learn about blockchain programming from scratch by building a fully decentralized application (DApp), step by step. You will also learn how to create your own collectable token on the RSK blockchain network using the Truffle framework, Open Zeppelin (OZ) libraries, and build a front end with React, using create-react-app. We will create a dapp inspired by Cryptokitties, a popular blockchain game where you can collect and breed digital cats. In this tutorial, instead of collecting felines in our app, we are going to collect exclusive color tokens. A fungible token represents an asset that can be exchanged for any other asset of equal value in its class. A currency is an example of a fungible asset. A $100 bill is equal to any other $100 bill, you can freely exchange these bills with one another because they have the same value, no matter the serial number on the specific $100 bill. They are fungible bills. On the other hand, a Non-Fungible Token (NFT) is a unique token. So collectible items are non-fungible assets, and can be represented by NFTs. ERC-721 was the first standard, and currently still the most popular standard, for representing non-fungible digital assets. The most important properties for this kind of asset is to have a way to check who owns what and a way to move things around. It is easy to create new ERC721-compliant contracts by importing it from the OZ library and we will do so in this tutorial. The interface for ERC-721 provides two methods: ownerOf: to query a token’s owner transferFrom: to transfer ownership of a token And this is enough to represent an NFT! In this tutorial, we are going to create an NFT to represent our collectible color tokens. You will be able to create new color tokens and claim them so that they can be held in a digital blockchain wallet. Here is a summary of the steps to be taken to build our token: Steps 1 to 4 are explained in detail in the tutorial link below: The same webinar is also available in Português. This article is also available in Português. The requirements 1 to 3 are explained in detail in the tutorial links below: For requirement 4, installing Metamask, connecting to RSK testnet, and getting some tR-BTCs, this is explained step-by-step in the tutorial link below: Create a new folder named colors. Inside the folder colors, do the steps below, following instructions from the tutorial Setup a project with Truffle and OpenZeppelin We have 3 requirements to build the frontend: This is the official template to create single-page React applications. It offers a build setup with no configuration. To learn more: create react app In the project folder, at terminal, run: npx create-react-app app --use-npm The option --use-npm is to select npm as package manager. npx comes with npm 5.2+ and higher, see instructions for older npm versions. This is a large package and this might take a couple of minutes to show the message of successful installation: Now you have a new folder named app and we will customize our frontend later. folder app cd app npm install -E web3@1.2.7 The option -E is to save dependencies with an exact version rather than using npm’s default. cd app npm install -E bootstrap@4.4.1 As I said before, the option -E is to save dependencies with an exact version rather than using npm’s default. Come back to the project folder, open truffle-config.js file in VS Code); const path = require("path"); module.exports = { networks: { testnet: { provider: () => new HDWalletProvider(mnemonic, ''), network_id: 31, gasPrice: Math.floor(gasPriceTestnet * 1.1), networkCheckTimeout: 1e9 }, }, contracts_build_directory: path.join(__dirname, "app/src/contracts"), compilers: { solc: { version: "0.5.7", } } } It looked like this: We add the library path to use with a new parameter contracts_build_directory that defines the locale where files for contracts artifacts, like abi and deployed addresses are saved. It will be located in a different folder: app/src/contracts. We will create a smart contract named Color.sol that will inherit the ERC721 definition from the OZ library. In the Contracts folder, create a new file named Color.sol. Copy and paste the smart contract from the following gist, or inline below: pragma solidity 0.5.7; import '@openzeppelin/contracts/token/ERC721/ERC721Full.sol'; contract Color is ERC721Full { bytes3[] public colors; mapping(bytes3 => bool) private _colorExists; constructor() ERC721Full("Color", "COLOR") public { } // E.G. color = "#FFFFFF" function mint(bytes3 _color) public { require(!_colorExists[_color], "color exists"); uint _id = colors.push(_color); _mint(msg.sender, _id); _colorExists[_color] = true; } } It looked like this: To create our ERC-721 Token, we will import ERC721Full from OZ. This library itself imports several other libraries such as SafeMath.sol, the standards for this kind of token and some extra features, like enumeration and metadata. With metadata we can customize our token by giving it a name and a symbol at constructor. This function gets run only once; whenever the smart contract is created the first time, i.e., deployed to the blockchain. We are calling the constructor function of the parent smart contract ERC721Full and passing in custom arguments like the name Color and the symbol COLOR. The color management is performed with the variable colors, which is an array of colors and _colorExists, which is a fast “lookup” to know when a color is already minted. Also we have a function to create new color tokens. This is the basic structure of the function. It will accept 1 argument of the bytes3 type, which will be a hexadecimal code that corresponds to the token’s color. For example, if we want to create a green token, we will pass “#00FF00” when we call this function. Or if we want to create a red token, we’ll use “#FF0000”. In the terminal, run this command: truffle compile First of all, we need to create a file in Truffle structure with instructions to deploy the smart contract. Folder migrations which is automatically created by Truffle. (source: running migrations) In the migrations folder, create the file 2_deploy_contracts.js Copy and paste this code: const Color = artifacts.require("Color"); module.exports = function(deployer) { deployer.deploy(Color); }; It looked like this: In the terminal, run this command: truffle migrate --network testnet Wait a few minutes while the transactions for the smart contract deployments are sent to the blockchain. The migrate command will compile the smart contract again if necessary. First, it deploys the smart contract Migrations.sol, file generated by Truffle: This is the transaction at RSK testnet: 0x3de61b8983dc3db2ca21a9d10106a19c445885fcb7040774bd6937daf94a4702 And then it deploys our smart contract Color.sol: This is the transaction at RSK testnet: 0x2c2d2932a7d637fbba100b5c482c1fa1899c4fe24bd1a458976a93cee6c5ba85 A tip: if there is a communication problem with the testnet between the publication of Migrations.sol and Color.sol, just run the migrate command again, it will deploy only what is missing. Congratulations! Our NFT Color is published at RSK Testnet. Save the contract address of token, it can be used later: tokenAddress = "0x5505a54a8F3e63D37095c37d9f8AcF0f4900B61F" Now let’s start building out the front end that will interact with the smart contract. It will allow us to create new color tokens, and list out all of the existing tokens in your wallet. In the app folder, we need to customize some files. In the app\public folder, open index.html file. At head section, update the title: <title>NFT Colors</title> In the app\src folder, open index.js file and add a line to use bootstrap in out project import 'bootstrap/dist/css/bootstrap.css'; Also remove this line: import './index.css'; The final index.js is this. You can overwrite it with the code from following gist, or inline below: import React from 'react'; import ReactDOM from 'react-dom'; import 'bootstrap/dist/css/bootstrap(); At this point, your completed index.js file should looks like this: Open App.css file and overwrite it with the code from the following gist, or copy and paste the code below: .token { height: 150px; width: 150px; border-radius: 50%; display: inline-block; } This code customizes the appearance for tokens. This is the result: Open App.js file and overwrite it with the code from following gist, or copy and paste the code below: import React, { Component } from 'react'; import Web3 from 'web3'; import './App.css'; import Color from './contracts/Color.json'; function colorHexToString(hexStr) { return '#' + hexStr.substring(2); } function colorStringToBytes(str) { if (str.length !== 7 || str.charAt(0) !== '#') { throw new Error('invalid color string'); } const </form> </div> </main> </div> <hr/> <div className="row text-center"> { this.state.colors.map((colorStr, key) => { return ( <div key={key} <div className="token" style={ { backgroundColor: colorStr } }></div> <div>{colorStr}</div> </div> ); })} </div> </div> </div> ); } } export default App; Import web3 here: import Web3 from 'web3' This part is connected to the RSK Testnet using the injected web3 provider, in this case, MetaMask:); } To load the instance of smart contract Color already published, we need to load the informations from Truffle deploy: import Color from './contracts/Color.json'; And after connecting successfully, the function loadBlockchainData loads accounts, network information and the smart contract Color.], }); } } Also we have a mint function at App.js which sends a transaction to the network calling the mint function in the smart contract. mint = (colorStr) => { const colorBytes = colorStringToBytes(colorStr); this.state.contract.methods .mint(colorBytes) .send({ from: this.state.account }) .once('receipt', (receipt) => { console.log ('transaction receipt: ', receipt) this.setState({ colors: [...this.state.colors, colorStr], }); }); } Finally, the render() function is responsible for the HTML code for the application. It has 3 primary functions: In the app folder, at terminal, run: npm start It will automatically open the default browser at If it does not open, you can enter the local url manually in the browser. Metamask automatically detects that our app would like to connect, authorize this action by clicking on the Connect button. And this is our frontend! The colors are saved with hexadecimal representation for each. To know more about color and hex color codes: Some color codes: Choose a color and enter your hexadecimal representation in the info text field, and click on the MINT button. It will call the mint() function at the smart contract instance Color, with the color that you defined. I will enter the color red, value #FF0000. Do not forget to use the symbol # Click on the confirm button. Great! Now I have my first color collectable token: I would like to mint the blue color: #0000FF Wait for a few seconds for your transaction to be mined… And now I have two colors in my collection! And my collection is growing! Hope it was easy for you to create a NFT! I showed you how to connect Truffle to the RSK network and deploy your own NFT using the OZ libraries, and that they work on the RSK network. This tutorial was inspired by Gregory McCubbin’s tutorial, from dApp University. Check out the original article. Our goal is to join forces and give options to people who believe in smart contracts based on Ethereum, and also believe in the power of Bitcoin, through RSK. I hope this tutorial has been helpful and I’d appreciate your feedback. Happy with this tutorial? Share it if you like it :) Go to top
https://developers.rsk.co/tutorials/tokens/create-a-collectable-token/
CC-MAIN-2020-34
refinedweb
1,903
56.05
Type: Posts; User: Shinisama Hello guys, Thank you for your help on my last question. I have another very simple question. I have been trying to figure this out for a while, and since my professor doesn't help me in the class I... Never mind lol I'm retarded. I got it, I was using an int for the variable, not a char. Thanks for the help! Alright, after a little bit more research I figured it out (at least I thought.) This is what I came up with: #include <iostream> using namespace std; int main () { int day; ... Hello, So I am new here, from what I have seen people here know what they're doing :) (not that my question is hard at all). So I am taking a programming class at my school. I have dabbled...
http://forums.codeguru.com/search.php?s=7d59d9703156380ef7a2a124bd1238bd&searchid=9125997
CC-MAIN-2016-30
refinedweb
138
84.37
Suppose I need to use a library which is accessed via a global variable e.g. jQuery, lodash, d3, etc. Let's assume that the library does not export modules of any flavor. What is the best way to import such a library? This seems counterproductive -- modules are a superior method of sharing code. Nonetheless, it is apparently an option some pursue. Example usage with lodash, which uses the _ global variable, in an adapter: _ // adapters/my-custom-adapter.js findQuery: function(store, type, query) { return this.findAll(store, type).then(function(data) { return _.filter(data, _.matches(query)) }); } Another option is to wrap the global in a module so it can be imported in the standard fashion. Example usage: // vendor/shims.js define('lodash', [], function() { 'use strict'; return {default: _}; }); // adapters/my-custom-adapter.js import _ from 'lodash'; findQuery: function(store, type, query) { return this.findAll(store, type).then(function(data) { return _.filter(data, _.matches(query)) }); } Sidebar Anyone know why the transpiler doesn't support the module declaration (which I think is part of the ES6 spec)? module module 'lodash' { export default: _; } So I guess option 2b is modify the transpiler to support module. Similar to option 2, but each vendored lib gets its own file. // vendor/lodash.js export default _; // adapters/my-custom-adapter.js import _ from 'vendor/lodash'; findQuery: function(store, type, query) { return this.findAll(store, type).then(function(data) { return _.filter(data, _.matches(query)) }); } It looks like there is some precedent in ES6 polyfills for loading globals when all else fails. That is, when a module has not been registered, there is a final check to see if the required module name is defined globally. I'm curious if this is considered a bad idea. // adapters/my-custom-adapter.js import _ from '_'; findQuery: function(store, type, query) { return this.findAll(store, type).then(function(data) { return _.filter(data, _.matches(query)) }); } Am I missing potential solutions? Which solution is preferable? Thanks! Have a look at Thanks for the reply! Using Ember's DI facilities is certainly one solution, but I'm not sure it's always the right solution. From my perspective, modules, DI and Ember DI are different creatures befitting different problems. inject A logger is a good fit for DI. We want to instantiate and share a single logger instance at runtime. We want the ability to swap out logger implementations. Conversely, lodash is a bunch of utility functions, and is not a good fit for DI. It will only ever have a single implementation. We don't want the ability (or onus) to inject lodash. We want to depend on it concretely. Ember DI has the following mechanics. In an initializer, I can do something like: var logger = new Logger(); application.register('logger:main', logger); application.inject('controller', 'logger', 'logger:main'); This says that my instance of logger is registered under the name "logger:main". Then, I can inject logger into all controllers (as specified by "controller"). It will appear on a given controller as the property logger i.e. can be accessed via this.logger. logger this.logger This is pretty neat, but also pretty limiting (has anyone ever been happy with a DI framework?). Limitation 1. The inject target, 'controller' has to be a valid "factory name". That is, it must be a "major framework class". 'controller' Limitation 2. The inject target, must be instantiated by the framework Limitation 3. The dependency is injected as an attribute of the object. Let's return to lodash, the pile of utility functions. If I define a vanilla JS class (POJO), which in turn depends on lodash, limitations 1 and 2 are killers. I instantiate POJOs myself, and they're not major framework classes, so I cannot take advantage of Ember DI. But even if I'm working on a major framework class, do I really want lodash's _ to become a property of the object? Not really. this._ seems weird, and I don't want to bind this everywhere just to access _. this._ this The availability of a Ember DI does not obviate the need for modules because 1. Ember DI is limited, and 2. DI is not always the right pattern. I think it is important to create module shims for globals before we even get into register/inject territory; a sacred shim barrier over which no code may cross unless it is wrapped by a module. In other words, I would modify the blog post example to: import io from 'socket-io'; // stuff app.register('io:main', io, {instantiate: false}); THIS IS AN EXCELLENT QUESTION (bump)
https://discuss.emberjs.com/t/best-practices-shimming-libraries-which-use-global-variables/7922
CC-MAIN-2017-30
refinedweb
783
51.55
In this article, we will learn about Logic Gates in Python. Let’s look at each of the logic gates in Python in detail with some easy examples. All of us are quite familiar while implementing logic gates in the processing of electrical signals and are widely used in the electrical and electronics industry. They are used in the diodes and transistors so that we can design by proper alignment of these electronic devices. In this article we will learn about the implementation of some basic gates ‘and‘, ‘or‘ ,’not‘ , ‘nand‘ ,’nor‘ in Python 3.x or earlier. These gates can be implemented by using user-defined functions designed in accordance with that of the truth table associated with the respective gate. def AND (a, b): if a == 1 and b == 1: return True else: return False # main function if __name__=='__main__': print(AND(0,0)) print(AND(1,0)) print(AND(0,1)) print(AND(1,1)) False False False True def OR(a, b): if a == 1: return True elif b == 1: return True else: return False # main function if __name__=='__main__': print(OR(0,0)) print(OR(1,0)) print(OR(0,1)) print(OR(1,1)) False True True True def NOT(a): if(a == 0): return 1 elif(a == 1): return 0 # main function if __name__=='__main__': print(OR(0)) print(OR(1)) True False def NAND (a, b): if a == 1 and b == 1: return False else: return True # main function if __name__=='__main__': print(NAND(0,0)) print(NAND(1,0)) print(NAND(0,1)) print(NAND(1,1)) True True True False def NOR(a, b): if(a == 0) and (b == 0): return True elif(a == 0) and (b == 1): return False elif(a == 1) and (b == 0): return False elif(a == 1) and (b == 1): return False # main function if __name__=='__main__': print(NOR(0,0)) print(NOR(1,0)) print(NOR(0,1)) print(NOR(1,1)) True False False False In this article, we learned how to implement logic gates in Python 3.x. Or earlier. We also learned about two universal gates i.e. NAND and NOR gates.
https://www.tutorialspoint.com/logic-gates-in-python
CC-MAIN-2021-21
refinedweb
360
59.06
Add a new, flexible UI for adding and configuring integrations. Review Request #10431 — Created Feb. 26, 2019 and submitted The old integrations UI worked alright when we only had a few integrations available, but didn't scale well. It was harder to visually separate the configurations from the available integrations, and really hard to see at a glance how many configurations you had in total. It also only worked in the Django administration UI, meaning it wasn't usable in, say, RBCommons or Splat Team Admin UIs. This change completely redoes the UI for integrations, while at the same time making it suitable for use outside of the Django administration UI. Now, configurations are presented as a config forms list, showing an icon for the integration, the configuration name, integration name, and the enabled/disabled state. Above the list is a button for adding an integration, which pops up a tile-based menu of all integration options. Down the road, this can be expanded to allow searching or filtering based on categories, but for now it provides a good way of quickly seeing what's available. The new UI has been built on top of the new config forms work, providing a consistent appearance wherever it's embedded. Tested adding new integrations via the popup. Tested editing existing integrations. Tested the integrations popup on various screen sizes, including very large and very small screens. Tested that the integration state was reflected in the list item. Tested custom URL namespaces, and that they're respected everywhere.
https://reviews.reviewboard.org/r/10431/
CC-MAIN-2020-10
refinedweb
255
54.73
Elastic Nodes Example#. Node Class Definition# The Node class serves three purposes: - Painting a yellow gradient “ball” in two states: sunken and raised. - Managing connections to other nodes. - Calculating forces pulling and pushing the nodes in the grid. Let’s start by looking at the Node class declaration. class Node(QGraphicsItem): # public Node(GraphWidget graphWidget) def addEdge(edge): *> = QList<Edge() enum { Type = UserType + 1 } int type() override { return Type; } def calculateForces(): advancePosition = bool() boundingRect = QRectF() shape = QPainterPath() def paint(painter, option, widget): protected: itemChange = QVariant(GraphicsItemChange change, QVariant value) def mousePressEvent(event): def mouseReleaseEvent(event): # private *> = QList<Edge() newPos = QPointF() graph = GraphWidget(): def __init__(self, graphWidget): self. def addEdge(self, edge): edgeList << edge edge.adjust() QList<Edge *> Node::edges(). def calculateForces(self): if (not scene() or scene().mouseGrabberItem() == self) {., mouseGrabberItem() ). Because we need to find all neighboring (but not necessarily connected) nodes, we also make sure the item is part of a scene in the first place. # Sum up all forces pushing this item away xvel = 0 yvel = 0 > items = scene().items() for item in items: node = qgraphicsitem_cast<Node *>(item) if (not node) continue vec = mapToItem(node, 0, 0) dx = vec.x() dy = vec.y() items() to find all items in the scene, and then use weight = (edgeList.size() + 1) * 10 for edge in qAsConst(edgeList): vec = QPointF() if (edge.sourceNode() == self)(). def advancePosition(self): if (newPos == pos()) return False setPos(newPos) return True The advance() function updates the item’s current position. It is called from GraphWidget::timerEvent(). If the node’s position changed, the function returns true; otherwise false is returned. def boundingRect(self): adjust = 2 def QRectF(adjust,adjust,adjust. def shape(self): path = QPainterPath()). def paint(self, painter, option, arg__0): painter.setPen(Qt.NoPen) painter.setBrush(Qt.darkGray) painter.drawEllipse(-7, -7, 20, 20) gradient = QRadialGradient(-3, -3, 10) if (option.state QStyle.State_Sunken) { gradient.setCenter(3, 3) gradient.setFocalPoint(3, 3) gradient.setColorAt(1, QColor(Qt.yellow).lighter(120)) gradient.setColorAt(0, QColor(Qt.darkYellow).lighter yellow to. def itemChange(self, GraphicsItemChange change, QVariant value): switch (change) { ItemPositionHasChanged: = case() for edge in qAsConst . def mousePressEvent(self, event): update() QGraphicsItem.mousePressEvent(event) def mouseReleaseEvent(self,). Edge Class Definition#(QGraphicsItem): # public Edge(Node sourceNode, Node destNode) sourceNode = Node() destNode = Node() def adjust(): enum { Type = UserType + 2 } int type() override { return Type; } protected: boundingRect = QRectF() def paint(painter, option, widget): # private source, = Node() sourcePoint = QPointF() destPoint = QPointF() arrowSize = 10. def __init__(self, sourceNode, destNode): self.source = sourceNode self.dest = destNode setAcceptedMouseButtons(Qt.NoButton) source.addEdge(self) dest.addEdge(self). Edge::sourceNode = Node() return source Edge::destNode = Node() return dest The source and destination get-functions simply return the respective pointers. def adjust(self): if (not source or not dest) return line = QLineF(mapFromItem(source, 0, 0), mapFromItem(dest, 0, 0)) length = line.length() prepareGeometryChange() if (length > qreal(20.)) { edgeOffset = QPointF(. def boundingRect(self): if (not source or not dest) def QRectF(): penWidth = 1. def paint(self, painter, arg__0, arg__1): if (not source or not dest) return line = QLineF angle = std::atan2(-line.dy(), line.dx()) sourceArrowP1 = sourcePoint + QPointF(sin(angle + M_PI / 3) * arrowSize, cos(angle + M_PI / 3) * arrowSize) sourceArrowP2 = sourcePoint + QPointF(sin(angle + M_PI - M_PI / 3) * arrowSize, cos(angle + M_PI - M_PI / 3) * arrowSize) destArrowP1 = destPoint + QPointF(sin(angle - M_PI / 3) * arrowSize, cos(angle - M_PI / 3) * arrowSize) Class Definition# GraphWidget is a subclass of QGraphicsView , which provides the main window with scrollbars. class GraphWidget(QGraphicsView): Q_OBJECT # public GraphWidget(QWidget parent = None) def itemMoved(): slots: = public() def shuffle(): def zoomIn(): def zoomOut(): protected: def keyPressEvent(event): def timerEvent(event): #if QT_CONFIG(wheelevent) def wheelEvent(event): #endif def drawBackground(painter, rect): def scaleView(scaleFactor): # private timerId = 0 centerNode = Node(). def __init__(self, parent): QGraphicsView.__init__(self, parent) scene = QGraphicsScene(self) NoIndex . The scene then gets a fixed scene rectangle , and is assigned to the GraphWidget view. The view enables CacheBackground to cache rendering of its static, and somewhat complex, background. Because the graph renders a close collection of small items that all move around, it’s unnecessary for Graphics View to waste time finding accurate update regions, so we set the BoundingRectViewportUpdate viewport update mode. The default would work fine, but this mode is noticably faster for this example. To improve rendering quality, we set Antialiasing . The transformation anchor decides how the view should scroll when you transform the view, or in our case, when we zoom in or out. We have chosen1 = Node(self) node2 = Node(self) node3 = Node(self) node4 = Node(self) centerNode = Node(self) node6 = Node(self) node7 = Node(self) node8 = Node(self) node9 = Node(self) scene.addItem(node1) scene.addItem(node2) scene.addItem(node3) scene.addItem(node4) scene.addItem(centerNode) scene.addItem(node6) scene.addItem(node7) scene.addItem(node8) scene.addItem(node9) scene.addItem(Edge(node1, node2)) scene.addItem(Edge(node2, node3)) scene.addItem(Edge(node2, centerNode)) scene.addItem(Edge(node3, node6)) scene.addItem(Edge(node4, node1)) scene.addItem(Edge(node4, centerNode)) scene.addItem(Edge(centerNode, node6)) scene.addItem(Edge(centerNode, node8)) scene.addItem(Edge(node6, node9)) scene.addItem(Edge(node7, node4)) scene.addItem(Edge(node8, node7)) scene.addItem. def itemMoved(self): if (not. def keyPressEvent(self, event): switch (event.key()) { Qt.Key_Up: = case() centerNode.moveBy(0, -20) break Qt.Key_Down: = case() centerNode.moveBy(0, 20) break Qt.Key_Left: = case() centerNode.moveBy(-20, 0) break Qt.Key_Right: = case() centerNode.moveBy(20, 0) break Qt.Key_Plus: = case() zoomIn() break Qt.Key_Minus: = case() zoomOut() break Qt.Key_Space: = case() Qt.Key_Enter: = case() shuffle() break default: QGraphicsView.keyPressEvent(event) This is GraphWidget's key event handler. The arrow keys move the center node around, the ‘+’ and ‘-’ keys zoom in and out by calling scaleView(), and the enter and space keys randomize the positions of the nodes. All other key events (e.g., page up and page down) are handled by QGraphicsView ‘s default implementation. def timerEvent(self, event): Q_UNUSED(event) *> = QList<Node() > items = scene().items() for item in items: if (Node node = qgraphicsitem_cast<Node >(item)) nodes << node for node in qAsConst(nodes): node.calculateForces() itemsMoved = False() for node in qAsConst(nodes): if (node.advancePosition()) itemsMoved = True if (not. def wheelEvent(self, event): scaleView(pow(2., -event.angleDelta().y() / 240.0)) In the wheel event handler, we convert the mouse wheel delta to a scale factor, and pass this factor to scaleView(). This approach takes into account the speed that the wheel is rolled. The faster you roll the mouse wheel, the faster the view will zoom. def drawBackground(self, painter, rect): Q_UNUSED(rect) # Shadow sceneRect = self.sceneRect() rightShadow = QRectF(sceneRect.right(), sceneRect.top() + 5, 5, sceneRect.height()) bottomShadow = QRectF(sceneRect.left() + 5, sceneRect.bottom(), sceneRect.width(), 5) if (rightShadow.intersects(rect) or rightShadow.contains(rect)) painter.fillRect(rightShadow, Qt.darkGray) if (bottomShadow.intersects(rect) or bottomShadow.contains(rect)) painter.fillRect(bottomShadow, Qt.darkGray) # Fill gradient = QLinearGradient textRect = QRectF(sceneRect.left() + 4, sceneRect.top() sceneRect.width() - 4, sceneRect.height() - 4) message(tr("Click = QString() "wheel or the '+' and '-' keys")) drawBackground() . We draw a large rectangle filled with a linear gradient, add a drop shadow, and then render text on top. The text is rendered twice for a simple drop-shadow effect. This background rendering is quite expensive; this is why the view enables CacheBackground . def scaleView(self, scaleFactor): factor = transform().scale(scaleFactor, scaleFactor).mapRect(QRectF(0, 0, 1, 1)).width() if (factor < 0.07 or factor > 100) return scale(scaleFactor, scaleFactor) The scaleView() helper function checks that the scale factor stays within certain limits (i.e., you cannot zoom too far in nor too far out), and then applies this scale to the view. The main() Function#. Example project @ code.qt.io
https://doc-snapshots.qt.io/qtforpython-dev/overviews/qtwidgets-graphicsview-elasticnodes-example.html
CC-MAIN-2022-21
refinedweb
1,260
53.58
Hi I just started with python, and trying to implement some system admin tasks and running into some rough. Basically I need to do some task on whichever share exists on their corresponding server. eg Server A has shares 1,2 and 3 Server B has share 1 and so on. Any help is appreciated :) pseudocode while not Done: Prompt for IP while not Flag prompt for shares def get_config(): config_list = [] done = False deny = 'n' counter = 1 while not done: print " Type n or N to exit " ip = raw_input("Enter IP: ") print "you entered ", ip if ip.lower() == deny.lower(): done = True flag = True else: config_list.append(ip) flag = False while not flag: share = raw_input("Enter Shares : ") if share.lower() == deny.lower(): flag = True else: config_list.append(share) print "Config File Reads ", config_list This works & after entering the values,I get an array like [ 192.168.0.12 , Share1, Share2, 192.168.0.22, Share 1, 192.168.0.14, Share5, Share6, Share9 ] Now for each IP, I need to do some action the shares on that server. as in for ip 192.168.0.12, do task a on Share1,Share2 for ip 192.168.0.22, do task a on Share1 and so on..... I'm struggling how to implement the above. Any thoughts?
https://www.daniweb.com/programming/software-development/threads/327273/list-manipulations
CC-MAIN-2019-09
refinedweb
216
84.17
CPA Report South Carolina South Carolina Association of Certified Public Accountants Magazine • November/December 2009 Sampling of 2009 Tax Law Changes Payment Card Security TIPRA 2005 and Roth Conversions South Carolina Association of Certified Public Accountants Magazine Vol. 39, No. 6, November/December 2009 Officers Charles M. Redfern III, CPA President Charles E. Brown, CPA President-Elect Timothy L. Baker, CPA Vice-President Michael R. Putich, CPA Secretary-Treasurer Sylvia G. Kitchens, CPA Immediate Past President BOARD OF DIRECTORS Anne P. Bunton, CPA Clarence Coleman, PhD, MBA, CPA Alys Anne Dennis, CPA J. Bratton Fennell, CPA Malynda M. Grimsley, CPA Penny A. Lewis, CPA Sharon E. Mann, CPA David A. Masters, CPA L. Kent Satterfield, CPA Phillip R. Snipes, CPA Michael J. Targia, CPA, Cr.FA Robert M. Tilton, CPA V. Carroll Webster, MBA, CPA Jada C. Wood, CPA Chapter Presidents Beth T. Zamorski, CPA, CFP, Catawba Philip A. Betette Jr., CPA, Central Sheryl G. McAlister, CPA, Coastal Wendy L. Hancock, CPA, CVA, Foothills Callie C. Coyne, CPA, Grand Strand Charles A. “Arden” Gatchell, CPA, CVA, Pee Dee Cara T. Hamilton, CPA, Piedmont Patrick P. Carey Jr., CPA, Sea Island SCACPA EXECUTIVE DIRECTOR Erin P. Hardwick, CAE EDITOR Katherine M. Swartz, CAE ASSISTANT EDITOR Allison K. Caldwell GRAPHIC DESIGNER Lisa S. McGee Contributing writers Neil Brown, MAcc, CPA, CFP Erin P. Hardwick, CAE Mark T. Hobbs, CPA Angela L. Polk, MAcc, CPA Don West, CPA, CISA, CISSP, PMP, CITP Statements of fact and opinion are made by the authors alone and do not imply an opinion on the part of the officers or members of the SCACPA. Advertising rates will be furnished on request to SCACPA, 570 Chris Drive, West Columbia, SC 29169, (803) 791-4181. Publication of an advertisement in The CPA Report does not constitute an endorsement of the product or service by The CPA Report or the SCACPA. For more information, visit. (888) 557-4814 | On the Inside FO CUS: TA X PL ANNING & TECHNO LO G Y 8 14 20 Sampling of 2009 Tax Law Changes Payment Card Security TIPRA 2005 and Roth Conversions OTHER FEATURES 10 18 24 Worth Watching: Legislative and Regulatory Issues Hot Topics: Pricing New Partner Admissions 2009 A & A Conference Preview IN E VER Y ISSUE 5 6 22 26 28 30 32 34 From the President Association News Board of Accountancy News Member News SCACPA Member Profile Chapter Connections Upcoming CPE Classifieds SCACPA ADMINISTRATION Erin P. Hardwick, CAE, Executive Director Reva E. Brennan, MPA, CAE, IOM, Associate Director Karen M. Hancock, CPA, Finance Director Glenna P. Minor, Peer Review and Member Services Manager Katherine M. Swartz, CAE, Member Services Director April M. Cox, Education Manager Emily M. Allen, Communications Coordinator Ext. 104 Ext. 103 Ext. 108 Ext. 107 Ext. 105 Ext. 110 Ext. 106 ehardwick@scacpa.org rbrennan@scacpa.org khancock@scacpa.org gminor@scacpa.org kswartz@scacpa.org acox@scacpa.org eallen@scacpa.org Contact SCACPA staff members by phone at (803) 791-4181 or (888) 557-4814. South Carolina CPA Report w November/December 2009 3 Don’t get backed into a corner with a malpractice claim Cover your firm with professional liability insurance. As a CPA, you work too hard to let a malpractice claim ruin your business. The AICPA-endorsed Premier Plan can provide your firm with broad coverage and a comprehensive risk control program designed to help your firm reduce its risk of claims. Our plan offers insureds: • A risk control hotline with specialists who provide advice • Training in three convenient formats: live seminar, webcast or online self-study • Online policyholder resource center, which offers engagement letter guides, 10 sample engagement letter templates, case studies and other useful tools to assist your firm In the event that you do incur a claim, the Program provides insureds experienced claims management. CNA, the Plan underwriter, insures over 25,000 firms and has handled more than 14,000 accountants malpractice claims and potential claims over the past 10 years. There’s a way out with the AICPA-endorsed Premier Plan. Contact Charles Cauthen at BB&T Insurance Services, Inc. today. (800) 868-3721 or (704) 954-3033 Endorsed by: Endorsed by: Nationally Administered by: Underwritten by: Aon Insurance Services is a division of Affinity Insurance Services, Inc.; in CA, MN & OK, (CA License #0795465) Aon Insurance Services is a division of AIS Affinity Insurance Agency, Inc.; © 2009 CNA. All rights reserved. E-5929-509 SC From the President It’s Been Grand T his year has certainly gone by quickly, and I want to borrow a phrase of a friend of mine from Rock Hill: “It’s been grand.” I still feel honored to have served as president of SCACPA—the primary volunteer organization of the profession—but my position was made easy with the help of many others. I was lucky to have had a strong, vocal, energetic Board of Directors, a willing and capable staff at SCACPA, and a dedicated group of committee chairs that stayed on task for the year. I would not be telling the truth if I said there was no stress involved with leading the association, but I definitely feel that it was well worth the time and effort. I still feel honored to have served as president of SCACPA— the primary volunteer organization of the profession—but my position was made easy with the help of many others. Over the past couple of years I have traveled to Washington, New York, Dallas, Amelia Island, Tampa, Tucson and Las Vegas to work with the AICPA and to add a voice from South Carolina. During the last five years the SCACPA Board has met in Charleston, Flat Rock, Asheville, Tryon and Columbia for productive planning retreats. The guidelines from the AICPA and retreats have kept the Board and staff on target over the years. I have witnessed changes in SCACPA over the past couple of years which deserve recognition. Our CPA Day at the State House event has improved every year and certainly helps our legislative efforts, which are an important role of SCACPA. The Peer Review program has grown due to new legislation, and SCACPA has not only taken this on but also improved the program. CPE had remained on the leading edge of professional issues and has stayed competitive in this new environment. We now have a Young CPA Leadership Cabinet, which will bring a younger voice into the leadership of SCACPA. We have worked hard to assist and work with the local chapters, which in effect helps improve the entire Association. The SCACPA staff and Erin Hardwick’s leadership should be commended for all their good work in these endeavors. As I mentioned in my last article, the Board has made great strides in all of our Five Bold Steps for 2009. We are already focused on our priorities for 2010, and have developed attainable goals to achieve our agenda. I want to thank the Board again for their commitment to SCACPA, and encourage them to keep up the good work. As I said, it’s been grand. n Pictured Top: AICPA CEO Barry Melancon, SCACPA President Charlie Redfern, SCACPA Executive Director Erin Hardwick and AICPA Board Chair Bob Harris. Middle: SCACPA members delivering the 2009 Tax Guide to South Carolina Legislators at the State House. Bottom: Charlie Redfern speaking with fellow CPAs at the 2009 CPA Day at the State House. (888) 557-4814 | Charles M. Redfern III, CPA SCACPA 2009 President Charlie is the president of Charles M. Redfern, CPA in Rock Hill, SC. He has been a member of SCACPA since 1977. South Carolina CPA Report w November/December 2009 5 Association News Mark Your Calendar! CPA SUMMIT AND MEMBER MEETING ACCOUNTING AND AUDITING CONFERENCE November 19-20 Embassy Suites – Columbia SC December 10-11 Francis Marion Hotel – Charleston, SC TECHNOLOGY CONFERENCE LAST CHANCE – CPE FRENZY December 1 Embassy Suites – Columbia SC December 29-30 SCACPA Headquarters – West Columbia, SC Register at today! 2009 FEDERAL TAX UPDATE ROAD SHOW WITH WALTER NUNNALLEE DECEMBER 14: Florence – Southeastern Manufacturing & Technology Institute 15: Bluffton – USC Beaufort at Bluffton 16: Columbia – Embassy Suites 17: Greenville – Embassy Suites Sea Island Chapter of SCACPA Establishes Scholarship WANTED: A Few Good Men & Women The SCACPA Educational Fund Trustees are pleased to announce the establishment of Sea Island Chapter of SCACPA endowed scholarship. The Chapter presented a check to SCACPA at its September 3 annual business meeting. The first Sea Island Chapter scholarship will be awarded in 20102011. The SCACPA Educational Fund scholarship recipients are students with tremendous intellectual talent, who are attending college to enter the accounting profession. Scholarships are awarded to college students who are South Carolina residents and are a rising junior, senior or Master’s Degree candidate majoring in accounting at a South Carolina college or university. Scholarship recipients must have a minimum GPA of 3.25 overall and 3.50 in accounting. Contributions and endowments help secure the Educational Fund’s future. Contributions may be directed to the general or endowment funds at any time, or new endowment funds may be established ($10,000 minimum). Staff contact: Glenna Minor No Experience Necessary! SCACPA’s Legislative Committee needs your help! We are actively seeking Key Person Contacts (KPCs) for all members of the South Carolina General Assembly. Do you have a legislator as a client? Know them through a civic or religious organization? Have mutual friends? Live or work in their district? It’s important to all CPAs that we maintain a strong advocacy to protect the profession and the clients we represent. SCACPA needs your help to contact your legislator when key issues arise. Become a KPC today, and let your voice be heard! Staff contact: Glenna Minor Welcome New Peer Reviewers! The SCACPA Peer Review Committee is pleased to welcome the following new peer reviewers: 6 Monica Rockwell, CPA Cox & Company, PA Anderson, SC Robin R. Poston, CPA Harper, Poston, & Moree, PA CPAs Georgetown, SC Stacey C. Moree, CPA Harper, Poston & Moree, PA CPAs Pawleys Island, SC Carol S. Hubbard, CPA Carol S. Hubbard, CPA, LLC Mount Pleasant, SC Staff contact: Glenna Minor Howard N. Nichols, CPA Lexington, SC South Carolina CPA Report w November/December 2009 Sign Up Now for Tax Season Help Whether your firm needs part-time tax season help, or you’re an individual seeking additional hours during tax season, SCACPA’s Tax Season Assistance Program can help. As requests are received, SCACPA compiles and distributes a master list to connect you with interested firms or CPAs. Online registration is quick and easy, and this annual program is offered at no cost to our members. Staff contact: Emily Allen (888) 557-4814 | SCACPA: Your Source for Customized Training On-site, off-site, online—whatever your preference, SCACPA offers a wide range of innovative, effective professional development opportunities designed to meet your needs and keep your staff on the leading edge of financial practices. Designed for groups of 10 or more, courses range from four hours to multiple days with more than 100 topics available! Discounts are available for large groups, and Discussion Leader Guides can be purchased if you want to conduct the training yourself. Save time and money with SCACPA’s customized training program! Staff contact: Reva Brennan Annual CPE Renewal Alert The SC Board of Accountancy has implemented a biennial renewal for your CPA license. However, CPAs must still earn a minimum of 40 hours of continuing professional education annually (January 1 through December 31). The aggregate total for reporting with the renewal will be 80 hours for the two-year cycle, with 40 hours earned each calendar year. SCACPA is prepared to help you meet this requirement with timely, high quality courses offered year round. Check page 32 for Upcoming CPE, or browse course descriptions and register online. Staff contact: April Cox 570 Chris Drive West Columbia, South Carolina 29169 (803) 791-4181 or Toll-free (888) 557-4814 Fax (803) 791-4196 South Carolina CPA OUR MISSION Invest in Yourself, Your Profession and Your Association: 2010 Membership Dues Notice Your 2010 SCACPA membership dues statement will soon be e-mailed (week of November 16) and mailed (week of November 30). Please remember that prompt payment saves the Association the cost of additional mailings – your timely payment means you won’t miss a beat when it comes to CPE discounts, your subscription to this magazine, The South Carolina CPA Report, SCACPA insurance and discount programs, outstanding networking opportunities and dozens of other benefits of membership. The fastest and easiest way to renew is on our new Web site,. To renew (effective November 16) follow these four steps: (1) Log into your membership account; (2) Select “Manage My Membership”; (3) Select “Pay My Dues”; and (4) Either renew for yourself or multiple people within your firm or organization. Be sure to check out our Membership Frequently Asked Questions (FAQs) at Content/Join/FAQs.aspx, where we’ve printed the commonly asked questions and answers regarding payment procedures and billing classifications. Staff contact: Katherine Swartz (888) 557-4814 | South Carolina Association of CERTIFIED PUBLIC ACCOUNTANTS To support all CPAs – whether in public practice, industry, government or education – with lifelong learning opportunities necessary for their success and to promote high ethical standards and legislative advocacy for both the public good and the profession. We accomplish this mission through the following activities: n n n n n Advocacy Certification & Licensing Communications Recruiting & Education Standards & Performance South Carolina CPA Report w November/December 2009 7 Feature Sampling of 2009 TAX LAW CHANGES by Angela L. Polk, MAcc, CPA SCACPA member since 1988 This article is a brief introduction to various law changes impacting 2009 made by the American Recovery and Reinvestment Act of 2009—which for the purposes of this article is referred to as “the Act.” ENHANCED TAX CREDIT FOR FIRST-TIME HOMEBUYERS In an attempt to help the housing industry, the Act included an enhanced tax credit for first-time homebuyers. The new credit applies to homes purchased on or after January 1, 2009, through the end of November 2009. This also includes residences under construction, as long as the taxpayer owns and occupies by the November 30 deadline. The law raises the maximum credit amount from the 2008 limit of $7,500 to $8,000. It also provides that this revised credit does not have to be repaid. Further, the revised credit only has a three-year recapture provision, versus the 15-year period that applies for 2008. The new credit may also be claimed on an amended 2008 return if the taxpayer does not want to wait until 2009 to claim the credit. Please note, however, that the IRS is reviewing the returns with additional scrutiny due to 8 South Carolina CPA Report w November/December 2009 (888) 557-4814 | the number of fraudulent claims that have been filed. The Service says that the processing time is longer—12 to 16 weeks instead of the usual eight to 12 weeks. AMERICAN OPPORTUNITY TAX CREDIT The Act also includes a measure aimed at making college more affordable for low and moderate-income students. The new provision temporarily replaces the Hope tax credit with the American Opportunity tax credit for 2009 and 2010. The maximum amount of the American Opportunity tax credit is $2,500. The credit is 100 percent of the first $2,000 of qualifying expenses and 25 percent of the next $2,000—so the maximum credit of $2,500 is reached when a student has qualifying expenses of $4,000 or more. The tax credit is available for up to four years. The Act expands the qualifying expenses from just tuition and fees to include textbooks. Forty percent of the credit is also refundable, and adjusted gross income limits were expanded. The credit begins phasing out at $80,000 for single to $160,000 for joint filers. CHANGES TO SECTION 529 Additionally, the definition of higher education expenses under Section 529 (qualified tuition) plans was expanded to cover computer technology and equipment, internet access and other related services for 2009 and 2010. Prior to the Act, a computer did not qualify unless it was required by the college or by a specific degree program or course. NET OPERATING LOSS (NOL) PAYBACK PERIOD EXTENDED Small businesses were also extended a longer net operating loss (NOL) carryback period for 2008 losses. Normally, losses are only carried back two years. The Act allows an (888) 557-4814 | election to be made to carry the NOL back three to five years. The election is required to be filed no later than the due date, including extensions for filing the tax return for the tax year of the NOL. If the business has a fiscal year beginning in 2008, they still have an opportunity to benefit from this expanded carryback period. Small businesses are defined in terms of gross receipts. The average gross receipts for the three years prior to the year generating the NOL has to be $15 million or less. ALTERNATIVE MINIMUM TAX RELIEF The Act provides temporary relief from alternative minimum tax (AMT) for 2009 by increasing the exemption amounts above last year’s levels and allowing nonrefundable credits to offset AMT as well as regular tax. Without this relief, it was previously estimated that more than 20 million additional taxpayers would have faced paying the tax on their 2009 returns. For tax years beginning in 2009, the AMT exemption amounts are increased as follows: $70,950 in the case of married individuals filing a joint return and surviving spouses; $46,700 in the case of unmarried individuals other than surviving spouses; and $35,475 in the case of married individuals filing a separate return. VARIOUS OTHER CREDITS There are numerous other credits—far too many to cover in one article—such as extension of the 50 percent bonus depreciation, the $250,000 179 expense limitation, and others included in this legislation impacting numerous individuals and businesses. There are also other law changes such as the “Worker, Retiree, and Employer Recovery Act of 2008” that also have an impact in 2009. For example, that act included provisions for required minimum distributions (RMDs) in 2009. Retirement plan and IRA account owners and their beneficiaries are allowed to waive their required minimum distributions for 2009. If distributions have already been taken in 2009 (that are not RMDs for 2008) and the taxpayer would benefit from the deferral, the distribution may qualify for a rollover to another eligible retirement plan, thereby saving the deferral. Please note that individuals who chose to delay taking their 2008 RMD until April 1, 2009 (e.g., retired employees and IRA owners who turned 70 ½ in 2008) are still required to take those distributions in 2009. If a beneficiary, on the other hand, is receiving distributions over a five-year period from an inherited account, he or she can waive the distribution for 2009, effectively permitting the beneficiary to take distributions over a six-year period. Additionally, designated beneficiaries of Roth IRAs may also waive their RMDs, thereby allowing them to avoid selling reduced value assets to make an otherwise required distribution. The main idea here is to note that there are a lot of changes this year that we need to be aware of. Unfortunately or fortunately, depending on your view, that means a lot of reading. n ANGELA L. POLK, MAcc, CPA, is a tax manager with WebsterRogers, LLP, specializing in estate, trust and gift taxation. She is an alumna of Francis Marion University and the University of South Carolina. Angela has served on SCACPA’s CPE, Membership and Emergency Professional Assistance committees. South Carolina CPA Report w November/December 2009 9 Compiled by Executive Director Erin P. Hardwick, CAE Serving SCACPA since 2005 South Carolina Tax Realignment Commission Convenes The South Carolina Tax Realignment Commission (TRAC) held its first organizational meeting on September 9, 2009. Burnie Maybank with Nexsen Pruitt Law Firm, former director of the state Department of Revenue, was elected TRAC chairman. Bob Steelman, with Michelin North America, was elected vice chairman. After the election of officers, Commission staff presented the legislation behind their creation and reiterated their charge to make recommendations to the General Assembly for changes to the state’s tax structure by March 2010. The legislation requires that the recommendations ensure a system that is adequate, equitable and efficient. 10 The Commission began their discussions by looking at the state’s sales tax exemptions. It was pointed out that South Carolina has exemptions totaling some $2.7 billion, while actual sales tax collections were only $2.3 billion. Chairman Maybank said he expected the next two meetings of the Commission would focus on discussing each and every one of the exemptions. After reviewing sales tax—including admissions, accommodations and fuel tax—the Commission will then look at the corporate tax structure. The TRAC met again on September 30, 2009. The Commission heard a presentation from the state’s Chief Economist, Dr. Bill Gillespie, on South Carolina’s revenue situation. Gillespie presented information pertaining to South Carolina CPA Report w November/December 2009 At the current rate of six percent, sales and use tax exemptions represent approximately $2.7 billion in unrealized revenue. The state Department of Revenue began a line-by-line review of the exemptions, explaining each and giving a brief background on the history of the exemption. (888) 557-4814 | how we tax, revenue generated and the current economic climate. Gillespie noted that of the 170 professional services recognized by the state, only 35 of them are currently taxed. The Commission began the review of state’s sales tax exemptions. At the current rate of six percent, sales and use tax exemptions represent approximately $2.7 billion in unrealized revenue. The state Department of Revenue began a line-by-line review of the exemptions, explaining each and giving a brief background on the history of the exemption. The Commission completed preliminary review of roughly half of those, and will hear the remainder of the exemptions at the next meeting. devices, radiopharmaceuticals used in cancer treatment, diabetic supplies, samples distributed by pharmaceutical representatives and other items fall in this category. The annual exemption estimate is $585 million. 4) Electricity and Heating Fuels for residential, commercial and industrial purposes. The annual exemption represents $102 million in the manufacturing sector, and $188 in residential. TRAC RESOURCES To view the current state tax exemptions, visit. bcb.sc.gov/BCB/bea/exemptions. pdf. To review all information presented to the Commission, visit. gov/citizensinterestpage/TRAC/ TRAC.html The Commission is scheduled to meet again October 28, November 12 and December 2, when they will continue their review of the various exemptions currently on the books. from several different professional associations that have similar concerns to discuss ways to address these concerns in a collaborative approach. OTHER STATE LEGISLATIVE ISSUES FEDERAL ISSUES Several of the larger exemptions, or categories of exemptions, generated a number a questions prompting the Chairman to announce they would have separate discussions. Based on the meeting, four categories have been identified for more in-depth discussion: Federal/State Tax Conformity Proposed Registration of Tax Preparers SCACPA continues to work toward early confirmation of federal-state tax conformity. Discussions with the state Department of Revenue and key legislators are now taking place to lay the groundwork for the introduction of conformity legislation early in 2010. 1) Motor Fuel Tax. While there is currently a state motor fuels tax that directly funds roads and bridges, sales tax is not applied. Currently, the exemption represents $500 million annually. Helping the SC Board of Accountancy Meet its Mission In testimony before the House Ways and Means Oversight Committee on June 4, 2009, Internal Revenue Service Commissioner Douglas Shulman announced that the IRS plans to make recommendations to ensure that tax preparers adhere to high ethical standards. Legislation to regulate preparers has generally been proposed by members of Congress as a partial response to 1) the high error rate associated with Earned Income Tax Credit (EITC) claims; and 2) consumer protection concerns associated with refund anticipation loans (RALs). 2) Communications Services. This includes land line and wireless toll charges, internet use, broadband, voice messages, texts and other services, with exemptions representing approximately $73 million annually. 3) Medical/Prescription. Prosthetic As the state Department of Labor Licensing and Regulation seeks economies of scale by consolidating the licensing, renewals, administration, investigative and legal representation functions for the 40 boards and commissions under its jurisdiction, regulating boards are becoming increasingly frustrated by their own inability to meet their respective missions of protecting the public. SCACPA recently convened a meeting with representatives The IRS has authority to regulate tax return preparers through the penalty authority under current law. The Internal Revenue Code permits the IRS to assess (among others) penalties for the understatement of a taxpayer’s liability (section 6694); the continued next page (888) 557-4814 | South Carolina CPA Report w November/December 2009 11 The current ...continued from previous page failure to furnish a copy or to sign the return (section 6695); the promotion of abusive tax shelters and gross valuation overstatements (section 6700); the aiding and abetting of the understatement of tax liability (section 6701); and actions to enjoin certain conduct by preparers or promoters (sections 7407 and 7408). administration The federal government also regulates CPAs, attorneys and enrolled agents through the IRS’s Office of Professional Responsibility (OPR). OPR enforces Circular 230, which governs the practice these professionals before the Service. OPR has the authority to identify standards of performance and discipline these Circular 230 practitioners through disbarment and other sanctions. House nor Senate The IRS announcement did not offer specifics on what the proposals may entail, though unconfirmed reports indicate that registration, an exam, a requirement for continuing professional education and possibly the granting of a certificate are being considered. AICPA representatives are meeting with congressional staff and IRS officials to discuss tax preparer registration in the past, and will continue to do so. Proposed Consumer Financial Protection Agency (CFPA) As the proposed legislation—H.R 3126—read in September 2009, it had the unintended consequence of going beyond the regulation of the sale of products related to consumer credit and finance and impacted independent services provided in the context of professional relationships. 12 and Congress have stated that they do not want the estate tax to expire; however, neither the has taken any steps legislatively. The proposed legislation would have resulted in redundant regulation of CPAs and certified public accounting firms that are already subject to appropriate oversight by the IRS, Treasury, state boards of accountancy and AICPA’s professional and ethical standards. In early October as a result of intense advocacy efforts by AICPA and SCACPA, CPAs are currently exempted from the legislation. CPAs should not, of course, be exempt from the Consumer Financial Protection Agency’s regulation when acting in other capacities and AICPA would support additional oversight of financial products, such as refund anticipation loans. The legislation continues to be discussed in Congress as we go to publication of The SCCPA Report. See SCACPA’s Web site for emerging information on this topic. South Carolina CPA Report w November/December 2009 President’s Budget Proposal for Mandatory E-File for Individuals President’s Obama’s fiscal year 2010 budget contains a proposal which gives the IRS the authority to draft regulations requiring tax return preparers who file more than 100 returns to e-file all individual, estate and trust returns. The 100-return threshold is defined as all returns filed by the preparer, which may include corporate, partnership, individual and other returns. For example, a preparer may file 40 corporate, 40 partnership and 21 individual returns on a yearly basis. Since the preparer files over 100 returns on a cumulative basis, he will be required to e-file all individual tax returns (as well as any estate, and trust returns that he might prepare). The proposal also would allow regulations requiring tax return preparers who file more than 100 returns (or any other person who files more than 250 returns) to e-file tax returns for individuals, estates or trusts. (888) 557-4814 | Estate Tax Developments In 2001, Congress enacted legislation designed to phase out the estate tax by 2010. Over these eight years the estate exemption has been increasing in increments, and is currently $3.5 million per person. Not only is the estate tax set to expire in 2010, but so is the rule that allows a step up in basis at death. That means that all would then come under a carryover basis regime that will be complex and difficult to implement. Wills and estate plans will all have to be redrafted if the repeal takes place beginning January 1, 2010, because Congress only repealed the estate tax for one year. If left alone, in 2011 the estate tax is reinstated at the levels that existed in 2001, meaning a $1million exemption and a 55 percent top rate. The current administration and Congress have stated that they do not want the estate tax to expire; however, neither the House nor Senate has taken any steps legislatively. Senate finance chair Max Baucus is supporting a permanent fix that encompasses much of a proposal made by the AICPA. It would continue the $3.5 million exemption and would make it fully transferable between spouses, indexed for inflation along with an equivalent gift tax exemption, while maintaining step up in basis. House Ways and Means chairman Charles Rangle is proposing a one year extension of the current rules. Tax Strategy Patents The patentability of tax planning methods is a growing concern among tax practitioners and taxpayers. In 1998, the U.S. Federal Circuit Court of Appeals, in State Street Bank & Trust v. Signature Financial Group, Inc., held that business methods could be patented. Since then, 78 patents for tax strategies have been granted and 132 patent applications for tax planning methods are pending as of August 2009. Patents for tax planning methods have already been granted in a variety of areas, including the use of financial products, charitable giving, estate and gift tax, pension plans, tax-deferred real estate exchanges and deferred Auditor Malpractice Issues Litigation Consulting/ Representation Peer Reviews & Inspections Over 425 System Reviews Conducted Nationwide John F. Hamilton, CMA, CPA D i re c t ( 8 03 ) 60 8 -80 6 6 o r Jo hnf h@aol.com (888) 557-4814 | compensation. For example, one patent granted is for the process of computing and disclosing the federal income tax consequences involved in the conversion from a standard individual retirement account (IRA) to a Roth IRA. Many more tax planning method patents are expected to be issued, directly targeting average taxpayers in a host of areas including income tax minimization alternative minimum tax (AMT) minimization and income tax itemized deduction maximization. The AICPA believes that patents granted for tax planning methods 1) limit the ability of taxpayers to fully utilize interpretations of tax law intended by Congress; 2) may cause some taxpayers to pay more tax than Congress intended and may cause other taxpayers to pay more tax than others similarly situated; 3) complicate the provision of tax advice by professionals; 4) mislead taxpayers into believing that a patented strategy is valid under the tax law; and 5) preclude tax professionals from challenging the validity of tax planning method patents. The AICPA and SCACPA believe that patents for tax planning methods undermine the integrity, fairness, and administration of the tax system and are contrary to sound public policy. n Reference: The AICPA’s Tax Section provided information on federal issues. Erin P. Hardwick, CAE Executive Director Erin has served as executive director of SCACPA since December 2005. South Carolina CPA Report w November/December 2009 13 Feature Tips from the PCI Security Standards Council by Don West, CPA, CISA, CISSP, PMP, CITP SCACPA member since 2001 A’t guarantee security, but it helps. Not complying can result in fines, adverse publicity and loss of the ability to accept payment cards. Compliance is difficult and expensive, even for larger merchants. It can be prohibitive for smaller ones. You can greatly reduce the cost and effort and 14 If an organization stores, processes or transmits payment card Primary Account Numbers (PAN), it must comply with the industry requirements for data security. Not complying can result in fines, adverse publicity and loss of the ability to accept payment cards. reduce your exposure by not storing cardholder data electronically. PAYMENT CARD INDUSTRY (PCI) SECURITY STANDARDS COUNCIL The payment card industry has been working for years to increase the security of card data. At first, the card associations established their own policies and standards. In 2006 Visa Inc., MasterCard Worldwide, South Carolina CPA Report w November/December 2009 American Express, Discover Financial Services and JCB International formed the PCI Security Standards Council and agreed to incorporate the resulting standards and certifications into their compliance programs. PCI DATA SECURITY STANDARD (DSS) The foundation of the Councils’ work is the Data Security Standard (DSS). Version 1.2.1 was released in July 2009. It is a very specific and detailed list of requirements for securing card holder data and contains hundreds of requirements, organized as follows: Build And Maintain A Secure Network Requirement 1: Install and maintain a firewall configuration to protect cardholder data. Requirement 2: Do not use vendorsupplied defaults for system passwords and other security parameters. Protect Cardholder Data Requirement 3: Protect stored cardholder data. (888) 557-4814 | Requirement 4: Encrypt transmission of cardholder data across open, public networks. companies and individuals certified by the Council to perform required services for the higher level merchants. Maintain a Vulnerability Management Program Requirement 5: Use and regularly update anti-virus software or programs. Requirement 6: Develop and maintain secure systems and applications. APPLICABILITY Applicability of the standards to a particular entity can be confusing. The main rule states that “PCI DSS requirements are applicable if a Primary Account Number (PAN) is stored, processed, or transmitted. If a PAN is not stored, processed, or transmitted, PCI DSS requirements do not apply.â€? Generally, the deadlines for compliance with the DSS have passed, and all merchants who meet this rule should be compliant now. Estimates of actual compliance vary. The issuing associations direct the acquiring banks as to how they manage merchant compliance. An. PCI PAYMENT APPLICATION DATA SECURITY STANDARD (PA-DSS) This standard started as the Visa Inc. program known as Payment Application Best Practices. Its goal is to help software vendors and others develop secure payment applications that support compliance with the PCI DSS. QUALIFIED SECURITY ASSESSORS, PAYMENT APPLICATION QSAS AND APPROVED SCANNING VENDORS QSAs, PA-QSAs and ASVs are (888) 557-4814 | example is merchant levels based on card acceptance volume. Table A shows the Visa levels and validation requirements.). continued next page TABLE A LEVEL/ TIER 1 2 3 MERCHANT CRITERIA VALIDATION REQUIREMENTS Merchants processing over 6 million Visa transactions annually (all channels), or Global merchants identified as Level 1 by any Visa region. Annual Report on Compliance (ROC) by Qualified Security Assessor (QSA) Merchants processing 1 million to 6 million Visa transactions annually (all channels). Annual Self-Assessment Questionnaire (SAQ) Merchants processing 20,000 to 1 million Visa e-commerce transactions annually. Annual SAQ Quarterly network scan by Approved Scan Vendor (ASV) Attestation of Compliance Form Quarterly network scan by ASV Attestation of Compliance Form Quarterly network scan by ASV Attestation of Compliance Form 4 Merchants processing less than 20,000 Visa e-commerce transactions annually, and all other merchants processing up to 1 million Visa transactions annually. Annual SAQ recommended Quarterly network scan by ASV if applicable Compliance validation requirements set by acquirer South Carolina CPA Report w November/December 2009 15 Feature SELF-ASSESSMENT QUESTIONNAIRE (SAQ) The Self Assessment Questionnaire referred to in the table above is actually four different questionnaires depending on how CHD is handled. Table B shows the SAQ Validation Types. just a few examples: 1) DSS 1.3 requires segregating the CHD network from the Internet and passing all inbound and outbound traffic through a Demilitarized Zone (DMZ). This means additional hardware, configuration and management. 2) DSS 10.5.5 requires file integrity monitoring. This means adding systems that constantly monitor 16 TABLE B SAQ VALIDATION TYPE DESCRIPTION SAQ: V1.2 1 Card-not-present (e-commerce or mail/telephone-order) merchants, all cardholder data functions outsourced. This would never apply to face-to-face merchants. A 2 Imprint-only merchants with no electronic cardholder data storage B 3 Stand-alone terminal merchants, no electronic cardholder data storage B 4 Merchants with POS systems connected to the Internet, no electronic cardholder data storage C 5 All other merchants (not included in Types 1-4 above) and all service providers defined by a payment brand as eligible to complete an SAQ. D critical files within the CHD system (operating system files, for instance) and notify you of any changes. More hardware, software and management. 3) DSS 10.6 requires that log files for all components in the CHD system are kept for months and reviewed daily. This can be thousands of entries per day. More hardware, software and management. ALTERNATIVES FOR SMALL MERCHANTS Large merchants can justify implementing and maintaining compliant systems, but many smaller, Level 4 merchants can’t. The answer is to not store CHD electronically. In other words, don’t be a SAQ-D merchant. If you accept cards online, there are two basic ways to do it. Take PayPal as an example. PayPal offers “PayFlow Pro” and “PayFlow Link” as ways that a Web site can accept payment cards. With PayFlow Pro, buyers enter their card data on your Web site. Your system sends the data to PayPal for South Carolina CPA Report w November/December 2009 processing, and PayPal sends the results of the transaction back to your system. Your system therefore stores CHD electronically, and you are a SAQ-D merchant. If you use PayFlow Link, the buyer is sent to a PayPal Web page for check out. All card data is entered into PayPal’s system, not yours. Your system still receives transaction results, but does not store CHD electronically. If you choose this method, you are now a SAQ-A merchant. If you are a face-to-face merchant like a retail store or a restaurant, it can be more complicated. Do you really need to store CHD electronically? There are several reasons to do so. One is as a service to the buyer, to make it easier to make a purchase on your Web site. Amazon’s “One Click Ordering” is an example. This feature is automatically enabled on your account the first time you place an order and enter your information. Some people love it. It can’t work without storing your CHD electronically. Even without the one click service, a lot of sites store your (888) 557-4814 | an amount on the card. That POS system is storing your CHD. They do it to prevent you from walking out without paying. A very popular reason to store CHD is to handle charge backs. Frequently people will make a purchase and then claim they didn’t. But when asked how many charge backs he had, there were—depending on how you accept and process cards. BREAKING NEWS! This article mentions earlier that Level 4 validation requirements were set by the acquiring banks. Until recently, this has remained mostly a voluntary process of self assessment with no requirement to submit the forms to anyone. On August 1, 2009, BB&T notified all of its merchant account holders that they had to complete and submit the self assessment forms, including an Attestation of Compliance by the Executive Officer. First National Merchant Services and First American Payment Systems have done the same thing. Voluntary selfassessment for the smallest merchants is quickly becoming a thing of the past. n Don West, CPA, CISA, CISSP, PMP, CITP, has 30 years experience in project management and information technology with Daniel Construction, Fluor Daniel, Jacobs Engineering, GE and BlueCross BlueShield of SC and is currently employed with Blytheco, LLC. Don is chairman of the SCACPA Technology Committee, and a member of the Long Range Planning and Web site Task Forces. He is also a SCACPA CPA Ambassador and has previously served on the Financial Planning for Disaster Task Force. Take the Lead Join a SCACPA Committee or Task Force Today! COMMITTEES Behavioral Standards Relations Personal Financial Planning Information Technology Business Valuation, Forensic and Litigation Services State & Local Taxation Legislative & Advocacy Editorial Board Membership Financial Literacy Continuing Professional Education DEVELOP relationships that last a lifetime. TASK FORCES Accounting Careers & Academic Members In Industry Taxation Young CPAs Leadership Cabinet Member Benefits GROW your experience. SHARE your skills and talents. Exercise your LEADERSHIP. Peer Review Technical Standards >> LEARN MORE >> TO SIGN UP Simply contact Reva Visit to learn more about each committee and task force. Brennan at rbrennan@scacpa.org, (803) 791-4181 ext. 103 or (888) 557-4814. Feature Valuing an Accounting Practice The members of SCACPA’s Business Valuation Task Force are sharing the expertise on valuing an accounting practice. Each task force member was asked this same question regarding pricing a new partner admission. Their individual responses are listed below. Staff Contact: Reva Brennan HOW DO ACCOUNTING FIRMS PRICE A NEW PARTNER ADMISSION? George DuRant, CPA/ABV/CFF, ASA, Columbia: Usually, one way or another, a new partner will pay for an interest via reduced earnings for some period of time. It is rare in my experience (but I have seen it) where a new partner is asked to buy-in based on some multiple of revenues and other factors. Growing and expanding firms seem more focused on retaining talent and receiving working capital contributions from new partners as opposed to “selling” an interest at pro rata firm market value. Non-growing firms admitting new partners are focused on old partner retirements, which are usually paid for on a retention basis over 2-5 years (out of earnings). James D. Ewart, CPA/ABV/CFF, CVA, Charleston: I believe what George is suggesting has roots in other industries such as physician practices, and has proven to be cost effective to the new partner and acceptable to the “old” partners because, all things being equal, income is not reduced in the first year. Additionally, how profits are divided could affect this approach. Finally, whether the “old” partners are selling a portion of their interest or the practice is expanding would impact this question. Don M. Hollerbach, CPA/ABV/ CFF, CFE, FCPA, CVA, CDFA, Charleston: A buy-in arrangement of some description is the norm in my experience, but I have seen a number of examples where the members of 18 a firm have the “eat what you kill” approach where there are revenue centers tied to the individual partners. In this arrangement, which is a form of cost sharing, the partners each maintain a client base, recognize revenue on an individual basis, pay for staff that are dedicated to their particular clients, allocate the overhead costs that are common to the partnership and share any value that is derived through cross-pollination of skill sets. New partners either bring a client base with them, and/or a specific skill set that adds value. Then they develop the client base to certain level while on staff, with a final transition to the process as defined above. The cost and revenue synergies created in this arrangement are of value to a partner, as opposed to a different business form such as a solo practice. Hendrikus E.J.M.L. van Bulck, MBA, Ph.D., CPA/ABV, Sumter: I have observed three general “models” for partner admissions: reduced earnings (as described by George DuRant), buyins (as described by Don Hollerbach) and mentorship. The size of the practice may be a determinant. Large, multi-partner accounting firms may be more concerned about preserving senior partners’ equity and retirement provisions. It is likely that these firms are fairly structured, and are more likely to have a formal recruitment plan, a buy-in plan or some form of “tenure track” (to borrow an academic term). Compared to solo practitioners, large firms may be able to distinguish South Carolina CPA Report w November/December 2009 more clearly between the professional and corporate components of the firm’s goodwill. The corporate goodwill may be an important consideration in the buy-in formula. Conversely, the sole practitioner may bring along a young CPA not only to share the workload, but also to groom this individual to eventually take over the practice. This sometimes resembles the father-son relationship. As retirement approaches, the practitioner shifts more of the income and perhaps partnership interest to the junior CPA. Scott Hendrix, MBA, CPA, CVA, West Columbia: Admitting a new partner and how to price that admission generally is a function of two dimensions: the operating environment and the perceived value-drivers. For the most part, small to mid-size accounting firms will fall into one of three categories: sole practitioner, single-entity/multiplepartner, or multiple-entity/ multiplepartner. The value to be derived from a new partner may also span a broad array of possibilities. Obviously, a sole practitioner would most likely be looking to develop a partner to whom he or she could eventually sell the practice. Firms in the other two categories may be looking to replace a retiring partner, or seeking new and complementary talent to expand a niche or exploit a new and growing revenue stream. Notwithstanding, the commonly exercised historical imperative has been to admit new partners at a reduced earnings rate, with the difference between tenured average partner earnings and the reduced earnings representing a buy-in amount or a premium to the existing partners. Depending upon the size and profitability of the firm, this buy-in period may span multiple years, but generally not less than five years. n (888) 557-4814 | Charleston and Grand Strand Region Victoria G. Dotson – Vice President & Manager of Trust Services Peter Alan Curcio – Senior Trust Officer 843.724.0801 Elsewhere in South Carolina Mary Ann Brown – Senior Trust Officer 843.815.5507 Our trust officers provide the same level of personal service that you do. When you recommend a trust manager to your clients, you’re putting your relationship on the line. You want to refer them to a trust officer who looks out for them the same way you do. At First Federal, we do. Our trust officers are easily accessible and they’re always glad to meet when it is most convenient for your client. We can establish a trust with fewer assets than you might think – and at First Federal, all of our trust clients receive the same high level of personal service. That’s a level of service other banks can’t match. We’re one of the strongest and most trusted banks in South Carolina, with the resources to help our clients accumulate, preserve and protect their wealth with all the trust services you’d expect, plus: • Conservatorships • Special Needs Trusts • Irrevocable Life Insurance Trusts And through our Estate Settlement Services, we even work on a contract basis with clients who don’t have a First Federal trust account. If you’re interested in referring a prospective trust client to First Federal, please call one of our trust officers today. They’re looking forward to hearing from you. Feature Commentary On TIPRA 2005 and Roth Conversions by Neil Brown, MAcc, CPA, CFP SCACPA member since 1994 The current market environment may provide some sophisticated taxpayers a unique opportunity to pay taxes at today’s low rates on a depressed account value and capture tax free growth. O n January 1, 2010, thanks to TIPRA 2005, anyone with a tax-deferred retirement account that can be rolled over will be eligible to convert those assets to a Roth IRA. Now, higher income taxpayers will be able to take advantage of a conversion opportunity that was once limited to those with an AGI of less than $100,000. There is no better time to build a better future for your clients. Our role as advisors will be to determine if and how much to convert, and when to pay taxes. The factors to consider when converting to Roth include (but are not limited to) the taxpayer’s timeframe, source for payment of taxes and current vs. future tax rates. There is no certain set of circumstances where one should convert or not convert—instead, it will depend upon a client’s specific needs, desires and assumptions. The current market environment may provide some sophisticated taxpayers a unique opportunity to pay taxes at today’s low rates on a depressed account value and capture tax free growth. An IRA worth $100,000 in 20 2007 may now be worth $60,000. By converting the $60,000 retirement account to a Roth IRA, the taxpayer is locking in his tax liability at the lower amount. Should the $60,000 Roth IRA eventually recover its losses and grow back to $100,000, the taxpayer will avoid paying taxes on the $40,000 difference. calculating MAGI for social security purposes, all taxable and taxexempt income and 50 percent of an individual’s social security benefits are included, but Roth IRA distributions are not. Therefore, a Roth IRA can prove to be a tax-friendly asset for managing the taxation of social security benefits. Additionally, you can actually request a “mulligan” or a “do over” by performing a recharacterization, thereby reversing the original conversion back into a traditional IRA with no tax consequences. A Roth IRA can be recharac¬terized back into a traditional IRA up to the tax filing deadline—including extensions, whether extended or not. For example, if an investor converts a traditional IRA to a Roth IRA in February 2009, they will have until October 15, 2010 to decide whether to take the “doover.” When paying taxes for the conversion, one could use assets from the IRA, or outside of the IRA. Using IRA assets to pay the tax liability results in a smaller Roth IRA balance, and any money not kept in the Roth conversion upon the rollover will be subject to an additional 10 percent penalty if under age 59 ½. If a taxpayer uses outside assets to pay the conversion tax, they are essentially allowing more assets to remain in the Roth IRA and effectively making a contribution to their retirement account. A conversion could also help with the future taxation of Social Security benefits. Up to 85 percent of social security benefits are taxable if MAGI exceeds certain amounts. When South Carolina CPA Report w November/December 2009 For 2010 only, a taxpayer who converts can include half of the conversion on the 2011 taxes and the balance on the 2012 taxes, thus slowing the tax payments. However, with the expected increase in tax rates (888) 557-4814 | in the coming years, most scenarios point to 100 percent inclusion in 2010 versus using the default spread. Of course, the spread could prove beneficial if one will be in lower future tax brackets due to reduced income or retirement. A Roth IRA will grow tax-free if all qualifications are met, and there are certain tax benefits. By utilizing a tax-free Roth IRA, retirees have more flexibility and control in managing their taxes. Most of us believe tax rates will be higher in the future. As such, now may be a great time to convert retirement assets to a Roth IRA. Many people currently consider our tax rate structure to be high, but historically we have seen top marginal tax rates as high as 50, 70 and 90 percent. Actually, for the last 50 years, there have been only a handful of years where the top tax rate was lower than we have now (1988-1992). By coordinating NOLs, loss carryovers and other tax items, a person can reduce or eliminate taxable income and thus the tax that would be associated with any Roth conversion. For instance, a business owner with taxable income of $75,000 and a NOL of $100,000 would have an adjusted gross income of negative $25,000. The business owner may wish to convert up to $25,000 of taxable retirement assets at little or no tax costs. Even small capital loss carryovers utilized against $3,000 of ordinary income would allow $3,000 to be converted with no tax increase if comparing to the tax due without the loss. The Roth conversion helps taxpayers realize favorable tax attributes, while paying little or no income taxes on the conversion. Now would be a great time to contact your clients with retirement accounts (888) 557-4814 | Most of us believe tax rates will be higher in the future. As such, now may be a great time to convert retirement assets to a Roth IRA. and negative taxable income and work with them to rollover enough assets to push the taxable income to at least zero. Some clients want to pay no taxes and others would prefer to at least roll over some IRA assets in the 10 or 15 percent brackets. Again, this depends on the individual taxpayer, but we did so for many clients at the market bottoms in November 2008 and March 2009. Clients who want to leave a large estate to their heirs should consider this strategy as well. While all owned assets are included in the deceased’s estate, the Roth IRA could reduce estate tax as well as the future income tax of the beneficiary. First, the taxes paid for the conversion are no longer in the estate and the estate tax is higher than the income tax rate, and the heirs receive a tax free account they can stretch. While naming a trust as a beneficiary of a retirement account is a complex matter, a Roth conversion can help. Distributions from an IRA that are maintained in the trust are taxed at the trust tax rate, which reaches the 35 percent level quite quickly. With a Roth IRA, any distributions actually maintained in the trust are tax-free upon the initial distribution. not. This tax-free feature can magnify the stretch provisions greatly. For example, assume a 70 year old with a $1,000,000 IRA would like to leave as much as possible to his 40 year old daughter at death. If he took only his required minimum distribution at age 70½, died at age 86, the account grew at 7 percent and the daughter stretched the traditional IRA, she would have received a total of $983,859 of after-tax distributions over her lifetime. However, had the Roth been converted prior to the father’s death, the daughter would have received a total of $1,492,920 of taxfree distributions, or 65 percent more, over her lifetime. Time, tax law and planning are moving quickly. For those advisors willing to provide great advice to their clients, now is the best time. If you simply want to do compliance work, there are many advisors who would love to add value to your former clients. We can no longer simply meet with our clients to do last minute tax planning or after the fact compliance work. We must add value—that is our goal. n Neil A. Brown, MAcc, CPA, CFP, is a Certified Financial Planner® for Burkett Financial Services and a national instructor for Keir Educational Resources, Surgent McCoy, the AICPA and Jeff Rattiner’s Financial Planning Express™. Neil is currently a member of SCACPA’s Editorial Board and the Personal Financial Planning Committee. Lastly, the stretch IRA left to an heir is taxable, but the stretch Roth IRA is South Carolina CPA Report w November/December 2009 21 Board of Accountancy by Mark T. Hobbs, CPA, Vice Chairman, SC Board of Accountancy SCACPA member since 1981 T he Board of Accountancy (BOA) met on August 27, 2009 in Columbia. The agenda consisted of a review of complaint and investigative activity from Board Staff personnel. After approving minutes from the June 23, 2009 board meeting, the Board then received a presentation from accounting educators requesting additional CPE credit for those instructors meeting certain criteria. The Board is currently reviewing changes to the Accountancy Law and Regulations, and this is one area being reviewed for possible modification. The Board Administrators’ report was presented by Randy Bryant, and the following committee updates were given: • Regulation/Legislative by Donnie Burkett, CPA • Peer Review by Mark Hobbs, CPA • Education/Experience by Bobby Creech, CPA • Examination/CBT by Tony Callander, CPA • Other Professional Issues by Wendell Lunsford • Qualification of Licensure by Tony Callander, CPA In addition to regular business matters, the Board conducted two disciplinary hearings. The next Board of Accountancy Meeting is scheduled for Thursday, October 22, 2009. ADMINISTRATOR UPDATE BOA Administrator Doris Cubitt, CPA has been out for the past several months on medical leave and is 22 The BOA will be making a presentation at SCACPA’s CPA Summit and Member Meeting on Thursday, November 19, 2009. Board members will be available to discuss any concerns or issues South Carolina Department of Labor, Licensing and Regulation Board of Accountancy (803) 896-4770 The following are key employees of LLR who are assigned to assist the Board in fulfilling its mission: Doris Cubitt, CPA, Administrator (803) 896-4770 or cubittd@llrsc.gov Michael Teague - teaguem@llrsc.gov Amy Holleman - hollemana@llrsc.gov Tiear Williams - williamstf@llr.sc.gov concerning licensure in South Carolina. expected to return to her duties hopefully in early 2010. While Doris is away, Michael Teague and Amy Holleman are working overtime to assist in Board of Accountancy matters. Please feel free to contact Michael Teague at (803) 896-4557 should you need immediate action or assistance. BOA PRESENTATION AT SCACPA SUMMIT & MEMBER MEETING The BOA will be making a presentation at SCACPA’s CPA Summit and Member Meeting on Thursday, November 19, 2009. In addition to discussing recent disciplinary cases and current issues facing accounting regulators in South Carolina, Board members will be available to discuss any concerns or issues concerning licensure in South Carolina. Please be reminded that Board of Accountancy members must South Carolina CPA Report w November/December 2009 retain their objectivity, and cannot get involved in an active investigation or case. This is to assure that Board members will not have to excuse themselves if the case progresses to an official hearing. What’s Important to You? The Board of Accountancy is committed to serving the public while keeping open channels of communications with our licensees. Please help us serve the public and the citizens of South Carolina by keeping us informed of areas that you believe warrant more regulations and Board of Accountancy involvement. n Mark Hobbs, CPA is the managing partner of The Hobbs Group, PA in Columbia. A past president of SCACPA, Mark currently serves on SCACPA’s Nominating and Investment Committees as well as the Long Range Planning Task Force. He may be reached at mark@hobbscpa.com. (888) 557-4814 | N CP A EW In ‘A’ su ra ra No nc ted w e Av a ila bl e Pr o gr It’s been a challenging year for CPAs. Through it all, CAMICO kept its promise to policyholders – to provide secure professional liability insurance and unlimited access to risk management solutions and claims guidance. Our policyholders benefited from the knowledge and expertise of our dedicated risk management and claims experts, who helped them avoid and reduce exposure to claims. This leaves our CPA insureds more time to spend with clients and less time worrying about a potential claim. So, will your firm have the security and knowledge it needs to succeed in this coming year? If you’re with CAMICO, it sure seems promising. CAMICO Professional Liability Insurance is endorsed by the South Carolina Association of CPAs David Porter 1.800.652.1772 x 2709 dporter@camico.com * New ‘A’ rated program administered by CAMICO Insurance Services with coverage provided by Liberty Insurance Underwriters, Inc. am * by Bratton Fennell, CPA SCACPA member since 1989 December 10-11, 2009 FEATURED A&A SESSIONS by presenter QUINTON BOOKER, PhD, CPA (1) IFRS Update, (2) FASB UPDATE DAVID BURKE, CPA (1) NC Ethic, (2) General Ethics DENNIS DYCUS, CPA, CFE, CGFM (1) How to Analyze Red Flags, (2) Things Everyone Needs to Know About Fraud, (3) Some of My Favorite Frauds/Why & How They Occurred CARLTON COLLINS, CPA The Tech Savvy CPA MARK HOBBS, CPA Peer Review Update IAN MACKAY, CPA Employee Benefit Plans Audits DEAN MEAD GASB Update BRADLEY NEWKIRK, CPA (1) A&A Update, (2) A&A Update Continued-In Depth Drill Down On Auditing and SSARS G. ROBERT “SMITTY” SMITH Jr., PhD, CPA, CGFM (1) GASB Statement Number 54, (2) Common Reporting Errors In Financial Statements 24 I have now been a member of SCACPA for more than 20 years, but did not really take advantage of my membership until the last six years. By being more active in the organization, I have gotten much more out of my membership. For the past three years, I have been lucky enough to serve on SCACPA’s Technical Standards committee. Our group has 19 members and is chaired by Ellen Adkins. We meet via teleconference six to eight times a year and act as a technical resource for members, reviewing exposure drafts on technical standards and recommending a response. Additionally, the Committee plans the annual Accounting and Auditing Conference each December. Prior to joining the Technical Standards committee, I regularly attended the Accounting and Auditing Conference and was twice a speaker (for those who attended, I am sure it was a treat!). In all seriousness, I attended the conference to receive 12-16 hours of quality CPE and gain some insight into what other CPAs in the state are doing to meet some of the challenges we are all facing today. Our committee has planned another high quality CPE event to take place December 10-11, 2009. I am excited about the program and look forward South Carolina CPA Report w November/December 2009 to the offerings that will be provided. I have heard a number of our speakers in the past, and they have the ability to make a seemingly boring topic interesting. In addition, I believe the topics we are offering provide real value to us in our jobs, whether we are in public or private practice. Each year that I have attended the conference, I can truly say that I have learned something that was immediately applicable to me at my job in industry. Whether the topic is fraud, technology or accounting rules, the subjects will apply to us in our roles as CPAs and trusted business advisors. As a member of the committee and the SCACPA board, I hope to see many of you at the conference. I always look forward to getting reacquainted with old friends and making new ones in the profession. I believe you will find the conference well worth your time, and you might just learn a thing or two! Please review complete session details online at. n Bratton Fennell, CPA is the CFO of Burroughs & Chapin Company, Inc. He currently serves as the Chapter Board Representative for SCACPA’s Grand Strand Chapter and Board Liaison to the Members in Industry Committee and the SCACPA BEGIN Campaign. He also serves on SCACPA’s Behavioral Standards and Technical Standards committees. (888) 557-4814 | 400,000 small businesses trust ADP. To an employee, it’s more than just a paycheck. It’s a ticket to a richer life. That’s why ADP is the preferred payroll provider for so many small businesses — and the accountants who serve them. When it comes to managing payroll, ADP offers accountants more choices. And more ways to succeed. Want to provide more value and more enhanced services to your clients? You can start today. accountant.adp.com 1-866-4ASK ADP Chris Vitrano Marketing Director ec-connection Milwaukee,Wisconsin © 2008 ADP, Inc. The ADP Logo is a registered trademark of ADP, Inc. (888) 557-4814 | South Carolina CPA Report w November/December 2009 25 Member News Focus On Membership Saunders Halkowitz HAPPENINGS ACROSS THE STATE H. Kyle Anderson, CPA, MPA, CMA, is now serving as a SCACPA Campus Champion at Anderson University. Stephen U. Davis, CPA of PricewaterhouseCoopers, LLP of Atlanta became licensed in Georgia in July. Leon W. Maginnis, CPA, CFE, has recently been awarded the Certified in Financial Forensics (CFF) Credential by the American Institute of Certified Public Accountants (AICPA). Established by the AICPA, the CFF credential is granted to CPAs with considerable professional experience in financial forensics. Matthew Madden, CPA of Elliott Davis, LLC, has been named among Greenville First’s Best & Brightest 35 and Under. Established by Greenville Magazine in 1994, the annual awards honor 25 men and women under the age of 35 as growing leaders in Greenville. Selection is based on business success and volunteer efforts in the community. Madden is currently serving a three-year term on the board of directors for Professionals United for Leadership and Social Enrichment (PULSE). This year, he co-chaired a PULSE mentoring program designed to give Greenville young professionals the opportunity to learn from seasoned business and community leaders. He is also involved with the History Makers of the Upcountry History Museum. At Elliott Davis, Madden is a tax manager in the Greenville office, serves on the United Way fundraising committee and plays a key role in the recruiting, training and development of new team members. He is a member of AICPA, SCACPA and the Urban Land Institute (ULI). 26 The Blue Ridge Council, Boy Scouts of America honored Irvine T. “Buck” Welling Jr. as the council’s 2009 Distinguished Citizen of the Year. Welling, 92, was employed by Elliott Davis LLC, with which he was associated for 61 years and is a retired partner. He is a past president of SCACPA and has been an active member since 1947. During his tenure with Elliott Davis, he served as a naval officer in World War II in the South Pacific. In 1964, Welling began working with John D. Hollingsworth, a textile machinery executive. He assisted in the creation of Hollingsworth Funds Inc., a charitable foundation of which he has served as chairman and president since 1996. The foundation has donated millions of dollars to Furman University, the YMCA and public charities in Greenville County. At an early age he earned his Eagle rank, the highest rank attainable in scouting. GRADUATIONS AND RETIREMENTS Scott McElveen, L.L.P. recently announced two new associate accountants: Chris Halkowitz and Cynthia Saunders. Chris graduated from Coastal Carolina University with a Bachelor of Science degree in Accounting, and completed his Masters of Business Administration with a concentration in Accounting. Cynthia graduated from North Carolina State University with a Bachelor of Science degree in Accounting, and completed her Master of Accountancy degree at Georgia Southern University. Paul D. Lister, CPA of Greer has retired. SCACPA NEWS Robert P. Schlau with Baldwin & Associates, LLC in Charleston has graduated and is pursuing licensure. The new artwork in SCACPA’s offices is provided by the Trenholm Artists Guild (. org). Special thanks to SCACPA member William “Bill” Arnott IV, CPA of DuRant, Schraibman & Lindsey in Columbia for making these arrangements. South Carolina CPA Report w November/December 2009 Anthony A. Callander, CPA of Greenville has retired. Thomas M. Carabo, CPA of Blenheim has retired. Hazel A. Catoe, CPA, MBA of Lando has retired. Obed A. Cramer, CPA of Augusta has retired. Minnetta J. Davis, CPA of Ocean Isle Beach, NC has retired. Paula Farrell with Elliott Davis, LLC in Columbia has graduated and is pursuing licensure. Robin M. Goff with KPMG LLP in Greenville has graduated and is pursuing licensure. J. Kirk Jennings with Grant Thornton, LLP in Columbia has graduated and is pursuing licensure. William Matthews Jr. with Moore Beauston & Woodham, LLP, CPAs in West Columbia has graduated and is pursuing licensure. Milne R. McCallum, CPA of Isle of Palms has retired. Virginia F. Milam, CPA of Greenville has retired. Joshua M. Price with Grant Thornton, LLP in Columbia has graduated and is pursuing licensure. Fred R. Seale, CPA with Burch Oxner Seale Company, CPAs in Florence has retired. Tarang A. Sharma with Grant Thornton, LLP in Columbia has graduated and is pursuing licensure. David R. Smith, CPA of Lake City has retired. (888) 557-4814 | Member News Focus On Membership Andrew B. Sprenger with Dixon Hughes PLLC in Greenville has graduated and is pursuing licensure. Alicia M. Smith has joined GlaserDuncan, CPAs in Mount Pleasant. Harvey B. Studstill, CPA of Columbia has retired. Laura M. Spells, CPA has joined The Hobbs Group, PA in Columbia. Alan J. Taylor, MAcc of Greenville has graduated and is pursuing licensure. Barbara B. Windham, CPA has joined Blue Cross Blue Shield of SC in Columbia. Murrell C. Timmons of Sullivans Island has graduated and is pursuing licensure. Carla A. Walker with William Levan Byrd, CPA, PC of Sumter has graduated and is pursuing licensure. Jerry C. Whitley, CPA of Columbia has retired. Bo Zhao with Trane in Columbia, has graduated and is pursuing licensure. MEMBER MOVES NEW FIRMS AND LOCATIONS Harriet L. Goldberg, CPA has opened Harriet L. Goldberg, CPA, LLC in Charleston. W. Michael Hamilton, CPA has opened Michael Hamilton, CPA, PA in Columbia. Lynne D. Jones, CPA has opened Lynne D. Jones, CPA, LLC in Greenville. John E. Altman III, CPA is now with Milliken & Company. Frans R. Moorrees, CPA has opened Frans R. Moorrees, CPA, PA in Asheville, NC. E.H.M. Booth, CPA has reopened E.H. Marlene Booth, PA in Greer. CONDOLENCES George L. Counts Jr., CPA is now with CA Consulting, LLC in Greenville. Susan D. Eidson (CPA Candidate) is now with Fred J. Adams, CPA in Greenville. Stuart W. Ford, CPA is now with the Town of Lexington. Ryan D. Foster, CPA is now with UCI Medical Affiliates in Columbia. Colleen A. Handy, CPA is now with Palmetto Surety Corporation in Charleston. Joel A. Owens, MAcc, has graduated from the University of South Carolina and joined Elliott Davis, LLC in Greenville. Kimberly L. Reeves, CPA is now with Ameco in Greenville. Mark A. Rhoden, CPA is now with MBI Financial Staffing in Columbia. Rachel Shaw, CPA is now with Lexington Medical Center in West Columbia. (888) 557-4814 | Byron Henry Coffin III, 69, died September 29, 2009. He was born May 5, 1940, in Alameda, CA and served his country as a cartographer in the Air Force. For the past 27 years, Mr. Coffin worked as a sole practitioner CPA, serving clients in the Irmo area. He became licensed and joined SCACPA in 1968. Byron is survived by his wife, Torrence R. Coffin; daughters Cindy Steiner (Bob) of Burke, VA, and Donna Bobinski (Mitch) of Charlotte, NC; son Byron (Donna) of Irmo; stepdaughter Jennifer Moore (Eric) of Chapin; mother Daisie Brown of Oakland, CA; sisters Marion Miller of Alameda, CA, and Gayle Paoletti of Hayward, CA; seven grandchildren and two stepgrandchildren. Memorials may be made to the Children’s Ministry at Cornerstone Presbyterian Church, 5637 Bush River Road, Columbia, SC 29212 or to the American Lung Association, 1817 Gadsden Street, Columbia, SC 29201. Joe Francis Dean Jr., 89, died September 30, 2009. Born in Sumter, he was a son of the late Joe Francis Dean, Sr. and Margaret Dawkins Dean. Mr. Dean was a member of Trinity United Methodist Church and a retired certified public accountant. He joined SCACPA in 1966 and became a Lifetime Member in 2008. He was a 60-year Mason, Shriner and a member of the Sumter Lions Club. Surviving are his wife, Mae Cummings Dean of Sumter; brother Harold Dean (Sadie) of Myrtle Beach; brother-in-law James McLane, Jr. of Houston, TX and numerous nieces and nephews. Memorials may be made to Trinity United Methodist Church, 226 W. Liberty Street, Sumter, SC 29150, or to the Sumter County Genealogical Society, 219 W. Liberty Street, Sumter, SC 29150. On-line condolences may be sent to. James T. “Jim” Lowery, Jr., 66, died August 6, 2009 in Boone, NC. Born March 26, 1943 in Rock Hill, SC, he was the son of James T. Lowery, Sr. and Opal Reynolds Lowery. Jim was a self-employed CPA who became licensed and joined SCACPA in 1975. He served in the U.S. Air Force during the Vietnam War, was a graduate of the University of South Carolina and a member of Surfside United Methodist Church. He is survived by his wife of 45 years, Betty Baldwin Lowery; sons James T. “Trip” Lowery III (Eileen) of Kill Devil Hills, NC, and Rad Lowery (Adrienne) of Surfside Beach; sister Rosemary Sullivan (Tim) of Rock Hill; brothers Joseph Lowery (Lea) of Rock Hill, and Lanny Lowery (Denise) of Spartanburg; and three grandchildren. Online condolences may be sent and. Memorial contributions may be made to the Jimmy V Foundation, 106 Towerview Court, Cary, NC 27513, or to the Valle Crucis Community Park, P.O. Box 581, Valle Crucis, NC 28691. Continued on page 34. South Carolina CPA Report w November/December 2009 27 Member Profile Focus On Membership Ken L. Newhouse Jr., CPA SCACPA member since 2001 HOMETOWN Gilbert, SC EMPLOYER Sellars, Cole & Bachkosky, LLC CURRENT SERVICE Financial Literacy Task Force, Chairman Favorite Book Bible FAVORITE MOVIE Hoosiers What made you choose to become a CPA? During my senior year in high school, I decided to take an elective course in accounting. Debits and credits came naturally to me, and I really enjoyed the class. After further research, I determined that the accounting field offered many opportunities that interested me, which lead to my decision to become a CPA. What do you believe are the keys to a successful career? • Find your passion. It is easier to stay focused and meet deadlines when your work is your passion. • Never stop learning. Focus on your passion, but also spend quality time in all areas of life so that you are a well-rounded person. • Learn how to communicate effectively. • Set goals. Live with a vision, because if you aim for nothing you will hit it every time. What do you believe are the major concerns of CPAs today, and how can they be addressed? Accountants have many concerns on the horizon, from international accounting standards to compliance legislation and tax law changes. The current economic climate is likely to create another mandate for more legislative control over the accounting systems of businesses. Another more individual issue was reinforced by a CNN Money article ranked Certified 28 South Carolina CPA Report w November/December 2009 Public Accountants as the sixth best job in America. It was not the positive ranking but the quality of life ratings, however, that got my attention. The CPA profession received two average ratings in the categories of benefit to society and stress. I believe that each of us can reduce the work-related stress level by maintaining a healthy balance between our professional and personal lives. What have you accomplished that makes you proud to be a CPA? While I enjoy my day-to-day work experiences, I am most proud of participating each fall in various financial literacy programs. I receive a great deal of personal gratification if I can assist someone in developing a life skill that will make an impact on that person’s financial future. Whom do you admire most, and why? My wife, Tina, is a very hard worker and loving mother of our son and soon to be daughter, due in January. When I met her, she had a math degree from USC but was going back to school at night to be a MCSE (Microsoft Certified Systems Engineer) and CCNA (Cisco Certified Network Administrator). I have seen her study and work very hard to keep current with her profession. Tina is organized and always has a detailed list together before we go on vacation trips. She reads to our son every night before bed, and makes sure his school bags and lunch are packed. I am proud of her and admire her more than anyone I know. What advice do you have for young CPAs? Always look to understand “why” something was done. Don’t accept SALY (same as last year) as an answer. Investigate, review the final report or return to determine the “if and why” of any changes that a reviewer may have made. Reviewers do not always have a chance to send changes back to you. What do you do for fun? I spend time with my family going to football games, movies and just playing in the back yard with my son. I also enjoy running, hiking and gardening. Ken also served on the following SCACPA committees: Web site Task Force (2007-2008); Information Technology Task Force (2003-2008; Chairman 2005-2006). He received the SCACPA President’s Award in 2003 and 2006. (888) 557-4814 | Introducing The Insurance Place of The Carolinas! T I P C Th Insurance Place The of The Carolinas Created C t d bby a CPA C exclusively for CPA’s…. No need to look elsewhere…. Supported by the nation's largest independent distributor of insurance, and provider of insurance planning support services, with access to over 100 top rated insurance carriers offering over 6,000 products, The Insurance Place of The Carolinas is your source for all types of individual life insurance, individual long-term care insurance, individual disability insurance and annuities. The relationship between a client and their CPA has, historically, been one of the most important and trusted relationships anyone will ever have. We think you will agree that no one better understands the needs of a CPA than another practicing Let's make the world a safer place... CPA. Nothing beats experience.... EVERY 10 SECONDS A CHILD IS ABUSED IN THIS COUNTRY AND 3 DIE EACH DAY Purchasing insurance is one of the most important FROM ABUSE AND NEGLECT!!! The decisions a person will ever make. It is critical to creators of this service support an organization make sure that your clients are being guided by known as Prevent Child Abuse America (). When you professionals who have the experience to help them make the absolute best choice. With literally choose to use The Insurance Place of The Carolinas, in addition to your clients receiving decades of experience, the professionals at The the absolute best service of its kind in the Insurance Place of The Carolinas are committed country, you are also helping us make the to helping you help your clients make the right world a safer place for abused children. choice. With regard to the specific types of insurance planning support services we provide, here is a list of some, but not all, of our capabilities: Life Insurance Planning • Long-Term Care Insurance Planning • Disability Insurance Planning • Annuity Planning • Personal Estate Planning • Key Person Life Planning • Wealth Transfer Planning • Wealth Preservation Planning • Buy-Sell Planning • Wealth Accumulation Planning • Business Succession Planning • Comprehensive Insurance Policy Review • Business Estate Planning • Tax Advantaged Planning Strategies • Captives If you have questions, contact Dianne Odom or Raymond Scruggs at 803-407-1040 South Carolina CPA Report w November/December 2009 29 or by email Dianne@TIPoftheCarolinas or Raymond@TIPoftheCarolinas (888) 557-4814 | th rolina Assoc Ca ia t So n io u Chapter Connections South Carolina CPA r Ce tifi an ts QUALITY CHAPTER AWARD CATAWBA CHAPTER Dues: $60 includes discounted registration to CPE seminars and free family/networking event • November 30: Annual Tax Update with Bill Grooms (8 hours, CA113009) ed nt Public Accou 2008 Quality Chapter Award Winners A Focus On Membership CENTRAL COASTAL CENTRAL CHAPTER Dues: $50 includes discounted registration to CPE seminars, free Oyster Roast, Family Day and Business Meeting Dinner; invitation to Entertainment Night and Golf Tournament • December 2: Tax Update with Dr. Caroline Strobel (8 hours, CE120209) FOOTHILLS GRAND STRAND COASTAL CHAPTER Dues: $130 includes free registration to CPE seminars (additional registration fee for Tax Update with Jack Surgent) and free registration to family/networking event • Stay tuned for 2010 events! FOOTHILLS CHAPTER Dues: $40 includes discounted registration to CPE seminars and three free social/networking events • December 4: Within the Red Zone of Your Retirement: Tax Planning Strategies for Getting to the Goal Line Without Fumbling (8 hours, FO120409) • December: Holiday Bowling Party at Star Lanes GRAND STRAND CHAPTER Dues: $75 includes free registration to CPE seminars; Holiday Party and Student Recruitment Fair • December 4: Holiday Dinner/Social (GRHP09) • January 2010: Annual Tax Update PEE DEE CHAPTER Dues: $50 includes discounted registration to CPE seminars and student event at Francis Marion • Stay tuned for 2010 events! PIEDMONT CHAPTER Dues: $50 includes registration for CPE at a nominal fee and free holiday luncheon • December 2: BPEN—Billiards, Pizza, Education and Networking (1 hour, PI082409) • December 17: Fourth Annual Holiday Charity Luncheon in conjunction with Tax Update with Walter Nunnallee (PIHP09) SEA ISLAND CHAPTER Dues: $135 includes free registration to CPE seminars and two special events, Night at Comedy Club and Professionals’ Night • December 15: Federal Tax Update with Walter Nunnallee (8 hours, 58309HH, $50 discount for chapter members) Register for chapter events online or by phone. Questions, comments or special needs? Contact Katherine Swartz, CAE at kswartz@scacpa.org. Pictured left: Members of the Piedmont Chapter of SCACPA at the BPEN Series – Billiards, Pizza, Education and Networking. The next BPEN event is December 2. 30 South Carolina CPA Report w November/December 2009 (888) 557-4814 | We’re not just in your neighborhood; we’re in your corner. AdXVa[^cVcX^VaZmeZgi^hZ WITH WACHOVIA We’re here for you, with the financing to fuel your dreams. The foresight to secure your future. And the flexibility to follow your lead. Are you with Wachovia? S T OP BY A WACHOV IA F IN A N CIA L CE N T ER T ODAY. Opportunity Lender. Wachovia Bank, N.A. and Wachovia Bank of Delaware, N. A., Members FDIC. (888)Equal 557-4814/ © 2009 Wachovia Bank, N.A. and Wachovia Bank of Delaware, N.A. All rights reserved. 090466 South Carolina CPA Report w November/December 2009 31 Upcoming CPE Focus On CPE Opportunity Knocks 2009 Federal Tax Update Road Show with Walter Nunnallee U sing a combination of humor and examples, the Farmer/Nunnallee Tax Seminars review current year federal tax developments, recurring problems and planning ideas affecting individuals, Dates and Locations Florence (12/14): Southeastern Manufacturing and Technology Institute (58309FF) on tax developments having the greatest impact Bluffton (12/15): USC Beaufort at Bluffton (58309FH) New! Co-sponsored by the Sea Island Chapter on 2009 tax return preparation and tax planning. Columbia (12/16): Embassy Suites (58309FC) This course includes a more than 250-page Greenville (12/17): Embassy Suites (58309FG) corporations and businesses. Get up-to-speed reference manual which features a topical index, checklists of first effective for 2009 and retroactive developments, and old and new planning ideas. Course Information Field: Tax (8 hours) Fees: CC $190, EB $195, M $220, NM $270 COURSE INFORMATION TUESDAY, DECEMBER 29 WEDNESDAY, DECEMBER 30 Instructor: Rebecca Lee Location: SCACPA Office, West Columbia Accommodations: Hampton Inn @ I-26 1094 Chris Drive West Columbia, SC 29169 (803) 791-8940 Room Rate: $79 NEW! Navigating the FASB Accounting Standards Codification (59109AM) NEW! International Accounting Standards: Differences with U.S. GAAP (59209AM) Applies to all courses All GAAP literature as we know it became a thing of the past in July 2009, when the new FASB Codification is expected to become the sole authoritative source for accounting research. Field: Accounting (2 hours) Fees: EB $75 (expires 12/8/09), M $100, NM $150 (CC not applicable) Meeting Workpaper Documentation Requirements (59109N) Various standard setting bodies are expanding the requirements for both workpaper preparation and retention. Samples of key workpapers will be included in the manual. Field: Auditing (2 hours) Fees: EB $75 (expires 12/8/09), M $100, NM $150 (CC not applicable) Pitfalls and Problems in Financial Statement Disclosures (59109PM) Learn the most common disclosure “errorsâ€? being made in financial statements, with special emphasis on problem disclosures identified in peer review. Field: Accounting (4 hours) Fees: EB $150 (expires 12/8/09), CC $95, M $175, NM $225 Note: Qualifies for Yellow Book 32 South Carolina CPA Report w November/December 2009 Develop an understanding of the International Accounting Standards and their differences between U.S. GAAP. Field: Accounting (2 hours) Fees: EB $75 (expires 12/9/09), M $100, NM $150 (CC not applicable) NEW! Accounting Issues for Troubling Times (59209N) Increased financial pressures often impact GAAP accounting requirements. Identify major accounting pronouncements that might affect companies and how to apply them. Field: Accounting (2 hours) Fees: EB $75 (expires 12/9/09), M $100, NM $150 (CC not applicable) Recent Compilation and Review Issues (59209PM) Learn about recent changes to reporting when performing controllership or other management services, and other issues covered in the latest Compilation and Review Alert. Field: Auditing (4 hours) Fees: EB $150 (expires 12/9/09), CC $95, M $175, NM $225 (888) 557-4814 | Upcoming CPE Focus On CPE 2010 TAX SEASON SURVIVAL KIT TAX TRAINING FOR NEW STAFF AND PARA-PROFESSIONALS January 7, 2010 January 4, 2010 Tax Planning Based on Form 1040 (60010) - Art Werner, JD Learn how to chart alternatives and guide clients through these complex tax times. Topics include the Alternative Minimum Tax, charitable giving, tax-saving strategies for real estate owners and investors, and more. January 5, 2010 The Complete Guide to the Preparation of Form 1041 (60110) Art Werner, JD Gain a practical understanding of the issues involved in preparing the U.S. Income Tax Return for Estates and Trusts (Form 1041). January 6, 2010 Surgent McCoy’s 1040 Tax Season Survival Guide (60210) Dorita Estes, CPA Get up-to-date with the changes and major issues in preparing individual income tax returns for the 2009 tax year. The Best Individual Income Tax Update Course by Surgent McCoy (60310) - Dorita Estes, CPA Learn the latest in tax law developments, including discussions of the planning opportunities and tax-saving ideas available to your individual tax clients. January 8, 2010 The Best Income Tax, Estate Tax, & Financial Planning Ideas of 2009 (60410) - Dorita Estes, CPA Explore practical tax-planning ideas to assist clients with their needs—crucial for CPAs looking for good ideas that can save clients money! January 14, 2010 The Complete Guide to Preparing Limited Liability Company, Partnership, and S Corporation Federal Income Tax Returns (60710) Bart Carson, CPA In one day, learn how to prepare S corporation, LLC, and partnership tax returns with a case study on both Form 1120S and Form 1065. January 11-13, 2010 Lion Square Lodge & Conference Center Vail, Colorado 24 hours of CPE! Sponsored by SCACPA (888) 557-4814 | January 12, 2010 Preparing Corporate Tax Returns for New Staff and Para-Professionals (60510) This hands-on, practical course is designed to train new staff accountants, data processing employees, para-professionals and bookkeepers to prepare a complicated federal corporate income tax return. January 13, 2010 Preparing Individual Tax Returns for New Staff and ParaProfessionals (60610) In addition to preparation instruction, this course covers the latest tax law changes, making it essential for new staff. This annual conference at the number one snow ski resort in America features six four-hour sessions on a wide variety of today’s most popular CPE topics, with some of the top CPE instructors in the country. To receive detailed course descriptions, instructor biographies, full color brochures of the facilities, and information about Vail, please call K2 Enterprises at (888) 542-9390. South Carolina CPA Report w November/December 2009 33 Classifieds Office Space Available ADVERTISER INDEX ACCOUNTING PRACTICE SALES Selling? We can help you: • Maximize the value of your practice. • Experience a smooth, pleasant process • Achieve confidence that you will find the right buyer. CURRENT LISTINGS Clemson - $200,000 South of Charlotte - $375,000 Columbia - $200,000 West of Charlotte, NC - $345,000 Accounting Practice Sales Inside back cover Spartanburg - $175,000 Hilton Head Area - $145,000 Greenville - $550,000 Charleston - $200,000 Buyers: Registration is free and simple. See our complete, up-to-date list of available practices at:. Contact: Brannon Poe, CPA at (888) 246-0974. Member News continued from page 26. Samuel “Ludie” Watkins died September 4, 2009 after a courageous battle with cancer. Ludie was a graduate of Furman University with a degree in Business Administration. He was a practicing CPA with an office at Clinton, and a member of SCACPA and the AICPA since 1973. He was also an active member of Sons of Confederate Veterans and a civil war reenactor. He spent 48 years as organist at New Prospect Baptist Church, and was a member of Beaverdam Baptist Church. Surviving are his wife, Mary Lee Ricketts Watkins; daughters, Beth (Chad) Thomas of Clarksville, GA and Sarah (Phalen) Satterfield of Ocala, FL; and five granddaughters. Memorials may be made to Beaverdam Baptist Church Building Fund, 1555 Beaverdam Church Road, Mountville, SC 29370 or New Prospect Baptist Church, 4996 Hwy 221 S, Laurens, SC 29360. Greenville; sons, Charles W. Whitmire, Jr. (Diane) of Taylors and Steve Allen Whitmire (LuAnne) of Greenville; brother Jerry Wilie (Pat) of Madison, WI; nine grandchildren and four greatgrandchildren. Condolences may be made at. Karen Michelle Young, 21, died January 24, 2008 in Rome, Italy while studying abroad. She is survived by her parents, Thomas and Patricia Young and brother James of North Attleboro, MA; grandparents Robert L. and Bonnie Hoy; numerous aunts and uncles; 17 cousins and other extended family. Karen graduated from Bishop Feehan in Attleboro where she excelled in academics and art. She was a junior at the University of South Carolina in Columbia, majoring in Business and Finance and a student member of SCACPA. She was a dedicated and ambitious young woman who set high standards and goals in her life, and Gail Wilie Whitmire, 68, of Townville, SC, died October 6, 2009. Born December touched many lives with her wit and sense of fashion. Memorials may be 5, 1940 in Plymouth, WI, she was the daughter of the late Alfred and Melinda made to Bishop Feehan, 70 Holcott Street, Attleboro, MA 02703 or YoungLife. Hesse Wilie. A graduate of Furman (Editor’s note: SCACPA was just recently University, she was owner of Gail W. Whitmire CPA, became licensed in 1977 notified of Karen’s death.) n and joined SCACPA in 1978. Surviving Members are encouraged to promote their accomplishments is her husband, C. Wofford Whitmire; in The SC CPA Report. Please send announcements or press daughters Debbie Whitmire Brantley releases to Katherine Swartz at kswartz@scacpa.org. (Mike) of Cumming, GA, and Linda Whitmire Vander Wood (Tony) of 34 South Carolina CPA Report w November/December 2009 ADP Page 25 American Pensions Inside front cover Aon/BB&T Insurance Services, Inc. Page 4 Blytheco Back cover CAMICO Page 23 First Federal Page 19 John F. Hamilton, CMA, CPA Page 13 johnfh@aol.com The Insurance Place of the Carolinas Page 29 theCarolinas.com Wachovia Page 31 (888) 557-4814 | Picture this... next tax season, a chair ...no desk Go with the leader. We provide excellent service and get the best results. We have qualified buyers waiting. See detailed articles about the process on our website! AVAILABLE PRACTICES South of Charlotte, NC CPA Firm – $375,000 Augusta Area CPA Firm – $405,000 Hilton Head, SC CPA Firm – $128,000 Clemson Tax/Bookkeeping Firm – $200,000 Raleigh, NC CPA Firm – $1,000,000 Buyers – Registration is free and simple B r annon Poe, CPA 1 . 888. 246. 0974 p oe@ knol og y. net W W W. A C C O U N T I N G P R A C T I C E S A L E S . C O M PRSRT STD US POSTAGE PAID PERMIT NO. 1146 Columbia, SC South Carolina Association of CPAs 570 Chris Drive, West Columbia, SC 29169 ADDRESS SERVICE REQUESTED TM Est. 1980
https://issuu.com/scacpa/docs/nov-deccpareport
CC-MAIN-2017-22
refinedweb
15,395
52.6
Coding Environment Setup sublime is the best text editor for Competitive Programming. Also, it is a lite weight text editor and You can use file input-output so easily Handel big input-output. So, for setup sublime before you need to prepare your computer. Install C/C++ compiler : - windows - For linux run this command. pacman is my package manager. Here you can use your package manager command. It's for arch-based Distro. sudo pacman -Syu gcc - Mac os Install Sublime : Now it's time to install Sublime on your Computer. Goto Sublime Offical Site and download sublime for your current Operating System. Let's Setup Our Sublime - First Do partition your sublime screen into 3 part. one is for your code and the other two is for the input and output section. In any case, if the GIF image is not working properly then you can see from here. I host the gif in GitHub also. Open the link in the new tab. 2 . Then click Tools > Build System > New Build System Now a file will be open. In that file, you need to paste the below code. { "shell_cmd": "g++ \"$$${file}\" -o \"$$${file_path}/${file_base_name}\"", "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", "working_dir": "${file_path}", "selector": "source.c, source.c++", "variants": [ { "name": "Run", "shell_cmd": "g++ -O2 -static -Wno-unused-result -std=c++17 -DONLINEJUDGE \"$$${file}\" -o \"$$${file_path}/$$${file_base_name}\" && \"$$${file_path}/${file_base_name}\"" } ] } Almost done! 3 . Now Save this file and remember the name of the file it will need in step 7 . and the file extension will be .sublime-build 4 . Now Create a Folder. And Make .cpp file and two .txt file. Make sure that those three files are in a directory. input.txt & output.txt 5 . Now add your Folder in sublime. Click File > Open Folder and select your folder. When you add a file in a section then instantly save this file in that section by clicking ctr+s 6 . Now Past this is in your .cpp file #include<bits/stdc++.h> using namespace std; int main(){ #ifdef ONLINEJUDGE clock_t tStart = clock(); freopen("input.txt","r",stdin); //can need to change file . this one for taking input freopen("output.txt","w",stdout); // this one for output #endif //Your Code #ifdef ONLINEJUDGE fprintf(stderr, "\n>> Runtime: %.10fs\n", (double) (clock() - tStart) / CLOCKS_PER_SEC); // this line gives your code runtime #endif return 0; } 7 . now click Tools > Build System > select file which is created in step 3. Now write an input and output code and save input in the input file. 8 . press ctrl + shift + B and a pop up will bring your sublime click one which has -Run part. WOW See you can successfully Generate your output. 9 . Now whenever you need to compile your code just click ctrl + B and you will compile and generate an output corresponding to your input. You can also find this blog form here If you find help full this blog give an upvote to my blog and sorry for my weak writing skill. Wishes you all a Happy new year, May your code accept all the time.
https://codeforces.com/blog/entry/98574
CC-MAIN-2022-40
refinedweb
510
76.62
Matthew Wilson's Weblog Artima Weblogs is a community of bloggers posting on a wide range of topics of interest to software developers. Artima.com Breaking Up The Monolith: coming at last Yesterday, after four years of vacillation and procrastination and occasional modification, I finally got the preface of my next book, Breaking Up The Monolith: Advanced C++ Design Without Compromise, into a form with which I'm happy. 8 pages in four years; at that rate the full book will take me 150 years! SourceForge shoots itself in the foot SourceForge.NET's new File Release manager takes computing productivity back to the days of the punched card reader, and it does it with Web 2.0! Just good service (?) A couple of plugs, with no ulterior motive, and a mildly philosophical musing. New Libraries coming ... Just a heads up about three new libraries, and improvements in two established ones, ... (and a thinly veiled hint at some help from any members of the C++ community who have time, and a desire to work with highly efficient, highly robust libraries.) Watch those spaces! Having the computer help you write and maintain your code is an essential facet of successful software development, and all good consultants will recommended that you follow suit. (Even if, sometimes, they forget to do so themselves ...) Breaking Up The Monolith: The End of the Procrastination! Having spent nearly two years "getting everything sorted" ready to write my next book, I've decided enough is enough. It starts TODAY! Development Management: Carthorse, Racehorse, or Wild Horse? Two radically different philosophies to the management of software developers. Which one do you favour? Why do Open Source?. To blog, or not to blog? After having spent the last 15 frustrating months of too-successful consulting that has stolen all my time for writing and most of my time for researching/open-source development, something's got to give! Is blogging the answer to my quandary? An exercise in compromise in class interface refinement. Attempting to find a compromise between the constraints of a facade that wraps a system API, the limitations of a limited namespace naming scheme, and a user wanting more expressiveness, revealed an interesting compromise in design. Monolith: Facts, Failures, Fallacies, Falsehoods and Furphies Looking for your best Fs, Fs, Fs, Fs and Fs regarding everyone's favourite (to use, or to moan about) language, C++. If you've got 'em, let me have 'em. The worst that can happen is you'll get a mention in the new book ... Back on board ... After a prolongued hiatus from public writing activities (articles, blogs, books) throughout 2006, I'm about to stage a comeback. For those with nothing to do with the next 120 seconds, here's an explanation of why, and what you can expect in the coming months. What is Documentation? Can we expect s/w engineers 2 be good at all facets? ... Contract Enforcement for humanity ... ? Should individual human beings, and humanity's institutions, adopt the principles of contract programming, and use contract enforcement in their own functioning? Would that lead to a better world? Definite proDuctivity aDvantages.
http://www.artima.com/weblogs/feeds/bloggers/bigboy.rss
CC-MAIN-2013-48
refinedweb
523
57.67
During the development of the example ramdisk driver, the system crashes with a data fault when running mkfs(1M). test# mkfs -F ufs -o nsect=8,ntrack=8,free=5 /devices/pseudo/ramdisk:0,raw 1024BAD TRAP mkfs: Data fault kernel read fault at addr=0x4, pme=0x0 Sync Error Reg 80<INVALID> pid=280, pc=0xff2f88b0, sp=0xf01fe750, psr=0xc0, context=2 g1-g7: ffffff98, 8000000, ffffff80, 0, f01fe9d8, 1, ff1d4900 Begin traceback... sp = f01fe750 Called from f0098050,fp=f01fe7b8,args=1180000 f01fe878 ff1ed280 ff1ed280 2 ff2f8884 Called from f0097d94,fp=f01fe818,args=ff24fd40 f01fe878 f01fe918 0 0 ff2c9504 Called from f0024e8c,fp=f01fe8b0,args=f01fee90 f01fe918 2 f01fe8a4 f01fee90 3241c Called from f0005a28,fp=f01fe930,args=f00c1c54 f01fe98c 1 f00b9d58 0 3 Called from 15c9c,fp=effffca0,args=5 3241c 200 0 0 7fe00 End traceback... panic: Data fault When the system comes up, it saves the kernel and the core file, which can then be examined with adb(1): # cd /var/crash/test# lsbounds unix.0 vmcore.0 # adb -k unix.0 vmcore.0physmem 1ece The first step is to examine the stack to determine where the system was when it crashed: $ccomplete_panic(0x0,0x1,0xf00b6c00,0x7d0,0xf00b6c00,0xe3) + 114 do_panic(0xf00be7ac,0xf0269750,0x4,0xb,0xb,0xf00b6c00) + 1c die(0x9,0xf0269704,0x4,0x80,0x1,0xf00be7ac) + 5c trap(0x9,0xf0269704,0x4,0x80,0x1,0xf02699d8) + 6b4 This stack trace is not helpful initially, as the ramdisk routines are not on the stack trace. However, there is a useful bit of information: the call to trap(). The first argument to trap() is the trap type. The second argument to trap() is a pointer to a regs structure containing the state of the registers at the time of the trap. See The SPARC Architecture Manual, Version 9 for more information. 0xf0269704$<regs0xf0269704: psr pc npc c0 ff2dd8b0 ff2dd8b4 0xf0269710: y g1 g2 g3 e0000000 ffffff98 8000000 ffffff80 0xf0269720: g4 g5 g6 g7 0 f02699d8 1 ff22c800 0xf0269730: o0 o1 o2 o3 f02697a0 ff080000 19000 ef709000 0xf0269740: o4 o5 o6 o7 8000 0 f0269750 7fffffff Note that the program counter (pc) in the previous example was ff2dd8b0 when the trap occurred. The next step is to determine which routine it is in. ff2dd8b0/ird_write+0x2c: ld [%o2 + 0x4], %o3 The pc corresponds to rd_write(), which is a routine in the ramdisk driver. The bug is in the ramdisk write routine, and occurs during an load (ld) instruction. This load instruction is dereferencing the value of o2+4, so the next step is to determine the value of o2. Using the $r command to examine the registers is inappropriate because the registers have been reused in the trap routine. Instead, examine the value of o2 from the regs structure. o2 has the value 19000 in the regs structure. Valid kernel addresses are constrained to be above KERNELBASE by the ABI, so this is probably a user address. The ramdisk does not deal with user addresses; consequently, the ramdisk write routine should not dereference an address below KERNELBASE. To match the assembly language with the C code, the routine is disassembled up to the problem instruction. Each instruction is 4 bytes in size, so 2c/4 or 0xb additional instructions should be displayed: rd_write,c/ird_write: rd_write: sethi %hi(0xfffffc00), %g1 add %g1, 0x398, %g1 ! ffffff98 save %sp, %g1, %sp st %i0, [%fp + 0x44] st %i1, [%fp + 0x48] st %i2, [%fp + 0x4c] ld [%fp + 0x44], %o0 call getminor nop st %o0, [%fp - 0x4] ld [%fp - 0x8], %o2 ld [%o2 + 0x4], %o3 The crash occurs a few instructions after a call to getminor(9F). If the ramdisk.c file is examined, the following lines stand out in rd_write: int instance = getminor(dev); rd_devstate_t *rsp; if (uiop->uio_offset >= rsp->ramsize) return (EINVAL); Notice that rsp is never initialized. This is the problem. It is fixed by including the correct call to ddi_get_soft_state(9F) (as the ramdisk driver uses the soft state routines to do state management): int instance = getminor(dev); rd_devstate_t *rsp = ddi_get_soft_state(rd_state, instance); if (uiop->uio_offset >= rsp->ramsize) return (EINVAL); Many data fault panics are the result of bad pointer references.
http://docs.oracle.com/cd/E19620-01/805-3024/debug-35/index.html
CC-MAIN-2014-52
refinedweb
687
65.86
My storage team and I focus on three of the most important aspects in any industry: customers, competitors and market trends. There is insight to gain and share in this role, so here is our take on Sun and Storage - Taylor Allis Open Storage: Early Markets As promised, below is a second White Paper on Open Storage. This second one addresses Open Storage market drivers and growth and is titled Open Storage Adoption. It can be downloaded here: Again, I would like to thank Bruce Norikane, our Sr. Analyst, for his help as well as our market research manager, Chris Ilg, for his forecasting work. And again, I'll use this blog to post the CliffsNotes for those short on time. Below I will cover the need for a new storage architectures and early target markets. In subsequent blogs I'll cover the Open Storage future market forecast, other vendor initiatives and customer case studies - early adopters who have used Open Storage to solve their critical business needs... The Need for a New Storage Architecture Bruce, mentioned above, made a profound statement during our Open Storage planning that ended up in the White Paper. He said, "Google and Amazon would not exist if they hadn’t built their own storage infrastructures." They certainly wouldn't exist in their current state. When they started, traditional storage architectures were too expensive and inflexible to support the business model they had in mind. So what did they do? They had to buy commodity components and developed their own software like the Google File System (GFS). Certainly not everyone can build their own file system today. But the requirements that drove Google to build their own file system have done nothing but increased. Consider the following facts: A new, more economic and scalable storage architecture is desperately needed - enter Open Storage... Open Storage Growth Markets Open Storage can (and will) compete with traditional storage architectures. But Open Storage won't "take over the world" overnight. Most likely the data center mix of open storage architectures vs. closed storage architectures will change over time and vary data center to data center (if history is our guide). But what markets will adopt sooner? What are the Open Storage "sweet spots"? Web 2.0: I count Web 2.0 apps as applications delivered via the Web. Apps like blogs, wikis, podcasts, RSS feeds, mashups, and social-networking sites like MySpace, Facebook or SmugMug. Consider this: And Web 2.0 apps are not just for up starts - Forrester surveyed 2,200 IT decision makers from traditional enterprises and found that 33% were planning on investing in Web 2.0 applications. Web 2.0 storage requirements differ from traditional storage requirements as well. They need massively scalable but low-cost systems. Web 2.0 users are even willing to trade high availability for lower costs. Everyone needs high scalability at lower costs - but the need in the Web 2.0 space is acute. Thus, Web 2.0 will be the key driver for Open Storage architectures. HPC Storage: IDC estimates that HPC storage systems added about $3.9 billion to the 2006 server revenue total and will undergo faster annual growth than HPC servers. Maximizing I/O bandwidth and minimizing latency while scaling storage capacity is the top priority for HPC storage users. Because of this, data locality is an issue for many HPC implementations. What's data locality? HPC services provider Instrumental, Inc.explains: storage architecture is needed. The one thing that HPC storage deployments have in common is that they are all custom built. HPC users need direct access to their storage components and software along with the flexibility to swap components and customize software to optimize their storage. This is difficult to do with closed storage systems. Additionally, parallel, shared or clustered file systems that leverage global namespace technologies are used in most HPC storage environments. This includes the HPC open source file systems Sun offers - like Lustre. In fact, Lustre is used in 15% of the top 500 supercomputers in the world and in six of the top 10 supercomputers. Lastly, an additional top storage requirement in HPC is Hierarchal Storage Management (HSM) software (moving data from disk to tape). Why? Just look at the massive amounts of data HPC applications generate. The San Diego Supercomputer Center states their earthquake simulations alone generate 47TB every week! By 2011, they expect archived data to grow to more than 100PB. HPC centers must leverage the economics of tape to store such massive amounts of data. Sun offers tape as well as open-source HSM software for disk-to-tape data migration - Sun's Storage Archive Manager (SAM) software. To see the real-world benefits an open storage architecture can offer HPC customers, see the Texas Advanced Computing Center (TACC) implementation of Sun Constellation - aka Ranger. Server Virtualization: Open storage introduces more flexibility and consolidation benefits to the server-virtualization market. This added functionality can be realized in two ways: Storage users can now consolidate three servers and a storage appliance onto a single server. In a closed architecture, storage software cannot be separated from the hardware. In the second scenario, users can use an open storage server, such as the Sun Fire X4500, as a storage target or shared appliance. What’s unique is that users can repurpose their storage appliance as their needs change. For example, customers can repurpose the same Sun Fire X4500 into a NAS device, a Virtual Tape Library (VTL) or a data replication appliance without buying more hardware. Now that's investment protection! In the following diagram, a customer has taken a Sun Fire X4500 server running Linux-based VTL software and has repurposed it into a remote replication appliance by leveraging server virtualization and open source Sun StorageTek Availability Suite software. Sever Virtualization and Open Storage can deliver better investment protection and significant cost and consolidation advantages ... Next Blog... What we predict the size and growth of the Open Storage will be Posted at 04:06PM Jun 10, 2008 by Taylor Allis in Storage Intelligence | Comments[1] Today's Page Hits: 52
http://blogs.sun.com/TA/date/20080610
crawl-002
refinedweb
1,021
56.05
Founder @Ruksack - Developer. Tinkerer. Entrepreneur. It was infatuation at first sight with Crystal, a programming language built for humans and computers. What a noble cause. Having been a fan of the beauty of the Ruby syntax, the promise of Ruby-like syntax with the speed of C was intriguing — life-altering, even. Since that day, I’ve been closely following the progress of Crystal and today, I will make a case for why you should care. It’s quite honestly one of the most exciting languages with promise for great potential. Before we get into it, keep in mind that Crystal is not yet ready for production, but you can still find many projects already using it — like this version of Sidekiq, written in Crystal. So, why should anyone care about yet another programming language? Well, because Crystal has combined a concoction of incredibly compelling ingredients that you won’t find in many other languages. One of the most appealing things about Crystal is the clean and readable Ruby-like syntax. The creators of the language understood the appeal of Ruby as one of the most visually appealing languages and they took it as the inspiration for Crystal. So, if you are coming from the Ruby world, transitioning to Crystal is going to be straightforward. Most of the time, you will be able to run Ruby code directly in Crystal, or run Crystal programs within a Ruby shell. To top it all off, you can even use Ruby syntax highlighting with Crystal. Similar to most interpreted languages, Crystal will let you build your wildest imaginations in a few lines of code. Crystal is a statically compiled language built on top of the revered LLVM framework and can hold its own against the likes of C, C++, and Rust. Just let that sink in a little bit… The development speed of Ruby syntax with speeds matching C… It’s incredibly compelling and hopefully has you as excited as I was when I first heard that claim. Don’t believe me? Just check out some of the latest benchmarks; this benchmark and this benchmark. If a part of your application or algorithm requires extreme performance, one strategy is to offload the functionality to a C extension or library. With Crystal, binding to existing C libraries or your own C libraries can be done without writing a single line of C code. Consider a quick example of a C library hello.c that we can build using the GCC compiler gcc -c hello.c -o hello.o. #include <stdio.h> void hello(const char * name){ printf("Hello %s!\n", name); } #hello.cr @[Link(ldflags: "#{__DIR__}/hello.o")] lib Say fun hello(name : LibC::Char*) : Void end Say.hello("your name") After building the binary, you can easily link the binary using Link and define the lib declaration which groups the functions and types belonging to that library — followed by calling your function. Voila! Crystal is a statically-typed language, allowing it to rule out many type-related bugs at compile-time and setting the stage for optimizations that would not be possible in dynamically-typed languages like Ruby or Python. This directly contributes to the performance of Crystal and what’s even more impressive is that the compiler in Crystal only requires you to explicitly specify types in case of ambiguity — the rest of the time you can work with it like any dynamic language. Macros are a way to modify the abstract syntax tree created during a programming language’s tokenizing and parsing phase, allowing us to add methods at compile time or create and modify classes. The main advantage of this is speed — as you save a lot of time spent by the compiler for invoking/calling functions. Crystal lets you utilize the majority of the language when it comes to writing macros, which means you can do crazy wizardry that normally would be unheard of in a statically-compiled language. Any comparison isn’t complete without talking about available web frameworks in the language and if you’ve already fallen in love with the likes of Rails and Phoenix — you’ll feel right at home with Crystal’s web framework Amber. It was designed from the ground up to follow Rails but is obviously an order of magnitude faster than Rails — with load times in microseconds not milliseconds. If you fall under the camp of Sinatra lovers, fear not because you’ve got the simplicity of the Kemal framework. Did I mention that Crystal’s built-in HTTP server has been able to handle over 2 million requests per second in benchmark testing? And most of the frameworks also deliver sub-millisecond response times for web applications. Crystal currently supports concurrency as a first-class citizen, while parallelism is making its way up the ranks — you can read about its progress on the Crystal website. Concurrency is supported in Crystal using Fibers — a lighter-weight version of an operating system thread. Unlike threads, which are pre-emptive, Fibers explicitly tell the runtime scheduler when to switch context. This helps Crystal avoid unnecessary context switching. If you want to add concurrency, you’ll find the spawn method in Crystal similar to the use of go-routines in Go — which I am personally a huge fan of. # Simple example spawn do sleep 5.seconds end Crystal also has support for channels inspired by CSP that allow communicating data between fibers without sharing memory and having to worry about locks or semaphores. As software engineers, we are always making tradeoffs when choosing a programming language or framework and like any language, Crystal isn’t the answer to all your prayers and comes with its own limitations. - Crystal is still relatively young and immature which leads to a lack of community and packages at this particular point in time. - This also results in a scarcity of development tools available even though they are readily becoming available. - If you are aiming to do something incredibly specific, you’ll have trouble finding documentation but this just means we have an opportunity to be the first adopters and hack together cool projects. - Even though concurrency is built into Crystal, work is still being done on parallelism being a first-class citizen. - Due to the pre-production status of the language, there is a possibility of breaking changes until v1.0 is reached. - It also doesn’t have great Windows compatibility but quite honestly, that’s not a negative for me. It might still be a while until Crystal is ready for production use, with great tools and a thriving community behind it. But it’s comforting to know that a wonderful language like Crystal is in the works behind the scenes. Looking at all the features that Crystal brings together, it is deserving of a lot of attention and popularity. If I’ve piqued your interest, I would encourage you to check out Crystal and make your own decision. In the meanwhile, I will continue to evangelize Crystal and keep a keen eye on its progress. Crystal programming — Reddit Create your free account to unlock your custom reading experience.
https://hackernoon.com/crystal-programming-language-is-slick-like-ruby-and-fast-like-c-an-overview-p88838qx
CC-MAIN-2021-04
refinedweb
1,192
60.65
On Fri, Sep 21, 2007 at 01:05:40AM -0400, Rich Felker wrote: > On Fri, Sep 21, 2007 at 01:32:02AM +0200, Diego Biurrun wrote: > > > +#ifndef uninitialized_var > > > +# define uninitialized_var(x) x=x > > > +#endif > > The code in this patch is not valid C afaik. Even if it is, the > variable is still used uninitialized in the construct int x=x; >From a quick look, the Standard is unclear on whether an identifier is visible to its own initializer. As you say, at that point taking its value would be undefined anyway. However taking its sizeof would be valid, so it's not entirely cut and dry. > If gcc is not reporting the warning here, it's a bug in gcc's > warning generation. So IMO this workaround has no merit... It's a known deficiency in gcc. The gcc manual gives some examples of problem situations, such as: int save_y; if (change_y) save_y = y, y = new_y; ... if (change_y) y = save_y; gcc isn't smart enough to figure out that save_y will only ever be used if it was also initialized. Even if gcc _could_ handle that case, it's easy to make it a lot harder: int save_y; if (v1) save_y = y, y = new_y; ... if (v2) y = save_y; and then have the relationship between v1 and v2 be complex, or expressed in a different translation unit. gcc does not have an attribute similar to __unused__ to mark these cases. I have no idea why not, as it would seem to be a perfect place for one. Instead the usual "solution" is to self-initialize. In fact gcc intentionally does _not_ warn about self initialization unless you enable -Winit-self, presumably for exactly this reason. -Dave Dodge
http://ffmpeg.org/pipermail/ffmpeg-devel/2007-September/039398.html
CC-MAIN-2016-44
refinedweb
286
70.02
Just to make my question clear, first I have a short explanation about my task. I would appreciate if you tell me any comment for each step of my work, since i am beginner in this stuff. I want to render an image for display on a multilayer display, based on the z values of the picture. I found Blender as a rendering tool (it means i am completely new So, for extracting z value in Blender, I opened a .blender image, clicked on "Render" menu, then wrote a short script of Python, like: import bgl zbuf = bgl.Buffer(bgl.GL_FLOAT, [100*100]) bgl.glReadPixels(150, 140, 100, 100, bgl.GL_DEPTH_COMPONENT, bgl.GL_FLOAT, zbuf) But I got for all z values 1.0. I know almost nothing about working with Blender. Is there something I am missing? And, is the process that i am going to do with the whole idea correct or achievable? Thanks in advance
https://www.blender.org/forum/viewtopic.php?t=25238&view=previous
CC-MAIN-2017-17
refinedweb
157
84.37
This is your resource to discuss support topics with your peers, and learn from each other. 07-30-2008 11:26 PM Greetings--I'm testing in the 8120 Simulator, using the 4.3 JDE. I've written code to pull up a MainScreen in the foreground when the simulator starts (this is a UI that will generally be used in the simulator only): invokeLater(new Runnable() { public void run() { pushGlobalScreen(new TestUI(), 1, UiEngine.GLOBAL_MODAL); } }); I also set the app to "auto-run on startup" from the Eclipse project properties.I also set the app to "auto-run on startup" from the Eclipse project properties. I tried the pushGlobalScreen without running it in the context of invokeLater; it generated a runtime exception. I also tried it in the context of a synchronized(Application.getEventLock()) block; same result. In any case, it sort of works--it displays my UI fine. But almost immediately thereafter, the simulator (not my app) looks like it generates a data receive and then a send, and shows the little up/down arrows on the UI. As a result, this whites out the display UI. If I click the trackball, my app repaints, mostly (minus one separator). I'm presuming the interrupting UI has higher priority. How do I ensure that my app stays in the foreground, or at least repaints after being obscured? I tried implementing the following in my MainScreen subclass: protected void onObscured(){ // Screen activeScreen = UiApplication.getUiApplication().getActiveScreen() ;; // activeScreen.getUiEngine().suspendPainting(true); UiApplication.getApplication().requestForeground() ;; } ... both with and without the commented-out code, but neither had any visible effect. Many thanks for any recommendations! Jeff Solved! Go to Solution. 07-31-2008 11:20 AM The repaint should occur automatically. But I think you may be trying to display your GUI before the BlackBerry is prepared to do so. Please ensure that you check the ApplicationManager.inStartup method to ensure that the startup process is complete before you display your GUI. If this isn't the case, please post a larger code sample that shows how you are displaying the screen. 08-01-2008 12:08 AM Greetings Mark, Many thanks for the response! I tried putting in a sleep loop (first outside, then within the invokeLater), but that hung. So, in response to your suggestion, I started stripping down the code to post as small an example as possible. In doing so, I discovered that I do not need to do a pushGlobalScreen. Instead, a simple pushScreen works as long as the MainScreen implements the method onObscured: import net.rim.device.api.ui.*; public class AgentApp extends UiApplication { public static final long guidName = 0x7bad99728b25ff48L; public static void main(String args[]) { AgentApp app = new AgentApp(); app.execute(); app.enterEventDispatcher(); } private void execute() { invokeLater(new Runnable() { public void run() { pushScreen(new TestApp()); } }); } } import net.rim.device.api.system.*; import net.rim.device.api.ui.*; import net.rim.device.api.ui.component.*; import net.rim.device.api.ui.container.*; public class TestApp extends MainScreen { public TestApp() { // ... } protected void onObscured() { UiApplication.getApplication().requestForeground() ; } // ... }; } // ... } Thanks again, Jeff
https://supportforums.blackberry.com/t5/Java-Development/pushGlobalScreen-repaint/td-p/24690
CC-MAIN-2017-04
refinedweb
510
57.77
IAKUSS atcvcT IN an£ ^-,,1 -l TK NA\-CN3SS.BMNB SUM *£ LEMON OF *!|T. IflMVING DONTINUOUS -I4 C fi Niu^fr liHTVnTING StCU.-TOM MM OF YMK ION N GAl i?< NAN LEO41 |ftOSS >.**^.> AV M HtMTI > s CCNOENTRAI > CNN*, !\T [AN MS* CNN SOLDIER, 0OOLT llONOKfT -ve f | IMTIl * 1 s ca ssn 11 OOMPU TO -is |S.K\l<>. CALiiP A <;,SM>*.; |MERCIC NETiCAl A DCS W S 9 tRiaRS, Nationwide <> bs e r v a n ce <>f Jewish Education Month ;md Week during the period from September to t<> October IS was announced by the American Association for Jewish Education which sponsors the observance in conjunction with the National Council for Jewish Education Dr. Solomon Grayzel, president <>l lit*Jewish Book Council of America, sponsored by the National Jewish Welfare Hoard, has announced that Jewish Hook Month will be observed during the month of November, the last seven days, November :M to 30 serving as the culminating Jewish Hook Week ... A plan by which local posts of the Jewish War Veterans of the United States will be organized in congregations throughout the country affiliated with the Union of Orthodox Jewish Congregations oi America, lias boon adopted by the two organizations, it was announced by Archie 11 Greenberg, National Commander of the J.W.V. One hundred and four Jewish refugees found shelter in German atomic bomb plant after having been imprisoned at notorious Bergen Belsen concentration camp All persons who stole Jewish property during the German occupation of Greece will be fully prosecuted unless they return it to their rightful 1 owners. Vice-Minister of Finance. Michael Pezmazoglou announces Seventy-five tons of special foodstuffs and medical supplies purchased by the Joint Distribution Committee have been furnished the needy Jews in Budapest. | Bucharest and Vienna Thousands of Jews in France who survived the Nazi ordeal depend upon continued American help if they are to survive the coming winter. Arthur D. Greenleigh. director of 1 the Joint Distribution Com1 mittee program in France, said. Wi bber College, school of business for Women at Babsonl Park. Florida, offers three scholarships to high school graduates for l!'4:i-4ti to the writers of the three best essays on I "Why 1 Want A Business Edu! cation." High demand for 1 Florida manpower and materials is s c n in the volume of construction now in the design stagi in : 11 stati, th< res :i of the Florida Si U Chambt 1 of Commi r i stated today .:: its weekly business re% lew St::..; : Claude Pepp< r, of Florida, will return to 1 this i iunt]y :; .. | an aunt .vith most p-1 te 111:-. how ;,i ext( :. Stati s' ton ign trade th natii :\> : Europe. Mrs. Joseph M. Welt of Detroit, national president of the National Council of Jewish Women, was the only Jewess among twelve women's leaders received at the White House by Presidenl Harrl S. Truman en the occasion of the twenty-fifth anniversary of women's suffrage in the United States Social science techniques are being used by the American Jewish Committees Scientific Department to determine the causes and cures of prejudices as investigations of anti-Semitism are being made I R< sevelt's ide toward, f.ned by Emerger.ev C >un< il ith facts : 11 futi si I ul out by Azzam Bav. tecreArab League H. Sheldon, adrninistra' ' % ' 1 chairman of the Non-SecA::.N... League, in ap< before House Immigran Sub-Committee, declared it % % is 1 inti : nal si cur'rated States and pos % 1 thi pi... 1 I th< em % world, to continue this country's sard to and her closer allies e romins I % :: ' 1 An l. :car:s. I % l I H rews ol Eu1 .'.... suffered enough cat ...ties in this war and that we - do everything possible to I an end to tl : :ng and isery that .--.ill continues spit* the fact that :t is now three months since V-E Daw' stated Senator Guy M. Gillette. |m accepting the presidency of the League for a Free Palestine. Those in the know insist that Gerald L. K. Smith I He is hard at work organizing 'The Now! Headquarters of this new organization will Z located in Chicago. ... In a recent confidential letter k supporters G. L. K. Smith wrote: "Our crusadp has r, !" .,. menace. Veterans crusade has now spanned the nation. At this very moment the servants of the caus (Mf>fii"A Ir/Nrrs *V(-* D*-*f""!fir ri-^ *V.- A 1 r-t .14 ; .-, *T*\. 1 active from the Pacific to the Atlantic." This is no empty boast .... Smith key men are playing an imporiant role in ft, Hearst sponsored "Youth For Christ" Movement, which I dentally is growing day by day. ... All rumors to the contZ only a few thousand Jews remain in Germany 7215?, Jews were listed as Germany's Jewish population in the MM census. Over 700,000 were eliminated by persecution and deportation. These figures are authentic and well knom to our State Department It's time that some of our correspondents stop holding out hope for more survivors. A TRUE STORY Dr. George N. Shuster, president of Hunter College in Net York has been sent to Germany by the War Department. He charqed with the special mission of "interrogating oncepowerful German leaders on a number of social, economic and political aspects of the Nazi regime." Last June Dr. Shuster was a witness before the Supreme Court New York county in the case of Professor F. W. Foerster against Victor Ridder, owner of the New York Staatszeitung. Shuster was a chat' acter witness for Ridder. Cross-examined by Foerster's cl torney, Louis Nizer, Shuster answered a few questions of greet significance. QUESTION: "Did you write any place thef Hitler is and has been a greatly perplexed honestly inquiring and quite unsteady young man?" ANSWER: "Yes, I did."... QUESTION: "In 1935 you considered Hitler 'an honestly etc' young man?" ANSWER: 'Yes." QUESTION "Did yooI ever write that the Germans are 'a people upon whom theJ late Mr. Woodrow Wilson played what can only be called 1 dirty trick'?" ANSWER: "Yes." Among other things Di| Shuster told as a witness are that Horst Wessel who wrote tie' Nazi anti-Semitic hymn is not so bad. "Chaps like hitt" said Shuster, "have done worse at Harvard and lived it dow' .... When Kenneth Leslie, editor of the PROTESTANT asked Secretary of War Stimson to recall Dr. Shuster because of n distorted views on Nazi leadership. Secretary Stimson refused because he could see nothing wrong about Dr. Shuster. .. ABOUT PEOPLE .... Eva Rubenstein, twelve-year-old daughter of ihe worlds qreatest pianist, Arthur Rubenstein. is a genius of the ballet Her interpretation of Massenet's "The Dying Swan given before an intimate audience, created a sensation. % Arthur may become known as Eva's father. Harry Freud, nephew oi the late Dr. Sigmund Freud is a sergeant in the U S Army He is with Army Intelligence, and was detailed to question Julius Streicher, the notorious anti-Semitic, taken prisoner long before the war. It's true that Charlie Chaplin has accepted an invitation to visit Moscow as the guest of the Soviet government. YOU SHOULD KNOW Burgess Meredith and his wile Paulette Goddcrd cne leaving for Palestine to star in a movie. The story written by Ben Hecht deals with the heroism of the Jewish Seli-de!en Corps in war times. Peter Bergson, head cf the Hebrew Committee of National Liberation will be a consultant to tie director Kurt Weill is supplying the musicci score. Rather ironic that the Bergson Committee succeeded in gelting Hollywood's interest in a Zionist film after c!l the Zionist big shots had failed to do so for years. ... The Arr.eiican Civil Liberties Union has addressed a letter to the Alien Property Custodian urging rconsideration of a recent order can celling the public auction of 650 German and Austrian BllM !" aie m ing the Hitler regime. Why does the A C.L U. advoca Nazi propaganda for American movie audiences. MELANGE Martin Morrison of Chicago is a blonde looking Nordic but his wile, who is Spanish and of dark complexion looks Jew ^ ... The other day the Morrisons were refused cd:nissl0 the Thousand Island Hotel on Wellesley Island. % % JJJ the hotel manager believed that the Morrisons were Je Morrison who never gave a thought to anti-Semiusin has become a fervent fighter against prejudice and disCTin ^ 1 uSS Leonard Lyons tells us that Commodore Lewis ^ erS formerly of the Kuhn and Loeb bank financed Lise M" successful atomic experiments after she fled from Gerrncmy -^ Larry Adler, the harmonica genius was shot accidently "^ back while on a USO tour in Germany. ... His injury 1 minor. PAGE 1 UDAY. AUGUST 31, 1945 fJewistFhridlian PAGE FIVE PENALTIES TO BE J London (JTA)Severe penalLies will be imposed upon all '..). who participated in the nnt'i-Jrwish disturbances which jL, taken place in recent in various Polish towns, announced here in a stateIl(: issued by Alfred Fiderkie!!. ilV Polish Charge d Affaires. \\\ are sorry that such things In the new Poland at { h ,V moment," the statement Icontinued, "but we believe that the .uti-J e w i s h crimes are I the whole mentality not onlv ol the Polish Government, but '< t ne c ntire Polish nation. These brutal gangster attacks .,, ing carried out by organi\ lands of reactionary elementin Poland who think that bv making pogroms they will not only harm the Jews, but a l su the democratic regime of p 0 | d," the statement emphaThe gangsters usually com< out of the woods and kill not nly Jews, but also Polish soldi. and militiamen. Jews can be sure that our government will take the necessary measures to tiring these bands to Justice. Measures have already 1, n to ensure order." Despite the terroristic activilie anti-Semitic elements in Poland. Polish Jews continue to am in Lodz from camps, in Germany, it was reported in a Yiddish broadcast from Warsaw. Three Jewish delegations, representing the Central Committee of Jews in Poland, called up.:. members of the Polish Cab:in t in Warsaw this week and urged additional protection for Jewish life' and property in connivtion with the anti-Jewish disti:: winces which have occurr| ed in various parts of the coun, try. it was reported in a Yiddish broadcast over the Warsaw radn. Dr. Joseph Schwartz, European director of the Joint Distribute >n Committee, has been granti d a visa allowing him to Poland to study Jewish 'here for the purpose of extending the relief activities the J.D.C. is now conducting for the liberated Polish Jews. Schwartz is proceeding from London to Poland via Germany. He will be the first representative of any Jewish organization abroad to be admitted to liberated Poland. An office of the Joint Distribution Committee has been functioning in Poland for some time with the permission of the Warsaw Government, under the direction of David Guzik, the only surviving J.D.C. pre-war representative. PRESIDENT TRUMAN IS STILL FOR PALESTINE Washington (JTA)President Truman qualified his recent statement on Palestine in a conference in the White House with Rep. Adolph J. Sabath, the latter told the Jewish Telegraphic Agency. Representative Sabath said that the President assured him of his deep interest in the welfare of the Jewish people and that he was trying to secure fair, just and equitable treatment for them everywhere in the world. Such fair treatment, when it prevails, the President told Rep. Sabath, might be expected to lessen the pressure for Jewish emigration to Palestine and would make unnecessary the tremendous effort to transport large numbers there. Rep. Sabath also declared that the President had expressed concern over the trouble in store by reason of Arab opposition to Jewish immigration to Palestine, but at the same time, he is still trying to enlarge opportunities for immigration there. "The President is working at it both ways," Sabath said. Asked whether there had been any Arab communication to the President after his recent statement on Palestine, Rep. Sabath said he did not know, but he assumed that the President knew how the Arabs felt. In the Greater Miami Houses o[Worship MIAMI BEACH JEWISH COMMUNITY CENTER, Conservative. 1415 Euclid Avenue, Miami Beach Friday evening service at 1'. M. Saturday morning Bervlce at '.' A. M. Rabbi Irving Lehrman will preach on The Weekly Portion of tinLaw. Cantor Emanuel Barkan will chant. Peter Rubelman, son of Mr. and Mrs. Paul Joye, win become Bar Mltsvah. Mlncha service al 7 P. M. followed bs Shalos Scudos and Maarlv. s.-liihoth inliliiiKht service Saturday. September I at 11:80 A. M. Rabbi Lehrman will preach on "From the Depths" and Cantor Barkan will i lianl. MIAMI JEWISH ORTHODOX CONGREGATION, 590 S. W. 17th Ave. Dally nervlce 8:30 A. M. and T P. M. Friday evening 7 P. -M. ami Saturday morning at 9 o'clock. Sabbath afternoon services al >' % % ". Sellchos services ai midnight Saturday with Rabbi Murray Grauer preaching j and Rabbi Joseph E. Rackovsky IchmitiiiR SHAAREI ZEDEK TALi MUD TORAH. 1545 S. W. 3rd Street I Prlrtaj evening services at 7 P. M. | Saturday morning at !> A. M. Rabbi j Simon April will speak on the Portion i of the Law. Mlncha services followed Ity Shalos Scudos and Maarlv services. Sellchos Saturday at 12:30 midnight. TEMPLE ISRAEL. Reform, 137 N. E. 19th Street KeRulnr services Friday evening at 7:15 P. M. Rabbi Saul Applebaum will conduct services. OBITUARIES BREGER Rubin* Breger, 12, son of Mr. I and Mrs. Milton B. Breger, 1045 i Meridian Avenue, Miami Beach, died in New York city Wednesday. He came here from New York with his parents nine years I ago. Surviving besides his parents are two brothers, Eli, United States Navy, and Jerry Breger, both of Miami. Services were held Monday at the Gordon Funeral home, with burial I in Mount Nebo cemetery. BETH DAVID CONGREGATION, Conservative, 139 N. W. 3rd Avenue Services Friday evening at 7:3" o'clock. During the services Saturday morning al 8:30, Edward, the son of Mr. and Mrs. Marry Cohen, will become bar mitsvah. The only midnight, services on the Hebrew calendar, will take place this Saturday at 12 o'clock midnight. It Is known as "Sllchos" whlcch marks the beginning of the Penetentlal season. Services will be conducted liy Rabbi Max Shapiro and Cantor Abra. ham Friedman. Rabbi Shapiro's topic fordiscussion will be, "Are We Prepared for Peace?" TEMPLE BETH SHOLOM, Liberal, 761 41st Street, Miami BeachFriday evening services at 5:45, CONGREGATION BETH JACOB. 301-311 Washington Avenue, Miami Beach. Moses Mescheloff, Rabbi. Othodox Friday evening services at 7:IHI p. M. Saturday morning services at 8:30. Rabbi Mescheloff will speak on the Portion of the Week. Shalos Seudos at 7:'ur P. M. ESvenlng services at 8:15 SellchOBs special midnitrht services will he held In tire Synagogue liulldinR at midnight. The services will be chanted by Cantor Louis Feder. Rabbi Mescheloff will speak on % a mi of the Darkness." The public is Invited. The ticket committee I'mthe reservation "f seats forthe llliih Holy Days will he at the Synagogue from 9:00 P, M. to midnight Saturday. A studv of the Mishna Is conducted dally from 7:30 to S:l)fl P. M. by Rabbi Mescheloff. Summersessions of the religious school Monday thru Friday from nine to twelve, I MAY ACT AGAINST PERSECUTORS, ATTLEE London (JTA) Under the provisions of the United Nations Charter adopted at San Francisco, action can be taken against any state which persecutes its Jewish nationals, Prime Minister Attlee told the House of Commons. Asked whether he considered that the charter empowered the United Nations to intervene when some state embarked, for example, on persecution of Jews under the pretext that it was an internal matter, the Prime Minister replied affirmatively. Earlier, Atlee refused to give the Commons any details on his consultations at Potsdam with President Truman regarding the Palestine problem. He also declined to answer a question as to whether he would consider the establishment of a small impartial Antlo-American commission to examine on the spot the Palestine question and present a joint report to the respective governments. "I am at present not in a position to make any statement on this matter," he said. The question was put to Attlee by Capt. Marples, one of the new members of the House. At the same time, the Prime Minister promised to make a statement on the Palestine issue "as soon as we have time to consider the matter." This promise was made after a question by Lord Winterton, who is known for his proArab sentiments. Buy War Bonds and Stamps to help preserve Democracy. PAINTING GLASS INSTALLED V. K. TATUM Glass and Paint Shop 7-29477810 N. W. 7th Ave. m CHAPTERS IN FIRST MEETING SINCE TRAVEL BAN Miami's three AZA chapters, Miami 22, Sigma Rho 572 and Royal Palm 390 will serve as hosts to delegates from Florida's chapters when the annual Labor Day state convention starts here Sunday. The chapters will be assigned by the BZB girls groups. Registration will take place the previous evening and the meeting will last three days and four nights. The program includes business sessions, debating contest, athletic events and social activities. A dip-dance will take place Sunday evening at the Venetian Pools in Coral Gables. A banquet at the Miami Woman's Club will close the gathering Tuesday evening with Rabbi Irving Lehrman as the principal speaker. The activities will be held at the Miami and Beach Y's. The AZA convention is Miami's first since the lifting of ODT restrictions. CITY CAR INSPECTION STARTS SEPTEMBER 1 Semi-annual police inspection begins Saturday and ends Oct. 15. "We won't be too hard on them where war-scarce materials are concerned," said Inspector Forrest E. Nelson, "but we are going back to the oldtime rigid requirements in brakes, lights, windshield wippers, horns and glass." The passenger car station is located at S. W. Second Avenue and Fourth Street. United States War Bonds are still the best investment. High Holy Day Services Miami Jewish Orthodox Congregation Will Conduct Services In Both Buildings MIAMI JEWISH ORTHODOX CONGREGATION 590 S. W. 17TH AVENUE Murray Grauer, Guest Rabbi Rabbi Joseph E. Rackovsky will chant SCHAAREI ZEDEK TALMUD TORAH 1545 S. W. THIRD STREET Simon April, RabbL Will Preach and Conduct Services Worshipers are asked to make immediate reservations for both buildings on week-day evenings or contact Lewis Green, executive secretary. PHONE 3-6086 Monday, September 3: Miami Service League at *:I5 1". M. Miami "V". Wednesday. September 5: National Council Jewish Women board iiK'i-iliiK. 1" A. Mat I'ViU-rntlon office, 1008 Congress Building, Wednesday. September 5: Bureau of Jewish Education board meeting al Federation office 8 P.M. Sunday, September 9: Temple Israel Sisterhood HIKII Holy Hay reception, 3 to 6. London (JTA)Units of the Jewish Brigade have arrived in Holland to guard German war prisoners engaged in doing salvage work in the sections of the country devastated by the Nazis. LEGAL NOTICES NOTICE OF APPLICATION FOR TAX NEED PILE 4iifti).". NOTICE IS IIEREIIY CIVEN that M. IIARKINS, holder of City of Miami Tax Certificates Numbered 16S and IB!', dated the 7th day of June. A I>. P.MS. lias filed said Certificates in inv office, and has made application for tax deed to be Issued thereon In accordance with law, Said Certificates embrace the followltiR described property, situated In Dade count*. Florida, to wit; S 48.48' of N". 130.44' of E. 185' I,ot 4, less E. 33' being lt > of Hesub. of Lot 4. of Tuttles L'nr,corded Plat, Tuttles Subdivision Plat book II pane 3 In the City of Miami. County of Hade, State of Florida, as embraced in Certificate N.i. lfiS. The assessment of said property under the said Certificate issued was In the name of Unknown. S. 43.48' of N. 173.M' of B. 1S.V Lot 4. less E. 33' St., being Lot 4 of Resub. of I>it 4, Tuttles Onrecorded Plat. Tuttles Subdivision. Plat book B page 3. in the City of Miami, County of Dade. State of Florida, as embraced In Certificate No. 169. The assessin, % r11 of said property under the said Certificate issued was In the name of I'nknown. Unless said Certificates shall be redeemed according to law, tax deed will issue thereon on the 3rd day of October. A.P. 1946. Dated this 28th day of AuRuat, A.D. PM... B LBATHHRMAN, Clerk Circuit Court. Dade County, Florida N. C. STERRETT, D. C. Circuit Court Seal. 8/31-9/7-14-21-28 '\/mi Dutunte! No longer a child and not yet a woman. She fares the futnre with courage alive with the eager, glowing beauty of youth. Tooley-Myron creative photography will capture the sweetness of her vibrant beauty. Remember she's sweet sixteen but oncef This, little lady is your invitation to visit our studio. No appointment necessary **W PWMtf* Lobby Floordu Pont Bldq.. Miami 205 Lincoln Road. Miami Beach A S &&"g~^-r>^*'*xj'3^&*&7*k PAGE 1 I n* PAGE SIX Jfetfeft flcricfiajn FRIDAY, AUGU ST 3l A New Birth of Freedom for Unfortunate Children The Pioneering Service of the National Home for Jewish Children at Denver By WILLIAM R. BLUMENTHAL RABBIS MAKE YEARLY j HARRISON DISCLOSES PILGRIMMAGE NEEDS OF HBUbttt EDITOR'S NOTD: We have re,, Ived a minibcr <>f Inquiries from our readers, contused by PUDllcHy Bppearing In the Jewish "orldlan concerning a Denver Institution that refused to accept a Federation nil. Minion. The institution concerned has no connection with the National Home for Jewish hlldren, nt Denver, which has a local, active chapter. The following article tells of some of the work of this Institution which Is a participating nKency nf the Greater Miami Jewish redi ration. Rosh Hashonah this year brings the hope for a new birth of freedom for all the peoples of the world. With the advent of the Jewish Now Year, the National Home for Jewish Children is rededicating itself to the guarantee of a new birth of freedom for a special portion of American Jewish youth freedom from the misery and suffering brought on by acute asthma and other allergic diseases. For thirty-eight years the Home has concerned itself with the care of underprivileged children of tuberculous parents. In recent years it has taken on the additional service of saving and rehabilitating the allergy-afflicted children for whom all medical treatment proved ineffective in their home environments throughout the country. Nestled at the foot of the snow-capped peaks of the Rocky Mountains, in the high, dry climate of Denver, the National Home is the only one of its kind in the country. The Home opens its doors to children whose families cannot afford the extensive and costly private care necessary to alleviate the suffering of their youngsters. When competent medical opinion recommends a change in climate and environment for such children. the Home admits them after an intensive medical and social studv. There the child remains until" it has been restored to normal health, or has sufficient!) recovered to make possible return to its own home. Children whose pale, anxious faces and appealing wide eyes once tola the tragic story of a struggle lor each gasp of breath: youngsters who saw their faith and hope crushed as medical treatment failed to help them: children who. in physical and resultant emotional and mental distress. have known nothing but pain and struggle are led back to healthy and happy lives through the pioneering work being done at the Home. These children come from all parts of the country, from New York to California, from Michi! gan to Texas. They remain at j the Home a year or two, or longer, until there is satisfactory recovery from the illness. In a comparatively normal environ! ment, and sharing the com1 panionship of other children, the asthmatic child is under expert medical supervision and is cared for bv a staff trained in child welfare. During its stay, periodic examinations are made and I full reports given to the refering physicians and hospital clinics. The National Home has a modern, well-equipped infirmary where children requiring bed care arc attended by registered nurses under the superviOf the attending physicians. The children are housed in attractively furnished congregate cottages. Each child is afforded the privacy of an individual bedroom. Food of the highest quality is carefully prepared in modThe Rabbinical Association of Greater Miami, announces ihat lhe annual pilgrimage to local cemeteries will an place Sunday, September 16th. The schedule nounced. will be anern kitchens and special diets are given when prescribed by the physicians, In addition to the intensive preparation made prior to the child's admission to the Home, an equally thorough after-care program is carried out upon the return of the child to its family. The purpose of this program is to make certain that the child will continue to enjoy its newhealth in the very Washington (JTA) Earl G. Harrison, United States representative on the Inter-Governmental Committee on Refugees, who recently returned from a six-weeks presidential mission to Europe to inquire into the condition and needs of stateless and non-repatriable persons, including 100,000 Jews of all nationalities in Germany, presented a detailed report to President Truman, recommending concrete improvements in their situation. Declaring that the President manifested real interest in the report, Mr. Harrison said that the President will take whatever steps are necessary to bring about an improved situation. The Inter-Governmental Committee on Refugees has not yet lv restored health in environment which originally bt , un to f unc tion on any broad was a factor contributing to tl 11 ba £ js Harr j son stated. While in Germany, Harrison .. I visited a number of camps houschild's illness. Trained social workers help educate the parneglect ethical and religious education under the guidance of expert teachers. The children participate in the community life by attending the local schools and in joining in communal recreations. The National Home's record of achievement fully shows the effectiveness or its Health program. This program has proved itself i i be a solution to many a perpersons, he stated. "There are no more Jews, because they killed them, and I saw the places where that was accomplished, at Dachau, Belsen and other concentration camps." Inquiry into the desires of the displaced Jews as to their future destination revealed a definite trend, Harrison declared, but declined to name this destination which, he said, is named in his report to the President. KB FAIN [in Jerusalem (JTA) Seven o( the 1,303 internees from j£< tius who arrived | lere ,iLT"t aboard the S. S Fr^coS.^* resting in Hadassah H^n while 160 who do not pK settle in Palestine are m UNRRA camp h~ !?. where 4y will remain until they can erf grate overseas. Homes and 2 for the others arc beine ar !" 7 ed for by the Jewish Age?" On tho journey from Mauri. tius, which marked the last ]L of a rlva-venr ,u.^o-.. ..." to Asia, plexing problem of allergy treatfQ number with ment where a change in climate =* u ._ . u relatives in this country, no substantial number expressed a wish to come to the United States, according to Harrison, who said that "we are known as a restrictive country." and environment was necessary. The beneficial effect of a change in climate lor children afflicted with asthma and other refractory respiratory diseases is acknowledged by thirty leading allergists throughout the country who serve the Home gratuitously as Regional Medical Consultants. Dr. M. Murray Peshkin, chief of the Children's Allergy Clinic of Mt. Sinai Hospital of New i synagogue of the renowned lyric BETH JACOB ENGAGES NEW CANTOR Congregation Beth Jacob announces the engagement for its a five-year odyssey which took the refugeefi om Euro* Asia, to Afrii a and back to Persons, Abraham Folkman, 57, of \ lerma andlS. tha Levi, 76, of Danzig, died and an infant, Franconia Mathilda Hadassah Silverg, was born. Spectators who witnessed the disembarkation wire moved u tears as families which had beer separated for fivi years were reunited, and elderly men aod women, who could hardly wilk, were helped down the gang, plank. The vessel was met bj representatives of all the lejj. ing Jewish institutions of Palatine, who revealed that 126 Jeter noes had died at Mauritius fifty children had been born and over 250 had enlisted in the Allied forces, including 53 in the Jewish Brigade. The refugees' exile on Mauritius began early in 1941 whn they were apprehended attempting to land illegally in Palestine. Despite vigorous protests by tie i Jewish community they wen sent to Mauritius, since it wa impossible to send them bad to their countries of origa, j which were Nazi-controlled. Large Old Line Insurance Company has opening for a couple of salesmen. This affords a good opportunity to make big money. Experience not necessary. Phone 2-6044 mornings for appointment. 26TH SOUTHEASTERN DISTRICT CONFERENCE Arbeiter Ring September 2, 3, 4 Sessions At Strath Haven Hotel, Miami Beach GALA CONCERT SUNDAY EVENING 8 P. M. Miami Beach Elementary School UNUSUAL TALENTEXCELLENT ENTERTAINMENT PUBLIC WELCOME AT ALL GATHERINGS Beth Jacob Synagogue 301-311 Washington Avenue, Miami Beach GREETS THE COMMNITY WITH PRAYER FOR LIFE AND PEACE MODERN ORTHODOX SERVICES WILL BE HELD In Our Synagogue Building and in Our Talmud Torah and Community Building throughout the High Holy Days RABBI MOSES MESCHELOFF will preach in English in both buildings CANTOR LOUIS D. FEDER renowned lyric baritone will chant the services, assisted by well-known Baalei Teiilla A committee will be at the synagogue daily excepting on the Sabbath from 9 a. m. to noon, and from 5 to 9 p. m. for reservation of seats. All servicemen are the invited guests of the congregation. York city, and chief consultant physician of the National Home states: "The National Home for Jewish Children at Denver, through a fortuitous combination of climate and environment, has brought remarkable relief to many children suffering from chronic bronchial asthma and other allergic respiratory diseases. The Home has amply demonstrated that complete recovery from asthma can occur in those cases heretofore regarded as hopeless. It has the most ideal setup I ever saw; the only place of its kind in America for care of asthmatic children."" Many little sufferers quickly become new human beings at the National Home. They arcgiven a chance to grow again and to enjoy the natural birthright of a happy childhood. Thanks to the vision of the founders of the National Home for Jewish Children and to the enduring zeal of its sponsors. this record of achievement is a reality in which American Jewry can take pride. The president of the National Home for Jewish Children is Mrs. Fannie E. Lorber, William Cohen is superintendent: William R. Blumenthal. executive director; Benjamin M. Winitt, assistant executive director and Rabbi Craim Davidovich, director of Religious education. The Home's address is 3447 West 19th Avenue. Denver. The eastern service department of the Home is at 1457 Broadwav, NewYork. The officers of the Miami Chapter are Mrs. Irving Miller, ; president: Mrs. Hy Friedman, first vice-president; Mrs. Isadore Vogel, second vice-president; Mrs. Sam Leschel, third vice! president; Mrs. E. Dorothy Miller, recording secretary; Mrs. | Charles Burns, corresponding I secretary; Mrs. Ben Bloom, financial secretary, and Mrs. Sam Luby, treasurer. Dr. Nelson A. Zivitz'is the re! gional consultant allergist of the Home in Miami Beach. baritone. Cantor Louis D. Feder. Cantor Feder received his formal musical training under a number of the most outstanding cantors of the Old World and PRODUCE PENICILLIN IN PALESTINE Jerusalem (JTA'-Dr. Banid' Levin, who has begun produdK in this country. He was a stu-< penicillin in Palestine, descriW dent of Professor Samuel Gilden in New York. He is a graduate of the Teachers Institute of the Yeshiva College. Cantor Feder served as cantor in Newburgh, N. Y., from 1933 to 1937 and in Ossining, N. Y. from 1937 to 1942. Since that time he has filled the pulpit as cantor in the synagogue at the Y.M.H.A. Bronx, N. Y. Cantor Feder plans the organization of youth and adult music groups in the Conto reporters this week howii small laboratory lure turns* 10,000,000 units of crude peni* lin every month. He said tW four times as much could be produced if additional facilita were available. Dr. Levin is able to product only penicillin which can K used externallv, because of U limited laboratory facility However, even with this limitation, physicians report extraordinary resulthave bea with both huma gregation. He will also be a part of the achieved religious school faculty. He will beings and animals. <^ er -.rj be joined by his family after the cows, for instance, Holidays. Buy More War Bonds. COWS, loi nwiaii-.^. ..penicillin injections as an aia preventing disease to which tI are subject. Air Conditioned RESTAURANT MIAMI'S NEWEST AND FINEST Featuring Unusual Fooda, Delicious Pastrie* N. E. SECOND AVE. at FOUHTH ST. Phone 2-07M For a Real Tasty Hungarian Kosher Dinner Go to e OCEAN VIEW HOTEL Restaurant Kosher iff a 158 Ocean Drive Miami Beach MAKE YOUR HOLIDAY RESERVATIONS NOW For Reservations Phone 5-9462 ALEX. B. COUNSELBAUM DIES WEDNESDAY Alexander B. Counselbaum. age 52, passed away Wednesday evening at the St. Francis Hospital following a heart attack. Riverside Memorial Chapel is sending the remains to Chicago for services and burial. Surviving him is his wife, Stella, who is the assistant director of the Florida Regional Anti-Defamation League office. Mrs. Counselbaum was to assume her duties here September 1. ANNOUNCING THE OPENING HERBERT 5 RESTAURANT 2200 W. FLAGLER STREET Operated by David and Florence Schiller Formerly Howard Johnson's Flagler Street Store Serving American Jewish Meals at Moderate Prices. ^ HERBERT'S SUPREME ICE CREAM MADE ON PRE Openins Friday at 5 o'Clock for Dinner^ ALL MEALS PREPARED UNDER THE SUPERV1SI THE POPULAR I. LEB OF MIAMI BEACH PAGE 1 LlDAY. AUGUST 31, 1945 fJenisti lUridicin PAGE SEVEN \ MIAMI ARMY-NAVY COMMITTEE Supported by Greater Miami Jewish Federation Of The JewUh WeUare Board Hlp Ui Keep a Record of Our Men in Service SERVICE PARADE! SERGEANT PROMOTED |0N 8ATTLEFIFELD A rare and signal honor was ..."id . one of Miami's servjce,£,. then it was revealed this eek that a battlefield commisll,, is second lieutenant was Conferred upon Joe Scheinberg. short of officers due to the urgent need for them at observation posts, etc. So my captain on several occasions, gave me responsibilities that would ordinarily be handled by himself or some other officer. When our colonel heard about this he sent in a recommendation to the commanding general of the Eighth Army that First Sgt. Joe S. Scheinberg be commissioned an officer right there on the battlefield, without going to O.C.S. or anything else. Naturally, I was honored and surprised. So today, Friday, August 10, I received word from the commanding general of the Eighth Army that I was awarded a battlefield commission of a second lieutenant." Joe is now with the field artillery, Eighth Army, 34th Division, and at present is a motor officer in the service battery. He was in New Guinea and then with the original invasion forces of Luzon. He won the Philippine Liberation and the Pacific Theatre of War ribbons and has two battle stars. Prior to entering the service he was associated with the Maxwell Company. His wife, Catherine, resides at 534 N. E. 23rd Street, and his mother and father, Mr. and Mrs. Scheinberg, at 900 S. W. 4th Avenue. Joe hopes "to be home by December." INTERIM REPORT BY BAR COMMITTEE I Hi was promoted from first [sergeant while on duty in the I South Pacific. Joe went in service in July, 11943. :s a private, and received his training at Camp Maxey, TexB where he became staff [sergeant. He went overseas May ll, :!'i4. Joe wrote his wife as follows: I'Hi: is how it all happened laboj; two months ago when we rare fighting around the Bolete I Pis S.mta Fe Areamy batftery had the important job of % jettii.^ ammunition and food [and keeping it moving right up ii the front lines we [wen moving so fast and furious th;i: at times my battalion was right up at the front next to front line troops. On several ocIcasi : my battery became very S/SGT. WEISBARD IS GIVEN BRONZE STAR S/Sgt. Ralph M. Weisbard, 24, Infantry, of Miami Beach, Fla. In Germany. Bronze Star, for heroic achievement in connection with military operations in Poteau, Belgium. Moving his 81-mm mortar squad close to front-line infantry, he delivered highly effective fire. Even when completely surrounded by the enemy, he continued to lay down devastating mortar barrages that took a heavy toll of the attackers. He reconnoitered a safe route and by his able leadership made possible his squad's movement through enemy lines to safety. J? r.-.-.r., g$MH\ -.--'.-- GHTING FOR AMERICA bi/Leon Bleharti : RISKING HIS LIFE FOR HIS COMRADES WHEN >CIR BOMBER CAUGHT FIRE OVER N AFRICA '-=:-"FSIN6 TO BLOWUP MIR JAMMED 3-TON OAD, £,F0RCEDTO CRASH-LAND. WITH SAME DISASTROUS RESULT WAITING. U. ROBERT B ?ARiS,23, OF CINCINNATI, AAF NAVIGATOR, : "\:;Ad.YENTERED&OMBSECTlON£,AFTER DERATE STRUG6LE FREED &DR0PPED 3CMFC BEFORE CRASHIN6.THE ENTIRE CREW WAS SAVED. PARIS WAS AWARDED DFC. JURIED UNDER ROCKS SHOT 11 TIMES AND LEFT FOR DEAD BY GERMA'.S WHEN HE REFUSED TO REVEAL HIS REGIMENTS POSITION AFTER BEING CAPTURED BY A TANK WHILE ON A LONE SCOUTINS MISSION BEHIND GERMAN LINES IN BELGIUM, Pfc JEROME RUBIN,0FTHE75* INFANTRY DIVISION AND BKlYN, THO BADLY WOUNDED,WAITED FOR DARKNESS AND THEN DRAGGED HIMSELF HALF A MILE TO HIS OUTFIT IN REARAND TO EVENTUAL R! NTHEl I SEEING ONE OF OUfiTANKS AFIRE I AND BEING SHELLED ;BYJAPS0NSAJPAN,HIS MOON LEADER ANDTWO ^OWRADES KILLED AND HIMSELF 5EftiOUSi.Y WOUNDED, Qrf ISIDORE % tfLDBERG.33.0F NYC, BOW GUNNER ON A WW WKMOVEDTHRU INTENSE SHELLING & THO HIS" OWN TAMK ALSOCAU6HT FIRS HE STOOD BY TILL OTHER CREW G0TOVT OF BURNING TANK AND TO SAFETY. [WON BRONZE STAR PRESIDENTIAL CITATION AND PURPLE HEART, AND DIRT WHILE INSIDE OKINAWA CAVE USED AS A MEDICAL STATION, BY DIRECT HIT OF JAP SHELL WHICH KILLED OR WOUNDED 200F0UR MEN 6. SEALED CAVE ENTRANCE,Pfc EUGENE FREEDMAN OF PHILA,MANA6ED TO FREEHIM w£ SELF S, THO INJURED DIRECTED CftMSOUTSIDE UNTIL ALL SURVIVORS WERE % M yffc % M \sr*L WAC In Army of Occupation In Germany Writes To Parents Here In an interim report recently presented to the Snack Bar committee of the Greater Miami Army and Navy Committee of the National Jewish Welfare Board by the executive secret.ny, the highlights of this report showed a tremendous upsurge in daily attendance. Letters of appreciation and gratitude from members of the armed forces of all faiths are pouring in constantly from the four corners of the country. It is the strongly considered opinion of the members of the Snack Bar Committee that there is no more important phase of the army and navy work of the Jewish Welfare Board in Miami which has aroused more favorable comments, not only on the part of the military and naval personnel but also the general public. At this particular time, because of the vacation period there is a shortage of volunteers who play the most important role in carrying on the work of the Snack Bar. A plea is being made for more volunteers so that the vital service of the Snack Bar may continue to draw not Mr. and Mrs. Benpamin Shulman, 528 Lincoln Road, Miami Beach, received a very interesting letter from their daughter, Lt. Florence Shulman, now with the army of occupation in Germany. Lt. Shulman is an officer in the WACS and has been in service three years. She is now attached to the Seventh Army. Excerpts from her letter of interest to our readers follow: "This trying to get a letter written is almost an impossibility but things are bound to settle dqwn to normalcy one of these days. It seems a lifetime since I left the good old U.S.A., but believe me, with all the wonderful experiences I've had, this tops anything imaginable and being with the army of occupation is going to be rather pleasant living. I was brought over here to be a P. A., which is a general's aid, but after being around Com Z Hqrs. in Paris for a few days, I decided that I wanted no part of it. There is so much confusion there that you wonder how we ever won the war and then when you get with a fighting outfit like the one I'm now with, you can easily understand why. After wearing that Air Corps patch for 20 months, I'm mighty proud to give it up to don that of the Seventh Army, which is the best outfit going. These boys are the ones who landed at Casablanca, came through the Tunisian campaign, Salerno, Sicily, the Anzio beachhead and on up to Germanythey were General Patton's original outfitbut he's only the plaudits of the local commanding officers but the apnow~wfth~Third Army in Munich" probation of the leaders in civilian and military life throughout the country. Those who desire to offer their Most of these boys have been together for about three years, and it's just one big happy familyour colonel is just as much services are requested to phone | one 0 f the GI's as the rest of Mr. Calvin Reich, manager of the Snack Bar at 58-2171 and arrange for an interview. Lt. I. S. Korach, USNR, former Miami Beach architect, has just returned from service as air combat intelligence officer with the last carrier task force. He was on board the carrier Yorktown in raids on Tokyo, Iwo Jima, Okinawa and the Japanese islands. He was with the Marines in the initial attack and capture of Guadalcanal in 1942, and shares a Presidential Unit Citation and a citation from Admiral Halsey for carrier work. Morris L. Haimowitz of Miami Beach, an officer assigned to the control office of the Hawaiian air depot, has been promoted to first lieutenant. Lt. Haimowitz' parents, Mr. and Mrs. Samuel Haimowitz, live at 937 Washington Avenue. Before he entered the army in July, 1942, Lt. Haimowitz was employed as a sociologist at the University of Florida. Word has been received by Mr. and Mrs. Jack Bernstein that their son Roy has been made a chief petty officer. He has been in the armed service three years and is now in Okinawa awaiting shipment to the States. Their daughter, Irma, has learned that her fiancee, Sherman Freedman, has been made a lieutenant (j.g.). Lieut. Freedman, who is now in New Orleans, is the son of Mr. and Mrs. Maurice Freedman, of Baltimore. Pfc. Allan Wolff, son of Mr. and Mrs. Nathan Wolff, 1434 Jefferson Avenue, recently visited his parents while en route from Fort Bragg, N. C, to Fort Sill, Okla., for advanced radio study in field artillery. Capl. Marico S. Weintraub, military police officer with Gen. Patton's Third Army, has been awarded the Bronze Star for exceptionally meritorious service in the Ardennes and Remagen sector. The award was given him m Nuernburg, Germany, where he served as provost marshal, tie was commended for setting up traffic co-ordination and dispensing supplies with such efficency that swiftly moving troops proceeded with smoothness at maximum speed. A native Miamian, Captain Weintraub entered service in January, 11942, and has been overseas for 16 months. He holds a unit citation presented for service at the Remagen Bridgehead. He attended the University of Florida for five years and when discharged will return for his degree in architecture. the boys and it's wonderful being with some real men again. Most of the boys in Paris have "gone Paris" in a big wayand indulge in "L'amour toujour L'amour" all the time. Although fraternization is permitted here in Germany, it hasn't gotten underway in full force yetand some of the fellows, as much as they may want to go out with German girls, won't do it. It's hard to believe that these people could have been such ardent Nazisthey are more like the Americans than any other people in Europe, the greater percentage of them speak English they are a very clean people, and the girls look just like the gals back home. France is the dirtiest place imaginable, and prices are beyond my means. Here in Germany, our money goes a long wayyou actually feel ashamed at paying so little for what you get, when you pay for it at all. Our boys have very taking ways, and you just take most of what you want if you can get the permission of the military government. You can have an entire week's laundry done here for one mark, which is 10 centsin Paris, it runs about $25 for one week's laundry, and at those prices, its simpler to go dirty. While I was in Paris, I visited the Louvre, Versailles and all the sights of Paris itself. Now as to my setupI'm located in Heidelberg, one of the most beautiful spots in Germany. It wasn't bombed at all, since it was of no value militaristically or industrially, being merely the home of the university, and the surrounding mountains hold some gorgeous chalets and castles, which are now occupied by our generals and colonels. I left Paris by ATC last Monday morning, en route for Munich, but since I was unable to discover the exact whereabouts of the Seventh Army I got off at Frankfort, where SHAAF Hqrs. is located to do a little investigating. The army had moved from Augsberg to Heidelberg over the week-endso it was a good thing my trip to Munich was intercepted because I wouldn't have found my army there. I connected with three officers bound for Hqrs. in a jeep and off we went. Believe me, our Air Force didn't leave much standing in GermanyFranfort and Mannheim are completely demolishedit's unbelievable some towns don't have a single building remaining standing. We're only about 10 miles from Dachau, but I have no desire to visit that spot. There are nine WAC officers here now, the first women ever to be assigned to the Seventh Army, and believe me, they are mighty glad to have us. I'm going to replace a major, who will be able to return home just as soon as I'm able to take over. My job is that of administrative officer in G-4 and a grander bunch of officers and EM you won't find anywhere. They confiscated an apartment house for uswe have three apartments, with three gals in each apartment. As yet, we haven't even started to settle down, but hope to acquire all the necessary household items as time goes on. We have a beautiful baby grand piano in our apartment, and the makings of a very comfortable homeit will just take a little time. We have taken over the most beautiful hotels as our messesand the food isn't too bad, except that I can't get very enthusiastic over German cooking. They put cream sauces on everything, even steak. There are three messesone for Lts., one for captainsand one for the field grade officers. Fortunately, we gals can eat at our own mess or be guests of other officers at theirs, so I've been getting some variety. They have just opened a new officer's club up in the mountains, which is just a dream place. You should see the cars the officers ride around inone of the officers has annexed Goering's car with its armored body and glass about one inch thick the car weighs several tons. They drive around in these enormous Horschs, Mercedes, besides the American made cars. No civilians are permitted to have cars, so the army has taken every available car, and we've been fairing very well. The University of Heidelberg is getting ready to reopen, so we're hoping to be able to take courses there when that happens. They are going to make things as pleasant as possible for the boys who stay on with the army of occupationand after what they have been through they deserve the best. After three years in the army I've once again run across some real gentlemen. These boys have been on the frontlines so long, living the most rugged sort of existence and they are so afraid they will do something wrong. These boys have been dreaming about the gals back home so idealistically the past few years that they are afraid to touch you for fear something will be spolied. I've had more real honest-to-goodness fun these past few days than I've had in years, and never have met a grander bunch of menas honorable as the day is long, and the straightest shooters going. Just to be able to talk to a gal that talks their language is a bit of heaven." Pfc. Stanley O. Goodman, son of Mr. and Mrs. Samuel Goodman, of 1010 Pennsylvania Avenue, Miami Beach, recently completed a four-week term at the Mediterranean theater's university study center, Florence, Italy. Overseas 17 months Goodman wears the Good Conduct ribbon and the Mediterranean theater ribbon with three battle participation stars, and the combat infantryman's badge. Maj. Leonard H. Finn, whose wife, Mrs. Beatrice Shaff Finn, lives at 319 N. E. 25th Street, may wear the meritorious service unit insignia awarded the 25th Army Air Forces base unit at Robins Field, Ga. Sgt. Waller Dansky, former football star at the University of Miami, is now stationed as civil engineer with the Army Air Forces in Manila. He has been overseas 19 months in the Netherlands, East Indies and New Guinea. Promotion of Edward S. Roth, 1915 S. W. Third Avenue, to major has been announced by Persian Gulf Command headquarters. Assistant chief of the Armv Exchange Branch of PCC headquarters, Maj. Roth has served in the once-vital supply line to Soviet Russia since Jan. 13, 1943. He is a graduated of the University of Florida and entered the army July 1, 1941. Lt. Lawrence Singer, son of Mr. and Mrs. W. D. Singer, of this city, is now enroute to the Pacific. During his stay on the coast he spent most of his time with Chaplain Colman A. Zwitman, of Miami, who is also reported on the way to the Pacific. PAGE 1 (. PAGE EIGHT Jewisi)ncrkiiar FRIDAY. AUGlg ni j B'NAI B'RITH NOTES By DAVE ISEN The first organization meeting, for the purpose <>t forming a separate B'nai Brith Lodge for Miami Beach, was held at the Beach "Y" last Wednesday evening. The lain out of over sixty men indicated the amount of interest in the formation of sueh a lodge. Brothers Harold Turk, Lou Heiman. and George Talianoff outlined the basic reasons for the necessity of a separate lodge. I'nder the temporary leadership of George Bertman, committees are being formed to work out the organization plans which will be taken up with the proposed membership at the next meeting to be held at the Beaeh "Y" the evening of September U. Every Ben Brith and first vice-president of the Women's Auxiliary, and who has been ill. has made a speedy recovery. Jerry Freehling and wife are going to Chattanooga. Tennessee this week to rest up "'""' the rebuilding program necessitated by the burning down 01 his plant. Here's hoping you all have a verv pleasant Labor Day weekend* and best wishes for a happy and prosperous New Year. WOMEN'S DIVISION OF AJC IN 7TH BOND DRIVE EXECUTIVE BOARD HAS MEETING ON^M. BEACH A meeting of the executive board of Ihe Greater Miami chapter of the Womena Division of the American Jewish Congress was held at the home of the president. Mrs. Sol ft Leslie 3114 Prairie Avenue, Miami Beach. Plans for the year were discussed and the calendai decided upon as follows: Monday, (lobe, 15. installation luncheon November 2t\. Thanksgiving Eve dinner-dance; February 24, Victory Donor luncheon: May Z4, closing luncheon. May 2. election of officers. Board meetings the fust Monday of each month, regular meetings the hist Menday of each month. Beginning November 9 the Friday Reviews which will take place the second and fourth Fridays of each month will commence. Chairmen in charge of thejnMrs Sol H. Leslie, president : v-n ; M of he Women's Division of the stallation luncheon will be Mrs. u. r.\ei.v DCII . % ' u '\ """";,'.:,.i, rnnsTu in Philip Sa nuin and Mis. fcmanMrs. Rosie Weiss; Mrs. Theodore Firestone and Mrs. S. H. the organization. This week-end will see Milton F r e I d m a n. George Talianoff, Louis Heiman, Sam Miller. Paul Weitzman, Harold Turk. Dena Goldman. Tillie Rosenthal, and a few others, traveling to Daytona Beach to attend the Florida Federation of B'nai Brith lodges conference. Several important m attei s, such as the formation of a B'nai Brith Youth Commission which wili formulate plans tor the organization of B'nai Brith Youth ips from the age oi in to 25 iris and from 13 to 21 for boys, will be discussed. Another i matter which will be worked out. will be the organization "l now lodges and the enrollment of new members foi the entire si;,to which will be undei the able leadership of our sident, Harold Turk. In addition to the above probfurther plans for Hillel will be discussed. By this tune all of you have. undoubti lly, eceivi I your invitations '." the dinner and rebe held at T P. M. Wednesday, September 5 at the Miami Women's Club, and which affair will ... talk by our district grand lodge officer's president. Jessie Fine. Those "1 you who plan t come anurged t.i make your reservations immediately as the capacity of the building is limited to approximately four hundred persons, l ii tiir response at our last affair iS any indication of the people we can expect, there will be a great number o1 disappointed people, so. make sure that your reservation is sent in promptly. Anothei convention being I. Id tins week is the A.Z.A. convention being held here in Miami and Miami Beach. Young men from Daytona Beach. Or; lando. Jacksonville. Tampa and J St. Petersburg. are gathered here as guests of the three local A.Z.A. chapters. Bill Schwartzman, of the Royal Palm Chapter of Miami Beach, and who is convention chairman, has arranged a very interesting program Including an oratorical and debating contest, a basketball me, a banquet and dance, and several other activities which will insure the success of the convention. FLASH Highland Kout, one of our young attorneys who has just returned from the army. was presented with twin boys bv his wife onlv twelve hours ago. MAZELTOVE: Incidentally Hi wants to know if I can suggest how he is going to git the whole family into his one bedroom apartmentAny suggestions from our members will be appreciated. Welcome back to Johnny Kronenfeld, who just returned from the Merchant Marine. We trust that Mrs. Landau. Rosie Firestone Leslie as co-chairmen. FRINK NAMES MATZ TO ADVISORY COMMITTEE Sam Matz has been appointed bv Mayor Herb Frink. of Miami Beach, to the public relations advisory committee as repieof the Miami Beach The Ladies' Auxiliary of the Jewish Home for the Aged will j sentative hold a board meeting on Mon' Apartment as sociation. dav. September 3, at 2 P. M. at RnnrUi 335 S W. 12th Avenue. Buy More War Bonds' A PRAYER BOOK from the Notional Jewish Welfare Board ij a *4 come gift to Pfc. Samuel Schechter of New York City, shown h, with Rabbi Robert P. Jacobs at Moore General Hospital, $ nanoa, N. C. Bedside visitations from rabbis is one of many JW| seivices for hospitalized military personnel. NOW IN OUR NEW LOCATION 101-102 Mercantile Bank Bldg. Lobby Entrance 420 Lincoln Road Miami Beach Servicemen: Why not make our office your hcadquarten? DR. ROBERT R. BRADFORD Optometrist-Optician Phone 5-2M1 REAL ESTATEMIAMI BEACH RENTALS LEASES SALES Lots. Homes. Hotels Apt. 8c Commercial Bldgs. M. GILLER, Realtor 144S Wh. Ave.. Ph. 5-5875 412-16 Seybold BldQPh. 25151 MIAMI BEACH HOMES AND INVESTMENT PROPERTIES B. E. BRONSTON. Realtor A Trustworthy Real Estate Service 505 Lincoln Rd. Ph.: 5-5868 f MODERN MERCHANDISING IS CLOSELY LINKED TO i MODE Air Conditioning The far-sighted merchant is making bin plans right now for the era of keen competition just ahead Ami modern Air Conditioning comes in for first Consideration, for along with modern merchandising, modern display and efficient customer service, engineered Air Conditioning is a must for the retail store of tomorrow that will best ser\e its customers. Throughout the war periodtogether with all essential industries Carrier Air Conditioning has been privileged to still further expand the usefulness and efficiency of Air Conditioning and modern refrigeration in the service of our country. And in this war era ... in facing new and difficult problems presented by the needs of war Air Conditioning has been brought to a new point of efficiency and economy unknown 'til now. So you as a far-sighted merchant who plans to put BELCHER INDUSTRIES A /'" i lion of Belcher Oil Company ESTABLI S H E D 19 IS MIAMI AND PORT EVERGLADES. FLORIDA modern Air Conditioning to work for you in >" l,r postwar plans, wili be wise to wail a little longer until the new Air Conditioning equipment, incorporating all the new features that have been developed by Carrier engineers during their years of war service, will be available. Carrierthrough the Belcher Industries, will be ready inmorrouto serve you in the Air Conditioning plan* you have in mind for your store, office, plant or in your home. Belcher will fill all orders in sequence just as soon as our new, improved equipment is made available by the government. A deposit now will insure you priority of delivery and installation of Carrier Air Conditioningthe sv>tem that provides clean, evenly distributed, draftless air of precisely controlled temperature and humidity day in and day out every day in the year' SoU Duinbuton ifl South Florida of Ait Conditioning and Kf/nftration Listen to June Melville in Miami Melody Time, Thursday* 6 30 p MM PAGE 1 UDAY. AUGUST 31. 1945 JewistifhridUan PAGE NINE "Between You and Me" By BORIS SMOLAR Copyright, 1344, Jewish Telegraphic Agency, Inc. |.|. V ,,NVKUSII>N NOTE: With .. .-litrv ">f America Into the war ii, ., Hilier. l'J41. we repliicpd the mil three-dot Byrabol (. .) eptin Items m this column by the ;:, code aymbol fin"V (. _.) ., expression of this country % termination, together with ner,,. of brlnclng victory to the mocratlc world Today (AUK. (he formal surrender of Japan I. received and peace again reigns 'the world Therefore, our rsonal reconversion goes Into ef, i :is of today and from hen E r t|i on, this column will use Its n-war symbol of Zionist Affairs lie Zionist political season soon open with activities a scale never known before J this country Everything lit.:.to the fact that President jman is willing to lend a npathetic ear to the Zionist mands, even though some tinists are disappointed that jman made his first public I. ment on Palestine during absence of all important aerican Zionist leaders from country ... It was underK1 that before making any lie utterances on Palestine, irnan would receive a delelon of Zionist leaders and dishis statement with them ormally The President's tement on Palestine at his s conference after his irn from Potsdam came in ver to a question asked by r. ter of the United Press [. li came as a complete surs to Zionist leadership in country and to the Ameri--t leaders who were E the World Zionist i' in London Now these leaders have returned York, n/e learn that the ii Zionist Conference only JUDGED ESROG TREES growing and soon cornto fruiting. Very ornaental. laise Your Own Esrog Exclusively at IALMAY NURSERY 3401 N. W. 46th Street Miami, Florida Phone 8-2581 increased the tension between Dr. Weizmann and David BenGunon ... It reached a point where Ben-Gurion, as chairman of the world Zionist executive, got up at the conference and declared that Weizmann docs not express the views of the executive This explains, perhaps, why Dr. Weizmann left for a vacation in Scotland just a day before the closing of the conference without delivering the usual closing address, which was delivered by Ben-Gurion. Russian Scene The increased anti-Soviet feelings which are now growing in England as displayed by Churchill and Foreign Secretary Bcvin in their speeches last week in the House of Commons are provoking in Moscow among other thingsintensified anti-Zionist feelings The Kremlin is taking the old line that Zionism is a tool of British imperialism, especially since it has become clear .that a Jewish State cannot exist in Palestine without the aid of Britain President Truman's announcement that Stalin was not consulted at Potsdam with regard to Palestine because he cannot do anything anyway, also did much % to contribute to Russia's renewed anti-Zionist feelings ProSoviet Jewish groups in America intend to discuss with Soviet Ambassador Gromyko in Washington the desirability of opening Biro-Bidjan to large-scale Jewish immigration from liberated European countries Originally, Moscow did not want to admit Jews from abroad to Biro-Bidjan because Russia expected a war with Japan, and Biro-Bidjan is situated right on the Russo-Manchurian frontier With the occupation of Manchuko by the Red Army, Biro-Bidjan is now very far from the Japanese border There is also no fear any longer that Japan will attack Russia for many years Hence some believe that Stalin may agree to admit many thousands of stateless European Jews to BiroBidjan Especially the thousands of homeless Jews now living in the Russian-occupied zone of Germany Also Jews who may no longer desire to live in Poland, Hungary, and Slovakia (((vantages of a Dade Federal Mortgage Consult US on Financing or Refinancing Your Home LOW RATES 1 nil.],Interest charges on d balances* EASY PAYMENTS % I'-. including Interest Principal, need be no more present monthly rental, 1 In many cases are less li> sent monthly rental. ""'iits can Include taxed P nee, etc. LONG TIME TO PAY Long term monthly payments automatically pay off Mortgage Without refinancing and without a strain on income. PROMPT SERVICE Immediate attention given to all customers. Being a Miami Institution, all problems can be solved here by Dade Fedtral Loan Committee. A HOME INSTITUTION Personalized handling of your loans by local People interested in local progress and familiar with local conditions. RESOURCES OVER $14,000,000 DADE FEDERAL OF MIAMI 45 NORTH EA5T FIRST AVE. JOSEPH M. LIPTOH ... PRESIDENT where anti-Semitism is still rampant Large scale settlement in Biro-Bidjan, it is argued could be Stalin's contribution to solution of the Jewish problem in Europe ... It is along these lines that discussions will be held in Washington with Soviet diplomatic representatives War and Peace A war novel which will be read long after the war is over is "The Journey Home" by Zelda Popkin, who for many years was connected with the Joint Distribution Committee Published by Lippincott on the eve of the end of the war, the book deals with the feelings of a man in the armed forces when he returns to the United States from "over there" bitter, tired and suspicious ... He finds himself suddenly after the train on which he travels from Miami to his home in New York crashes near the end of the trip .... Normal, human feelings awaken in him when he discovers that he is able to help people during the train wreck The author cleverly selected a Miami-New York crowded train as the scene of her action, since twenty-four hours of travel on a train bring people closer together The variety of passengers on the train, their conversations, the different classes to which they belong form a good pattern of war-time America ... It is to this America that many a soldier returns from overseas, hating everything and resenting sympathy ... He finds love at the end of the journey, after thinking that love is nothing but an old-fashioned word which does not belong in the world of today Mrs. Popkin is the author of a number of successful mystery stories "The Journey Home" is her first novel and it is the kind of a novel of absorbing interest that one wants to read from the beginning to the very end Domestic Issues With the war over, Congress will soon be faced with the problem of what to do with the 211,000 visas to which Germans are entitled yearly under the American immigration quota It is obvious that this country can not afford to admit 29,000 people who for the last twelve years have been indoctrinated with Nazi propaganda ... It is these very same people that the Allies are now trying to keep isolated for years of "re-education" in the democratic way of life Therefore, under dis cussion is a proposal to bar anyone from Germany for the next ten years, except immigrants who can prove that they were anti-Nazis Jews would naturally fall into the latter category Congress will also be asked to allot the German immigration visas to the thousands of refugees who were admitted to this country on "visitors' visas" and who must now return to their native lands from where they fled during the Nazi regime These suggestions, if accepted, would enable the refugees to change their "temporary stay" in the United States to permanent residence as full-fledged immigrants There is also a suggestion that the" German quota for the next five years be divided among Poland, Hungary, Rumania, Greece, Czechoslovakia and Yugoslavia Congress will have to decide whether the immigration quota for Germany should be kept, cut, ended or restricted, and representatives of Jewish I organizations will be asked to testify at special hearings It is obvious that if Germans were admitted under the immigration quota, the Nazi underground movement would flood the United States with spies in an attempt to get hold of the secrets of the atom bomb and other military secrets which might prove useful to them in starting a new devastating war Even children from Germany are not a desirable element in this country, since a study made by the American Military Government established that the children in the Reich are even more pro-Nazi than the adults who understand that Nazism is defeated forever HEADS B'NAI B'RITH AMERICANISM DEPARTMENT Vy T-'-'-% % % ? MRS. KATZ HOSTESS AT COCKTAIL PARTY Mrs. Abe Katz was hostess at a luncheon and cocktail party for 15 hospitalized veterans last Friday at the Roney. Mrs. Katz was assisted by Binne Barnes, film actress, and Mrs. Damon Runyon. Games were arranged for the soldiers, representing cities from coast to coast. All of the soldiers are patients at the AAF Regional and Convalescent Hospital at the Biltmore. This affair was one of a series of weekly events for servicemen, sponsored by different hostesses at the Roney. A. N B. Kapplin, veteran newspaperman and Duluth (Minn.) civic leader, who has been appointed national director of B'nai B'rith's Americanism Department. Mr. Kapplin is now head of the veterans relations program of the Anti-Defamation League, a post which he will retain. DRINK PLENTY OF CTZripure ."'V Water DELIVERED TO YOUR HOME 5-GALLON BOTTLE 70c CASE OF SIX TABLE BOTTLES ... 80c | Plus Botllo Deposit > PHONE 2-4128 N OW, more than ever, you want **to stay on the job and do your full share of the work which must be done. Headache, Muscular Pains, Simple Neuralgia, Functional Monthly Pains slow you down, interfere with your work, spoil your fun. Have you ever tried DR. MILES AnlS-Pain Pills when any of these common pains have made you miserable? Dr. Miles Anti-Pain Pills are pleasant to take, and prompt in action. They do not upset tho stomach or make you constipated. A single tablet usually brings relief. Dr. Miles Anti-Pain Pills are compounded under the supervision of competent chemists. *Get Dr. Miles Anti-Pain Pills at your drug store. Regular package 25*, Economy package $1.00. Read directions and take only as directed. IN WAR OR PEACE When Buying a Home When Selling Your Home You can always be confident of receiving reliable, ethical and specialized service. RAOI0 SERVICEFREE ESTIMATES C "E N T E R DOWNTOWN MIAMI MIAMI BEACH 105 N. E. 2nd St. 1405 Wish. Avt. Ph. 3-3619 Ph. 5-7173 Satisfaction Guaranteed FREE LOAN OF RADIO WHILE WE FIX YOURS FOR SOUTHWEST REAL ESTATE SEE I. S. SHAPOFF 2755 SOUTH WEST 27th AVENUE PHONE 4-7027 PAGE 1 i nt PAGE TEN fjenisti ncrkUan The* Birth of the Atom Bond By LISE MEITNER (Copyright, 1945. by the Jewish Telegraphic Agency Inc.) lKll I'OR > NOTK I" l.is.Melti,,-i ; w r ,.|,l Ji'W i-h ph) -i. i( from V'lrni ho wim foi M*1 b> I tie \ l( % ;i mnii> ilescrlbea in Hi, rollowlnn exeltwlve JowlHh relciti iphl Vi s nrtk-le. i-nblea from Swoiloii ln*i o utory f ""' lui-iii o( the .Horn bomb n wr .. engi % one and even aft i the poss li t> : sui in app .. as been re; 111 pr :'. ill! Indus 1 1 often meets wu great < ... In litM'.ora! scienl .. % ..w he have ilution of a si -i do not pai ticipati technic; So cast as far as 1 [he case of the | de\ A: Dl D E St rass maun -\ rm. phys w :th e. . % % % % % % Us nto nts Dr Otto R V -. Dams % si a 1 ;. % £, xpl; Dr N:e'.s Bohr's n % to a: this process v % st and \ s firs' to t, ..D M I .\ I GENERAL PAINTING % BEST MECHANICS f f :>t -itfj Qivn J. D. Giibreath Pain! Co. PHONE K"C S.* r."j ; 5-09 utilization of this energy for the manufacture of atom bi And when the theoretical possibility of such utilization had been discovered, I, like any other responsible person, hoped that its practical realization would not be possible. Later on, as it became clear 1 that the Germans might succeed in the co ns tructi on ol atom bombs during the war just ended, the forestalling ol tins became, of course, a most i problem foi i ph> sicists of the allied MOO. Tl p< only based n th fear of the consequences I mankind of such utilizal m The scientist is e> er awesti... k at the discovery ol I aw % " nature, ami si thesi laws for th con,. .. p ms w hie i might lead to 1 on <: List seem blasphemy ... Mj int v> st in atomic p iysi< goes' back I n > first year's stud> i ne < itj I \ nna I re 5 w fascinated 1 was hi n, si LISJ wit ' accal; I read n th n 5 at radium by Piern and NIarii Cui i 908, 1 went U B i my scientifu n additi n ti n > with Max G .-sicist w he theor> nd 1918 N i riz w inn< i I egin s expei % work with Dr. Hahn. 1 i this ,vay t etrati the field I % .. years as assistant D ':'. ':' at th '.'-... rs % "... ; % i v. Dr Hahn. 1 was task % ng ... I I :'-.-... R ' thi K. -. W Inst tul Chenv.sti Bei n-Dahlen MONAHAN'S ONE-STOP AUTO SERVICE :.;; s W. Ith Street Hour* J A M ta 3 F.M. Sur-iavi ;. j PHONE C-*266 NOW OPEN FOR DINNER Music by Cy Washburn Bar tad Cocktail Leung* Victor's DRUM Coral Way crt 36th Ave. -;;->!. ; $ .".-M*4 AI Iris k Insurance Agency, Inc -~AV WTLENS Manage : BISOAYXE BI II DING RTTEnTIOn-POREnTS At this Mason ol dM year tl-.r iuMratf c: a'.'. pareoti ^ centered .-:-. Educational instirunona :c: s at hf: child will b^ properly e-iu:c:eThe sure woj d guaranteeing AM -e:e<^crv is .cRcampben dia purpaee :s through L-:e lzpec --...:; % ALEX 5. COHEN Acer.: Phone:-"-" Bertdeuce MQ1] This gave me the opportunity to investigate on a broad basis With a staff of assistants and students, the problems ol natural and. later, artificial transmutation of the elements from their physical side. My life in Berlin also made it possible toi me to follow closely xi losive development ol atomic physics in some of its branch. Thus, when in 1912 Max Von Laue (German p > cist and 1914 N'obi winner! made his gri ai scovery of the interference ol X Ray tin rystalsl we were shown the vi \ first Laue d Whili pi % i : % : '"' : '' " % '" :;\ -\ had been interruped by \v War, the H 1 "' a much ; > i < % % hangi Ever st tration on i I 11 mg isi i i mentary Af tei A rsoi more dill cu p M tner JewWhen 1 % % % % % % cersity rs I longei .ved t leave G nany. 1 Aus s not vi any country. Dutch ssior their govei H ' % % x % -Thus. I c; first 1 [ Cop< "'. s first two atoi j Mi ) % : % % Th energj I it uran -11. it is % find apt plants thus raising i thr Rress Rh A Hunter ami His Trize lad U Roll ttiroro: i ::-,; rve>i^j N .:: Grauo>, 15 >-oc. : % . Hcrmane G <:.-;. ih< - aanhal I % -< 1 % Rt .-. .,' i -." ^. t\i-i ( -<!J i\_;-r_-_. Gen ' KCCMTI Tr< Si: a. Refuse* ><:> ice ~ .J---.J Zad 'XX A.-:eoK-; i' : b :: % tttt x:: il i ." i I -..-.-.'. Ku t-x -': i : peuibk :. :: a oi l!vy-i. ?f.^i<<!.-> r.r> M :mp-:iroit % .< Kmtt .iir rtTott T-< SRS necena i: -rpn lr.x= :-< L-..sj't.>.\rr<*i. KLEINS ELECTRIC WORKS s £ : -. = -: j n A B : S =rz i -?: i-: Si M E::*:i *:: i:tt £ri""= : : : ; =-:-:; MR raiDAY.^UGusr ,, ^ -: EMMM -1 I -. i | ; =:;-i--iNAT G A N S Wf-:.-: -,j 't C;. MB Nrww B :; = .* :* Relatives Scan Vaad Hatzala'lUh A NNOUNCEMENT that 7.500 new names of concentration camp survivors had been received by the Vaad Hatiala Emergency Committee, brought throngs of relatives and friends of Europe's missing Jewry into its offices at 132 Nassau Street. The names were obtained during the past few months while relief teams operating from Switzerland under the direction of Isaac Sternbuch. the Vaad Hatsalas European director, were distributing more than $300,000 worth of food and medical supplies to the freed inmates of Aushwitx. Buchewald. Allendorf and Bergen Belsen concentration camps. Most of the survivors are from Germany. Hungary, the Netherlands and France. More than 15 per cent of the visitors to the Vaad Hattala'i ofi reported they found the BM1M ( relatives whom they had p ven long ago as dead The Vaad Hattala is alioeofa^ in Jewish relief and rescu* or 'i h Russia. Switzerland. Sweden." B* I gium and France In the latter t 0 | countries it has established three orphanages to reclaim for Judaim the many Jewish children ho ire ; being returned by Ctrutian IJBpathizers who had hidden tfc during the Nazi period of occspttion. To meet the iplrftual u *a as the physical needs of the th. sands of Jewish lurvlvon still u large In the liberated areas, tte Vaad has purchased and has placet in operation through UM Ratbiaital Council in Bnglaad .-even SJMgogue-ambulance ni JDC INCREASES MONTHLY APPROPRIATIONS IN ITALY R< me To meet the emersitual .ited by the \ in 9,000 nonItalian Jewisl fugees who end Italy fi m Austria in recent weeks, the Joint Distribution Commit! is been obliged to increase its monthly appropriati n for work in Italy to 5:20.000. the second budget rei-isi in two months. This emerg y situation is no ] nger an Italian problem." ed Reuben Resnik. J.D.C s Milan. He --. an conI non-repat P . .' -. .-. ith srnalle r nun f Hur.ga tan, V;.i -... % R % '.: Resnik I thai :.rof entry into II that camp fac. persons and L*N1 be made a\ that ps> sons. I, i; ho] that manj:! the non-repati eligible for emigrat: n I tine. Encourage mei I seaaet I to stay or. ':.-.% ing soldii I 5 for -.-. % -. % I stated countrii of normal ".:.. Il | ahead for 1 % % % % Stay il HUM aide or return ( % locai ba i patients Cai "-1 % Buy War Bonds and S-.a.-^ MR. SAUL KENHOU Servir.g his ousands of customers en Mi-nu ^ec^: :* many veers announces the reccer.:r.: :: KENHOLZ STRICTLY KOSHER Meats and Poultry 415 Espanola Way MONDAY. SEPTEMBER 3rd PHONE 5-3992 y-; as t^ual the fines: of stripy Kt*tM W^ Prime Meets end choice selecdcr: c: ?:~~: RIVERMONT PARZ SAXITARIVM :: ' -s "-S: =t.~x -.,. :1 1 .-. ... ;i tmm ;.--: l-I ;-. ;-:; S*'.£=££= v r Z % ;..-% !'i.-i: --:!! ^^-:- =fi.-.-. Z:.-;t- "9^ r ROHANS, PAINT AND HARDWARE sTCKt Monahan's Electric 3C4 S. W 22sd AT*. ELECTOCAL App^-c, Rep*-*Preosp< Pics* 4-8*32 ^e-aiers in Prar. 6 Lambert's Pcin.3 6 '_-% Nfl '-me si HARDWARE Mechanical T:c- Garden cmd Eectriccl Supp^** MORRIS ROKINSSY, 0=e: 4106 ROYAL PALM AVENUE MIAMI BEACH % szss PAGE 1 FRIDAY, AUGUST 31. 1945 'Jewistifkric/nr PAGE ELEVEN THE JEWISH QUIZ BOX By Rabbi Samuel J. Fox (Copyright, 1945, J. T. A.) QUESTION: What are "Selichos? ANSWER: The colloquial expression "Selichos" refers to I penitential prayers that are offered at different times for the gake of admission of guilt and the solicitation of divine forgiveness. In the amalgamation of Jewish prayers there are many sorts of prayers. The word "Selichoh" literally translated means "forgiveness." The Taanaitic literature usually describes the origin of the "Selichoth" prayers as a method described to King David through divine Revelation. David is said to have become alarmed at the trials and tribulations of his people and was seeking some means of forgiveness for their sins when the Almighty advised him for REST CONVALESCENCl ICHRONICCASEJ -RqyPark Health Resort ask for KOSHER ZION PRODUCTS at your LOCAL DELICATESSEN THIS LABEL Insures Your Health U. S. Gov't. Inspected Demand It! DELICIOUS SALAMI WEINERS CORNED BEEF PASTRAMI Kosher Zion Sausage Co. CHICAGO II You Are in Need of Kosher Zion ProductsCall Florida Provision Co., Inc. Operated by Pearl Bros. SOLE DISTRIBUTORS 1725 N. W. 7th Avenue PHONE 2-6141 to gather his people together whenever a crucial moment would arise and to offer prayers of repentance and forgiveness QUESTION: Why arc Selichos Bald before Rosh Hashana (New ANSWER: The New Year being a day of judgment, is to be considered a crucial period in the life of men. It was therefore deemed advisable to recite special penitential prayers before the New Year begins as well as in the New Year's service and for ten days following, including the Day of Atonement. Furthermore, the rabbis ordered every man to consider himself as a sacrifice (since personal sacrifice is a feature of atonement) on the Day of Judgment. As was the case with ritualistic animal sacrifices, four days of segregation was required in order to heed the object from becoming imperfect. Man, on his day of judgment is hence, also asked to prepare himself at least four days in advance. If there are less than four days between the Sabbath preceding the New Year and the New Year itself, the Selichos services (as is the case this year) start on the preceding Sabbath. QUESTION: Why must the High Holiday selichoth services begin at midnight Saturday night? ANSWER: It was desired to start the week off with sentiments of penitence, and so with the dismissal of the Sabbath, penitence is immediately begun. The midnight hour has long been known as one of silence and awe, thereby promoting introspective thoughts. It is for this same reason that the Selichos on the following days are said before the break of dawn when we are likely to submerge our minds into serious thinking. MIAMI SERVICE LEAGUE PLANS FOR INSTALLATION DADE CITIZENS MAY OBTAIN F.H.A. LOANS Keep on Buying War Bonds and Stamps. REV. S. J. FREEDMAN'S HEBREW BOOK STORE Formerly of Newark, New Jersey Is now located 327 WASHINGTON AVENUE Near Third St., Miami Beach. Fla. In Freedman's Hebrew Book Store, you will find a complete assortment of all religious books in Hebrew and English Torahs, Talaisim, Tfilin. Mezuzas, Mentalach, etc.A large variety of Palestine and American Hebrew novelties. An Assortment of New Year Cards ALL AT REASONABLE TRICES The only store of Its kind In FloridaAlso country orders taken and promptly filled. TOP SOIL 3-0561 GRADE A PULVERIZED and PROCESSED MUCK and MARL. Any Mixture No Shells or Weeds BITTER BLUE SOD Soil and Fill of Any Kind Landscaping Estimates All Work Guaranteed MIAMI TOP SOIL CO. Ed. Alper I WANT MY MILK Estab. 1924 And B* Sura If % FLORIDA DAIRIES HOMOGENIZED Vitamin "D" Milk "Milk Product*" Dacro Protected TEL. 2-2621 Greater Miami Delivery Visit Our Farm at 6200 N. W. 32nd StrMt At the last meeting of the Miami Service League, held August 20 at the Y.M.H.A., plans were completed for the installation luncheon to be held at Victor's Drum on Wednesday, Octo% ber 3, at 12:30 noon. Mrs. Henry : kieen, chairman, announced 1 that Mr. Joseph Rose, executive \ director of the Greater Miami Jewish Federation, will be guest speaker. Officers to be installed are Mrs. Murray Koven, honor\ ary president; Mrs. George Chertkof, president; Mrs. Hen' ry Kauffman, first vice-president; Mrs. Leon -Kaplan, second vice-president; Mrs. Freda LeI vine, secretary; Mrs. Jacob Stone; corresponding secretary, and Mrs. William Weintraub, treasurer. The next meeting will be held on Monday, September 3, at 8 P. M. LEGAL NOTICES i.i NOTICE IS HEREBY GIVEN that % undersigned, desiring to engage business under the ficltious name SNO-CREME, .,i 6 W. Flagler St.. ami, Florida, intends to register id name with the Clerk of the i'lilt Court of Dads County, Florida. ARTHl'U ii. BRESSLER ROSE FREEMAN EON KAPLAN Attorney for Applicants. 8 11 9/7-14-21-28 Any qualified citizen of Dade county who resides within the corporate limits of Miami or other municipalities in this area, can still obtain the aid of the FHA in dealing with his postwar building or improvement Erogram, as materials and labor ecome available. This is revealed in a statement issued here by Paul J. O'Connor, FHA area director for 14 South Florida counties. Quoting from a statement issued by Commissioner Raymond M. Foley, of the FHA, Washington, Mr. O'Connor told what the Federal Housing administration will do to speed postwar home building and modernization in Miami, Dade county and in the United States. "More than 10,000 private financial institutions in every part of the United States are ready to start on the financing of America's postwar home building and modernization program. LEGAL NOTICES NOTICE IS HEREBY GIVEN that the undersigned, desiring to engage In business under tinfictitious name of HERBERT'S RESTAl'RANT. Intend to register said name with the Clerk of the Circuit Court of Dade County, Florida. DAVID SCHILLER IGNATZ I.El! MEYERS & VYEITZMAN Attorneys for Applicants 7/10-17-24-31 9/7 Notice Is hereby given that the Undersigned, desiring to engage in biisim-SH under the fictitious name of CHARLES AI'ART.MENTS at 750 Pennsylvania Avenue. Miami Beach, intend to register said name with tinClerk of the Circuit Court of Hade County, Florida. ABRAM WASHERMANMOI.I.IE W. MARCl'S JULIUS WASHERMAN MARY WA8SERMAN LIANA COOPERSMITH Attorney for Applicants 8/10-17-24-31 9/7 NOTICE IS HEREBY GIVEN that the undersigned, desiring to engage in business under the fictitious name of STEVENS MARKETS at Jar.' i'"nee He Leon Boulevard, Coral Gables, Florida. Intends t" register said name with the Clerk of the Circuit Court of Had.County, Florida. STEVENS MARKET NO. 2, Inc., A Florida corporal ion. By: MAX STEVENS, President Attest: IRVING EPSTEIN, Secretary MYERS .v HEIMAN Attorneys for Applicant 8 24-31 9/7-14-21 NOTICE IS HEREBY GIVEN that the undersigned, desiring to engage in business under the fictitious name of STEVENS MARKETS at 2201 N. W. 02nd Street. Miami Florida intends to register said name with the Clerk of the Circuit Court of Dade County, Florida. STEVENS MARKET NO. 1. INC., A Florida corporation. By: MAX STEVENS, President Atte-t : IRVING EPSTEIN. Secretary MYERS & HEIMAN Attorneys for Applicant 8 24-31 '.i 7-14-L'l NOTICE IS HEREBY GIVEN that the undersigned, desiring to engage in business under the fictitious name of STEVENS MARKETS at 1060 S W. :7th Avenue, Miami, Florida Intends to register said name with the Clerk of the Circuit Court of Dade Countv. Florida. STEVENS MARKET NO. 3. INC. A Florida corporation. By: MAX STEVENS, President Attest: IRVING EPSTEIN, Secretary MYERS .v HEIMAN Attorneys for Applicant 8/24-31 9/7-14-21 IN THE CIRCIIT COPRT OF THE ELEVENTH JUDICIAL CIRCUIT OF FI>)P.I|1A. IN AND FOR DADE COUNTY. IN CHANCERY. No. 03985 DIANE WIXMAN. Plaintiff. vs. LEO WIXMAN. Defendant ORDER OF PUBLICATION TO: LEO WIXMAN. 75th AAFBU. A.U.S., Ashvllle, North Carolina: You are hereby ordered to file your appearance or answer to the Bill of Complaint for Divorce filed against you by DIANE WIXMAN, on or before the 2" day of September. 1946, otherwise the allegations of said Bill will be taken as confessed against DONE AND ORDERED this 28 day of August. A.D.. 1945. E. B. LEATHERMAN. Clerk of Circuit Court. By Wit. W. STOCKING. D. C. (Circuit Court Seal) HAROLD Tl'ltK. Solicitor for Plaintiff. 8/31 9/7-14-21 IN THE CIRCFIT COPRT OF THE ELEVENTH JUDICIAL CIRCUIT OP EUlRIDA. IN AND FOR DADE COUNTY. IN CHANCERY. Case Number 93982 ORDER FOR PUBLICATION MARION CATHERINE MORAL. Plaintiff, vs. SIMPLICIO T. MORAL, Defendant. TO: Slmpliclo T. Moral c/o St. Alba ns Hotel. New York, New York. You are hereby ordered to file your appearance or answer to the Bill of Complaint for Divorce in the above styled cause, on the 28 day of September, 1941, or a Decree Pro Confess., will be entered against you. It Is further ordered that the Jewish Floridian Is the newspaper In which this order shall be published once a week for four (4) consecutive weeks. This 2S dav of August. 194.1. B. B LEATHERMAN, Clerk Circuit Court 11th Judicial Circuit. Dade County. Fiords, By T. M. WORDEN. Deputy Clerk (Circuit Court Seal) DeCOSTAS A MAER Attorneys for Plaintiff inm-inn." Blsoayne Bldg. Miami 32. Florida 8/31 9/7-14-21 NOTICE IS HEREBY GIVEN that the undersigned, desiring to engage In business under the fictitious name of A & B GARMENT COMPANY, not Inc.. Intends to register said name with the Clerk of the Circuit Court of Dade County. Florida. AARON BERKOWITZ PAUL WEIT7.MAN Attorney for Appllcant^^ ^ Freedom of speech does not mean careless talk! NOTICE IS HEREBY GIVEN that [he undersigned, desiring to engage in business under the ficltlous name of LA INDIA BONITA GIFTS at 216 V H. 1st Street Intends to register said name with the Clerk of the Circuit Court of Dade 'Hintv. Florida. MYERS fiKBifr* SDfeBRMi MEMOBIAI. CHAPEL THOS, M, BURNS, JR. % .?fol DirectorABE EISENBERQ T**r 5-7777 HtrasiPE AMBULANCE SEBVICE .' % JL& % U36 Washington Are. MEUMni 8ch '.$tfc St.. ad AnwtHn Are. NOTICE IS HEREBY GIVEN that the undersigned, desiring to engage In business under the fictitious name or ROBERTS at 50 N. W. 1st St.. Int> mis to register said name with the clerk of ttumcircult Court of Dade County. FldHhi. REPBEN GREENBERG Mil.TON A. FRIEDMAN Attorney for Applicant 8 10-17-24-30 9/7 NOTICE IS HEREBY GIVEN that the undersigned, desiring to engage In business under the fictitious name of ELECTRIX APPLIANCE & REPAIR SHOP at 27B7 S. W. 27th Ave.. intends to register said name with the Clerk of the Circuit Court of Dade County, Florida. GEORGE ROSENE MARN FEINP.ERG Attorney for Applicant S/1O-17-21-30 9/7 NOTICE OF APPLICATION FOR TAX DEED FILE 39SGS Notice Is hereby given that Vivian Randolph, holder as assignee of City of Miami. Tax Certificate num bered 4094, dated the 7th day of June, A. D. 1943. has filed said Certificate In my office, and has made application for tax deed to Issue thereon In accordance with law. Said Certificate embraces the following described property, situated in Dade Countv, Florida, to-wit: Ixit 44.1, Auburndale Tamiaml Trail Addition. Plat Book 15, Page 16, In the City of Miami, County of Dade, State of Florida. The assessment of said property under the Certificate issued was In the name of Pnknown unless said Certificate shall he redeemed according to law, tax deed will issue thereon on the 12th day of September, A.D, 1945. Dated this 8th day of August, A.D. 1945, (Circuit Court Seal) E. B. LEATHERMAN Clerk of Circuit Court, Dade County. Florida By N. C. STERRETT. D. C. 8/10-17-24-31 9/7 A CHASE FEDERAL HOME LOAN OFFERS YOU Low Interest Rates Small MonthlyPayments No Loan Fees (Actual Cost Only) No Charge ior Prepayment 'We also make loans ior periods not exceeding five years without monthly payments 1111 Lincoln Road 1 2 Block East oi Alton CHASE FEDERAL 1 *fc. jy 1 J, !'..' % Mk^B^BfiiMlMHi PAGE 1 PAGE TWELVE Jew 1stflcridliair Face Facts George J. Talianoff Executive Director A.D.L. The Assistant Secretary of War has announced that 83 Miami Beach hotels, which had been in service more than three years, are to receive their honorable discharge around November 15. Miami Beach can truly be proud of the role played by the hotels, which represent the community's largest industry, in the successful completion of the war. The hotels provided the facilities which, at the outbreak of the war, enabled 25 per cent of the officers and 20 per cent of the ground crew of our tremendous air force to be trained in this community. During this past year the hotel facilities made possible the largest of five redistribution stations in the country. It is increasingly evident that Miami Beach, a relatively small community, has contributed much to the success of our military might. High praise is due many organizations and many individuals for their unstinting efforts in behalf of the thousands of service personnel who have passed through this area. Their selfless efforts would fill a large volume, and space in this column docs not permit the enumeration of all their contributions. Today, however, we wish to pay tribute to those who have made possible the Miami Beach Snack Bar which, in the four ^j710 S. W. 12th AV. MIAMH X-JUL I'HllA YOUR JEWISH FUNERAL HOME WE OFFICIALLY REPRESENT THE MAJORITY OF NORTHERN JEWISH FUNERAL HOMES Information Gladly Furnished on Req\.eJ SERVING MIAMI BEACH I MIAMI Exclusively Jewish -2.4 HOURv JOS. L. PLUMMER FUNERAL DIRECTOR months of its operation, has done much to engender good-will and improved relations between the military and civilians. The Snack Bar became a reality on May 2, 1945. It was a long felt need as far back as June, 1944 when we surveyed the area and noted the absence of an effective medium whereby the Jewish community could conduct war service work directly with servicemen of all faiths, thus giving our veterans a true impression of representative patriotic Jews. From its very first day, the operation of the Snack Bar was an assured success. Its popularity spread rapidly among servicemen stationed in and about this area. Staffed by 400 Jewish hosts and hostesses, the Snack Bar has served approximately 7,000 servicemen and their families and friends weekly. The semi-annual report of the Florida Regional Office of the Anti-Defamation League dated Julv 1, 1945 pays high tnli ite to those who have made possible this splendid public relations project. The report reads in part: "To the men and women volunteers at the Snack Bar who have given unstintingly of their efforts, as well as the Jew staff members, should go the credit for the success of this project." An example of the unselfish spirit motivating these volunteers is that shown by the chairman of the Snack Bar, Carl Weinkle. During the construction of the Snack Bar. he worked day and night in its organization and in preparation for its opening. Thereafter, in addition In his dunes as chairman, he has donned an apron to work a shift (and usually more) weekly. Without thought of reward or recognition, he, like so many volunteers, have worked arduously and selflessly. Our community is indeed proud of men like Carl Weinkle and the hundreds of hosts and hostesses he typifies, who have made possible the success of the Snack Bar. IN THE MAIL BOX .Ht SSSssn TtjGUST BROS;.RV£ Is the BEST Buy Mere War Bonds. THIS SUMMER... &fUf thM CMackitcne COMPLETE WINTER LUXURIES AT LOW SUMMER RATES. MVATE POOL-aUKAf-MARINE DECK TROPICAL GARDENS PATIO 250 ROOMS* BATHS Phone 58-1811 %BLIICI:STMH: \each IIHIIIHIIIIHIIII ITOUBY I PAINTING ICO. Rabbinical Association Urges Stores To Close for Holidays Jewish Floridian Miami. Fla. The Rabbinical Association ot Greater Miami requests all merchants of our faith to close their stores during the High Holy Days. We know that the great majority of our people realize the solemnity of these days and will remain closed on September 8 and September 17. Yet. in the past, there have been some who have failed to close their businesses on Rosh Hashana and Yom Kippur. This, not only has reflected unfavorably upon us from a religious standpoint, but also has adversely affected our relationship with those not of our faith. Our observance of our religion has brought us admiration from all men in all times. Let us not lose our own dignity and the admiration of our community at this time. We pray for a truly happy New Year for all. .... Greater Miami Rabbinical Association Rabbi Jacob H. Kaplan. President Sports Brevities Now that his charley horses have cleared up Hank Greenberg is murdering the ball at a .350 clip with an average of .304 for the season. He is hitting the long ball, too, strong proof that he has not lost his eye as so many claim. Hank thinks returning vets will benefit more by putting in a spring training season before tackling the game as he did without any warm-up. Incidentally Hank recently received a Ford auto franchise for New York City from none other than Henry Ford himself. Can it be the Detroit motor magnate's conscience is bothering him? The good burghers of Flatbush gave Goody Rosen a day last Sunday at Ebbets Field. Ever since Goody has been in a batting slump going from bad to worse. Against the western nines Roscy has been hitting a cool .239 to drop him from top to third place in the National League batting race, he is still boasting a .345 average. Goody received a wrist watch and two boxes of cigars. You never see the Toronto lad without a stogie in his mouth. He generally sits behind us at Madison Square Garden on fight nights and is never without a cigar in his mouth. The weed looks like a bat in his mouth, it's so big. Roy Zimmerman reported to the Giants but as yet can't get Mike Schmer off base. Mike has impressed Ott with his hustle and steady hitting. NEW REPRESENTATIVE FOR JOINT DEFENSE APPEAL 3 SOCOI L IUHS £D ANDINSURED CONTRACTORS = 669 N.W.6^ St reek. MIAMI 36. FLORIDA IIIIIBHIIHIIIIHIIIIWIIIBIIIIHIIIIpjIlli JEWISH CALENDAR All Holidays and Fast Days begin at sunset of the day preceding the dates given below: 1945 ROSH HASHONAH Saturday. Sept. 8 Sunday. Sept. 9 YOM KIPPUR Monday. Sept. 17 SUCCOTH Saturday. Sept. 22 to Sunday. Sept. 30 CHANUKAH First Candle. Friday. Nov. 30 YIZKOR or Memorial Services for the d parted are conducted on the fol> lowing Holidays: YOM KIPPUR Monday. Sept. 17 George A. Levy (above), veteran welfare worker and community leader, will now serve as the southern representative for the Joint Defense Appeal of the American Jewish Committee and the Anti-Defamation League of B'nai B'rith. He is the former executive director of the Dallas Jewish Federation, former city manager of Denver, and well known writer on city planning and municipal government. His affiliation with the Joint Defense Appeal was announced by Nathan M. Ohrbach, national chairman. Your Complete Department Store With Quality Merchandise Washington Ave. at 13th St. Miami Beach And for your convenience Morris Brother's New Apparel and Accessory Store 70 E. Flagler St.. Miami Rabbi Joseph E. R ack 152 S.W.5thSt. Phone 2-7439 GORDON ROOFrNfT^T SHEET METAL WOlff 414 S. W. 22n'd A" U PHONE 4-5860 ONETAIDAY, VITAMIN J=iTAi7lT$ 'piIINK of ill Ynurmln. imum dally riuirre. Read direction.^ UBC only as directed. Alka-Seltzer WHEN Headache, Mat" cular Paina or Siir.pl. Neoralna. Diatreu after ,"' % ' % "> Stomach, or "MornlnaAfter" interfere with your work or spoil your fun, try Alka-Seltier. nEiu BiscnvnE RREIM S. W. 4th ST. AT MIAMI AVE. BOXING WRESTLING MONDAY NTTE FRIDAY NITE MONDAY NTTE 111 FRIDAY NTTE FOR RESERVATIONS CALL SAM'S NEWS STAND 3-123 6 DINE IN COMFORT AT THE STRAND RESTAURANT Washington Ave. at 12th St., Miami Beach OPEN ALL YEAR AIR CONDITIONED ilmln Hi.M.iimueim-m or Hie Itrlainnl llwuvra .1 Huffman'*) Telephone 58-2979 Palm Beach MRS. MABY SCHREBNICX Representative ALFAR CP.CAMCPy cc^> FOR THE BEST IN DAIRY PRODUCTS WEST PALM BEACH MILK CREAMICE CREAM AMBULANCE SERVICE MIZZELL SIMON MORTUARY 413 Hibiscus Street Phone 8121 West Palm Beach, Fla LAINHART & POTTER ESTABLISHER 1893 "BUILDING MATERIAL FOR PARTICULAR BUILDERS Phone 5191 West Palm Beach, Fla FERGUSON FUNERAL HOME,Inc. 1201 South Olive Avenue WEST PALM BEACH PHONE 5172 SOUTHERN DAIRIES Serving Palm Beach County. f "' u £f 9 p t0 j Nationally Famous Southern Dain* MILK AS NEAR TO YOU AS YOUR W 0 !" "^-V^*-W-^N^^r-H-%--V*^" C. W. SMITH PLUMBING CONTRACTOR 529 Independence Road. West Palm Beach No job too large or too small. Over 50 years in bus"" *> *>^w> *ML. r ' i N. r; 1 > / / PAGE 1 r i N. r; % 1 > / / xml version 1.0 standalone yes Volume_Errors Errors PageID P4 ErrorID 1003 ErrorText Text light P8 1003 Text light P16 1003 Text light P20 1004 Text is light
http://ufdc.ufl.edu/AA00010090/00917
CC-MAIN-2014-15
refinedweb
16,613
63.8
Windows Communication Foundation From the Inside When using a typed contract, incoming messages on the server are shredded on your behalf to be turned into method calls and parameters. Ordinarily, the particular method call selected for an application messages will have the same parameterized contract as the message. This allows the transformation between messages and parameters to be made with a high degree of fidelity. However, operations also permit fault responses in addition to the normal application response. The parameterized fault contract is going to look nothing like the standard application contract. Therefore, there's really no transformation that will take you from the fault message to the same parameterized contract in a way that makes any sense. The response that comes back from the server is unrepresentable using the standard data structure that the application is expecting to receive for an application response. This is why with a typed contract fault messages have to be expressed as an exceptional condition. Exceptions tend to transform the message with a much lower fidelity to the original content. With an untyped contract, incoming messages on the server are not shredded on your behalf but rather preserved in their entirety. You can think about this as performing the transformation between messages and parameters with perfect fidelity since the parameter is equal to the message. Similarly, any message response, whether it's a fault response or a normal application response, is also going to be representable with perfect fidelity. Both types of responses have the same format with an untyped contract so the application can handle them equally well. This is why with an untyped contract fault messages are preserved as messages. One of the major reasons for using untyped contracts is to have great fidelity with the wire. It wouldn't make sense to force the application to lose that fidelity for a certain class of messages. If you choose to in your application though, you can still run the same exception machinery. For details, read some of the past articles on creating and consuming faults. Next time: Streaming Web Content How do I write a contract for a wrapped message in the default namespace? I've written a quick sample
http://blogs.msdn.com/drnick/archive/2008/08/15/using-faults-with-untyped-messages.aspx
crawl-002
refinedweb
368
53
In addition to what’s in Anaconda, this lecture uses the quantecon library. !pip install --upgrade quantecon We’ll also need the following imports: import matplotlib.pyplot as plt %matplotlib inline import numpy as np import scipy.linalg as la from quantecon import Kalman from quantecon import LinearStateSpace from scipy.stats import norm np.set_printoptions(linewidth=120, precision=4, suppress=True) Friedman (1956) and Muth (1960)¶ Milton Friedman [Fri56] (1956) posited that consumer’s forecast their future disposable income with the adaptive expectations scheme $$ y_{t+i,t}^* = K \sum_{j=0}^\infty (1 - K)^j y_{t-j} \tag{1} $$ where $ K \in (0,1) $ and $ y_{t+i,t}^* $ is a forecast of future $ y $ over horizon $ i $. Milton Friedman justified the exponential smoothing forecasting scheme (1) informally, noting that it seemed a plausible way to use past income to forecast future income. In his first paper about rational expectations, John F. Muth [Mut60] reverse-engineered a univariate stochastic process $ \{y_t\}_{t=- \infty}^\infty $ for which Milton Friedman’s adaptive expectations scheme gives linear least forecasts of $ y_{t+j} $ for any horizon $ i $. Muth sought a setting and a sense in which Friedman’s forecasting scheme is optimal. That is, Muth asked for what optimal forecasting question is Milton Friedman’s adaptive expectation scheme the answer. Muth (1960) used classical prediction methods based on lag-operators and $ z $-transforms to find the answer to his question. Please see lectures Classical Control with Linear Algebra and Classical Filtering and Prediction with Linear Algebra for an introduction to the classical tools that Muth used. Rather than using those classical tools, in this lecture we apply the Kalman filter to express the heart of Muth’s analysis concisely. The lecture First Look at Kalman Filter describes the Kalman filter. We’ll use limiting versions of the Kalman filter corresponding to what are called stationary values in that lecture. A Process for Which Adaptive Expectations are Optimal¶ Suppose that an observable $ y_t $ is the sum of an unobserved random walk $ x_t $ and an IID shock $ \epsilon_{2,t} $: $$ \begin{aligned} x_{t+1} & = x_t + \sigma_x \epsilon_{1,t+1} \cr y_t & = x_t + \sigma_y \epsilon_{2,t} \end{aligned} \tag{2} $$ where$$ \begin{bmatrix} \epsilon_{1,t+1} \cr \epsilon_{2,t} \end{bmatrix} \sim {\mathcal N} (0, I) $$ is an IID process. Note: A property of the state-space representation (2) is that in general neither $ \epsilon_{1,t} $ nor $ \epsilon_{2,t} $ is in the space spanned by square-summable linear combinations of $ y_t, y_{t-1}, \ldots $. In general $ \begin{bmatrix} \epsilon_{1,t} \cr \epsilon_{2t} \end{bmatrix} $ has more information about future $ y_{t+j} $’s than is contained in $ y_t, y_{t-1}, \ldots $. We can use the asymptotic or stationary values of the Kalman gain and the one-step-ahead conditional state covariance matrix to compute a time-invariant innovations representation $$ \begin{aligned} \hat x_{t+1} & = \hat x_t + K a_t \cr y_t & = \hat x_t + a_t \end{aligned} \tag{3} $$ where $ \hat x_t = E [x_t | y_{t-1}, y_{t-2}, \ldots ] $ and $ a_t = y_t - E[y_t |y_{t-1}, y_{t-2}, \ldots ] $. Note: A key property about an innovations representation is that $ a_t $ is in the space spanned by square summable linear combinations of $ y_t, y_{t-1}, \ldots $. For more ramifications of this property, see the lectures Shock Non-Invertibility and Recursive Models of Dynamic Linear Economies. Later we’ll stack these state-space systems (2) and (3) to display some classic findings of Muth. But first, let’s create an instance of the state-space system (2) then apply the quantecon Kalman class, then uses it to construct the associated “innovations representation” # Make some parameter choices # sigx/sigy are state noise std err and measurement noise std err μ_0, σ_x, σ_y = 10, 1, 5 # Create a LinearStateSpace object A, C, G, H = 1, σ_x, 1, σ_y ss = LinearStateSpace(A, C, G, H, mu_0=μ_0) # Set prior and initialize the Kalman type x_hat_0, Σ_0 = 10, 1 kmuth = Kalman(ss, x_hat_0, Σ_0) # Computes stationary values which we need for the innovation # representation S1, K1 = kmuth.stationary_values() # Form innovation representation state-space Ak, Ck, Gk, Hk = A, K1, G, 1 ssk = LinearStateSpace(Ak, Ck, Gk, Hk, mu_0=x_hat_0) Some Useful State-Space Math¶ Now we want to map the time-invariant innovations representation (3) and the original state-space system (2) into a convenient form for deducing the impulse responses from the original shocks to the $ x_t $ and $ \hat x_t $. Putting both of these representations into a single state-space system is yet another application of the insight that “finding the state is an art”. We’ll define a state vector and appropriate state-space matrices that allow us to represent both systems in one fell swoop. Note that$$ a_t = x_t + \sigma_y \epsilon_{2,t} - \hat x_t $$ so that$$ \begin{aligned} \hat x_{t+1} & = \hat x_t + K (x_t + \sigma_y \epsilon_{2,t} - \hat x_t) \cr & = (1-K) \hat x_t + K x_t + K \sigma_y \epsilon_{2,t} \end{aligned} $$ The stacked system$$ \begin{bmatrix} x_{t+1} \cr \hat x_{t+1} \cr \epsilon_{2,t+1} \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0 \cr K & (1-K) & K \sigma_y \cr 0 & 0 & 0 \end{bmatrix} \begin{bmatrix} x_{t} \cr \hat x_t \cr \epsilon_{2,t} \end{bmatrix}+ \begin{bmatrix} \sigma_x & 0 \cr 0 & 0 \cr 0 & 1 \end{bmatrix} \begin{bmatrix} \epsilon_{1,t+1} \cr \epsilon_{2,t+1} \end{bmatrix} $$$$ \begin{bmatrix} y_t \cr a_t \end{bmatrix} = \begin{bmatrix} 1 & 0 & \sigma_y \cr 1 & -1 & \sigma_y \end{bmatrix} \begin{bmatrix} x_{t} \cr \hat x_t \cr \epsilon_{2,t} \end{bmatrix} $$ is a state-space system that tells us how the shocks $ \begin{bmatrix} \epsilon_{1,t+1} \cr \epsilon_{2,t+1} \end{bmatrix} $ affect states $ \hat x_{t+1}, x_t $, the observable $ y_t $, and the innovation $ a_t $. With this tool at our disposal, let’s form the composite system and simulate it # Create grand state-space for y_t, a_t as observed vars -- Use # stacking trick above Af = np.array([[ 1, 0, 0], [K1, 1 - K1, K1 * σ_y], [ 0, 0, 0]]) Cf = np.array([[σ_x, 0], [ 0, K1 * σ_y], [ 0, 1]]) Gf = np.array([[1, 0, σ_y], [1, -1, σ_y]]) μ_true, μ_prior = 10, 10 μ_f = np.array([μ_true, μ_prior, 0]).reshape(3, 1) # Create the state-space ssf = LinearStateSpace(Af, Cf, Gf, mu_0=μ_f) # Draw observations of y from the state-space model N = 50 xf, yf = ssf.simulate(N) print(f"Kalman gain = {K1}") print(f"Conditional variance = {S1}") Kalman gain = [[0.181]] Conditional variance = [[5.5249]] Now that we have simulated our joint system, we have $ x_t $, $ \hat{x_t} $, and $ y_t $. We can now investigate how these variables are related by plotting some key objects. fig, ax = plt.subplots() ax.plot(xf[0, :], label="$x_t$") ax.plot(xf[1, :], label="Filtered $x_t$") ax.legend() ax.set_xlabel("Time") ax.set_title(r"$x$ vs $\hat{x}$") plt.show() Note how $ x_t $ and $ \hat{x_t} $ differ. For Friedman, $ \hat x_t $ and not $ x_t $ is the consumer’s idea about her/his permanent income. fig, ax = plt.subplots() ax.plot(yf[0, :], label="y") ax.plot(xf[0, :], label="x") ax.legend() ax.set_title(r"$x$ and $y$") ax.set_xlabel("Time") plt.show() We see above that $ y $ seems to look like white noise around the values of $ x $. fig, ax = plt.subplots() ax.plot(yf[1, :], label="a") ax.legend() ax.set_title(r"Innovation $a_t$") ax.set_xlabel("Time") plt.show() MA and AR Representations¶ Now we shall extract from the Kalman instance kmuth coefficients of - a fundamental moving average representation that represents $ y_t $ as a one-sided moving sum of current and past $ a_t $s that are square summable linear combinations of $ y_t, y_{t-1}, \ldots $. - a univariate autoregression representation that depicts the coefficients in a linear least square projection of $ y_t $ on the semi-infinite history $ y_{t-1}, y_{t-2}, \ldots $. Then we’ll plot each of them # Kalman Methods for MA and VAR coefs_ma = kmuth.stationary_coefficients(5, "ma") coefs_var = kmuth.stationary_coefficients(5, "var") # Coefficients come in a list of arrays, but we # want to plot them and so need to stack into an array coefs_ma_array = np.vstack(coefs_ma) coefs_var_array = np.vstack(coefs_var) fig, ax = plt.subplots(2) ax[0].plot(coefs_ma_array, label="MA") ax[0].legend() ax[1].plot(coefs_var_array, label="VAR") ax[1].legend() plt.show() The moving average coefficients in the top panel show tell-tale signs of $ y_t $ being a process whose first difference is a first-order autoregression. The autoregressive coefficients decline geometrically with decay rate $ (1-K) $. These are exactly the target outcomes that Muth (1960) aimed to reverse engineer print(f'decay parameter 1 - K1 = {1 - K1}') decay parameter 1 - K1 = [[0.819]]
https://python-advanced.quantecon.org/muth_kalman.html
CC-MAIN-2020-40
refinedweb
1,475
52.49
This is kind of an extension from a previous post that I did. The following code I got from KevinWorkman and it deals with loading a wav file as a resource. I took Kevin's code and created a stand alone program to see if it works. I can get it to compile and run without errors but no sound plays. I'm using Eclipse IDE. I've imported the wav file into the src directory which contains the class that calls the resource. I've also imported it into the root directory of the project itself. I've used a forward slash at the beginning of the file name. I also tried to just load it as a File instead of using getClass().getResource("boxing_bell.wav"); I can't get it to play. I'm at a complete loss. Here's the code: Code Java: public class playClip { private Clip music; private void startSong(){ try{ System.out.println("Starting...\n"); AudioInputStream stream = AudioSystem.getAudioInputStream( getClass().getResource("boxing_bell.wav")); // AudioInputStream stream = AudioSystem.getAudioInputStream(new File("boxing_bell.wav")); music = AudioSystem.getClip(); music.open(stream); music.start(); System.out.println("Done...\n"); } catch(Exception e){ e.printStackTrace(); music = null; } } public static void main(String args[]) { playClip play = new playClip(); play.startSong(); } } I also tried making a resource directory within the src directory and including that in the build path. Any ideas of what I'm doing wrong? I think it has more to do with Eclipse than the code. The reason I say this is I found a book on Safari Online that is almost identical to the code above. Can you say "Clueless!" Thanks Curt
http://www.javaprogrammingforums.com/%20whats-wrong-my-code/9217-more-getresource-eclipse-question-printingthethread.html
CC-MAIN-2015-27
refinedweb
274
60.51
Facelets seems to really scratch an itch for the JSF development community. I've gotten a lot of positive feedback from my first article about Facelets, and I'm looking forward to showing you more fun stuff you can do with Facelets in this article. Kudos to Jacob Hookom and everyone else involved in the development of Facelets! In my last article, I introduced the concept behind Facelets and showed you how to create and manipulate its HTML-style templates and reusable composition components. In this article, I build on that discussion, using many of the same examples and components I introduced then. For starters, I show you a pain-free way to do Internationalization using a Facelets expression language (EL) function. Next, I show you how to create reasonable defaults and custom logic tags. Finally, I show you how to do lightweight metaprogramming in Facelets. Because so many of the examples in this article build on the ones from my previous article, I strongly suggest you read that article first. You might also want to download the example code for this article and install Facelets (and Tomahawk) before going further. Internationalization made easy Internationalization doesn't have to hurt when you're working with Facelets. For the first exercise, I show you how to extend the field composition component from the last article to work with dates, Booleans, and all manner of Java types that should be displayed as text. I also show you how to use reasonable defaults to internationalize the label for the field. Recall from last time that the field composition component uses the field name as its default label if the label is not passed, as shown here: Say you would like to change that. Instead of loading the fieldName as its default label, you want the field composition component to look up the fieldName in the resource bundle associated with Faces. For this, you create a tag library that defines tags and EL functions. First, you create an EL function that looks up a fieldName in the resource bundle. If it can't find the label in the resource bundle, it tries to generate a fieldName based on the camel case of the given fieldName. Listing 1 shows an example usage: Listing 1. Example usage of the EL function In Listing 1, I the EL function arc:getFieldLabel(fieldName,namespace) to look up the fieldName in the resource bundle associated with Faces. The getFieldLabel() method actually looks up the label in the resource bundle. Here are the steps to create an EL function: - Create a TagLibraryclass. - Create a Java utility class. - Register the getFieldLabel()method. - Register the TagLibraryclass. - Register the facelets-taglib descriptor file. The following sections explain these steps one by one and show you how to use your new EL function. Step 1. Create a TagLibrary class EL functions and logic tags are defined in a Facelets TagLibrary class. To create a TagLibrary, class you need to subclass AbstractTagLibrary, as shown in Listing 2: Listing 2. Subclassing AbstractTagLibrary Once the tag library is defined, you can add EL functions and logic tags to it. Step 2. Create a Java utility class Next you need to create a Java utility class that has a static method called getFieldLabel(). This utility method has no special tie to Facelets; it's just a regular Java static method, as shown in Listing 3: Listing 3. The Java utility class with getFieldLabel() The getFieldLabel() method shown in Listing 3 looks up the field in the resource bundle associated with JSF. If it cannot find the field, it splits and capitalizes the camel-case string, such that a "firstName" field name becomes "First Name." This gives you a reasonable default, which you can still set up in the resource bundle if you want to override it. Step 3. Register the getFieldLabel method In the AbstractTagLibrary class shown in Listing 2 ( JsfCoreLibrary), you need to register the getFieldLabel() method with the base class so that it is available as an EL function. I do this in Listing 4: Listing 4. Registering JsfCoreLibrary.java as an EL function As you can see, Listing 4 just iterates through all the methods on the JsfFunction class using reflection. It then adds all JsfFunction's static methods using the inherited method addFunction(). Step 4. Register the TagLibrary class You've now defined the EL function and the TagLibrary class that contains it. Next, you need to register your new TagLibrary class so that it can be found by Facelets. You do this by declaring a new library class in a new facelets-taglib file called jsf-core.taglib.xml, as shown in Listing 5: Listing 5. jsf-core.taglib.xml Step 5. Register the facelets-taglib descriptor file For Facelets to find your tag library, you need to register it in the WEB-INF/web.xml file, as shown in Listing 6: Listing 6. Registering the new taglib with Facelets Notice that I added jsf-core.taglib.xml to the semicolon-delimited list passed to the init-param facelets.LIBRARIES. Composition components go in their own taglib file. EL functions and Facelets logic tags can go in the same taglib file. Using the EL function in a composition component Now that you've defined the EL function, placed it in the Facelets taglib descriptor file, and registered the taglib descriptor file in web.xml, you can start to use the tag. In the field composition component, you can use the arc:getFieldLabel to look up the label in the resource bundle, as shown in Listing 7: Listing 7. Using the EL function Notice I imported that "arc" library by specifying its namespace in the xmlns:arc="" HTML element. The namespace has to match the namespace declared in the TagLibrary class ( JsfCoreLibrary in this case) as shown here: This might seem like a lot of work, even for just five steps. However, once you've done this basic setup, you can easily add more logic tags and EL functions without going through the same hassle every time. You'll have reasonable defaults for all your field label names. And, if your application only supports your native tongue and location, then for most cases, you won't have to add entries in the resource bundle. You'll only have to add entries in the resource bundle if you want a special label or if you start to use your application for other languages and/or locations. Facelets solves a pet peeve of mine about internationalization: writing a lot of special code for something I may never need. Now it's free! Next, let's see what happens if you decide you want to change the field tag so that it generates Booleans, dates, and text components automatically. Creating custom logic tags First, you want to add some metaprogramming capabilities to the field.jsp tag. For this, you create Facelets logic tags that tell you if a particular value binding type is a Boolean ( isBoolean), some form of text ( isText), or a date ( isDate). Then you use the tags to render the appropriate component. Listing 8 shows the usage for these tags (field.xhtml): Listing 8. field.xhtml The field.xhtml code in Listing 8 renders an inputText if the value binding is some sort of text. It renders a selectBooleanCheckbox if the value binding type is a Boolean. Finally, it renders a Tomahawk calendar component if it is a date (see "About Tomahawk"). Next, you create a value binding to get the type that is being bound to a particular component. The value binding has information about the type of value the component is bound to. If you've used JSF, then you're already familiar with value bindings; for example, #{Employee.firstName} is a value binding tag that likely equates to a string type while the #{Employee.age} tag likely equates to an integer type. In the next section, you learn how to create a value binding tag using Facelets. Create a value binding tag There are four steps to creating a tag that retrieves a value binding in Facelets: - Create a class that subclasses the TagHandler. - Register the attributes in the constructor. - Override the apply method. - Register the tag in the JsfCoreLibraryclass. The following sections explain each of the steps to build a value-binding tag and then show you how to use it. Step 1. Create a class that subclasses TagHandler You can use a Facelets TagHandler to inject the logic to decide whether components in the body of a tag are added to the component tree. Remember that the endgame of a Facelets template is to create a JSF component tree. Listing 9 shows how the SetValueBindingHandler tag subclasses TagHandler. The SetValueBindingHandler just defines a variable and puts the variable in the Facelets scope so your logic tags can reuse the variable. Listing 9. SetValueBindingHandler subclasses TagHandler Step 2. Register the attributes in the constructor When you write Facelets tags, it is important to realize that the attributes are defined by the tag itself and not in an XML file. The constructor of SetValueBindingHandler defines and registers two attributes (var and valueBinding) in the constructor, as shown in Listing 10: Listing 10. Register the attributes in the constructor Step 3. Override the apply method Next, you override the apply method in SetValueBindingHandler. Typically, you override the apply method to programmatically decide if the components defined in the body of the tag are added to the component tree. However, SetValueBindingHandler just defines a variable (whatever var is set to; for example, "vb") to the value binding that was passed. Listing 11 shows the code to override the apply method: Listing 11. Override the apply method Listing 11 defines two variables: var and var + "Type". Next, you simply put the variables into the faceletsContext (see my comments in Listing 11 for more details). Step 4. Register the tag in the JsfCoreLibrary class You can use the same JsfCoreLibrary for this example as for the previous one. A TagLibrary can contain both EL functions and logic tags. So, for the final step of this exercise, you register the SetValueBindingHandler tag in the JsfCoreLibrary by calling the superclass addTagHandler, as shown in Listing 12: Listing 12. Register the tag in the JsfCoreLibrary The nice thing about Facelets is that if you compare developing tags in Facelets to writing equivalent tags in JSP, it takes a lot less XML. You can easily develop many more tags and register them in the JsfCoreLibray. Notice that the name of the tag is setValueBinding. Using the custom logic tag Now that you've defined the tag, setValueBinding, you can start using it, as shown in Listing 13: Listing 13. Using the setValueBinding tag You don't have to import anything or set up anything in web.xml. Once you define a tag library (like "arc"), you can add tags and functions to it without updating any XML files. Yes, you can escape XMHell! Metaprogramming with Facelets For a last little bit of Facelets fun (for this article), you'll create a tag that allows you to add components defined in the body if the value binding is of a certain type. The magical tag, IsTypeHandler(), selectively decides if a component gets added to the component tree. The tags calls this.nextHandler.apply(faceletsContext, aParent) if the components defined in the body should be added to the component tree. The isTypeHandler() calls the abstract method isType() to determine if it should call this.nextHandler.apply(faceletsContext, aParent) and add the components defined in the body of tag handler to the component tree. Listing 14 shows the base class for all of this: Listing 14. Base class for handling types Next, you add a tag per type that you want to handle, as I do in Listing 15: Listing 15. Handling specific types Listing 15 just uses the type of the value binding to decide if the components defined in the tag's bodies get added to the component tree. Each tag overrides the isType() method. Currently, I'm using just the type to determine if the body components get added to the tree, but you could easily use annotations or other forms of metadata if you wanted. Naturally, your task isn't complete until you register all of the above tags with the JsfCoreLibrary, as shown in Listing 16: Listing 16. Adding the type handling tags to the TagLibrary Now you have three more tags in your taglibrary: isBoolean, isText, and isDate(). You can use these tags in your field tag as shown in Listing 17: Listing 17. Final field.xhtml Your field tag now displays an inputText field if the value binding is of type Integer, String, BigDecimal, Character, Long, Short, Byte, Float, Double, short, int, char, etc. The field tag displays a check box if the value binding type is a boolean or a Boolean. And it displays a Tomahawk calendar component if the value binding is of type java.util.Date -- which, frankly, is very cool. In this article, I've shown you some fun and fairly powerful applications of Facelets. The Facelets EL function takes a lot of the pain out of internationalization, and custom logic tags allow you to extend Facelets' built-in logic tags. Along the way, you've seen how easy it was to extend the simple examples from my previous article with more advanced functionality. I showed you how to update the field composition component to work with dates (Tomahawk calendar), Booleans (check boxes), and all manner of Java types that should be displayed as text. I also introduced you to reasonable defaults, which I used to internationalize the label for the field component. Keep an eye out for more fun with Facelets in the coming months! Information about download methods Learn - "Facelets fits JSF like a glove" (Richard Hightower, developerWorks, February 2006): Get started with the first real solution to your JSF-and-JSP woes. - Kiss my app (Jacob Hookom's blog, May 2005): Candid thoughts about Facelets from its creator. - "Inside Facelets, Part 1: An Introduction" (Jacob Hookom, JSF Central, August 2005): A more formal introduction to Facelets. - Use Facelets with Tomahawk (MyFaces WiKi, Apache.org): An ongoing discussion about using Facelets with the MyFaces Tomahawk extension. - "Design with the JSF architecture" (Anand Joshi, developerWorks, December 2005): Learn about the Gang of Four design patterns at the heart of JavaServer Faces. - "JSF for nonbelievers: Clearing the FUD about JSF" (Richard Hightower, developerWorks, February 2005): A four-part series that defends and demystifies JSF programming. - Another Sleepless Night in Tucson: Rick's blog, where he thinks aloud about JSF and Facelets (not to mention wine and cooking) till the wee hours of the morning. - The Java technology zone: Hundreds of articles about every aspect of Java programming. Get products and technologies - JSR 252: JavaServer Faces 1.2: Download JavaServer Faces. - Facelets home page: Download Facelets. - Apache MyFaces project: Download the MyFaces Tomahawk extension..
http://www.ibm.com/developerworks/java/library/j-facelets2/index.html
crawl-003
refinedweb
2,502
62.78
I spent a lot of time in searching if this was actually possible, did a lot of research, tried many different methods and finally I’ve been successful. Before I start let me give you some background; Business Scenario The Sender system is IBM WebSphere MQ and the receiver side is an SFTP. So it becomes JMS to SFTP. Business Requirement The sender side is splitting each xml document to 3 mb parts. But it is splitted irregularly. For example; This is the structure before they split and what receiver system expects from PI. The xml document above becomes like below parts when client put the files to MQ. Another requirement is, the message parts are uploaded to MQ unordered. So last message part can be at first row or first message part can be at middle rows etc. And total size of the complete/unsplitted xml document can be max. 50+ MB. Also quantity of message parts is unknown and most important thing is there is nothing to use to define the message parts sequence. Solution Tries Firstly it occurred to me that I can send message parts to ccBPM and merge them with a transformation step. Then I tried this scenario. Because we don’t have any possible field to use in correlation, I made dummy correlation like giving ‘sender component’. When I run this scenario, I noticed that incoming messages are failing on transformation step. I thought that reason of this exception is while messages goes in to mapping, they are tried to parse as if the message is xml. By the way sender and receiver adapter validations are off. To achieve it I tried to add xml elements like <Envelope> and </Envelope> at beginning of the message and end of the message to convert my irregular xml message to smooth and parsable xml message. First I tried this method using XSLT by embedding incoming message to smooth xml structure as CDATA. This was 1. step on Operation Mapping and the 2. step was my actual mapping which I merge incoming messages as below. This attempt failed. Because XSLT expects incoming data as xml format. Then I used Java Mapping instead of XSLT with the same logic; embedding incoming data in to xml structure as CDATA. But this time I placed java mapping in front of the ccBPM instead of transformation step like below. This attempt failed too. I realized that it mighty have impossible to handle irregular xml after message go out from sender channel. Then I decided to write a simple custom module on JMS adapter to convert incoming data to xml message by adding xml tags beginning and end of the message. After the start of writing EJB, an idea came; why I didn’t just make a runnable jar and call it from channel? Solution I made some changes on configuration and made it JMS to File as shown below. PI is taking message parts from MQ and putting them in a folder on itself without any conversion. While leaving the messages to folder, there is an operating system command on receiver file adapter which works after message processing. With this command PI executes a script file whenever each message file created in target folder. The script file executes a runnable jar file. But before the execution it checks whether the jar is running currently or ready to run at that moment. This check is necessary to prevent triggering jar file on every message part. It must run once when the first message part placed in the folder. When the jar app is executed, it fetches all message part files from PI’s output folder and goes in a loop which turns number of file times. First looks for the begin of root element if the message part contains it then it is assigned to a string. Then looks for the end of root element likewise and it is assigned to another string. Remainders is assign to another else string by concatenating each other in order and in a row. After each assignment, currently processing file is moved to ‘processed’ folder. At the end of the loop, which means all message part files are processed and moved from PI’s output folder, the strings assigned above are concatenated and this generates complete xml. At the same time this strings represents three main part of the complete xml which are begin part, middle parts and end part. Then the new complete xml file is created with containing timestamp in filename to prevent duplicate situation. The checking logic in bat file is, if jar file name is ‘ready’ then change its name to ‘running’ and execute it. Then check the folder continuously which PI puts incoming message parts, until there is no file anymore. This means jar app fetched all message parts and done its job. Then bat file changes the jar file’s name again to ‘ready’ then the script ends. Also I made some performance tests like merging 20 files which equals to 60 mb total. During the tests I have observed that playing with big data causes Java heap size error. To achieve it I added -Xmx parameter to bat file which sets maximum java heap size. As a result the script in front of the jar app enables to run jar app once until all message parts processed. Script file; @echo off if exist "XMLMerger_ready.jar" ( rename XMLMerger_ready.jar XMLMerger_running.jar java -Xmx512M -jar XMLMerger_running.jar ) :loop if not exist "T:\in\incoming\%" ( rename XMLMerger_running.jar XMLMerger_ready.jar exit ) else ( goto :loop ) Jar source code; package com.xml; /** * @author ridvanpolat * */ import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.sql.Timestamp; public class Merge { public static void main(String[] args) throws IOException { // wait 5 seconds to let PI to put all message parts to the incoming folder try { Thread.sleep(5000); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } // declarations java.util.Date date = new java.util.Date(); String beginPart = ""; String midParts = ""; String endPart = ""; // we will put generated xml to this path String path = "T:\\in\\"; // we will fetch message parts from this path which PI puts File file = new File(path + "\\incoming\\"); // check whether the path is exist or not if (file != null && file.exists()) { // get all files to an array, not only the filename, gets with the path File[] listOfFiles = file.listFiles(); // if there is file in the folder then.. if (listOfFiles != null) { // we will use this string to collect all parts at the end String completeXML = ""; // run the codes below number of file times for (int i = 0; i < listOfFiles.length; i++) { // this control is necessary because there might be some other non-file items in the folder, we have to process only files. if (listOfFiles[i].isFile()) { BufferedReader br = null; try { // for the current file. we are reading first line only, because the part files are composed of single line String sCurrentLine; br = new BufferedReader(new FileReader(listOfFiles[i])); // if file is not empty while ((sCurrentLine = br.readLine()) != null) { // get begin part if (sCurrentLine.contains("<Envelope")) { beginPart = sCurrentLine; // check if the message is complete xml if (sCurrentLine.contains("</Envelope")) { completeXML = sCurrentLine; } // get end part } else if (sCurrentLine.contains("</Envelope")) { endPart = sCurrentLine; // get middle parts and concat } else { midParts = midParts.concat(sCurrentLine); } } } catch (IOException e) { e.printStackTrace(); } finally { try { if (br != null) { br.close(); } } catch (IOException ex) { ex.printStackTrace(); } } try { // move processed files from incoming folder if (listOfFiles[i].renameTo( new File( path + "\\processed\\" + listOfFiles[i].getName()))) { System.out.println("File is moved successful!"); } else { System.out.println("File is failed to move!"); } } catch (Exception e) { e.printStackTrace(); } } // endloop } // concat 3 main part in order and in a row completeXML = beginPart.concat(midParts.concat(endPart)); // for error handling from script file System.out.println(completeXML); BufferedWriter output = null; try { // get time stamp String getTimestamp = new Timestamp(date.getTime()).toString(); // change unsupported characters for filename getTimestamp = getTimestamp.replace(' ', '_').replace(':', '-').replace('.', '-'); // create new file with xml extention and timestamp to prevent duplicate situation File newFile = new File(path + "\\XMLdata" + getTimestamp + ".xml"); output = new BufferedWriter(new FileWriter(newFile)); // push our concated data to new file output.write(completeXML); } catch (IOException e) { e.printStackTrace(); } finally { if (output != null) { output.close(); } } } } } } I hope has been useful. Ridvan Polat
https://blogs.sap.com/2015/07/29/merging-irregular-xml-files/
CC-MAIN-2020-40
refinedweb
1,391
66.44
thanks for your help anyways thanks for your help anyways No sorry this is all I have it seems to me that it is taking string and reading it into buffer then output to the consumer, i think i may have my wires crossed somewhere. I want the buffer to pass an arraylist of intergers to... Just did that there mate import java.util.*; import java.util.concurrent.locks.*; import java.io.*; public class Pipeline{ public static void main(String []args){ ArrayList<Integer>buffer =new... A thread pipeline is a sequence of threads linked together with a chain of buffers. Each thread in the pipeline reads from the buffer preceding it in the chain and may write to the buffer following...
http://www.javaprogrammingforums.com/search.php?s=6f61e26d9d869ac3e049fab4ddea5b1b&searchid=1273865
CC-MAIN-2014-52
refinedweb
121
69.31
react-native-svg-transformer React Native SVG transformer allows you import SVG files in your React Native project the same way that you would in a Web application when a using library like SVGR to transform your imported SVG images into React components. This makes it easy to use the same code for React Native and Web. Usage Import your .svg file inside a React component: import Logo from "./logo.svg"; You can then use your image as a component: <Logo width={120} height={40} /> If you use React Native version 0.56 or older, you need to rename your .svg files to .svgx. Demo (iOS/Android/Web) Installation and configuration Step 1: Install react-native-svg library Make sure that you have installed and linked react-native-svg library: Step 2: Install react-native-svg-transformer library yarn add --dev react-native-svg-transformer Step 3: Configure the react native packager For React Native v0.57 or newer / Expo SDK v31.0.0 or newer Merge the contents from your project's metro.config.js file with this config (create the file if it does not exist already). metro.config.js:"] } }; })(); If you are using Expo, you also need to add this to app.json: { "expo": { "packagerOpts": { "config": "metro.config.js" } } } For React Native v0.56 or older React Native versions older than 0.57 do not support running the transformer for .svg file extension. That is why a .svgx file extension should be used instead for your SVG files. This is fixed in React Native 0.57 and newer versions. Add this to your rn-cli.config.js (create the file if it does not exist already): module.exports = { getTransformModulePath() { return require.resolve("react-native-svg-transformer"); }, getSourceExts() { return ["js", "jsx", "svgx"]; } }; For Expo SDK v30.0.0 or older If you are using Expo, instead of adding the rn-cli.config.js file, you need to add this to app.json: { "expo": { "packagerOpts": { "sourceExts": ["js", "jsx", "svgx"], "transformer": "node_modules/react-native-svg-transformer/index.js" } } }
https://reactnativeexample.com/import-svg-files-in-your-react-native-project-the-same-way/
CC-MAIN-2021-17
refinedweb
338
61.22
Last Updated on September 3, 2020 Movie: -. Kick-start your project with my new book Deep Learning for Natural Language Processing, including step-by-step tutorials and the Python source code files for all examples. Let’s get started. - Update Oct/2017: Fixed a minor typo when loading and naming positive and negative reviews (thanks Arthur). - Update Aug/2020: Updated link to movie review dataset. How to Develop a Deep Learning Bag-of-Words Model for Predicting Sentiment in Movie Reviews Photo by jai Mansson, some rights reserved. Tutorial Overview This tutorial is divided into 4 parts; they are: - Movie Review Dataset - Data Preparation - Bag-of-Words Representation - Sentiment Analysis Models Need help with Deep Learning for Text Data? Take my free 7-day email crash course now (with code). Click to sign-up and also get a free PDF Ebook version of the course. Start Your FREE Crash-Course Now were released in 2004, referred to as “v2.0”. The dataset is comprised of 1,000 positive and 1,000 negative movie reviews drawn from an archive of the rec.arts.movies.reviews newsgroup hosted at imdb.com.. Note: Your results may vary given the stochastic nature of the algorithm or evaluation procedure, or differences in numerical precision. Consider running the example a few times and compare the average outcome.). Note: Your results may vary given the stochastic nature of the algorithm or evaluation procedure, or differences in numerical precision. Consider running the example a few times and compare the average outcome.() that will return a value that can be rounded to. Note: Your results may vary given the stochastic nature of the algorithm or evaluation procedure, or differences in numerical precision. Consider running the example a few times and compare the average outcome.. - Tokenizer Keras API Summary In this tutorial, you discovered how to develop a bag-of-words model for predicting the sentiment of movie reviews. Specifically, you learned: -. Do you have any questions? Ask your questions in the comments below and I will do my best to answer. Excellent sample codes and explanation. Thanks. Thank you, Jason. Very interest work. Thank you. Very nicely explained. Thanks Thanks Hirak. Well explained Thanks Chetana. Thank you, Jason, well explained. Thanks. Hi,can you give me the source code,thank you84! The source code is on the post. Use copy-paste. Thank you Jason. You are playing a key role in my career growth. I’m glad to hear that! Great article, Jason. Actually, there was a small mistake in those line below: positive_lines = process_docs(‘txt_sentoken/neg’, vocab) negative_lines = process_docs(‘txt_sentoken/pos’, vocab) Thanks Arthur, fixed! Excellent articles Jason. My comment is not just for this specific article but in general on this website. This is really helpful. Thanks Kapil! Thank for such a nice and concise article! Thanks. Dear Sir, Could you please also help us with the above kind of articles in R. I am a R learner and looking for articles from people like you for my learning Your help will be appreciated. Thanks Rgds Vijay Thanks for the suggestion Vijay. Excellent work! Very clear presentation. Best regards Thanks Jacek. Hi Jason, I created the model as instructed. But when I try to predict for a new text then I get an error saying the input shape is different. When we fit a model, the input shape is fetched based on the training data. However, tokenizer.text_to_matrix gives a different shape for new text. Thereby, model cannot be used to predict new text. Could you please suggest the solution for the same. Thanks, Sappy You must prepare new text in exactly the same way as training data text. I recommend using the same functions and even encoders used to prepare training data. Dr. Jason, I have used the model and saved to the disk as .h5 file. Then I loaded it with the function load_model(). Now I tried prediction using the above code and getting this error: ‘Tokenizer’ object has no attribute ‘word_index’. The same functions have been used throughout. What is wrong I couldn’t find out. Please suggest for corrections. I’m sorry to hear that, I have not seen this error before. I have some suggestions here: Thank you Dr. Jason! Such a very valuable tutorial! While playing with the models I’ve noticed, that splitting data (at least in this case) at different points results to VERY different accuracy (up to 5% difference). Say, we get test data from the beginning/middle or from the last reviews – all would yield different results. So, furthermore, I’ve experimented with sklearn train_test_split with different random_state numbers to split the dataset at different points – and the results depend so much on. (That is because tokenizer fits on varying set of tokens each time.) What would be the best approach to tackle such situation and get the best out of it? Excellent and an important observation Vladimir. See this post for a more robust model evaluation strategy: Nice, I like that simple approach. Thanks for sharing. No problem. Jason, Please have a look at a more gracious approach to preprocess text, encode it as a term-matrix and convert to an array. I’ve created a tutorial in my blog, inspired by your awesome articles: So, the idea is to use sklearn CountVectorizer! It accepts arguments and make all the necessary preprocessing: tokenize, define word size, filter stopwords, includes words with certain frequency occurence, and even more allows to make ngrams! Grateful to you, Cheers! –Vladimir Nice one! Also, sometimes it is good to split out all the pieces for learning (e.g. for beginners) or for more control/fine tuning. Really helpful!!!!!!! Thanks, I’m glad to hear that. Hi Jason, I created the model as instructed. But when I try to predict for a new text then when I always get result as 0. Please help. Perhaps your model requires more tuning? when I run the prediction function it gives me this …!!! print(predict_sentiment(text, vocab, tokenizer, model)) NameError: name ‘model’ is not defined Looks like you might have missed some of the code from the tutorial. This is the code I run it, please Mr jason help me and tell me where is the error that I made or what I missed from numpy import array from string import punctuation from os import listdir from collections import Counter from nltk.corpus import stopwords from keras.preprocessing.text import Tokenizer from keras.models import Sequential from keras.layers import Dense from keras.layers import Dropout from pandas import DataFrame from matplotlib import pyplot #, clean and return line of tokens def doc_to_line(filename, vocab): # load the doc doc = load_doc(filename) # clean doc tokens = clean_doc(doc) # filter by vocab tokens = [w for w in tokens if w in vocab] return ‘ ‘.join(tokens) # load all docs in a directory def process_docs(directory, vocab, is_trian): lines = list() # walk through all files in the folder for filename in listdir(directory): # skip any reviews in the test set if is_trian and filename.startswith(‘cv9’): continue if not is_trian and not filename.startswith(‘cv9’): continue # create the full path of the file to open path = directory + ‘/’ + filename # load and clean the doc line = doc_to_line(path, vocab) # add to list lines.append(line) return lines # evaluate a neural network model def evaluate_mode(Xtrain, ytrain, Xtest, ytest): scores = list() n_repeats = 2 n_words = Xtest.shape[1] for i in range(n_repeats): # define network model = Sequential() model.add(Dense(50, input_shape=(n_words,), activation=’relu’)) model.add(Dense(1, activation=’sigmoid’)) # compile network model.compile(loss=’binary_crossentropy’, optimizer=’adam’, metrics=[‘accuracy’]) # fit network model.fit(Xtrain, ytrain, epochs=50, verbose=2) # evaluate loss, acc = model.evaluate(Xtest, ytest, verbose=0) scores.append(acc) print(‘%d accuracy: %s’ % ((i+1), acc)) return scores # prepare bag of words encoding of docs def prepare_data(train_docs, test_docs, mode): # create the tokenizer tokenizer = Tokenizer() # fit the tokenizer on the documents tokenizer.fit_on_texts(train_docs) # encode training data set Xtrain = tokenizer.texts_to_matrix(train_docs, mode=mode) # encode training data set Xtest = tokenizer.texts_to_matrix(test_docs, mode=mode) return Xtrain, Xtest # load the vocabulary vocab_filename = ‘vocab.txt’ vocab = load_doc(vocab_filename) vocab = vocab.split() vocab = set(vocab) # load all training reviews positive_lines = process_docs(‘txt_sentoken/pos’, vocab, True) negative_lines = process_docs(‘txt_sentoken/neg’, vocab, True) train_docs = negative_lines + positive_lines # load all test reviews positive_lines = process_docs(‘txt_sentoken/pos’, vocab, False) negative_lines = process_docs(‘txt_sentoken/neg’, vocab, False) test_docs = negative_lines + positive_lines # prepare labels ytrain = array([0 for _ in range(900)] + [1 for _ in range(900)]) ytest = array([0 for _ in range(100)] + [1 for _ in range(100)]) modes = [‘binary’, ‘count’, ‘tfidf’, ‘fre() # classify a review as negative (0) or positive (1) def predict_sentiment(review, vocab, tokenizer, model): # clean tokens = clean_doc(review) # filter by vocab tokens = [w for w in tokens if w in vocab] # convert to line line = ‘ ‘.join(tokens) # encode encoded = tokenizer.texts_to_matrix([line], mode=’freq’) # prediction yhat = model.predict(encoded, verbose=0) return round(yhat[0,0]) # test positive text text = ‘Best movie ever!’ print(predict_sentiment(text, vocab, tokenizer, model)) # test negative text text = ‘This is a bad movie.’ print(predict_sentiment(text, vocab, tokenizer, model)) I have some ideas here: Thank you so much Mr Jason when I run the prediction function it gives me this …!!! print(predict_sentiment(text, vocab, tokenizer, model)) NameError: name ‘model’ is not defined same problem , do i have to make a new file and import the other files or what ? (sorry newbie in python) Looks like you have not copied all of the code from the example. Can you please write us a full code ? i dont get how to include the last part the function part to get result of one tense ! Great content. Thanks. many thanks ! I’m glad it helped. Do you think that stemming might improve the classification accuracy or do you think it might lead to overfitting? It will likely simplify the problem and in turn lift skill. Can you please clarify the predict function more please, and do i need to run the train snippet each time i want to test that on a new data ? thank u I explain more how to make predictions with Keras models here: Hi DR Jason, It is a very good post, thank you it cleared me many points. I have a question. I would like to know if instead of train test split it can be used k-fold cross validation? Or in the case of document classification it is not necessary k-fold cross validation? Best regards. It is a good idea if you have the resources, we often do not when it comes to NLP models. Thank you. Best Regards. Hi Jason, You’re blog, like this one helps me a lot for my work. I would like to see how ‘Embedding’ would perform as compared to Bag-of-Words. Do you have a tutorial using embedding for sentiment analysis? Kind Regards, Emmanuel Thanks Emmanuel! Yes, I have many such tutorials, type embedding into the blog search. Thank you. My goal is to improve the performance of my existing ‘classical’ bag-of-words method using Multinominal Bayesian, for both sentiment analysis and document classification. It works well with document classification. However, I am looking for a model with a better performance, especially for my sentiment analysis, given that comments are multiple languages. Would you consider/think that using a multi-channel, N-gram in a CNN would improve the performance, in general? Many thanks for the response :). I wouldn’t guess, I would design experiments to discover. It actually improved the accuracy! Thank you so much for the great tutorial! Your tutorials has greatly improved my skills and understanding in ML. Cheers, Emmanuel Thanks, nice work! Jason, I’m newer to Python … would love to set up what you provided guidance on above … I’ve downloaded the movie preview data set … how do I run the first set of code though? “An example of cleaning the first positive review is listed below.” … when I put this code into IDLE on Python it returns a syntax error. My apologies for such a newbie question … I imagine once I get how to apply your code I can get the rest working. Thanks for such a wonderful write up! Hope I can get it running soon. I recommend running code from the command line, I have an example here: I am using the same but using CNN i Got accuracy = 0.8 but when i make prediction function i Got all the result positive , have you an idea please? Perhaps try re-running the example a few times and compare results? Hi Do you maybe know why the rank of yhat (as the returned value of Model.predict call above) is 2 and not one? Given your example above, my expectation would be that yhat is [1] and not [[1]]. Thanks One prediction is made for each input sample. Hello Jason, thank you for this post, it was really helpful 🙂 I have few questions and I was wondering if you could help me. Can we use the bag of words model with CNN or RNN ? And how about using a validation set, would it increase the accuracy ? Also you tlaked about running the program on GPUs, what’s the major changes that we have to make ? Thnx No, bag of words discards the temporal ordering required by CNN and LSTM. Validation dataset does not impact model performance, it is used to evaluate model performance. You must configure the underlying backend (tensorflow) to use CPU or GPU. I don’t provide instructions for this. Thank you Jason, this was helpful I’m happy to hear that. NameError: name ‘model’ is not defined Jason mentioned to save the model and the tokenizer file as below – “Ideally, we would fit the model on all available data (train and test) to create a final model and save the model and tokenizer to file so that they can be loaded and used in new software.” After fitting the model please save the model – model.save(‘my_model.h5’) After getting the tokenizer file , please save the tokenizer file – from pickle import dump dump(tokenizer, open(‘tokenizer.pkl’, ‘wb’)) Looks like you might have missed some lines of code. Hi Vinay, Can you tell me where exactly do we need to specify the line of code “from pickle import dump dump(tokenizer, open(‘tokenizer.pkl’, ‘wb’))” and this one: “model.save(‘my_model.h5’)” In the first case we are saving the tokenizer to file, in the second we are saving the model to file. Hello, I want to read the raw data represented as sequences of integers ( System calls, ADFA-LD Dataset ) , how to do this, I cannot use the modes mentionned above ? Thanks You must encode each word in your vocab with a unique number. But my vocab is a set of integers (between 1 and 340) each integer represent a unique system call. Great! Perhaps start by prototyping a few models? The problem is how to define Xtrain and Ytrain, cause I have only text and not an array. I tried the encoding with unique numbers but the same problem : I got errors in shape of Ytrain or others. The question is: to train a model, Are we obliged to have dataset with columns and rows? is there a method to use the sequences directly, without transform them? Thank you, and sorry for disturbing you In general, the model will take multiple samples as input, where each sample is a vector for encoded words – encoded text. Perhaps try running the above example and see how the text was encoded and passed as input to the model? I tried this, I got this error: valueError: specify a dimension (num_words argument), or fit on some text data first I’m sorry to hear that, I have some suggestions here: Hi Kahina, I too got the same error. Later I realized that my ‘vocab.txt’ was empty. Great tip. Hi Jason, after executing the code, I am getting an error as below – (array([[0. , 0.01519757, 0.00911854, …, 0. , 0. , 0. ], [0. , 0. , 0. , …, 0. , 0. , 0. ], [0. , 0.03007519, 0.01879699, …, 0. , 0. , 0. ], …, [0. , 0.01201923, 0.01442308, …, 0. , 0. , 0. ], [0. , 0.01230769, 0.01538462, …, 0. , 0. , 0. ], [0. , 0. , 0.008 , …, 0. , 0. , 0. ]]), whereas In your code, I can see the output as only 1 or zero. I have not changed even one word of the code. Its exactly the same. Can you tell me what exactly might be the problem? Thanks! Sorry to hear that, I have some suggestions here that might help: Sorry, I did not mean error. I meant output Hey, Jason, I feel the method here is quite similar to word embedding encoding method. I wonder which part is using bag-of-words? Is the following section ? Why do we use sequence encoding at the beginning ? Thank you. modes = ['binary', 'count', 'tfidf', 'fre() Bag of words is the mapping of words to a count vector. The vector is not ordered, they are not sequences. hi sir this one was a very good model!! i have a query in my code . i have made a model in NLP but i dont know hor can i predict my result can you help me with the code??? You can call model.predict() Perhaps this will help: Hi can you help on this error? this code is from deep learning for nlp Code: text = ‘ Best movie ever! It was great, I recommend it. ‘ percent, sentiment = predict_sentiment(text, vocab, tokenizer, model) print( ‘ Review: [%s]\nSentiment: %s (%.3f%%) ‘ % (text, sentiment, percent*100)) # test negative text text = ‘ This is a bad movie. ‘ percent, sentiment = predict_sentiment(text, vocab, tokenizer, model) print( ‘ Review: [%s]\nSentiment: %s (%.3f%%) ‘ % (text, sentiment, percent*100)) Error: NameError Traceback (most recent call last) in 171 # test positive text 172 text = ‘ Best movie ever! It was great, I recommend it. ‘ –> 173 percent, sentiment = predict_sentiment(text, vocab, tokenizer, model) 174 print( ‘ Review: [%s]\nSentiment: %s (%.3f%%) ‘ % (text, sentiment, percent*100)) 175 # test negative text in predict_sentiment(review, vocab, tokenizer, model) 140 #return round(yhat[0,0]) 141 percent_pos = yhat[0,0] –> 142 if round(percent_post) == 0: 143 return(1-percent_post), ‘NEGATIVE’ 144 return percent_pos, ‘POSITIVE’ NameError: name ‘percent_post’ is not defined Looks like the code has been changed and added a percent_post function. I don’t know about that function sorry. Hi Dr. Jason, Thank you for sharing this, it’s very helpful! I was wondering how exactly the program knows which reviews are positive and which negative? I understand that this line labels the reviews by 0 and 1: “ytrain = array([0 for _ in range(900)] + [1 for _ in range(900)])”, but how does the program know which reviews in the range are negative and which positive? And why are both ranges 900? Thanks! Quinn You’re welcome. It learns from examples. In that code we are preparing the class labels for the examples so that the model can learn. The numbers refer to the number of examples in each class. Ah I see. Could you please confirm if my following understanding is correct? We defined the training corpus variable as “docs = negative_lines + positive_lines”. Because of that, the negative reviews are in the first half of the array, while the positive ones are in the second half. And because we know that each section has 900 reviews each, we can simply label the first 900 with 0 to represent negative, and the other 900 with with 1 because it’s positive. If we had defined “docs” the other way around, i.e. “docs = positive_lines + negative_lines”, then when we label the reviews, we should be using “ytrain = array([1 for _ in range(900)] + [0 for _ in range(900)])”. Is the above statement correct? Again, thank you very much. Correct. Thank you. Another question I was wondering about is that I see we only use either positive or negative reviews. Is it not recommended in general to include neutral reviews in the training dataset? The reason that I’m asking is that I have a list of sentences that I’m currently classifying into positive/negative, and there are some sentences that are neutral. I’m inclined to include these as neutral instead of excluding them entirely. That is a good idea and a natural extension to the tutorial. Thank you. In that case, is there a way you would recommend labeling the positive/negative/neutral comments? Is 1 for positive, 0 for neutral and -1 for negative sensible? Or is it better to keep everything positive, i.e. using 0, 1 and 2? I tried to look this up online, but have found limited information on this. Thanks again! It does not really matter. Hi Sir, When iam trying to create the model accuracy is coming as 65.5. What and all way we can improve the model performance, accuracy etc Here are some suggestions: Hi Jason! Thanks for this fantastic post! I have an imbalance dataset of texts consisting of 4 languages with two labels and want to perform binary classification on it with CNN. Any guide through the process? How is it different from a single-language dataset? Thanks again! Interesting, I recommend that you get creative and try a suite of different approaches. I would recommend prototyping diffrent approaches, e.g. different inputs models for each language, maybe share an output model. Hello thank you for your amazing tutorial. I am new to nlp and I am confused about two things. 1 ) why did we make a list of vocabulary from the reviews and then again tokenized the reviews in the next step? 2 ) what is the role of the word scores? do they indicate that the word is pos or neg or is it only showing how much they have appeared in the reviews dataset? thanks again! Good questions. We want control over the vocab used in the models, e.g. limit the words to those most useful/relevant makes the models simple/fast/effective. We are predicting the sentiment in this tutorial, you can predict anything you like as long as you have training data. thank you for your reply! You’re welcome. Hi Jason: Wonderful text classification tutorial !. I implemented additional options to the code, taken from yours other NLP tutorials, in order to evaluate several sensitivity analysis, such as: – evaluate statistic variation for different training-validations dataset grouping, using k-fold cross-validations Sklearn API. – evaluate results improvement by adding Deep Learning layers (or not), such as Embedding and 1D Convolutionals, to capture better words pattern extraction, before injecting them to dense layers of the fully connected part of the model. In the case of using embedding layer I also add the option to use GloVe pre-trained words vector weights (or not) – Different options for “coding” document text words…into numbers. with keras functions such as: “texts_to_sequences()”, or “one_hot()2, or “texts_to__matrix()”. – Different options to set up the number of “words features”, such as the maximum length of words contained in any document (1,301), or the number of different vocabulary words in all docs (24,875), or even any arbitrary number of features greater than the maximum length (e.eg. 100,000!). by the way I experiment on using kernel_regulrarizer argument for dense layer, e.g. “l1-l2”, but I got a surprised result, the model does not learn at all (50% accuracy).! I also apply train-validation split at the end (not at the beginning at you do). That is, after performing all the words preparation, cleaning, getting vocabulary and coding words/features for the whole dataset. the best results I achieve it is around 89% accuracy I am curious by the effect of adding embedding layers to the model, that change the 2D Input text documents defined by e.g. [number of docs, number of words features] to a 3D [number of docs, number of words features, number of word vector coordinates]… is this embedding layer applicable to other areas of ML/DL outside NLP (such as computer vision, time series, or is just specific to NLP? in my case the most confused part of the sentiment analysis is the tedious procedure to convert text docs into texts, lines, words, cleaning, get docs vocabulary…and finally applying coding to convert words into numbers! I expect new APIs could overcome this long procedure with more powerful and simple APIs! thanks Very cool, thanks for sharing. Yes, embeddings can be used with any categorical or ordinal inputs, for example: Agreed, cleaning text is zero fun. Thank you Jason! I would take a look at the suggested tutorial for encoding categorical variables for deep learning have a nice day! Same to you! Dear Jason, I have gone through the tutorial and had an error: ==> AttributeError: module ‘tensorflow.python.framework.ops’ has no attribute ‘_TensorLike’ when it executed the the function “evaluate_mode()” near the end of the program: results[mode] = evaluate_mode(Xtrain, ytrain, Xtest, ytest) I have fixed so many errors so far and worked fine, but this one is hard. I have tried a few times, but I could not fix it. Hence, I need your help when you have a chance if possible. Many thanks for your help in advance. I’m sorry to hear that you’re having trouble Rob, this may help: i want to apply BOW model for an excel sheet (xlsx), comprising of question and answer columns, i please need your help. Thank you in advance ! Start by saving your spreadsheets as CSV files so you can load them in Python. Is there any email or any other platform i can reach you at i’d like to share a few things with you and need your help please. Thank you ! Yes, the contact page linked in the menu: Hi Jason, Is there a way to analyze bigrams using the above methodology. I think the tokenizer library in keras doesn’t support it. Is there a way to create a fixed length vector of bag of words model with restricted vocabulary exactly like in this tutorial but with bigrams? A bag of words has a fixed vocab, but is not concerned with document length. You can use bag of bi-grams instead of words, but it would be a MASSIVE vector. A real pain. Thank you Jason! I have a labeled dataset to detect emotion, and I have a Spanish emotion lexicon. I compute the TF scheme in order to obtain how frequently an expression (term, word) occurs in a document. and I want to incorporate the effective lexical features by check the presence of lexicon terms in the sentence and obtain a vector that represents each emotional category (anger, fear, sadness and joy). Finally, to carry out the classification, the concatenation of the TF sentence representation and the word-based features are used as input to the different machine learning algorithms. how can I incorporate the effective lexicon features to obtain a vector? and how can I concatenate TF with Lexicon and used it as input to the different ML? Perhaps ensemble the two different models? Perhaps use a multi-input neural net model with separate input submodels for each feature type? Perhaps contrast the two above approaches with one large concat vector input?
https://machinelearningmastery.com/deep-learning-bag-of-words-model-sentiment-analysis/
CC-MAIN-2021-31
refinedweb
4,557
65.32
This is an interesting topic for discussion I think. And then: Good habits to have when doing python: For example: I know the above is Important because when you call a function from the outside it wont run your program like it is a stand alone script.(If I am saying it right). Code: Select all def main(): return if __name__ == "__main__": main() List of Habits: - New file for each class. (Like you must do in Java). is it good or bad and why Commenting, how important is it really? List of Features: - Learning gtk and other gui scripting? how essential? Slicing (ex. strvar[2:3]), do you realy use it? Kind regards Longtomjr
https://forums.solydxk.com/viewtopic.php?f=60&t=252
CC-MAIN-2019-30
refinedweb
114
75.91
FFI cook book From HaskellWiki This attempts to be a guide/tutorial/cookbook approach to writing a library using external (FFI) functions. Some people complain that cookbook approaches encourage EmptyDataDecls): > There is also a third style, which uses newtype: newtype EnvHandle = EnvHandle (Ptr EnvHandle) You can also use something like Ptr a when functions expect void*, and use that to enforce type consistency. For instance, you have a function that expects a pointer to a buffer and returns the old one: foreign import ccall "name_of_function" function :: Ptr a -> IO (Ptr a) 1.4 Working with structs Please check me For example suppose you had a struct like: typedef struct { int a; char b; double c; } my_struct; And you wanted to write a storable instance. Here pre-processing with hsc2hs tool can be helpfull. You would write it like this: instance Storable Struct where alignment _ = #{alignment my_struct} sizeOf _ = #{size my_struct} peek ptr = do a <- #{peek my_struct, a} ptr b <- #{peek my_struct, b} ptr c <- #{peek my_struct, c} ptr return (MyStruct a, b, c) poke ptr (MyStruct a b c) = do #{poke my_struct, a} ptr a #{poke my_struct, b} ptr b #{poke my_struct, c} ptr c Note that the #{alignment foo} syntax is not currently built-in to hsc2hs. You have to add the following line to your haskell source file to add the alignment syntax: #let alignment t = "%lu", (unsigned long)offsetof(struct {char x__; t (y__); }, y__) With a string field . 2 Calling C functions in DLL by Ronald Guida, hCafe, 12 sep 2007 1. I can leave "test_foo.lhs" and "foo.cpp" as-is: foo.cpp: #include "foo.h" __stdcall int foo(int x) { return 3 * x + 1; } test_foo.lhs: > {-# OPTIONS_GHC -fglasgow-exts #-} > module Main > where > import Foreign > import Foreign.C > foreign import stdcall unsafe "foo" > c_Foo :: Word32 -> IO Word32 > main = do > putStrLn "Entering main" > let x = 7::Word32 > y <- c_Foo(x) > putStrLn $ "y = " ++ show y > putStrLn "Exiting main" 2. I need to change "foo.h" to the following: #if BUILD_DLL #define DECLSPEC __declspec(dllexport) #else #define DECLSPEC __declspec(dllimport) #endif extern "C" { DECLSPEC __stdcall int foo(int x); } 3. I need to create a "foo.def" file and list the functions to be exported in a DLL: LIBRARY foo DESCRIPTION "Foo Library" EXPORTS foo Note: The library name on the first line must match the dll name. "LIBRARY foo" corresponds to "foo.dll" 4. The build process is as follows. (1) gcc -DBUILD_DLL -c foo.cpp (2) gcc -shared -o foo.dll foo.o foo.def \ -Wl,--enable-stdcall-fixup,--out-implib,libfoo.a 5. At this point, I'll have "foo.dll" and "libfoo.a". I can load my "foo" library, as a DLL, into GHCi with the command: $ ghci -lfoo In reality, I would use: $ ghci test_foo.lhs -lfoo 6. Once I'm satisfied and ready to compile: ghc --make test_foo.lhs -L. -lfoo Notes: (1) "-L." directs GHC to look in the current directory for libraries. GHCi seems to look there by default. (2) The resulting "test_foo.exe" will dynamicly load "foo.dll". 7. If I want a staticly linked executable instead: ar rcs libfoo_static.a foo.o ghc --make test_foo.lhs -L. -lfoo_static 8. Finally, I can put the build steps into a Makefile: # Makefile for foo test_foo.exe : test_foo.lhs libfoo.a foo.dll ghc --make test_foo.lhs -L. -lfoo test_foo_static.exe : test_foo.lhs libfoo_static.a ghc --make test_foo.lhs -L. -lfoo_static -o test_foo_static.exe libfoo.a : foo.dll foo.dll : foo.o foo.def gcc -shared -o foo.dll foo.o foo.def \ -Wl,--enable-stdcall-fixup,--out-implib,libfoo.a libfoo_static.a : foo.o ar rcs libfoo_static.a foo.o foo.o : foo.cpp foo.h gcc -DBUILD_DLL -c foo.cpp .PHONY: clean clean: rm -f *.[oa] rm -f *.dll rm -f *.hi rm -f *.exe 3 Calling C++ functions in a Visual Studio DLL from Haskell, and Haskell functions from the C++ DLL This material is placed on the separate page 4
http://www.haskell.org/haskellwiki/index.php?title=FFI_cook_book&oldid=34926
CC-MAIN-2013-20
refinedweb
664
75.81
PyX — Example: drawing/pathitem.py Constructing paths from pathitems from pyx import * c = canvas.canvas() rect1 = path.path(path.moveto(0, 0), path.lineto(1, 0), path.moveto(1, 0), path.lineto(1, 1), path.moveto(1, 1), path.lineto(0, 1), path.moveto(0, 1), path.lineto(0, 0)) rect2 = path.path(path.moveto(2, 0), path.lineto(3, 0), path.lineto(3, 1), path.lineto(2, 1), path.lineto(2, 0)) rect3 = path.path(path.moveto(4, 0), path.lineto(5, 0), path.lineto(5, 1), path.lineto(4, 1), path.closepath()) c.stroke(rect1, [style.linewidth.THICK]) c.stroke(rect2, [style.linewidth.THICK]) c.stroke(rect3, [style.linewidth.THICK]) c.writeEPSfile("pathitem") c.writePDFfile("pathitem") c.writeSVGfile("pathitem") Description In this example, some simple paths are constructed out of pathitems, which are the basic building blocks of paths. While we only use moveto, lineto and closepath instances, we can already see some features of paths in PyX. In the first path instance rect1, we alternatingly use moveto and lineto pathitem instances. A moveto instance sets an internal current point, while a lineto instance additionally creates a straight line connecting the old and the new current point. Due to the intermediate moveto instances, we generate a path which contains 4 separate subpaths. When stroking this path with a thick linewidth in order to show the details, the corners of the result exhibits that the individual lines are not connected. In the second case rect2, we skip the intermediate moveto instances. The default join method between pathitems within a single subpath is to miter them. This results in a different rendering except for the start and end point of the path. In order to get rid of the ragged effect at the corners, we close the path as shown by rect3. Here, one can (and should) skip the last connecting line since a closepath pathitem implicitly adds a straight connection line between the first and the last point of the subpath. PyX resembles the full PostScript path model. The whole PostScript path construction functionality is available by means of pathitems and the resulting PostScript code will make use of the corresponding PostScript operators. For PDF output, where some of the PostScript features are not available (all forms of arcs are missing in PDF), proper replacement code is generated automatically. You might ask why you should skip the last straight connection line of finite length when closing a path. This is not a question of reducing the file size but increasing the rendering stability of the drawing. The problem is that in case of rounding errors a very short connection line might mistakenly be inserted when rendering a closepath. Depending on the linejoin setting, this can create a major visual defect.
http://pyx.sourceforge.net/examples/drawing/pathitem.html
CC-MAIN-2016-36
refinedweb
461
60.82
preface As mentioned earlier, the disadvantage of the IO multiplexing API, select and poll is that the performance is not enough. The more client connections, the more obvious the performance degradation. The emergence of epoll solves this problem. Reference The Linux Programming Interface A statistical comparison is as follows: fd quantity poll CPU time(second) select CPU time(second) epoll CPU time(second) --------------------------------------------------------------------- 10 0.61 0.73 0.41 100 2.9 3.0 0.42 1000 35 35 0.53 10000 990 930 0.66 --------------------------------------------------------------------- It can be seen that after fd reaches 100, select/poll is very slow, and epoll performs very well even if it reaches 10000, because: - Every time select/poll is called, the kernel must check all the descriptors passed in; For epoll, each time epoll is called_ CTL, the kernel will associate the relevant information with the underlying file description. When the IO event is ready, the kernel will add the information to the ready list of epoll. Then call epoll_. Wait, the kernel only needs to extract the information in the ready list and return it. - Each time select/poll is called, all file descriptors to be monitored should be passed to the kernel. When the function returns, the kernel should return the descriptors and identify which ones are ready. After the results are obtained, all descriptors should be judged one by one to determine which events are available; Epoll is calling epoll_ The monitoring list is maintained during CTL, epoll_wait does not need to pass in any information, and the returned result only contains ready descriptors, so there is no need to judge all descriptors. Conceptually, epoll is understood to register the IO event of fd monitored to epoll (calling epoll_ctl), and then to call epoll's API waiting event to arrive (calling epoll_wait), and the kernel may maintain a read and write buffer for each fd. - If I monitor read events and there is data in the read buffer, epoll_wait will return, and I can call read to read the data. - If I monitor write events and the write cache is not full, epoll_wait will also return. At this time, I can call write to write data. - If fd some errors occur, epoll_wait will also return. At this time, I can know according to the returned flag bit. - If I monitor read events and a client connects, epoll_wait will return, and I can call accept to accept the client. Introduction to epoll API - int epoll_create(int size); Create an epoll instance and return the file descriptor (fd) representing the instance. The size is ignored since Linux 2.6.8, but must be greater than 0.5 - int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event); Epoll control interface. epfd is the file descriptor of epoll. fd is the file descriptor to be operated. op has the following types: - EPOLL_CTL_ADD registers fd the event. The event type is specified in event. - EPOLL_CTL_MOD modifies registered fd events. - EPOLL_CTL_DEL delete fd event. epoll_event has an events member, which specifies the event type to be registered. The more important are: - EPOLLIN fd readable events - EPOLLOUT fd writable event - EPOLLERR fd has an error. This event is always monitored and does not need to be increased manually - When EPOLLHUP fd is suspended, this event is always monitored and does not need to be manually increased. This usually occurs when the socket is abnormally closed. At this time, read returns 0, and then clean up the socket resources normally. epoll_event also has an epoll_data_t member. Custom data is set externally to facilitate subsequent processing. - int epoll_wait(int epfd, struct epoll_event * events, int maxevents, int timeout); Wait for an event to occur. If no event occurs, the thread will be suspended. Maxevents specifies the maximum number of events. The length of the event array passed in outside events should be equal to maxevents. When an event occurs, epoll will fill in the event information here. timeout specifies the maximum waiting time. 0 means to return immediately and - 1 means to wait indefinitely. epoll_wait returns the number of waiting events. When it returns, traverse events to process fd. When epoll is no longer in use, close should be called to close epollfd. Horizontal trigger and edge trigger epoll trigger events have two modes, the default is called horizontal trigger (LT), and the other is called edge trigger (ET): - LT mode: epoll if the read buffer of fd is not empty or the write buffer is not full_ Wait will always trigger the event (that is, return). - ET mode: when the monitored fd state changes (from never ready to ready), the event is triggered once. After that, the kernel will not notify unless a new event comes. //Thank you The description of the original ET mode is wrong. It has been corrected after carefully reading the man document. LT is much simpler to process than et. the read event is triggered and only needs to be read once. If the data is not read, epoll the next time_ Wait will return, and writing is the same; The ET mode requires that when the event is triggered, it is always read and write until it is clearly known that the reading and writing has been completed (the error code of EAGIN or EWOULDBLOCK is returned). The process of horizontally triggered server program is as follows: - accept a new connection, add the fd of the new connection to the epoll event, and listen to the epolin event. - When the EPOLLIN event arrives, the data in the fd is read. - If you want to write an event to this fd, add the EPOLLOUT event to epoll. - When the EPOLLOUT event arrives, write the data to fd. If the data is too large to be written out at one time, keep the EPOLLOUT event first and continue writing the next time the event arrives; If the write out is complete, delete the EPOLLOUT event from epoll. A practical echo program: This time, we will use epoll and non blocking socket to write a really practical echo server, call fcntl function and set o_ The Nonblock flag bit turns the file descriptor of the socket into a non blocking mode. Non blocking mode is more complex to handle than blocking mode: - Read, write and accept functions will not block. They will either succeed or return - 1 failure. errno records the reason for the failure. There are several error codes to pay attention to: - EAGAIN or EWOULDBLOCK occurs only when fd is non blocking, which means that there is no data to read, no space to write, or no client can accept. Come back next time. These two values may be the same or different. It is best to judge together. - EINTR indicates that it is interrupted by a signal, which can be called again. - Other errors indicate a real error. - It's troublesome to write data to an fd. We can't guarantee that all data will be written at one time, so we need to save it in the buffer first, then add a write event to epoll, and then write data to fd when the event is triggered. When the data is written, remove the event from epoll. This program saves the written data in the linked list. We leave listening fd in blocking mode because epoll_ When the wait returns, it can be determined that there must be a client connected, so accept can generally succeed without worrying about blocking. The client connection uses a non blocking mode to ensure that there is no blocking when reading and writing is not completed. The following is the code of this program. Some comments have been added in key places. It is more useful to look at the code carefully than to look at the text description:) #include "socket_lib h" #include <unistd.h> #include <assert.h> #include <errno.h> #include <fcntl.h> #include <sys/epoll.h> #define MAX_CLIENT 10000 #define MIN_RSIZE 124 #define BACKLOG 128 #define EVENT_NUM 64 // Cache node struct twbuffer { struct twbuffer *next; // Next cache void *buffer; // cache char *ptr; // Currently unsent cache, buffer= PTR indicates that only part of the message was sent int size; // Cache size not currently sent }; // Cache list struct twblist { struct twbuffer *head; struct twbuffer *tail; }; // Client connection information struct tclient { int fd; // Client fd int rsize; // Current read cache size int wbsize; // Cache size not yet written struct twblist wblist; // Write cache linked list }; // server information struct tserver { int listenfd; // Monitor fd int epollfd; // epollfd struct tclient clients[MAX_CLIENT]; // Client structure array }; // epoll add read event void epoll_add(int efd, int fd, void *ud) { struct epoll_event ev; ev.events = EPOLLIN; ev.data.ptr = ud; epoll_ctl(efd, EPOLL_CTL_ADD, fd, &ev); } // epoll modify write event void epoll_write(int efd, int fd, void *ud, int enabled) { struct epoll_event ev; ev.events = EPOLLIN | (enabled ? EPOLLOUT : 0); ev.data.ptr = ud; epoll_ctl(efd, EPOLL_CTL_MOD, fd, &ev); } // epoll delete fd void epoll_del(int efd, int fd) { epoll_ctl(efd, EPOLL_CTL_DEL, fd, NULL); } // Set socket to non blocking void set_nonblocking(int fd) { int flag = fcntl(fd, F_GETFL, 0); if (flag >= 0) { fcntl(fd, F_SETFL, flag | O_NONBLOCK); } } // Increase write cache void add_wbuffer(struct twblist *list, void *buffer, int sz) { struct twbuffer *wb = malloc(sizeof(*wb)); wb->buffer = buffer; wb->ptr = buffer; wb->size = sz; wb->next = NULL; if (!list->head) { list->head = list->tail = wb; } else { list->tail->next = wb; list->tail = wb; } } // Free write cache void free_wblist(struct twblist *list) { struct twbuffer *wb = list->head; while (wb) { struct twbuffer *tmp = wb; wb = wb->next; free(tmp); } list->head = NULL; list->tail = NULL; } // Create client information struct tclient* create_client(struct tserver *server, int fd) { int i; struct tclient *client = NULL; for (i = 0; i < MAX_CLIENT; ++i) { if (server->clients[i].fd < 0) { client = &server->clients[i]; break; } } if (client) { client->fd = fd; client->rsize = MIN_RSIZE; set_nonblocking(fd); // Set to non blocking mode epoll_add(server->epollfd, fd, client); // Add read event return client; } else { fprintf(stderr, "too many client: %d\n", fd); close(fd); return NULL; } } // Close client void close_client(struct tserver *server, struct tclient *client) { assert(client->fd >= 0); epoll_del(server->epollfd, client->fd); if (close(client->fd) < 0) perror("close: "); client->fd = -1; client->wbsize = 0; free_wblist(&client->wblist); } // Initialize service information struct tserver* create_server(const char *host, const char *port) { struct tserver *server = malloc(sizeof(*server)); memset(server, 0, sizeof(*server)); for (int i = 0; i < MAX_CLIENT; ++i) { server->clients[i].fd = -1; } server->epollfd = epoll_create(MAX_CLIENT); server->listenfd = tcpListen(host, port, BACKLOG); epoll_add(server->epollfd, server->listenfd, NULL); return server; } // Release server void release_server(struct tserver *server) { for (int i = 0; i < MAX_CLIENT; ++i) { struct tclient *client = &server->clients[i]; if (client->fd >= 0) { close_client(server, client); } } epoll_del(server->epollfd, server->listenfd); close(server->listenfd); close(server->epollfd); free(server); } // Processing acceptance void handle_accept(struct tserver *server) { struct sockaddr_storage claddr; socklen_t addrlen = sizeof(struct sockaddr_storage); for (;;) { int cfd = accept(server->listenfd, (struct sockaddr*)&claddr, &addrlen); if (cfd < 0) { int no = errno; if (no == EINTR) continue; perror("accept: "); exit(1); // error } char host[NI_MAXHOST]; char service[NI_MAXSERV]; if (getnameinfo((struct sockaddr *)&claddr, addrlen, host, NI_MAXHOST, service, NI_MAXSERV, 0) == 0) printf("client connect: fd=%d, (%s:%s)\n", cfd, host, service); else printf("client connect: fd=%d, (?UNKNOWN?)\n", cfd); create_client(server, cfd); break; } } // Processing read void handle_read(struct tserver *server, struct tclient *client) { int sz = client->rsize; char *buf = malloc(sz); ssize_t n = read(client->fd, buf, sz); if (n < 0) { // error free(buf); int no = errno; if (no != EINTR && no != EAGAIN && no != EWOULDBLOCK) { perror("read: "); close_client(server, client); } return; } if (n == 0) { // client close free(buf); printf("client close: %d\n", client->fd); close_client(server, client); return; } // Determines the size of the next read if (n == sz) client->rsize >>= 1; else if (sz > MIN_RSIZE && n *2 < sz) client->rsize <<= 1; // Add write cache add_wbuffer(&client->wblist, buf, n); // Add write event epoll_write(server->epollfd, client->fd, client, 1); } // Process write void handle_write(struct tserver *server, struct tclient *client) { struct twblist *list = &client->wblist; while (list->head) { struct twbuffer *wb = list->head; for (;;) { ssize_t sz = write(client->fd, wb->ptr, wb->size); if (sz < 0) { int no = errno; if (no == EINTR) // Signal interrupted, continue continue; else if (no == EAGAIN || no == EWOULDBLOCK) // The kernel buffer is full. Come back next time return; else { // Other errors perror("write: "); close_client(server, client); return; } } client->wbsize -= sz; if (sz != wb->size) { // Not completely sent out. Come back next time wb->ptr += sz; wb->size -= sz; return; } break; } list->head = wb->next; free(wb); } list->tail = NULL; // Write all here and close the write event epoll_write(server->epollfd, client->fd, client, 0); } // Handle errors first void handle_error(struct tserver *server, struct tclient *client) { perror("client error: "); close_client(server, client); } int main() { signal(SIGPIPE, SIG_IGN); struct tserver *server = create_server("127.0.0.1", "3459"); struct epoll_event events[EVENT_NUM]; for (;;) { int nevent = epoll_wait(server->epollfd, events, EVENT_NUM, -1); if (nevent <= 0) { if (nevent < 0 && errno != EINTR) { perror("epoll_wait: "); return 1; } continue; } int i = 0; for (i = 0; i < nevent; ++i) { struct epoll_event ev = events[i]; if (ev.data.ptr == NULL) { // accept handle_accept(server); } else { if (ev.events & (EPOLLIN | EPOLLHUP)) { // read handle_read(server, ev.data.ptr); } if (ev.events & EPOLLOUT) { // write handle_write(server, ev.data.ptr); } if (ev.events & EPOLLERR) { // error handle_error(server, ev.data.ptr); } } } } release_server(server); return 0; } Turn from Network programming: epoll - Zhihu
https://programmer.help/blogs/network-programming-epoll.html
CC-MAIN-2021-49
refinedweb
2,228
60.75
QProgressBar high memory usage I have a program with a progress bar. It is used to signify the amount of a song played. This progress bar is used again for each song. When the program has been sitting for a few songs the progress bar uses quite a lot of memory. I've written a little test application in both Python (my program is in python (PyQT)) and in C++. In both casses a fairly wide (800-1000px) progress bar running to completion uses about 50MB ram. That seems a bit exessive to me. I'm guessing QrogressBar caches something. Can anyone help me find what can be done about the high memory usage? This is the Python code I use. This shows exactly the same symptoms as a C++ implementation (but uses less code:)). @ #!/bin/env python from PyQt4 import QtGui from PyQt4 import QtCore import sys import time app = QtGui.QApplication(sys.argv) window = QtGui.QWidget() progress = QtGui.QProgressBar(window) progress.setMaximum(100) layout = QtGui.QVBoxLayout() layout.addWidget(progress) window.setLayout(layout) def update(): if progress.value() == progress.maximum(): progress.reset() progress.setMaximum(progress.maximum() + 20) progress.setValue(progress.value() + 1) timer = QtCore.QTimer(window) timer.start(100) timer.connect(timer, QtCore.SIGNAL('timeout()'), update) window.show() time.sleep(8) app.exec_() @ Maybe I'm wrong, but when ProgressBar reaches maximum, you reset it and then add + 20 to the maximum. So after all, new maximum for PB is 120. Again, after next song, new max will be 140?! And one thing is concerning me: how do you looked up the QProgressBar usage Thanks for your reply. I used htop to look up the memory usage. So it's not only the progress bar's memory usage ofcourse. But you can see the data and res segments rise rapidly. The test program does indeed grow the maximum. I did this to simulate the changing maximum in my program. It makes little difference on the memory usage actually. It seems that the more steps are taken, the more memory is used. bq. It seems that the more steps are taken, the more memory is used. Which is quite obvious when you loading only into memory, without deleting items. And I hardly believe that QProgressBar is using so much memory. Check out your code, maybe it's something with memory managment when you operating with audio files? No, this test program will use so much memory. Nothing more than a window with a progress bar. The code above is not from the sound program. It is just to show the symptoms. I too can hardly believe that QProgressBar is using all this memory but the test program indicates it does. So I don't have any ideas what can be wrong. Me neither, hence the forum post. I thank you for your help anyway.
https://forum.qt.io/topic/13231/qprogressbar-high-memory-usage
CC-MAIN-2018-39
refinedweb
474
69.48
0 Members and 1 Guest are viewing this topic. I don't know why you want it, Simutrans already has it. #include "../../display/viewport.h"SQInteger world_change_coord(HSQUIRRELVM vm){ koord k = param<koord>::get(vm, 2); welt->get_viewport()->change_world_position(koord3d(k,welt->min_hgt(k))); return push_instance(vm, "coord", k.x, k.y);}STATIC register_function(vm, world_change_coord, "chag_coord", 2, ""); local pos=coord(95,33) world.chag_coord(square_x(pos.x, pos.y)) Did not saw this thread.Your patch is correct. Instead of returning push_instance(..) it could return SQ_OK. You could also look into functions exported to the script by register_method. This would be much easier. 1) Jumping of view point without user interaction can be irritating. I find it very irritating that the viewpoint changes if one builds a factory. 2) There is no way the user can tell the script `Do it again!` I see two problems:1) Jumping of view point without user interaction can be irritating. I find it very irritating that the viewpoint changes if one builds a factory.2) There is no way the user can tell the script `Do it again!` ...If the screen would go dark before changing the view point, the player would be more likely to understand that he just teleported, resulting in less confusion. This is especially true if a new window pops up at the same time, explaining what happened.... A black fade-in/out seems very nice to me. Maybe we could use this not only for teleportation, but also for a jump in time?Could be useful in the story based scenario's I'm planning for the future. (if I ever find the time...) I wish I could do this. If the penguin can do it, why does not simutrans ?. I do not like the suggestion to override user decisions, how to display messages.
http://forum.simutrans.com/index.php?PHPSESSID=fs3kb1j59aprlsbsu6ogp49bg7&topic=16571.0
CC-MAIN-2017-17
refinedweb
307
68.97
We have many servers and still want to update them all. The actual way is that any of the sysadmins go from server to server and make a aptitude update && aptitude upgrade - it's still not cool. aptitude update && aptitude upgrade I am searching now for a solution which is still better and very smart. Can puppet do this job? How do you do it? You can use the exec type such as: exec exec { "upgrade_packages": command => "apt-get upgrade -q=2", path => "/usr/local/bin/:/bin/:/usr/bin/", # path => [ "/usr/local/bin/", "/bin/" ], # alternative syntax } To be honest, I did not try it myself, but I think you just need to create a new module that include such an exec definition. The apt-get upgrade command is interactive. To make it run quietly, you can add the option -q=2 as shown above. apt-get upgrade -q=2 touch if all your hosts are debian, you can try the unattended-upgrades package. Here we have been using puppet to manage our debian virtual machines, with puppet we are able to enable and manage unnatended-upgrade configs on all servers. Recently our team are testing the mcollective tool to run commands on all servers, but to use mcollective ruby skills are needed. [s] Guto I would recommend going for Puppet, facter and mCollective. mCollective is a very nice framework where you can run commands over a series of hosts (in parallels) using facter as filter. Add to that a local proxy / cache and you'd be well set for servers management. Use a tool that is made to run a single command on multiple servers. And by that I do not mean having a kazillion terminals open with Terminator or ClusterSSH, but instead having a single terminal to a management server running a tool suitable for the job. I would recommend func, Salt or mCollective in this context. If you already have Puppet, go for mCollective (it integrates nicely in Puppet). If you don't, and you have an old Python on your machines, you might enjoy func. If you Python in new, try Salt. All these tools run the command specified at the command line asynchronously, which is a lot more fun than a sequential ssh loop or even doing the same aptitude commands in umpteen Terminator windows to umpteen servers. You'll definitely love Salt. So I guess there are many things which contribute to a good solution: Bandwidth: Basically two alternatives to save bandwidth come into my mind: Administration: I would configure a parallel shell like PDSH,PSSH,GNU Parallel and issue the command on all clients, if I tested the command previously on an example machine. Then its not very likely that it may fail on all the others. Alternatively you may consider a cron job on all clients, but then it may fail automatically, so I would prefer the first solution. If you concern about simultaneity of upgrades you could schedule your commands with at at Logging: As with parallel shells you have the possibility to redirect output I would combine stderr and stdout and write it to a logfile. My own parallel ssh wrapper: classh is an alternative to the various Parallel and cluster ssh tools out there. You might like it better or you might hate it. There are only three reasons I'm mentioning it here: subprocess.communicate() It's extremely simple to write a custom script, in Python, to use classh.py as a module. So it's very easy to write something like: !#/bin/env python import classh job = classh.SSHJobMan(cmd, targets) job.start() while not job.done(): completed = job.poll() for i in completed: # do something with the classh.JobRecord object referenced by i # done # You can optionally do post-processing on the dictionary of JobRecords here # keyed off the target strings (hostnames) </code></pre> That's all there is to it. For example in the nested completed loop you can gather a list of all those which returned some particular exit status or to scan for specific error messages, and set up follow-up jobs to handle those. (The jobs will be run concurrently, default of 100 jobs at any time, until each is completed; so a simple command on a few hundred hosts usually completes in a few seconds and a very complex shell script in a single long command string ... say fifty lines or so ... can complete over a few thousand hosts in about 10 minutes ... about 10K hosts per hour in my environment, with many of those located intercontinentally). So this might be something you can use as an ad hoc measure until you have your puppet configuration implemented and well testing ... and it's also quite handing for performing little ad hoc surveys of your hosts to see which ones are deviating from your standards in various little ways. The answer using exec is pretty helpful. However according to the apt-get manual it's not a good idea to use -q=2 this way (though I have used it for years without problems) . I have used a script myself for years, running apt-get the following way: ssh example.org "apt-get update && apt-get -y upgrade && apt-get -y dist-upgrade && apt-get clean" Things like puppet and other tools people mentioned sure may work, but it seems like it's overkill for what basically is just mimicking a few commands typed by a human. I believe in using the simplest tool for a specific job, in this case a bash script is about as simple as it gets without losing functionality. you can use Fabric. Fabric is a Python (2.5-2.7) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks. use webmin,,,and use its webmin cluster feature, in which you can add all systems to one webmin console and issue them any command or control all of them from one place. Or Use Cluster ssh Or PSSH For years I've been happily upgrading and installing packages using apt-dater. It is lightweight and effective tool for remote package management. It uses screen, sudo and ssh. For package management apt-dater may be easier solution than configuration management tools. apt-dater is handy for centralised package management on different GNU/Linux flavours such as Debian and CentOS. screen sudo ssh Another solution if all your hosts are running Debian (or derivatives) is to use the cron-apt package. But, as suggested per the documentation, a bit of care must be taken. I'm currently using cron-apt on a dozen of servers to perform all the security updates automatically and unattended. To avoid any unwanted upgrades, I only use cron-apt on servers which runs the Debian stable distribution and I make sure to configure my apt sources so use the distribution name, wheezy, and not its alias (stable). The specific cron-apt configuration that I use is summarised in one action file: /etc/cron-apt/action.d/5-install /etc/cron-apt/action.d/5-install dist-upgrade -y -o APT::Get::Show-Upgraded=true -o Dir::Etc::SourceList=/etc/apt/sources.list.d/security.list -o Dir::Etc::SourceParts="/dev/null" Any other upgrade, is done manually, using screen or whatever is most appropriate, as it may require manual intervention during the upgrade. By posting your answer, you agree to the privacy policy and terms of service. asked 2 years ago viewed 1605 times active 11 days ago
http://serverfault.com/questions/346039/system-updates-for-many-servers/346043
CC-MAIN-2014-23
refinedweb
1,262
62.48
String jumble(String): accepts a string and returns a jumbled version of the original: for this method, jumbled means that two randomly chosen characters other than the first and last characters of the string are swapped; this method must use the class, Random. The method must swap two different characters: in other words the two random indices into the string cannot be equal, cannot be 0, and cannot be equal to the string’s length minus one. So, for example, a four-letter string MUST result in the returned string having the same first and last characters and have the second and third characters swapped. Examples of what this method might do: “fist” returns “fsit”, “much” returns “mcuh”, but for longer strings there will be more possible return values: “spill” could return “splil” or “sipll”. Only ONE pair of letters should be swapped and strings shorter than four characters are returned unchanged. When the string length is greater than 3, the original string must never be returned. I cant seem to get the first and last character to stay the same. It will always scramble the whole word. DO NOT USE ANY CLASSES only random. Im a BEGINNER so keep it Easy talk no Array's, appends, etc. Use substrings, CharAt, length only. if and else for loops are fine while loops are also okay aswell as do/while. public class Test { public static void main(String[] args) { String s = "goal"; System.out.print(jumble(s)); } public static String jumble(String s) { int i = 0; int b = s.length() -1; String result = ""; java.util.Random r; r = new java.util.Random(); char beginning = s.charAt(0); char ending = s.charAt(s.length() - 1); if ( r.nextBoolean() ) { result = beginning + result + s.substring(1, b) + ending; } else{ result += beginning + s.substring(1, b)+ ending; } return result; } }
http://www.javaprogrammingforums.com/%20whats-wrong-my-code/12051-jumble-printingthethread.html
CC-MAIN-2014-15
refinedweb
304
75.61
morse_code 0.1.0 Morse Code # Usage # Fist depend on the libary by ading this to your package's pubspec.yaml: dependencies: morse_code: ^0.1.0 Now inside your Dart code you can import it. import 'package:morse_code/morse_code.dart'; For this example we're going to use the following morse code string: final String encodedMessage = '.... . .-.. .-.. --- / .-- --- .-. .-.. -..'; There are two ways to decode a morse code string. Either provide de encoded string as an argument to the constructor, and call the decode method. final Morse morse = new Morse(encodedMessage); String decodedMessage = morse.decode(); // Or combine the two, for more compact code: String decodedMessage = new Morse(encodedMessage).decode(); Or provide the encoded string as an argument to the decode method. final Morse morse = new Morse(); String decodedMessage = morse.decode(encodedMessage); // Or again combine the two, for more compact code: String decodedMessage = new Morse().decode(encodedMessage); Contributing # Feel free to open a PR with any suggetions! [0.1.0] - 16 June 2018 Breaking change # n/a Fixes / Enhancements # - Initial version of the Morseclass. Docs # - Initial documentation. Use this package as a library 1. Depend on it Add this to your package's pubspec.yaml file: dependencies: morse_code: :morse_code/morse.
https://pub.dev/packages/morse_code
CC-MAIN-2020-05
refinedweb
196
61.22
Using ONLY ! ~ & ^ | + How can I find out if a 32 bit number is TMax? TMax is the maximum, two's complement number. My thoughts so far have been: int isTMax(int x) { int y = 0; x = ~x; y = x + x; return !y; } That is just one of the many things I have unsuccessfully have tried but I just cant think of a property of TMax that would give me TMax back. Like adding tmax to itself would be unique compared to all the other integers. Here is the actual problem: /* * isTMax - return 1 if x is the maximum, two's complement number, * and 0 return otherwise. * Legal ops: ! ~ & ^ | + * Max ops: 10 * Rating: 1 */ int isTMax(int x) { int y = 0; x = ~x; y = x + x; return !y; } int is 32 bits so the max signed would probably be 0x7FFFFFFF As far as I know, there is no way to determine if a particular value is the max value of a signed type without already knowing the maximum value of that type and making a direct comparison. This is because signed expressions experience undefined behavior on overflow. If there were an answer to your question, it would imply the existence of an answer to a serious unsolved problem that's been floating around on SO for some time: how to programmatically determine the max value for a given signed type. int isTmax(int x) { //add one to x if this is Tmax. If this is Tmax, then this number will become Tmin //uses Tmin = Tmax + 1 int plusOne = x + 1; //add to x so desired input becomes 0xFFFFFFFF, which is Umax and also -1 //uses Umax = 2Tmax + 1 x = x + plusOne; plusOne = !(plusOne); //is x is 0xffffffff, then this becomes zero when ~ is used x = ~x; x = x | plusOne; x = !x; return x; } Spend 3 hours on this problem. I know this problem comes from csapp's data lab and its newest requirement is 1. Integer constants 0 through 255 (0xFF), inclusive. You are not allowed to use big constants such as 0xffffffff .... * isTmax - returns 1 if x is the maximum, two's complement number, * and 0 otherwise * Legal ops: ! ~ & ^ | + * Max ops: 10 * Rating: 1 So, shift operator( <</ >> and 0x7FFFFFFF from accepted answer is forbidden now) Below is my way: TDD-style: isTmax(2147483647) == isTmax(0b011111111111...1) == 1 isTmax(2147483646) == isTmax(0b011111111111...0) == 0 isTmax(-1) == isTmax(0b111111111...1) == 0 isTmax(-2147483648) == isTmax(0b100000000...0) == 0 the return should be either 0 or 1. In, c, ! + all nonzero will return 0. So ! is a must, otherwise we cannot guarantee getting 0 for all numbers. because 0b0111111...1(aka 2147483647) is the only argument which should make isTmax return 1 and 2147483647 + 1 should be 10000000...0(aka -2147483648) 0b011111111...1 xor 0b1000000000...0 is 0b11111111111...111. Because we must use !, what we hope to see is 0(aka 0b0000000000000...0). Obviously, just apply logic not(aka !) to 0b1111111...1), then we will get 0b000000000000): !(~(x ^ (x + 1)) let's printf it void print(int x) { printf("%d\n", !(~(x ^ (x + 1)))); } int main() { print (2147483647); print(2147483646); print(-1); print(-2147483648); } 1 0 1 0 Not bad, only -1 doesn't work as we expected. Let's compare -1 and 2147483647 11111111111111111111111111111111 01111111111111111111111111111111 We can find -1 + 1 = 0 while 2147483647 + 1 = -2147483648. Emphasize again, what we want is diff -1 and 2147483647, because both of them return 1 as above shows. Look back to the protety of logic not in c: all nonzero will return 0, so !-2147483648 == 0 and !(-1 + 1) != 0. Just modify left part of x ^ (x + 1)( x) into x + !(x + 1). If x is 2147483647, x + !(x + 1) will equal to x. Run again: void print(int x) { printf("%d\n", !(~( x + !(x + 1) ^ (x + 1)))); } int main() { print (2147483647); print(2147483646); print(-1); print(-2147483648); } 1 0 0 0 Done! No shifts solution. Realizing to take advantage of the property that !(0b01111 + 1 = 0b10000) = 0 and !(0b11111 + 1 = 0b00000) = 1 is particularly tricky. This problem took me a long time. /* * isTmax - returns 1 if x is the maximum, two's complement number, * and 0 otherwise * Legal ops: ! ~ & ^ | + * Max ops: 10 * Rating: 1 */ int isTmax(int x) { int a = ~((x + 1) ^ x); int b = !(x + 1); int c = !(a + b); return c; } Something like this perhaps? 0x7FFFFFFF is the maximum positive signed 32 bit two's complement number. int isTMax(int x){ return !(x ^ 0x7FFFFFFF); } I am not sure, you may need to cast it to unsigned for it to work. #include <stdio.h> #include <stdlib.h> int test(int n) { return !(n & 0x80000000) & !~(n | (n + 1)); } // or just effectively do a comparison int test2(int n) { return !(n ^ 0x7fffffff); } int main(int ac, char **av) { printf("is%s TMax\n", test(atoi(av[1])) ? "" : " not"); return 0; } if it is Tmax : 011111..... then we xor it with 10000.... we get 11111.... then we ~ to get all 0s = 0 , !0 we get 1: int isTmax(int x) { return !(~((1 << 31) ^ x )); } User contributions licensed under CC BY-SA 3.0
https://windows-hexerror.linestarve.com/q/so7300650-How-to-find-TMax-without-using-shifts
CC-MAIN-2021-21
refinedweb
845
84.88
Adding support for call-by-need (aka lazy arguments) using scalameta: def foo(cond: Boolean)(bar: => String) = { lazy val lazyBar = bar if (cond) lazyBar + lazyBar else "" } foo(true){ // some computation ... } This looks ok but can it be abstracted so we don’t have to define these local lazy values? This would be useful especially when dealing with multiple lazy arguments. In this blog I’m going to present a simple solution using scalameta macro annotations to remove the boilerplate required for lazy arguments. Macro annotations to the rescue I have defined a macro annotation @WithLazy which implements call-by-need arguments. We use @Lazy to mark the parameters we want to evaluate lazily (in our case it's elem). Let's have a look at the example bellow: @WithLazy def lazyFill[T](t: Int)(@Lazy elem: T): Seq[T] = Seq.fill(t)(elem) Let’s call the method with zero and a non-zero t: lazyFill(0) { println("call-by-need") 1 } //prints nothing, yields: List() lazyFill(4) { println("call-by-need") 1 } // prints only once: call-by-need // yields: List(1, 1, 1, 1) As we can see elem is evaluated at most once: when t > 0 elem is evaluated once and when t == 0 elem doesn't get evaluated. If you want to try out this example feel free to skip to the Installation section. Implementation details The first and current implementation is relatively simple and consists of the following steps: - Define the @WithLazymacro annotation which implements the call-by-need functionality and @Lazyto mark the parameters to be evaluated lazily. - All the parameters annotated with @Lazyare changed to be call-by-name. - The method is wrapped with another one with the same signature. - Define local lazy values in the outer method for each @Lazyannotated parameter with its value. - The inner method name is added the “$Inner” suffix. - In the outer method body call the inner method with the corresponding local lazy values (if any). After applying the AST transformation the method we defined above is transformed into: def lazyFill[T](t: Int)(@Lazy elem: => T): Seq[T] = { def lazyFill$Inner[T](t: Int)(@Lazy elem: => T): Seq[T] = Seq.fill(t)(elem) lazy val elem$Lazy: T = elem lazyFill$Inner(t)(elem$Lazy) } The implementation of the @WithLazy macro annotation can be found here. Design decisions & challenges You may probably wonder why did I choose this approach instead of declaring the local lazy values and rewrite the function body tree to use these values instead. Currently, macro annotations support the syntactic API only which in a nutshell means that you get the AST as is, with no context, no types inferred, just the plain AST. Using the syntactic API only makes the scoping very challenging, which in my case would happen when having nested methods. This was one of the main reasons I ended up using the method wrapping approach. This approach was fairly easy to implement and it also gave me a nice starting point for further experiments. Also, it was quite challenging to check which argument is annotated with @Lazy. Because @Lazy != @lazyargs.Lazy I had to make sure that I check the parameters for being annotated with @Lazy, @lazyargs.Lazy, @com.tudorzgureanu.lazyargs.Lazy or _root_.@com.tudorzgureanu.lazyargs.Lazy. Luckily, I was not the only one facing this problem and I was able to find a suggestion from @olafur which helped me to determine all the parameters that were annotated with @Lazy. Of course, I could just generate a list of all the sub-packages and then check if there are any parameters annotated with any "version" of @Lazy from that list. Perhaps, I should give it a try. Unfortunately, if the import was renamed there is nothing you can do about it. The good news is that def macros are going to support the Semantic API although there is no ETA for making macro annotations to support the Semantic API. Future plans - Probably the first improvement would be adding a naive lazy implementation that doesn’t rely on lazy values, which are advertised to be resource consuming (it uses locks to provide thread safety). It will trade thread safety in exchange for performance. As we most of the time write functions whose parameters aren’t involved in concurrent computation it would make sense to have this low-overhead alternative as the default implementation and the tread safe implementation enabled by another annotation (e.g. @volatilelike in Dotty). - Add more test cases that cover various ways of defining functions (e.g. nested functions). This should bring more safety when doing further experiments with this library. Installation After experimenting enough with scalameta I decided to release the macro annotation as a small library. It’s not production-ready (it might never be, although I will still spend some time improving it) so use it at your own risk fun. You will need to use Scala 2.11.8+ or 2.12.x. - Add the bintray repo resolver for this project: resolvers += Resolver.bintrayIvyRepo("tudorzgureanu", "generic") - Add the dependency to this project: libraryDependencies += "com.tudorzgureanu" %% "scala-lazy-arguments" % "0.1.0" - Add scalameta paradise compiler plugin and scalameta dependency: addCompilerPlugin("org.scalameta" % "paradise" % "3.0.0-M8" cross CrossVersion.full) libraryDependencies += "org.scalameta" %% "scalameta" % "1.8.0" % Provided Conclusions In this blog post I have presented a relatively simple solution for adding support for call-by-need arguments without boilerplate. It is implemented using scalameta macro annotations. Hopefully, the support for lazy keyword will be extended so we can apply it on method parameters as well. The full code is available on github. Happy meta-hacking! Originally published at tudorzgureanu.com on June 28, 2017.
https://medium.com/@tudorzgureanu/adding-support-for-call-by-need-aka-lazy-arguments-using-scalameta-429d2fbb0b9a
CC-MAIN-2018-17
refinedweb
950
55.34
The MCP3008 ADC is pretty cheap and easy to use with the Pi, so I bagged myself one. Raspberry Pi Spy has got a really good tutorial on setting up an MCP3008 to read analogue sensors which I followed to get everything running, but the code didn't fit my needs so I created a python class for reading data from the MCP3008. from spidev import SpiDev class MCP3008: def __init__(self, bus = 0, device = 0, channel = 0): self.bus, self.device, self.channel = bus, device, channel self.spi = SpiDev() def __enter__(self): self.open() return self def open(self): self.spi.open(self.bus, self.device) def read(self): adc = self.spi.xfer2([1, (8 + self.channel) << 4, 0]) data = ((adc[1] & 3) << 8) + adc[2] return data def __exit__(self, type, value, traceback): self.close() def close(self): self.spi.close() The class is really easy to use, using Python's 'with' statement to control it: with MCP3008(channel = 0) as ch0: print ch0.read()The code is here - github.com/martinohanlon/mcp3008
http://www.stuffaboutcode.com/2015/04/raspberry-pi-mcp3008-adc-python.html
CC-MAIN-2017-17
refinedweb
175
59.5
Hi, I am working with DEMO9S08DZ60 and I the first thing I want to test is the SCI ports. But I don't know why I don't transmit anything either in port1 or port2. (I use the oscilloscope trying to see the output signal). My easy code is below, hope you can help me a little bit with this. Thanks in advance. #include <hidef.h> #include "MC9S08DZ60.H" void main( void ) { UINT8 data[9]; /* disable COP */ SOPT1 = 0x20; /* disable COP, enable stop mode */ /* Init Clock, Use PLL Engaged External mode, from 8MHz crystal -> 16 MHz bus */ MCGC2 = 0x36; while (!MCGSC_OSCINIT); MCGC1 = 0xB8; while (!MCGSC_IREFST); while(MCGSC_CLKST != 2); MCGC1 = 0x90; MCGC3 = 0x44; while(!MCGSC_PLLST); while (!MCGSC_LOCK); MCGC1 = 0x10; while(MCGSC_CLKST != 3); MCGC2_BDIV = 0; /* Enable interrupt */ EnableInterrupts; SCI2C1 = 0x40; SCI2C2 = 0x0E; SCI2BDH = 0x00; SCI2BDL = 0x41; SCI2S2 = 0x00; SCI2C3 = 0x00; SCI1C1 = 0x40; SCI1C2 = 0x0E; SCI1BDH = 0x00; SCI1BDL = 0x41; SCI1S2 = 0x00; SCI1C3 = 0x00; while(1) { SCI2D = 'U'; SCI1D = 'U'; } } /* main */ It is quite good at this. It will know what you have set for the clocks and will set up the baud rate correctly. Then you can look a the code.
https://community.nxp.com/thread/45833
CC-MAIN-2019-22
refinedweb
188
82.85
BPython Lives!!! In January, I suggested it would be trivial to write a preprocessor that would accept a version of python which delimited blocks with braces instead of indentation. Ok, almost, I suggested #{ and #} as delimiters. Well, I had a few minutes free today, and here it is, a functional BPython->Python compiler, so to speak. Here's the kind of imput it takes (notice how it's not indented at all: def factorial(n): #{ if n==1: #{ return 1 #} else: #{ return n*factorial(n-1) #} #} for x in range(1,10): #{ print x,"!=",factorial(x) #} And it produces this (I am not happy with the indenting of the comments, but who cares): def factorial(n): #{ if n==1: #{ return 1 #} else: #{ return n*factorial(n-1) #} #} for x in range(1,10): #{ print x,"!=",factorial(x) #} As you can see, this is both a legal Python and a legal BPython program ;-) It has some problems, like not working when you use a line like this: #{ x=1 But hey, it is python with braces. Here's the code. I predicted 30 lines. It's 34. And it's 99% a ripoff of Ka Ping Yee's regurgitate.py which you can find all around the web. #!/usr/bin/env python import tokenize, sys program = [] lastrow, lastcol = 1, 0 lastline = '' indlevel=0 def rebuild(type, token, (startrow, startcol), (endrow, endcol), line): global lastrow, lastcol, lastline, program,indlevel if type==52 and token.startswith ("#{"): type=5 indlevel+=1 if type==52 and token.startswith ("#}"): type=6 indlevel-=1 line=" "*indlevel+line.lstrip() startcol+=indlevel*2 endcol+=indlevel*2 # Deal with the bits between tokens. if lastrow == startrow == endrow: # ordinary token program.append(line[lastcol:startcol]) elif lastrow != startrow: # backslash continuation program.append(lastline[lastcol:] + line[:startcol]) elif startrow != endrow: # multi-line string program.append(lastline[lastcol:startcol]) # Append the token itself. program.append(token) # Save some information for the next time around. if token and token[-1] == '\n': lastrow, lastcol = endrow+1, 0 # start on next line else: lastrow, lastcol = endrow, endcol # remember last position lastline = line # remember last line tokenize.tokenize(sys.stdin.readline, rebuild) for piece in program: sys.stdout.write(piece) So, all of you who dislike python because of the lack of braces and the significant whitespace: BPython has no significant whitespace, and braces are mandatory. Enjoy coding! It would be pretty straightforward to just build this functionality into Iron Python - with the C# source being readily available. That way you could get your brace delimited Python up and running on machines with the .NET Framework (or Mono) without a pre-processor. Maybe I didn't make it clear enough that I think brace delimited python sucks ;-)
https://ralsina.me/weblog/posts/P347.html
CC-MAIN-2020-45
refinedweb
450
57.77
Subject: Re: GR_Image is raster specific From: Paul Rohr (paul@abisource.com) Date: Fri Mar 10 2000 - 14:56:30 CST Justin, IIRC, what you're seeing here is about how far Matt Kimball got when he was thinking about adding SVG support last summer. As you've noticed he did most of the required code refactoring, but not quite all of it. I really like the approach you've proposed here. At 05:02 PM 3/9/00 -0600, Justin Bradford wrote: >A (simple) SVG implementation is really quite easy, and completely XP (by >just drawing with the conventional GR_Graphics classes). Someday, we would >want to extend GR_Graphics with things like curves, alpha channels, >gradients, etc, but the SVG implementation could always draw on it, and >stay XP code. Yes, yes, yes. That's exactly what I've been hoping for too. >As for the file format, I was thinking we should use the same design as >raster images: have a separate data item, but in that data item, we should >the SVG code. Hmm. I hadn't thought of moving them out-of-flow like that, but I think I like it. So long as we know dimensions for that IMAGE box in the layout, the fact that it's a forward reference shouldn't be a problem. >I think it would work better if we could pass the SVG XML >directly to the GR_ImageVector and let it parse the XML itself (so we can >have SVG input come from multiple entry points (paste, import, and load). Agreed. Being able to handle SVGs as a standalone entity (just like we do now for raster images) is a desirable feature. Do we want to figure out the switching mechanism for other raster image formats (JPG, BMP, etc.) first, so we can take advantage of it here? >Of course, this means we have to sneak the SVG code by expat so we can >save it as a normal data item. Or maybe we can pass control to the >ImageVector expat handlers somehow? Possibly using the special namespace >stuff in expat? I'm not sure how we do this yet. Embedding one kind of XML inside another is exactly what namespaces are for, and knowing James, I suspect that the mechanisms he's added to expat are quite clean. Sounds like the first step will be to upgrade our expat module in CVS to the latest release. Do you feel comfortable doing that diff-merge (IIRC, we've got a few BEOS-specific tweaks), or should we find someone else to take care of that? Paul This archive was generated by hypermail 2b25 : Fri Mar 10 2000 - 14:51:00 CST
http://www.abisource.com/mailinglists/abiword-dev/00/March/0231.html
CC-MAIN-2014-10
refinedweb
450
78.08
Hi all, I meet a problem on populating array properties... here is the detail description: public class User { String [] phone; public String[] getPhone(){ return phone; } public void setPhone(String[] phone) { this.phone=phone; } } public class UserAction { private User user=new User(); public User getUser(){ return user;} public void setUser(User user) { this.user=user;} public String execute() { // user.getPhone() always return null... } } And i have a jsp which will submit a list of phone to the action class <form name=xxx action=xxx> <input type=text <input type=text <input type=text <input type=submit name=submit value=submit/> </form> after the form is submitted... the action class is called, however the list of phone can't be populated to the user object in the UserAction class... i have tried if the phone is not a array type.. the property is populated to the user object ... any suggestion for the issue? thx alot!
http://mail-archives.apache.org/mod_mbox/struts-user/200806.mbox/%3Cf3357190806011216r7ee2d241j798aa6cb3f8725ea@mail.gmail.com%3E
CC-MAIN-2014-49
refinedweb
153
57.67